-
Notifications
You must be signed in to change notification settings - Fork 7.8k
JIT: Don't reuse IP register for EX(call) #18392
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
Draft
arnaud-lb
wants to merge
8
commits into
php:master
Choose a base branch
from
arnaud-lb:no-reuse-ip
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4b7da22
Pass zend_jit_ctx to zend_jit_trace_get_exit_point()
arnaud-lb 9b6c36e
JIT: Don't reuse IP register for EX(call)
arnaud-lb 771229d
Prevent clobbering call_reg during deopt
arnaud-lb 19457e8
Fix type
arnaud-lb 1426d6c
Disable debug helper
arnaud-lb b8c908b
jit_STORE_IP() should reset last valid opline by default
arnaud-lb a86f853
Disable debug helper
arnaud-lb 88fca8b
Snapshot may be spilled
arnaud-lb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ | |
#include "Zend/Optimizer/zend_func_info.h" | ||
#include "Zend/Optimizer/zend_call_graph.h" | ||
|
||
typedef struct _zend_jit_ctx zend_jit_ctx; | ||
|
||
/* Address Encoding */ | ||
typedef uintptr_t zend_jit_addr; | ||
|
||
|
@@ -62,6 +64,14 @@ typedef uintptr_t zend_jit_addr; | |
#define Z_SSA_VAR(addr) ((addr)>>_ZEND_ADDR_REG_SHIFT) | ||
#define Z_IR_REF(addr) ((addr)>>_ZEND_ADDR_REG_SHIFT) | ||
|
||
#define ZEND_ADDR_ARG(call, var) ZEND_ADDR_REF_ZVAL(ir_ADD_OFFSET(call, var)) | ||
|
||
#define Z_IS_ARG_ADDR(addr) \ | ||
(Z_MODE(addr) == IS_REF_ZVAL && ( \ | ||
Z_IR_REF(addr) == jit->call \ | ||
|| (jit->ctx.ir_base[Z_IR_REF(addr)].op == IR_ADD \ | ||
&& jit->ctx.ir_base[Z_IR_REF(addr)].op1 == jit->call))) | ||
|
||
#define Z_STORE(addr) \ | ||
((jit->ra && jit->ra[Z_SSA_VAR(addr)].ref) ? \ | ||
(jit->ra[Z_SSA_VAR(addr)].flags & ZREG_STORE) : \ | ||
|
@@ -240,9 +250,9 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_loop_counter_helper(ZEND_OPCODE_H | |
|
||
ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_copy_extra_args_helper(ZEND_OPCODE_HANDLER_ARGS); | ||
ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_copy_extra_args_helper_no_skip_recv(ZEND_OPCODE_HANDLER_ARGS); | ||
bool ZEND_FASTCALL zend_jit_deprecated_helper(OPLINE_D); | ||
bool ZEND_FASTCALL zend_jit_nodiscard_helper(OPLINE_D); | ||
bool ZEND_FASTCALL zend_jit_deprecated_nodiscard_helper(OPLINE_D); | ||
bool ZEND_FASTCALL zend_jit_deprecated_helper(zend_execute_data *call); | ||
bool ZEND_FASTCALL zend_jit_nodiscard_helper(zend_execute_data *call); | ||
bool ZEND_FASTCALL zend_jit_deprecated_nodiscard_helper(zend_execute_data *call); | ||
void ZEND_FASTCALL zend_jit_undefined_long_key(EXECUTE_DATA_D); | ||
void ZEND_FASTCALL zend_jit_undefined_long_key_ex(zend_long key EXECUTE_DATA_DC); | ||
void ZEND_FASTCALL zend_jit_undefined_string_key(EXECUTE_DATA_D); | ||
|
@@ -446,6 +456,8 @@ typedef struct _zend_jit_trace_exit_info { | |
int32_t poly_this_ref; | ||
int8_t poly_func_reg; | ||
int8_t poly_this_reg; | ||
int32_t call_ref; | ||
int8_t call_reg; | ||
Comment on lines
+459
to
+460
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. Deoptimization relied on |
||
} zend_jit_trace_exit_info; | ||
|
||
typedef struct _zend_jit_trace_stack { | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Debugging helper, will remove