Skip to content

Commit 0995d8a

Browse files
Remove optimizations
1 parent 243131a commit 0995d8a

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

Python/optimizer_analysis.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -382,23 +382,6 @@ get_current_code_object(JitOptContext *ctx)
382382
return (PyCodeObject *)ctx->frame->code;
383383
}
384384

385-
static PyFunctionObject *
386-
optimize_guard_code_version(JitOptContext *ctx, _PyBloomFilter *dependencies,
387-
_PyUOpInstruction *this_instr, uint32_t version)
388-
{
389-
PyCodeObject *co = get_current_code_object(ctx);
390-
if (co->co_version == version) {
391-
_Py_BloomFilter_Add(dependencies, co);
392-
// If frame func is known, that means we can get rid of the code guard.
393-
if (ctx->frame->func != NULL && ctx->frame->func->func_version != 0) {
394-
REPLACE_OP(this_instr, _NOP, 0, 0);
395-
}
396-
}
397-
else {
398-
ctx->done = true;
399-
}
400-
}
401-
402385
static PyObject *
403386
get_co_name(JitOptContext *ctx, int index)
404387
{

Python/optimizer_bytecodes.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,22 +1767,6 @@ dummy_func(void) {
17671767
sym_set_recorded_gen_func(nos, func);
17681768
}
17691769

1770-
op(_GUARD_CODE_VERSION__PUSH_FRAME, (version/2 -- )) {
1771-
optimize_guard_code_version(ctx, dependencies, this_instr, version);
1772-
}
1773-
1774-
op(_GUARD_CODE_VERSION_RETURN_VALUE, (version/2 -- )) {
1775-
optimize_guard_code_version(ctx, dependencies, this_instr, version);
1776-
}
1777-
1778-
op(_GUARD_CODE_VERSION_YIELD_VALUE, (version/2 -- )) {
1779-
optimize_guard_code_version(ctx, dependencies, this_instr, version);
1780-
}
1781-
1782-
op(_GUARD_CODE_VERSION_RETURN_GENERATOR, (version/2 -- )) {
1783-
optimize_guard_code_version(ctx, dependencies, this_instr, version);
1784-
}
1785-
17861770
op(_GUARD_IP__PUSH_FRAME, (ip/4 --)) {
17871771
(void)ip;
17881772
stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer);

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)