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.
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
Optional chaining #6973
base: master
Are you sure you want to change the base?
Optional chaining #6973
Changes from 1 commit
b2f5f1b
8e9abda
2f84eb1
6538ef0
a33799e
caccbc6
2cde756
f833213
d2377a4
6a2c0ec
e3820ec
cc54764
9e11b34
2498b2d
63093df
6e7d935
9369845
ba32362
c8297ec
8baa9e6
8c4eddf
f48dc1b
05790ae
3b5d8d5
a18431e
d96b76b
0abf9c2
a2709e7
8210f62
629cb8a
55dea9f
2aaa1c9
835a4fa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Instead of acquiring a tmp I copy the location of
pnodeOptChain
toinnerNode
(In case the caller has already aquired a tmp)
ChakraCore/lib/Runtime/ByteCode/ByteCodeEmitter.cpp
Line 63 in 05790ae
And copy it back after emitting
innerNode
(In case the location was
NoRegister
and the emission ofinnerNode
aquired a tmp)ChakraCore/lib/Runtime/ByteCode/ByteCodeEmitter.cpp
Line 69 in 05790ae
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.
We "copy" the value from the
knopOptChain
node to theknopDelete
nodeThere 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.
JavascriptOperators::Delete
does only returntrue
. Why can't we just emit bytecode to loadtrue
?Is this because of getter/setter side-effects?
ChakraCore/lib/Runtime/Language/JavascriptOperators.cpp
Lines 534 to 539 in 05790ae
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.
Sorry for the delay, I was confused when I first looked at this; it appears this OpCode is used only in this one location in the bytecodeemitter and is for a no_op delete, as far as I can see we could indeed replace it with LdTrue and delete the logic for OpCode:Delete_A and the relevant code paths.