Skip to content

Commit 195bb88

Browse files
fix problems from merge
1 parent b2f4fa6 commit 195bb88

File tree

7 files changed

+928
-820
lines changed

7 files changed

+928
-820
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4811,7 +4811,7 @@ dummy_func(
48114811
printf("SIDE EXIT: [UOp ");
48124812
_PyUOpPrint(&next_uop[-1]);
48134813
printf(", exit %ld, temp %d, target %d -> %s]\n",
4814-
exit - current_executor->exits, exit->temperature.as_counter,
4814+
exit - current_executor->exits, exit->temperature.value_and_backoff,
48154815
(int)(target - _PyCode_CODE(code)),
48164816
_PyOpcode_OpName[target->op.code]);
48174817
}
@@ -4921,7 +4921,7 @@ dummy_func(
49214921
printf("DYNAMIC EXIT: [UOp ");
49224922
_PyUOpPrint(&next_uop[-1]);
49234923
printf(", exit %ld, temp %d, target %d -> %s]\n",
4924-
exit - current_executor->exits, exit->temperature.as_counter,
4924+
exit - current_executor->exits, exit->temperature.value_and_backoff,
49254925
(int)(target - _PyCode_CODE(_PyFrame_GetCode(frame))),
49264926
_PyOpcode_OpName[target->op.code]);
49274927
}

Python/executor_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/partial_evaluator_bytecodes.c

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ dummy_func(void) {
5757
op(_LOAD_CONST, (-- value)) {
5858
// Should've all been converted by specializer.
5959
Py_UNREACHABLE();
60+
// Just to please the code generator that value is defined.
61+
value = sym_new_const(ctx, NULL);
6062
}
6163

6264
op(_LOAD_CONST_INLINE, (ptr/4 -- value)) {
@@ -99,7 +101,6 @@ dummy_func(void) {
99101

100102
op(_CHECK_STACK_SPACE_OPERAND, ( -- )) {
101103
MATERIALIZE_INST();
102-
(void)framesize;
103104
}
104105

105106
op(_BINARY_SUBSCR_INIT_CALL, (container, sub -- new_frame)) {
@@ -116,7 +117,7 @@ dummy_func(void) {
116117
ctx->done = true;
117118
}
118119

119-
op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null[1], args[oparg] -- new_frame)) {
120+
op(_INIT_CALL_PY_EXACT_ARGS, (callable[1], self_or_null[1], args[oparg] -- new_frame)) {
120121
MATERIALIZE_INST();
121122
MATERIALIZE_INPUTS();
122123

@@ -139,15 +140,20 @@ dummy_func(void) {
139140
argcount++;
140141
}
141142

143+
_Py_UopsPESlot temp;
142144
if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
143-
new_frame = (_Py_UopsPESlot){(_Py_UopsPESymbol *)frame_new(ctx, co, 0, args, argcount), NULL};
145+
temp = (_Py_UopsPESlot){
146+
(_Py_UopsPESymbol *)frame_new(ctx, co, 0, args, argcount), NULL
147+
};
144148
} else {
145-
new_frame = (_Py_UopsPESlot){(_Py_UopsPESymbol *)frame_new(ctx, co, 0, NULL, 0), NULL};
146-
149+
temp = (_Py_UopsPESlot){
150+
(_Py_UopsPESymbol *)frame_new(ctx, co, 0, NULL, 0), NULL
151+
};
147152
}
153+
new_frame = temp;
148154
}
149155

150-
op(_PY_FRAME_GENERAL, (callable, self_or_null[1], args[oparg] -- new_frame)) {
156+
op(_PY_FRAME_GENERAL, (callable[1], self_or_null[1], args[oparg] -- new_frame)) {
151157
MATERIALIZE_INST();
152158
MATERIALIZE_INPUTS();
153159
PyCodeObject *co = NULL;
@@ -158,25 +164,26 @@ dummy_func(void) {
158164
break;
159165
}
160166

161-
new_frame = (_Py_UopsPESlot){(_Py_UopsPESymbol *)frame_new(ctx, co, 0, NULL, 0), NULL};
167+
_Py_UopsPESlot temp = (_Py_UopsPESlot){(_Py_UopsPESymbol *)frame_new(ctx, co, 0, NULL, 0), NULL};
168+
new_frame = temp;
162169
}
163170

164-
op(_PY_FRAME_KW, (callable, self_or_null[1], args[oparg], kwnames -- new_frame)) {
171+
op(_PY_FRAME_KW, (callable[1], self_or_null[1], args[oparg], kwnames -- new_frame)) {
165172
MATERIALIZE_INST();
166173
MATERIALIZE_INPUTS();
167174
new_frame = (_Py_UopsPESlot){NULL, NULL};
168175
ctx->done = true;
169176
}
170177

171-
op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable, null, args[oparg] -- self, init, args[oparg])) {
178+
op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable[1], null[1], args[oparg] -- init[1], self[1], args[oparg])) {
172179
(void)type_version;
173180
MATERIALIZE_INST();
174181
MATERIALIZE_INPUTS();
175-
self = sym_new_not_null(ctx);
176-
init = sym_new_not_null(ctx);
182+
self[0] = sym_new_not_null(ctx);
183+
init[0] = sym_new_not_null(ctx);
177184
}
178185

179-
op(_CREATE_INIT_FRAME, (self, init, args[oparg] -- init_frame)) {
186+
op(_CREATE_INIT_FRAME, (init[1], self[1], args[oparg] -- init_frame)) {
180187
MATERIALIZE_INST();
181188
MATERIALIZE_INPUTS();
182189
init_frame = (_Py_UopsPESlot){NULL, NULL};
@@ -315,12 +322,28 @@ dummy_func(void) {
315322
(void)right;
316323
}
317324

318-
op(_MAYBE_EXPAND_METHOD, (callable, self_or_null[1], args[oparg] -- func, maybe_self[1], args[oparg])) {
325+
op(_MAYBE_EXPAND_METHOD, (callable[1], self_or_null[1], args[oparg] -- func[1], maybe_self[1], args[oparg])) {
319326
MATERIALIZE_INST();
320327
MATERIALIZE_INPUTS();
321-
func = sym_new_not_null(ctx);
328+
func[0] = sym_new_not_null(ctx);
322329
maybe_self[0] = sym_new_not_null(ctx);
323330
}
331+
332+
op(_LOAD_GLOBAL_MODULE_FROM_KEYS, (index/1, globals_keys -- res, null if (oparg & 1))) {
333+
(void)index;
334+
MATERIALIZE_INST();
335+
MATERIALIZE_INPUTS();
336+
res = sym_new_not_null(ctx);
337+
null = sym_new_null(ctx);
338+
}
339+
340+
op(_LOAD_GLOBAL_BUILTINS_FROM_KEYS, (index/1, builtins_keys -- res, null if (oparg & 1))) {
341+
(void)index;
342+
MATERIALIZE_INST();
343+
MATERIALIZE_INPUTS();
344+
res = sym_new_not_null(ctx);
345+
null = sym_new_null(ctx);
346+
}
324347
// END BYTECODES //
325348

326349
}

0 commit comments

Comments
 (0)