|
8989 | 8989 | next_instr += 1; |
8990 | 8990 | INSTRUCTION_STATS(INSTRUMENTED_RETURN_VALUE); |
8991 | 8991 | _PyStackRef val; |
| 8992 | + _PyStackRef value; |
8992 | 8993 | _PyStackRef retval; |
8993 | 8994 | _PyStackRef res; |
8994 | 8995 | // _RETURN_VALUE_EVENT |
|
9003 | 9004 | JUMP_TO_LABEL(error); |
9004 | 9005 | } |
9005 | 9006 | } |
| 9007 | + // _MAKE_HEAP_SAFE |
| 9008 | + { |
| 9009 | + value = val; |
| 9010 | + value = PyStackRef_MakeHeapSafe(value); |
| 9011 | + } |
9006 | 9012 | // _RETURN_VALUE |
9007 | 9013 | { |
9008 | | - retval = val; |
| 9014 | + retval = value; |
9009 | 9015 | assert(frame->owner != FRAME_OWNED_BY_INTERPRETER); |
9010 | | - _PyStackRef temp = PyStackRef_MakeHeapSafe(retval); |
| 9016 | + _PyStackRef temp = retval; |
9011 | 9017 | stack_pointer += -1; |
9012 | 9018 | ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
9013 | 9019 | _PyFrame_SetStackPointer(frame, stack_pointer); |
9014 | 9020 | assert(STACK_LEVEL() == 0); |
9015 | 9021 | _Py_LeaveRecursiveCallPy(tstate); |
9016 | | - _PyInterpreterFrame* dying = frame; |
| 9022 | + _PyInterpreterFrame *dying = frame; |
9017 | 9023 | frame = tstate->current_frame = dying->previous; |
9018 | | - CI_SET_ADAPTIVE_INTERPRETER_ENABLED_STATE |
9019 | 9024 | _PyEval_FrameClearAndPop(tstate, dying); |
9020 | 9025 | stack_pointer = _PyFrame_GetStackPointer(frame); |
9021 | 9026 | LOAD_IP(frame->return_offset); |
|
9039 | 9044 | next_instr += 1; |
9040 | 9045 | INSTRUCTION_STATS(INSTRUMENTED_YIELD_VALUE); |
9041 | 9046 | _PyStackRef val; |
9042 | | - _PyStackRef retval; |
9043 | 9047 | _PyStackRef value; |
| 9048 | + _PyStackRef retval; |
9044 | 9049 | // _YIELD_VALUE_EVENT |
9045 | 9050 | { |
9046 | 9051 | val = stack_pointer[-1]; |
|
9057 | 9062 | DISPATCH(); |
9058 | 9063 | } |
9059 | 9064 | } |
| 9065 | + // _MAKE_HEAP_SAFE |
| 9066 | + { |
| 9067 | + value = val; |
| 9068 | + value = PyStackRef_MakeHeapSafe(value); |
| 9069 | + } |
9060 | 9070 | // _YIELD_VALUE |
9061 | 9071 | { |
9062 | | - retval = val; |
| 9072 | + retval = value; |
9063 | 9073 | assert(frame->owner != FRAME_OWNED_BY_INTERPRETER); |
9064 | 9074 | frame->instr_ptr++; |
9065 | | - PyGenObject* gen = _PyGen_GetGeneratorFromFrame(frame); |
| 9075 | + PyGenObject *gen = _PyGen_GetGeneratorFromFrame(frame); |
9066 | 9076 | assert(FRAME_SUSPENDED_YIELD_FROM == FRAME_SUSPENDED + 1); |
9067 | 9077 | assert(oparg == 0 || oparg == 1); |
9068 | 9078 | _PyStackRef temp = retval; |
|
9072 | 9082 | tstate->exc_info = gen->gi_exc_state.previous_item; |
9073 | 9083 | gen->gi_exc_state.previous_item = NULL; |
9074 | 9084 | _Py_LeaveRecursiveCallPy(tstate); |
9075 | | - _PyInterpreterFrame* gen_frame = frame; |
| 9085 | + _PyInterpreterFrame *gen_frame = frame; |
9076 | 9086 | frame = tstate->current_frame = frame->previous; |
9077 | | - CI_SET_ADAPTIVE_INTERPRETER_ENABLED_STATE |
9078 | 9087 | gen_frame->previous = NULL; |
9079 | 9088 | ((_PyThreadStateImpl *)tstate)->generator_return_kind = GENERATOR_YIELD; |
9080 | 9089 | FT_ATOMIC_STORE_INT8_RELEASE(gen->gi_frame_state, FRAME_SUSPENDED + oparg); |
9081 | 9090 | assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER); |
9082 | 9091 | #if TIER_ONE |
9083 | | - assert( |
9084 | | - frame->instr_ptr->op.code == INSTRUMENTED_LINE || |
9085 | | - frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION || |
9086 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND || |
9087 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER || |
9088 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT || |
9089 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR); |
| 9092 | + assert(frame->instr_ptr->op.code == INSTRUMENTED_LINE || |
| 9093 | + frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION || |
| 9094 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND || |
| 9095 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER || |
| 9096 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT || |
| 9097 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR); |
9090 | 9098 | #endif |
9091 | 9099 | stack_pointer = _PyFrame_GetStackPointer(frame); |
9092 | 9100 | LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND); |
9093 | | - value = PyStackRef_MakeHeapSafe(temp); |
| 9101 | + value = temp; |
9094 | 9102 | LLTRACE_RESUME_FRAME(); |
9095 | 9103 | } |
9096 | 9104 | stack_pointer[0] = value; |
@@ -12057,24 +12065,32 @@ |
12057 | 12065 | frame->instr_ptr = next_instr; |
12058 | 12066 | next_instr += 1; |
12059 | 12067 | INSTRUCTION_STATS(RETURN_VALUE); |
| 12068 | + _PyStackRef value; |
12060 | 12069 | _PyStackRef retval; |
12061 | 12070 | _PyStackRef res; |
12062 | | - retval = stack_pointer[-1]; |
12063 | | - assert(frame->owner != FRAME_OWNED_BY_INTERPRETER); |
12064 | | - _PyStackRef temp = PyStackRef_MakeHeapSafe(retval); |
12065 | | - stack_pointer += -1; |
12066 | | - ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
12067 | | - _PyFrame_SetStackPointer(frame, stack_pointer); |
12068 | | - assert(STACK_LEVEL() == 0); |
12069 | | - _Py_LeaveRecursiveCallPy(tstate); |
12070 | | - _PyInterpreterFrame* dying = frame; |
12071 | | - frame = tstate->current_frame = dying->previous; |
12072 | | - CI_SET_ADAPTIVE_INTERPRETER_ENABLED_STATE |
12073 | | - _PyEval_FrameClearAndPop(tstate, dying); |
12074 | | - stack_pointer = _PyFrame_GetStackPointer(frame); |
12075 | | - LOAD_IP(frame->return_offset); |
12076 | | - res = temp; |
12077 | | - LLTRACE_RESUME_FRAME(); |
| 12071 | + // _MAKE_HEAP_SAFE |
| 12072 | + { |
| 12073 | + value = stack_pointer[-1]; |
| 12074 | + value = PyStackRef_MakeHeapSafe(value); |
| 12075 | + } |
| 12076 | + // _RETURN_VALUE |
| 12077 | + { |
| 12078 | + retval = value; |
| 12079 | + assert(frame->owner != FRAME_OWNED_BY_INTERPRETER); |
| 12080 | + _PyStackRef temp = retval; |
| 12081 | + stack_pointer += -1; |
| 12082 | + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
| 12083 | + _PyFrame_SetStackPointer(frame, stack_pointer); |
| 12084 | + assert(STACK_LEVEL() == 0); |
| 12085 | + _Py_LeaveRecursiveCallPy(tstate); |
| 12086 | + _PyInterpreterFrame *dying = frame; |
| 12087 | + frame = tstate->current_frame = dying->previous; |
| 12088 | + _PyEval_FrameClearAndPop(tstate, dying); |
| 12089 | + stack_pointer = _PyFrame_GetStackPointer(frame); |
| 12090 | + LOAD_IP(frame->return_offset); |
| 12091 | + res = temp; |
| 12092 | + LLTRACE_RESUME_FRAME(); |
| 12093 | + } |
12078 | 12094 | stack_pointer[0] = res; |
12079 | 12095 | stack_pointer += 1; |
12080 | 12096 | ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
@@ -13890,41 +13906,47 @@ |
13890 | 13906 | frame->instr_ptr = next_instr; |
13891 | 13907 | next_instr += 1; |
13892 | 13908 | INSTRUCTION_STATS(YIELD_VALUE); |
13893 | | - _PyStackRef retval; |
13894 | 13909 | _PyStackRef value; |
13895 | | - retval = stack_pointer[-1]; |
13896 | | - assert(frame->owner != FRAME_OWNED_BY_INTERPRETER); |
13897 | | - frame->instr_ptr++; |
13898 | | - PyGenObject* gen = _PyGen_GetGeneratorFromFrame(frame); |
13899 | | - assert(FRAME_SUSPENDED_YIELD_FROM == FRAME_SUSPENDED + 1); |
13900 | | - assert(oparg == 0 || oparg == 1); |
13901 | | - _PyStackRef temp = retval; |
13902 | | - stack_pointer += -1; |
13903 | | - ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
13904 | | - _PyFrame_SetStackPointer(frame, stack_pointer); |
13905 | | - tstate->exc_info = gen->gi_exc_state.previous_item; |
13906 | | - gen->gi_exc_state.previous_item = NULL; |
13907 | | - _Py_LeaveRecursiveCallPy(tstate); |
13908 | | - _PyInterpreterFrame* gen_frame = frame; |
13909 | | - frame = tstate->current_frame = frame->previous; |
13910 | | - CI_SET_ADAPTIVE_INTERPRETER_ENABLED_STATE |
13911 | | - gen_frame->previous = NULL; |
13912 | | - ((_PyThreadStateImpl *)tstate)->generator_return_kind = GENERATOR_YIELD; |
13913 | | - FT_ATOMIC_STORE_INT8_RELEASE(gen->gi_frame_state, FRAME_SUSPENDED + oparg); |
13914 | | - assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER); |
13915 | | - #if TIER_ONE |
13916 | | - assert( |
13917 | | - frame->instr_ptr->op.code == INSTRUMENTED_LINE || |
13918 | | - frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION || |
13919 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND || |
13920 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER || |
13921 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT || |
13922 | | - _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR); |
13923 | | - #endif |
13924 | | - stack_pointer = _PyFrame_GetStackPointer(frame); |
13925 | | - LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND); |
13926 | | - value = PyStackRef_MakeHeapSafe(temp); |
13927 | | - LLTRACE_RESUME_FRAME(); |
| 13910 | + _PyStackRef retval; |
| 13911 | + // _MAKE_HEAP_SAFE |
| 13912 | + { |
| 13913 | + value = stack_pointer[-1]; |
| 13914 | + value = PyStackRef_MakeHeapSafe(value); |
| 13915 | + } |
| 13916 | + // _YIELD_VALUE |
| 13917 | + { |
| 13918 | + retval = value; |
| 13919 | + assert(frame->owner != FRAME_OWNED_BY_INTERPRETER); |
| 13920 | + frame->instr_ptr++; |
| 13921 | + PyGenObject *gen = _PyGen_GetGeneratorFromFrame(frame); |
| 13922 | + assert(FRAME_SUSPENDED_YIELD_FROM == FRAME_SUSPENDED + 1); |
| 13923 | + assert(oparg == 0 || oparg == 1); |
| 13924 | + _PyStackRef temp = retval; |
| 13925 | + stack_pointer += -1; |
| 13926 | + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
| 13927 | + _PyFrame_SetStackPointer(frame, stack_pointer); |
| 13928 | + tstate->exc_info = gen->gi_exc_state.previous_item; |
| 13929 | + gen->gi_exc_state.previous_item = NULL; |
| 13930 | + _Py_LeaveRecursiveCallPy(tstate); |
| 13931 | + _PyInterpreterFrame *gen_frame = frame; |
| 13932 | + frame = tstate->current_frame = frame->previous; |
| 13933 | + gen_frame->previous = NULL; |
| 13934 | + ((_PyThreadStateImpl *)tstate)->generator_return_kind = GENERATOR_YIELD; |
| 13935 | + FT_ATOMIC_STORE_INT8_RELEASE(gen->gi_frame_state, FRAME_SUSPENDED + oparg); |
| 13936 | + assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER); |
| 13937 | + #if TIER_ONE |
| 13938 | + assert(frame->instr_ptr->op.code == INSTRUMENTED_LINE || |
| 13939 | + frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION || |
| 13940 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND || |
| 13941 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER || |
| 13942 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT || |
| 13943 | + _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR); |
| 13944 | + #endif |
| 13945 | + stack_pointer = _PyFrame_GetStackPointer(frame); |
| 13946 | + LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND); |
| 13947 | + value = temp; |
| 13948 | + LLTRACE_RESUME_FRAME(); |
| 13949 | + } |
13928 | 13950 | stack_pointer[0] = value; |
13929 | 13951 | stack_pointer += 1; |
13930 | 13952 | ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); |
|
0 commit comments