-
Couldn't load subscription status.
- Fork 8k
Pass opline as argument to opcode handlers in CALL VM #17952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
89f0186
4c40e69
5f188dc
11e34f6
de98f4c
de5d147
9b79cd0
edfe12b
a1198d3
249daf8
01e9fab
b26c402
bd41680
aad09ec
a79c90e
da98b66
2499f1a
b1894a3
a741f06
66e912d
f63cefc
135b40f
96e8203
70fb7cd
43bcb3a
a9a1625
a4b8ffa
8c610df
5a2031b
e63cd0d
978a379
520bb05
36f6b15
0c61a86
c4a0d57
12c4ff5
4ce43ed
b85a4a3
f0a9003
b83b50b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,7 +98,7 @@ static const void *zend_jit_func_trace_counter_handler = NULL; | |
| static const void *zend_jit_ret_trace_counter_handler = NULL; | ||
| static const void *zend_jit_loop_trace_counter_handler = NULL; | ||
|
|
||
| static int ZEND_FASTCALL zend_runtime_jit(void); | ||
| static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_runtime_jit(ZEND_OPCODE_HANDLER_ARGS); | ||
|
|
||
| static int zend_jit_trace_op_len(const zend_op *opline); | ||
| static int zend_jit_trace_may_exit(const zend_op_array *op_array, const zend_op *opline); | ||
|
|
@@ -2871,7 +2871,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op | |
| if (GCC_GLOBAL_REGS) { | ||
| ir_TAILCALL(IR_VOID, ir_LOAD_A(jit_IP(jit))); | ||
| } else { | ||
| ir_RETURN(ir_CONST_I32(1)); /* ZEND_VM_ENTER */ | ||
| zend_jit_vm_enter(jit, jit_IP(jit)); | ||
| } | ||
| ir_IF_TRUE(if_hook_enter); | ||
| } | ||
|
|
@@ -3074,11 +3074,18 @@ static int zend_real_jit_func(zend_op_array *op_array, zend_script *script, cons | |
| } | ||
|
|
||
| /* Run-time JIT handler */ | ||
| static int ZEND_FASTCALL zend_runtime_jit(void) | ||
| static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_runtime_jit(ZEND_OPCODE_HANDLER_ARGS) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ops. It looks like the previous prototype was wrong. |
||
| { | ||
| zend_execute_data *execute_data = EG(current_execute_data); | ||
| #if GCC_GLOBAL_REGS | ||
| zend_execute_data *execute_data; | ||
| zend_op *opline; | ||
| #else | ||
| const zend_op *orig_opline = opline; | ||
| #endif | ||
|
|
||
| execute_data = EG(current_execute_data); | ||
| zend_op_array *op_array = &EX(func)->op_array; | ||
| zend_op *opline = op_array->opcodes; | ||
| opline = op_array->opcodes; | ||
| zend_jit_op_array_extension *jit_extension; | ||
| bool do_bailout = 0; | ||
|
|
||
|
|
@@ -3097,7 +3104,7 @@ static int ZEND_FASTCALL zend_runtime_jit(void) | |
| } | ||
| } | ||
| jit_extension = (zend_jit_op_array_extension*)ZEND_FUNC_INFO(op_array); | ||
| opline->handler = jit_extension->orig_handler; | ||
| ((zend_op*)opline)->handler = jit_extension->orig_handler; | ||
|
|
||
| /* perform real JIT for this function */ | ||
| zend_real_jit_func(op_array, NULL, NULL, ZEND_JIT_ON_FIRST_EXEC); | ||
|
|
@@ -3116,7 +3123,11 @@ static int ZEND_FASTCALL zend_runtime_jit(void) | |
| } | ||
|
|
||
| /* JIT-ed code is going to be called by VM */ | ||
| return 0; | ||
| #if GCC_GLOBAL_REGS | ||
| return; // ZEND_VM_CONTINUE | ||
| #else | ||
| return orig_opline; // ZEND_VM_CONTINUE | ||
| #endif | ||
| } | ||
|
|
||
| void zend_jit_check_funcs(HashTable *function_table, bool is_method) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes
EX(opline) = oplinewhenZEND_VM_IP_GLOBAL_REGis defined.This may cause output of incorrect line number in error message.
May be I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's correct.
This causes
oplineto be saved toEX(opline)in the CALL VM (and in the HYBRID VM, as before). Saving used to be unnecessary asEX(opline)was always up to date in the CALL VM. I believe that the#ifdefis redundant asSAVE_OPLINE()was a no-op on the CALL VM.