12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001 |
- // This file is generated by Tools/cases_generator/generate_cases.py
- // from:
- // Python/bytecodes.c
- // Do not edit!
- #ifndef NEED_OPCODE_METADATA
- extern int _PyOpcode_num_popped(int opcode, int oparg, bool jump);
- #else
- int
- _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
- switch(opcode) {
- case NOP:
- return 0;
- case RESUME:
- return 0;
- case INSTRUMENTED_RESUME:
- return 0;
- case LOAD_CLOSURE:
- return 0;
- case LOAD_FAST_CHECK:
- return 0;
- case LOAD_FAST:
- return 0;
- case LOAD_FAST_AND_CLEAR:
- return 0;
- case LOAD_CONST:
- return 0;
- case STORE_FAST:
- return 1;
- case LOAD_FAST__LOAD_FAST:
- return 0+0;
- case LOAD_FAST__LOAD_CONST:
- return 0+0;
- case STORE_FAST__LOAD_FAST:
- return 1+0;
- case STORE_FAST__STORE_FAST:
- return 1+1;
- case LOAD_CONST__LOAD_FAST:
- return 0+0;
- case POP_TOP:
- return 1;
- case PUSH_NULL:
- return 0;
- case END_FOR:
- return 1+1;
- case INSTRUMENTED_END_FOR:
- return 2;
- case END_SEND:
- return 2;
- case INSTRUMENTED_END_SEND:
- return 2;
- case UNARY_NEGATIVE:
- return 1;
- case UNARY_NOT:
- return 1;
- case UNARY_INVERT:
- return 1;
- case BINARY_OP_MULTIPLY_INT:
- return 2;
- case BINARY_OP_MULTIPLY_FLOAT:
- return 2;
- case BINARY_OP_SUBTRACT_INT:
- return 2;
- case BINARY_OP_SUBTRACT_FLOAT:
- return 2;
- case BINARY_OP_ADD_UNICODE:
- return 2;
- case BINARY_OP_INPLACE_ADD_UNICODE:
- return 2;
- case BINARY_OP_ADD_FLOAT:
- return 2;
- case BINARY_OP_ADD_INT:
- return 2;
- case BINARY_SUBSCR:
- return 2;
- case BINARY_SLICE:
- return 3;
- case STORE_SLICE:
- return 4;
- case BINARY_SUBSCR_LIST_INT:
- return 2;
- case BINARY_SUBSCR_TUPLE_INT:
- return 2;
- case BINARY_SUBSCR_DICT:
- return 2;
- case BINARY_SUBSCR_GETITEM:
- return 2;
- case LIST_APPEND:
- return (oparg-1) + 2;
- case SET_ADD:
- return (oparg-1) + 2;
- case STORE_SUBSCR:
- return 3;
- case STORE_SUBSCR_LIST_INT:
- return 3;
- case STORE_SUBSCR_DICT:
- return 3;
- case DELETE_SUBSCR:
- return 2;
- case CALL_INTRINSIC_1:
- return 1;
- case CALL_INTRINSIC_2:
- return 2;
- case RAISE_VARARGS:
- return oparg;
- case INTERPRETER_EXIT:
- return 1;
- case RETURN_VALUE:
- return 1;
- case INSTRUMENTED_RETURN_VALUE:
- return 1;
- case RETURN_CONST:
- return 0;
- case INSTRUMENTED_RETURN_CONST:
- return 0;
- case GET_AITER:
- return 1;
- case GET_ANEXT:
- return 1;
- case GET_AWAITABLE:
- return 1;
- case SEND:
- return 2;
- case SEND_GEN:
- return 2;
- case INSTRUMENTED_YIELD_VALUE:
- return 1;
- case YIELD_VALUE:
- return 1;
- case POP_EXCEPT:
- return 1;
- case RERAISE:
- return oparg + 1;
- case END_ASYNC_FOR:
- return 2;
- case CLEANUP_THROW:
- return 3;
- case LOAD_ASSERTION_ERROR:
- return 0;
- case LOAD_BUILD_CLASS:
- return 0;
- case STORE_NAME:
- return 1;
- case DELETE_NAME:
- return 0;
- case UNPACK_SEQUENCE:
- return 1;
- case UNPACK_SEQUENCE_TWO_TUPLE:
- return 1;
- case UNPACK_SEQUENCE_TUPLE:
- return 1;
- case UNPACK_SEQUENCE_LIST:
- return 1;
- case UNPACK_EX:
- return 1;
- case STORE_ATTR:
- return 2;
- case DELETE_ATTR:
- return 1;
- case STORE_GLOBAL:
- return 1;
- case DELETE_GLOBAL:
- return 0;
- case LOAD_LOCALS:
- return 0;
- case LOAD_FROM_DICT_OR_GLOBALS:
- return 1;
- case LOAD_NAME:
- return 0;
- case LOAD_GLOBAL:
- return 0;
- case LOAD_GLOBAL_MODULE:
- return 0;
- case LOAD_GLOBAL_BUILTIN:
- return 0;
- case DELETE_FAST:
- return 0;
- case MAKE_CELL:
- return 0;
- case DELETE_DEREF:
- return 0;
- case LOAD_FROM_DICT_OR_DEREF:
- return 1;
- case LOAD_DEREF:
- return 0;
- case STORE_DEREF:
- return 1;
- case COPY_FREE_VARS:
- return 0;
- case BUILD_STRING:
- return oparg;
- case BUILD_TUPLE:
- return oparg;
- case BUILD_LIST:
- return oparg;
- case LIST_EXTEND:
- return (oparg-1) + 2;
- case SET_UPDATE:
- return (oparg-1) + 2;
- case BUILD_SET:
- return oparg;
- case BUILD_MAP:
- return oparg*2;
- case SETUP_ANNOTATIONS:
- return 0;
- case BUILD_CONST_KEY_MAP:
- return oparg + 1;
- case DICT_UPDATE:
- return 1;
- case DICT_MERGE:
- return 1;
- case MAP_ADD:
- return 2;
- case INSTRUMENTED_LOAD_SUPER_ATTR:
- return 3;
- case LOAD_SUPER_ATTR:
- return 3;
- case LOAD_SUPER_ATTR_ATTR:
- return 3;
- case LOAD_SUPER_ATTR_METHOD:
- return 3;
- case LOAD_ATTR:
- return 1;
- case LOAD_ATTR_INSTANCE_VALUE:
- return 1;
- case LOAD_ATTR_MODULE:
- return 1;
- case LOAD_ATTR_WITH_HINT:
- return 1;
- case LOAD_ATTR_SLOT:
- return 1;
- case LOAD_ATTR_CLASS:
- return 1;
- case LOAD_ATTR_PROPERTY:
- return 1;
- case LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN:
- return 1;
- case STORE_ATTR_INSTANCE_VALUE:
- return 2;
- case STORE_ATTR_WITH_HINT:
- return 2;
- case STORE_ATTR_SLOT:
- return 2;
- case COMPARE_OP:
- return 2;
- case COMPARE_OP_FLOAT:
- return 2;
- case COMPARE_OP_INT:
- return 2;
- case COMPARE_OP_STR:
- return 2;
- case IS_OP:
- return 2;
- case CONTAINS_OP:
- return 2;
- case CHECK_EG_MATCH:
- return 2;
- case CHECK_EXC_MATCH:
- return 2;
- case IMPORT_NAME:
- return 2;
- case IMPORT_FROM:
- return 1;
- case JUMP_FORWARD:
- return 0;
- case JUMP_BACKWARD:
- return 0;
- case POP_JUMP_IF_FALSE:
- return 1;
- case POP_JUMP_IF_TRUE:
- return 1;
- case POP_JUMP_IF_NOT_NONE:
- return 1;
- case POP_JUMP_IF_NONE:
- return 1;
- case JUMP_BACKWARD_NO_INTERRUPT:
- return 0;
- case GET_LEN:
- return 1;
- case MATCH_CLASS:
- return 3;
- case MATCH_MAPPING:
- return 1;
- case MATCH_SEQUENCE:
- return 1;
- case MATCH_KEYS:
- return 2;
- case GET_ITER:
- return 1;
- case GET_YIELD_FROM_ITER:
- return 1;
- case FOR_ITER:
- return 1;
- case INSTRUMENTED_FOR_ITER:
- return 0;
- case FOR_ITER_LIST:
- return 1;
- case FOR_ITER_TUPLE:
- return 1;
- case FOR_ITER_RANGE:
- return 1;
- case FOR_ITER_GEN:
- return 1;
- case BEFORE_ASYNC_WITH:
- return 1;
- case BEFORE_WITH:
- return 1;
- case WITH_EXCEPT_START:
- return 4;
- case PUSH_EXC_INFO:
- return 1;
- case LOAD_ATTR_METHOD_WITH_VALUES:
- return 1;
- case LOAD_ATTR_METHOD_NO_DICT:
- return 1;
- case LOAD_ATTR_METHOD_LAZY_DICT:
- return 1;
- case KW_NAMES:
- return 0;
- case INSTRUMENTED_CALL:
- return 0;
- case CALL:
- return oparg + 2;
- case CALL_BOUND_METHOD_EXACT_ARGS:
- return oparg + 2;
- case CALL_PY_EXACT_ARGS:
- return oparg + 2;
- case CALL_PY_WITH_DEFAULTS:
- return oparg + 2;
- case CALL_NO_KW_TYPE_1:
- return oparg + 2;
- case CALL_NO_KW_STR_1:
- return oparg + 2;
- case CALL_NO_KW_TUPLE_1:
- return oparg + 2;
- case CALL_BUILTIN_CLASS:
- return oparg + 2;
- case CALL_NO_KW_BUILTIN_O:
- return oparg + 2;
- case CALL_NO_KW_BUILTIN_FAST:
- return oparg + 2;
- case CALL_BUILTIN_FAST_WITH_KEYWORDS:
- return oparg + 2;
- case CALL_NO_KW_LEN:
- return oparg + 2;
- case CALL_NO_KW_ISINSTANCE:
- return oparg + 2;
- case CALL_NO_KW_LIST_APPEND:
- return oparg + 2;
- case CALL_NO_KW_METHOD_DESCRIPTOR_O:
- return oparg + 2;
- case CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS:
- return oparg + 2;
- case CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS:
- return oparg + 2;
- case CALL_NO_KW_METHOD_DESCRIPTOR_FAST:
- return oparg + 2;
- case INSTRUMENTED_CALL_FUNCTION_EX:
- return 0;
- case CALL_FUNCTION_EX:
- return ((oparg & 1) ? 1 : 0) + 3;
- case MAKE_FUNCTION:
- return ((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0) + 1;
- case RETURN_GENERATOR:
- return 0;
- case BUILD_SLICE:
- return ((oparg == 3) ? 1 : 0) + 2;
- case FORMAT_VALUE:
- return (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0) + 1;
- case COPY:
- return (oparg-1) + 1;
- case BINARY_OP:
- return 2;
- case SWAP:
- return (oparg-2) + 2;
- case INSTRUMENTED_INSTRUCTION:
- return 0;
- case INSTRUMENTED_JUMP_FORWARD:
- return 0;
- case INSTRUMENTED_JUMP_BACKWARD:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_TRUE:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_FALSE:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_NONE:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_NOT_NONE:
- return 0;
- case EXTENDED_ARG:
- return 0;
- case CACHE:
- return 0;
- case RESERVED:
- return 0;
- default:
- return -1;
- }
- }
- #endif
- #ifndef NEED_OPCODE_METADATA
- extern int _PyOpcode_num_pushed(int opcode, int oparg, bool jump);
- #else
- int
- _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
- switch(opcode) {
- case NOP:
- return 0;
- case RESUME:
- return 0;
- case INSTRUMENTED_RESUME:
- return 0;
- case LOAD_CLOSURE:
- return 1;
- case LOAD_FAST_CHECK:
- return 1;
- case LOAD_FAST:
- return 1;
- case LOAD_FAST_AND_CLEAR:
- return 1;
- case LOAD_CONST:
- return 1;
- case STORE_FAST:
- return 0;
- case LOAD_FAST__LOAD_FAST:
- return 1+1;
- case LOAD_FAST__LOAD_CONST:
- return 1+1;
- case STORE_FAST__LOAD_FAST:
- return 0+1;
- case STORE_FAST__STORE_FAST:
- return 0+0;
- case LOAD_CONST__LOAD_FAST:
- return 1+1;
- case POP_TOP:
- return 0;
- case PUSH_NULL:
- return 1;
- case END_FOR:
- return 0+0;
- case INSTRUMENTED_END_FOR:
- return 0;
- case END_SEND:
- return 1;
- case INSTRUMENTED_END_SEND:
- return 1;
- case UNARY_NEGATIVE:
- return 1;
- case UNARY_NOT:
- return 1;
- case UNARY_INVERT:
- return 1;
- case BINARY_OP_MULTIPLY_INT:
- return 1;
- case BINARY_OP_MULTIPLY_FLOAT:
- return 1;
- case BINARY_OP_SUBTRACT_INT:
- return 1;
- case BINARY_OP_SUBTRACT_FLOAT:
- return 1;
- case BINARY_OP_ADD_UNICODE:
- return 1;
- case BINARY_OP_INPLACE_ADD_UNICODE:
- return 0;
- case BINARY_OP_ADD_FLOAT:
- return 1;
- case BINARY_OP_ADD_INT:
- return 1;
- case BINARY_SUBSCR:
- return 1;
- case BINARY_SLICE:
- return 1;
- case STORE_SLICE:
- return 0;
- case BINARY_SUBSCR_LIST_INT:
- return 1;
- case BINARY_SUBSCR_TUPLE_INT:
- return 1;
- case BINARY_SUBSCR_DICT:
- return 1;
- case BINARY_SUBSCR_GETITEM:
- return 1;
- case LIST_APPEND:
- return (oparg-1) + 1;
- case SET_ADD:
- return (oparg-1) + 1;
- case STORE_SUBSCR:
- return 0;
- case STORE_SUBSCR_LIST_INT:
- return 0;
- case STORE_SUBSCR_DICT:
- return 0;
- case DELETE_SUBSCR:
- return 0;
- case CALL_INTRINSIC_1:
- return 1;
- case CALL_INTRINSIC_2:
- return 1;
- case RAISE_VARARGS:
- return 0;
- case INTERPRETER_EXIT:
- return 0;
- case RETURN_VALUE:
- return 0;
- case INSTRUMENTED_RETURN_VALUE:
- return 0;
- case RETURN_CONST:
- return 0;
- case INSTRUMENTED_RETURN_CONST:
- return 0;
- case GET_AITER:
- return 1;
- case GET_ANEXT:
- return 2;
- case GET_AWAITABLE:
- return 1;
- case SEND:
- return 2;
- case SEND_GEN:
- return 2;
- case INSTRUMENTED_YIELD_VALUE:
- return 1;
- case YIELD_VALUE:
- return 1;
- case POP_EXCEPT:
- return 0;
- case RERAISE:
- return oparg;
- case END_ASYNC_FOR:
- return 0;
- case CLEANUP_THROW:
- return 2;
- case LOAD_ASSERTION_ERROR:
- return 1;
- case LOAD_BUILD_CLASS:
- return 1;
- case STORE_NAME:
- return 0;
- case DELETE_NAME:
- return 0;
- case UNPACK_SEQUENCE:
- return oparg;
- case UNPACK_SEQUENCE_TWO_TUPLE:
- return oparg;
- case UNPACK_SEQUENCE_TUPLE:
- return oparg;
- case UNPACK_SEQUENCE_LIST:
- return oparg;
- case UNPACK_EX:
- return (oparg & 0xFF) + (oparg >> 8) + 1;
- case STORE_ATTR:
- return 0;
- case DELETE_ATTR:
- return 0;
- case STORE_GLOBAL:
- return 0;
- case DELETE_GLOBAL:
- return 0;
- case LOAD_LOCALS:
- return 1;
- case LOAD_FROM_DICT_OR_GLOBALS:
- return 1;
- case LOAD_NAME:
- return 1;
- case LOAD_GLOBAL:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_GLOBAL_MODULE:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_GLOBAL_BUILTIN:
- return ((oparg & 1) ? 1 : 0) + 1;
- case DELETE_FAST:
- return 0;
- case MAKE_CELL:
- return 0;
- case DELETE_DEREF:
- return 0;
- case LOAD_FROM_DICT_OR_DEREF:
- return 1;
- case LOAD_DEREF:
- return 1;
- case STORE_DEREF:
- return 0;
- case COPY_FREE_VARS:
- return 0;
- case BUILD_STRING:
- return 1;
- case BUILD_TUPLE:
- return 1;
- case BUILD_LIST:
- return 1;
- case LIST_EXTEND:
- return (oparg-1) + 1;
- case SET_UPDATE:
- return (oparg-1) + 1;
- case BUILD_SET:
- return 1;
- case BUILD_MAP:
- return 1;
- case SETUP_ANNOTATIONS:
- return 0;
- case BUILD_CONST_KEY_MAP:
- return 1;
- case DICT_UPDATE:
- return 0;
- case DICT_MERGE:
- return 0;
- case MAP_ADD:
- return 0;
- case INSTRUMENTED_LOAD_SUPER_ATTR:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_SUPER_ATTR:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_SUPER_ATTR_ATTR:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_SUPER_ATTR_METHOD:
- return 2;
- case LOAD_ATTR:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_INSTANCE_VALUE:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_MODULE:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_WITH_HINT:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_SLOT:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_CLASS:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_PROPERTY:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN:
- return ((oparg & 1) ? 1 : 0) + 1;
- case STORE_ATTR_INSTANCE_VALUE:
- return 0;
- case STORE_ATTR_WITH_HINT:
- return 0;
- case STORE_ATTR_SLOT:
- return 0;
- case COMPARE_OP:
- return 1;
- case COMPARE_OP_FLOAT:
- return 1;
- case COMPARE_OP_INT:
- return 1;
- case COMPARE_OP_STR:
- return 1;
- case IS_OP:
- return 1;
- case CONTAINS_OP:
- return 1;
- case CHECK_EG_MATCH:
- return 2;
- case CHECK_EXC_MATCH:
- return 2;
- case IMPORT_NAME:
- return 1;
- case IMPORT_FROM:
- return 2;
- case JUMP_FORWARD:
- return 0;
- case JUMP_BACKWARD:
- return 0;
- case POP_JUMP_IF_FALSE:
- return 0;
- case POP_JUMP_IF_TRUE:
- return 0;
- case POP_JUMP_IF_NOT_NONE:
- return 0;
- case POP_JUMP_IF_NONE:
- return 0;
- case JUMP_BACKWARD_NO_INTERRUPT:
- return 0;
- case GET_LEN:
- return 2;
- case MATCH_CLASS:
- return 1;
- case MATCH_MAPPING:
- return 2;
- case MATCH_SEQUENCE:
- return 2;
- case MATCH_KEYS:
- return 3;
- case GET_ITER:
- return 1;
- case GET_YIELD_FROM_ITER:
- return 1;
- case FOR_ITER:
- return 2;
- case INSTRUMENTED_FOR_ITER:
- return 0;
- case FOR_ITER_LIST:
- return 2;
- case FOR_ITER_TUPLE:
- return 2;
- case FOR_ITER_RANGE:
- return 2;
- case FOR_ITER_GEN:
- return 2;
- case BEFORE_ASYNC_WITH:
- return 2;
- case BEFORE_WITH:
- return 2;
- case WITH_EXCEPT_START:
- return 5;
- case PUSH_EXC_INFO:
- return 2;
- case LOAD_ATTR_METHOD_WITH_VALUES:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_METHOD_NO_DICT:
- return ((oparg & 1) ? 1 : 0) + 1;
- case LOAD_ATTR_METHOD_LAZY_DICT:
- return ((oparg & 1) ? 1 : 0) + 1;
- case KW_NAMES:
- return 0;
- case INSTRUMENTED_CALL:
- return 0;
- case CALL:
- return 1;
- case CALL_BOUND_METHOD_EXACT_ARGS:
- return 1;
- case CALL_PY_EXACT_ARGS:
- return 1;
- case CALL_PY_WITH_DEFAULTS:
- return 1;
- case CALL_NO_KW_TYPE_1:
- return 1;
- case CALL_NO_KW_STR_1:
- return 1;
- case CALL_NO_KW_TUPLE_1:
- return 1;
- case CALL_BUILTIN_CLASS:
- return 1;
- case CALL_NO_KW_BUILTIN_O:
- return 1;
- case CALL_NO_KW_BUILTIN_FAST:
- return 1;
- case CALL_BUILTIN_FAST_WITH_KEYWORDS:
- return 1;
- case CALL_NO_KW_LEN:
- return 1;
- case CALL_NO_KW_ISINSTANCE:
- return 1;
- case CALL_NO_KW_LIST_APPEND:
- return 1;
- case CALL_NO_KW_METHOD_DESCRIPTOR_O:
- return 1;
- case CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS:
- return 1;
- case CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS:
- return 1;
- case CALL_NO_KW_METHOD_DESCRIPTOR_FAST:
- return 1;
- case INSTRUMENTED_CALL_FUNCTION_EX:
- return 0;
- case CALL_FUNCTION_EX:
- return 1;
- case MAKE_FUNCTION:
- return 1;
- case RETURN_GENERATOR:
- return 0;
- case BUILD_SLICE:
- return 1;
- case FORMAT_VALUE:
- return 1;
- case COPY:
- return (oparg-1) + 2;
- case BINARY_OP:
- return 1;
- case SWAP:
- return (oparg-2) + 2;
- case INSTRUMENTED_INSTRUCTION:
- return 0;
- case INSTRUMENTED_JUMP_FORWARD:
- return 0;
- case INSTRUMENTED_JUMP_BACKWARD:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_TRUE:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_FALSE:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_NONE:
- return 0;
- case INSTRUMENTED_POP_JUMP_IF_NOT_NONE:
- return 0;
- case EXTENDED_ARG:
- return 0;
- case CACHE:
- return 0;
- case RESERVED:
- return 0;
- default:
- return -1;
- }
- }
- #endif
- enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000 };
- struct opcode_metadata {
- bool valid_entry;
- enum InstructionFormat instr_format;
- };
- #ifndef NEED_OPCODE_METADATA
- extern const struct opcode_metadata _PyOpcode_opcode_metadata[256];
- #else
- const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
- [NOP] = { true, INSTR_FMT_IX },
- [RESUME] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_RESUME] = { true, INSTR_FMT_IB },
- [LOAD_CLOSURE] = { true, INSTR_FMT_IB },
- [LOAD_FAST_CHECK] = { true, INSTR_FMT_IB },
- [LOAD_FAST] = { true, INSTR_FMT_IB },
- [LOAD_FAST_AND_CLEAR] = { true, INSTR_FMT_IB },
- [LOAD_CONST] = { true, INSTR_FMT_IB },
- [STORE_FAST] = { true, INSTR_FMT_IB },
- [LOAD_FAST__LOAD_FAST] = { true, INSTR_FMT_IBIB },
- [LOAD_FAST__LOAD_CONST] = { true, INSTR_FMT_IBIB },
- [STORE_FAST__LOAD_FAST] = { true, INSTR_FMT_IBIB },
- [STORE_FAST__STORE_FAST] = { true, INSTR_FMT_IBIB },
- [LOAD_CONST__LOAD_FAST] = { true, INSTR_FMT_IBIB },
- [POP_TOP] = { true, INSTR_FMT_IX },
- [PUSH_NULL] = { true, INSTR_FMT_IX },
- [END_FOR] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_END_FOR] = { true, INSTR_FMT_IX },
- [END_SEND] = { true, INSTR_FMT_IX },
- [INSTRUMENTED_END_SEND] = { true, INSTR_FMT_IX },
- [UNARY_NEGATIVE] = { true, INSTR_FMT_IX },
- [UNARY_NOT] = { true, INSTR_FMT_IX },
- [UNARY_INVERT] = { true, INSTR_FMT_IX },
- [BINARY_OP_MULTIPLY_INT] = { true, INSTR_FMT_IXC },
- [BINARY_OP_MULTIPLY_FLOAT] = { true, INSTR_FMT_IXC },
- [BINARY_OP_SUBTRACT_INT] = { true, INSTR_FMT_IXC },
- [BINARY_OP_SUBTRACT_FLOAT] = { true, INSTR_FMT_IXC },
- [BINARY_OP_ADD_UNICODE] = { true, INSTR_FMT_IXC },
- [BINARY_OP_INPLACE_ADD_UNICODE] = { true, INSTR_FMT_IX },
- [BINARY_OP_ADD_FLOAT] = { true, INSTR_FMT_IXC },
- [BINARY_OP_ADD_INT] = { true, INSTR_FMT_IXC },
- [BINARY_SUBSCR] = { true, INSTR_FMT_IXC },
- [BINARY_SLICE] = { true, INSTR_FMT_IX },
- [STORE_SLICE] = { true, INSTR_FMT_IX },
- [BINARY_SUBSCR_LIST_INT] = { true, INSTR_FMT_IXC },
- [BINARY_SUBSCR_TUPLE_INT] = { true, INSTR_FMT_IXC },
- [BINARY_SUBSCR_DICT] = { true, INSTR_FMT_IXC },
- [BINARY_SUBSCR_GETITEM] = { true, INSTR_FMT_IXC },
- [LIST_APPEND] = { true, INSTR_FMT_IB },
- [SET_ADD] = { true, INSTR_FMT_IB },
- [STORE_SUBSCR] = { true, INSTR_FMT_IXC },
- [STORE_SUBSCR_LIST_INT] = { true, INSTR_FMT_IXC },
- [STORE_SUBSCR_DICT] = { true, INSTR_FMT_IXC },
- [DELETE_SUBSCR] = { true, INSTR_FMT_IX },
- [CALL_INTRINSIC_1] = { true, INSTR_FMT_IB },
- [CALL_INTRINSIC_2] = { true, INSTR_FMT_IB },
- [RAISE_VARARGS] = { true, INSTR_FMT_IB },
- [INTERPRETER_EXIT] = { true, INSTR_FMT_IX },
- [RETURN_VALUE] = { true, INSTR_FMT_IX },
- [INSTRUMENTED_RETURN_VALUE] = { true, INSTR_FMT_IX },
- [RETURN_CONST] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_RETURN_CONST] = { true, INSTR_FMT_IB },
- [GET_AITER] = { true, INSTR_FMT_IX },
- [GET_ANEXT] = { true, INSTR_FMT_IX },
- [GET_AWAITABLE] = { true, INSTR_FMT_IB },
- [SEND] = { true, INSTR_FMT_IBC },
- [SEND_GEN] = { true, INSTR_FMT_IBC },
- [INSTRUMENTED_YIELD_VALUE] = { true, INSTR_FMT_IX },
- [YIELD_VALUE] = { true, INSTR_FMT_IX },
- [POP_EXCEPT] = { true, INSTR_FMT_IX },
- [RERAISE] = { true, INSTR_FMT_IB },
- [END_ASYNC_FOR] = { true, INSTR_FMT_IX },
- [CLEANUP_THROW] = { true, INSTR_FMT_IX },
- [LOAD_ASSERTION_ERROR] = { true, INSTR_FMT_IX },
- [LOAD_BUILD_CLASS] = { true, INSTR_FMT_IX },
- [STORE_NAME] = { true, INSTR_FMT_IB },
- [DELETE_NAME] = { true, INSTR_FMT_IB },
- [UNPACK_SEQUENCE] = { true, INSTR_FMT_IBC },
- [UNPACK_SEQUENCE_TWO_TUPLE] = { true, INSTR_FMT_IBC },
- [UNPACK_SEQUENCE_TUPLE] = { true, INSTR_FMT_IBC },
- [UNPACK_SEQUENCE_LIST] = { true, INSTR_FMT_IBC },
- [UNPACK_EX] = { true, INSTR_FMT_IB },
- [STORE_ATTR] = { true, INSTR_FMT_IBC000 },
- [DELETE_ATTR] = { true, INSTR_FMT_IB },
- [STORE_GLOBAL] = { true, INSTR_FMT_IB },
- [DELETE_GLOBAL] = { true, INSTR_FMT_IB },
- [LOAD_LOCALS] = { true, INSTR_FMT_IX },
- [LOAD_FROM_DICT_OR_GLOBALS] = { true, INSTR_FMT_IB },
- [LOAD_NAME] = { true, INSTR_FMT_IB },
- [LOAD_GLOBAL] = { true, INSTR_FMT_IBC000 },
- [LOAD_GLOBAL_MODULE] = { true, INSTR_FMT_IBC000 },
- [LOAD_GLOBAL_BUILTIN] = { true, INSTR_FMT_IBC000 },
- [DELETE_FAST] = { true, INSTR_FMT_IB },
- [MAKE_CELL] = { true, INSTR_FMT_IB },
- [DELETE_DEREF] = { true, INSTR_FMT_IB },
- [LOAD_FROM_DICT_OR_DEREF] = { true, INSTR_FMT_IB },
- [LOAD_DEREF] = { true, INSTR_FMT_IB },
- [STORE_DEREF] = { true, INSTR_FMT_IB },
- [COPY_FREE_VARS] = { true, INSTR_FMT_IB },
- [BUILD_STRING] = { true, INSTR_FMT_IB },
- [BUILD_TUPLE] = { true, INSTR_FMT_IB },
- [BUILD_LIST] = { true, INSTR_FMT_IB },
- [LIST_EXTEND] = { true, INSTR_FMT_IB },
- [SET_UPDATE] = { true, INSTR_FMT_IB },
- [BUILD_SET] = { true, INSTR_FMT_IB },
- [BUILD_MAP] = { true, INSTR_FMT_IB },
- [SETUP_ANNOTATIONS] = { true, INSTR_FMT_IX },
- [BUILD_CONST_KEY_MAP] = { true, INSTR_FMT_IB },
- [DICT_UPDATE] = { true, INSTR_FMT_IB },
- [DICT_MERGE] = { true, INSTR_FMT_IB },
- [MAP_ADD] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_LOAD_SUPER_ATTR] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_SUPER_ATTR] = { true, INSTR_FMT_IBC },
- [LOAD_SUPER_ATTR_ATTR] = { true, INSTR_FMT_IBC },
- [LOAD_SUPER_ATTR_METHOD] = { true, INSTR_FMT_IBC },
- [LOAD_ATTR] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_INSTANCE_VALUE] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_MODULE] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_WITH_HINT] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_SLOT] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_CLASS] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_PROPERTY] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN] = { true, INSTR_FMT_IBC00000000 },
- [STORE_ATTR_INSTANCE_VALUE] = { true, INSTR_FMT_IXC000 },
- [STORE_ATTR_WITH_HINT] = { true, INSTR_FMT_IBC000 },
- [STORE_ATTR_SLOT] = { true, INSTR_FMT_IXC000 },
- [COMPARE_OP] = { true, INSTR_FMT_IBC },
- [COMPARE_OP_FLOAT] = { true, INSTR_FMT_IBC },
- [COMPARE_OP_INT] = { true, INSTR_FMT_IBC },
- [COMPARE_OP_STR] = { true, INSTR_FMT_IBC },
- [IS_OP] = { true, INSTR_FMT_IB },
- [CONTAINS_OP] = { true, INSTR_FMT_IB },
- [CHECK_EG_MATCH] = { true, INSTR_FMT_IX },
- [CHECK_EXC_MATCH] = { true, INSTR_FMT_IX },
- [IMPORT_NAME] = { true, INSTR_FMT_IB },
- [IMPORT_FROM] = { true, INSTR_FMT_IB },
- [JUMP_FORWARD] = { true, INSTR_FMT_IB },
- [JUMP_BACKWARD] = { true, INSTR_FMT_IB },
- [POP_JUMP_IF_FALSE] = { true, INSTR_FMT_IB },
- [POP_JUMP_IF_TRUE] = { true, INSTR_FMT_IB },
- [POP_JUMP_IF_NOT_NONE] = { true, INSTR_FMT_IB },
- [POP_JUMP_IF_NONE] = { true, INSTR_FMT_IB },
- [JUMP_BACKWARD_NO_INTERRUPT] = { true, INSTR_FMT_IB },
- [GET_LEN] = { true, INSTR_FMT_IX },
- [MATCH_CLASS] = { true, INSTR_FMT_IB },
- [MATCH_MAPPING] = { true, INSTR_FMT_IX },
- [MATCH_SEQUENCE] = { true, INSTR_FMT_IX },
- [MATCH_KEYS] = { true, INSTR_FMT_IX },
- [GET_ITER] = { true, INSTR_FMT_IX },
- [GET_YIELD_FROM_ITER] = { true, INSTR_FMT_IX },
- [FOR_ITER] = { true, INSTR_FMT_IBC },
- [INSTRUMENTED_FOR_ITER] = { true, INSTR_FMT_IB },
- [FOR_ITER_LIST] = { true, INSTR_FMT_IBC },
- [FOR_ITER_TUPLE] = { true, INSTR_FMT_IBC },
- [FOR_ITER_RANGE] = { true, INSTR_FMT_IBC },
- [FOR_ITER_GEN] = { true, INSTR_FMT_IBC },
- [BEFORE_ASYNC_WITH] = { true, INSTR_FMT_IX },
- [BEFORE_WITH] = { true, INSTR_FMT_IX },
- [WITH_EXCEPT_START] = { true, INSTR_FMT_IX },
- [PUSH_EXC_INFO] = { true, INSTR_FMT_IX },
- [LOAD_ATTR_METHOD_WITH_VALUES] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_METHOD_NO_DICT] = { true, INSTR_FMT_IBC00000000 },
- [LOAD_ATTR_METHOD_LAZY_DICT] = { true, INSTR_FMT_IBC00000000 },
- [KW_NAMES] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_CALL] = { true, INSTR_FMT_IB },
- [CALL] = { true, INSTR_FMT_IBC00 },
- [CALL_BOUND_METHOD_EXACT_ARGS] = { true, INSTR_FMT_IBC00 },
- [CALL_PY_EXACT_ARGS] = { true, INSTR_FMT_IBC00 },
- [CALL_PY_WITH_DEFAULTS] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_TYPE_1] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_STR_1] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_TUPLE_1] = { true, INSTR_FMT_IBC00 },
- [CALL_BUILTIN_CLASS] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_BUILTIN_O] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_BUILTIN_FAST] = { true, INSTR_FMT_IBC00 },
- [CALL_BUILTIN_FAST_WITH_KEYWORDS] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_LEN] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_ISINSTANCE] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_LIST_APPEND] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_METHOD_DESCRIPTOR_O] = { true, INSTR_FMT_IBC00 },
- [CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = { true, INSTR_FMT_IBC00 },
- [CALL_NO_KW_METHOD_DESCRIPTOR_FAST] = { true, INSTR_FMT_IBC00 },
- [INSTRUMENTED_CALL_FUNCTION_EX] = { true, INSTR_FMT_IX },
- [CALL_FUNCTION_EX] = { true, INSTR_FMT_IB },
- [MAKE_FUNCTION] = { true, INSTR_FMT_IB },
- [RETURN_GENERATOR] = { true, INSTR_FMT_IX },
- [BUILD_SLICE] = { true, INSTR_FMT_IB },
- [FORMAT_VALUE] = { true, INSTR_FMT_IB },
- [COPY] = { true, INSTR_FMT_IB },
- [BINARY_OP] = { true, INSTR_FMT_IBC },
- [SWAP] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_INSTRUCTION] = { true, INSTR_FMT_IX },
- [INSTRUMENTED_JUMP_FORWARD] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_JUMP_BACKWARD] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_POP_JUMP_IF_TRUE] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_POP_JUMP_IF_FALSE] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_POP_JUMP_IF_NONE] = { true, INSTR_FMT_IB },
- [INSTRUMENTED_POP_JUMP_IF_NOT_NONE] = { true, INSTR_FMT_IB },
- [EXTENDED_ARG] = { true, INSTR_FMT_IB },
- [CACHE] = { true, INSTR_FMT_IX },
- [RESERVED] = { true, INSTR_FMT_IX },
- };
- #endif
|