Skip to content

Commit 703dfc9

Browse files
Fix test, move is_abstract to subclass attribute
1 parent 8552182 commit 703dfc9

File tree

5 files changed

+51
-54
lines changed

5 files changed

+51
-54
lines changed

Lib/test/test_generated_cases.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,7 @@ def test_pure_uop_body_copied_in(self):
22582258
"""
22592259
input2 = """
22602260
op(OP, (foo -- res)) {
2261+
REPLACE_OPCODE_IF_EVALUATES_PURE(foo);
22612262
res = sym_new_known(ctx, foo);
22622263
}
22632264
"""
@@ -2272,9 +2273,9 @@ def test_pure_uop_body_copied_in(self):
22722273
JitOptSymbol *foo_sym = foo;
22732274
_PyStackRef foo = sym_get_const_as_stackref(ctx, foo_sym);
22742275
_PyStackRef res_stackref;
2275-
/* Start of pure uop copied from bytecodes for constant evaluation */
2276+
/* Start of uop copied from bytecodes for constant evaluation */
22762277
res_stackref = body(foo);
2277-
/* End of pure uop copied from bytecodes for constant evaluation */
2278+
/* End of uop copied from bytecodes for constant evaluation */
22782279
res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
22792280
stack_pointer[-1] = res;
22802281
}
@@ -2300,6 +2301,7 @@ def test_pure_uop_body_copied_in_complex(self):
23002301
"""
23012302
input2 = """
23022303
op(OP, (foo -- res)) {
2304+
REPLACE_OPCODE_IF_EVALUATES_PURE(foo);
23032305
res = sym_new_known(ctx, foo);
23042306
}
23052307
"""
@@ -2314,14 +2316,14 @@ def test_pure_uop_body_copied_in_complex(self):
23142316
JitOptSymbol *foo_sym = foo;
23152317
_PyStackRef foo = sym_get_const_as_stackref(ctx, foo_sym);
23162318
_PyStackRef res_stackref;
2317-
/* Start of pure uop copied from bytecodes for constant evaluation */
2319+
/* Start of uop copied from bytecodes for constant evaluation */
23182320
if (foo) {
23192321
res_stackref = body(foo);
23202322
}
23212323
else {
23222324
res_stackref = 1;
23232325
}
2324-
/* End of pure uop copied from bytecodes for constant evaluation */
2326+
/* End of uop copied from bytecodes for constant evaluation */
23252327
res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
23262328
stack_pointer[-1] = res;
23272329
}
@@ -2347,6 +2349,7 @@ def test_pure_uop_reject_array_effects(self):
23472349
"""
23482350
input2 = """
23492351
op(OP, (foo[2] -- res)) {
2352+
REPLACE_OPCODE_IF_EVALUATES_PURE(foo[2]);
23502353
res = sym_new_unknown(ctx);
23512354
}
23522355
"""

Python/optimizer_bytecodes.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,37 +222,37 @@ dummy_func(void) {
222222
}
223223

224224
op(_BINARY_OP_ADD_INT, (left, right -- res)) {
225-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
225+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
226226
res = sym_new_type(ctx, &PyLong_Type);
227227
}
228228

229229
op(_BINARY_OP_SUBTRACT_INT, (left, right -- res)) {
230-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
230+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
231231
res = sym_new_type(ctx, &PyLong_Type);
232232
}
233233

234234
op(_BINARY_OP_MULTIPLY_INT, (left, right -- res)) {
235-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
235+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
236236
res = sym_new_type(ctx, &PyLong_Type);
237237
}
238238

239239
op(_BINARY_OP_ADD_FLOAT, (left, right -- res)) {
240-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
240+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
241241
res = sym_new_type(ctx, &PyFloat_Type);
242242
}
243243

244244
op(_BINARY_OP_SUBTRACT_FLOAT, (left, right -- res)) {
245-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
245+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
246246
res = sym_new_type(ctx, &PyFloat_Type);
247247
}
248248

249249
op(_BINARY_OP_MULTIPLY_FLOAT, (left, right -- res)) {
250-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
250+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
251251
res = sym_new_type(ctx, &PyFloat_Type);
252252
}
253253

254254
op(_BINARY_OP_ADD_UNICODE, (left, right -- res)) {
255-
REPLACE_OPCODE_IF_EVALUTES_PURE(left, right);
255+
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
256256
res = sym_new_type(ctx, &PyUnicode_Type);
257257
}
258258

@@ -365,7 +365,7 @@ dummy_func(void) {
365365
}
366366

367367
op(_UNARY_NOT, (value -- res)) {
368-
REPLACE_OPCODE_IF_EVALUTES_PURE(value);
368+
REPLACE_OPCODE_IF_EVALUATES_PURE(value);
369369
sym_set_type(value, &PyBool_Type);
370370
res = sym_new_truthiness(ctx, value, false);
371371
}

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)