mirror of
https://github.com/python/cpython.git
synced 2026-04-13 23:31:02 +00:00
gh-142982: Specialize CALL_FUNCTION_EX (GH-143391)
This commit is contained in:
parent
ff7d1cec41
commit
df355348f0
20 changed files with 2074 additions and 1188 deletions
|
|
@ -837,6 +837,17 @@ dummy_func(void) {
|
|||
new_frame = PyJitRef_Wrap((JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0));
|
||||
}
|
||||
|
||||
op(_PY_FRAME_EX, (func_st, null, callargs_st, kwargs_st -- ex_frame)) {
|
||||
assert((this_instr + 2)->opcode == _PUSH_FRAME);
|
||||
PyCodeObject *co = get_code_with_logging((this_instr + 2));
|
||||
if (co == NULL) {
|
||||
ctx->done = true;
|
||||
break;
|
||||
}
|
||||
|
||||
ex_frame = PyJitRef_Wrap((JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0));
|
||||
}
|
||||
|
||||
op(_CHECK_AND_ALLOCATE_OBJECT, (type_version/2, callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
|
||||
(void)type_version;
|
||||
(void)args;
|
||||
|
|
@ -1000,8 +1011,7 @@ dummy_func(void) {
|
|||
ctx->frame->func = func;
|
||||
}
|
||||
// Fixed calls don't need IP guards.
|
||||
if ((this_instr-1)->opcode == _SAVE_RETURN_OFFSET ||
|
||||
(this_instr-1)->opcode == _CREATE_INIT_FRAME) {
|
||||
if ((this_instr-1)->opcode == _CREATE_INIT_FRAME) {
|
||||
assert((this_instr+1)->opcode == _GUARD_IP__PUSH_FRAME);
|
||||
REPLACE_OP(this_instr+1, _NOP, 0, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue