Do not exit to VM when setting undefined prop in constructor #18576
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.
JIT'ed
ASSIGN_OBJ
expressions will exit to VM when the prop is undef. However, in a constructor it's very likely the case. Therefore most traces withnew
expressions will exit to VM:Here I ensure that we don't need to exit to VM when it's likely that the prop will be undef.
In the function JIT we compile a slow path to handle such properties, but not in the tracing JIT, assumingly to reduce code size. Here I enable compilation of the slow path in the tracing JIT when it's likely the prop will be undef. Quite conveniently we already record the prop type during tracing, so I use that to make the decision.
This results in a 1.20% wall time improvement on the symfony demo benchmark with 20 warmup requests.