-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[JSC] Add operationIteratorNextTryFast operation #26232
[JSC] Add operationIteratorNextTryFast operation #26232
Conversation
EWS run on previous version of this PR (hash 60717cf) |
60717cf
to
433b634
Compare
EWS run on current version of this PR (hash 433b634) |
JITSlowPathCall slowPathCall(this, tryFastFunction); | ||
slowPathCall.call(); | ||
Jump fastCase = branch32(NotEqual, GPRInfo::returnValueGPR2, TrustedImm32(static_cast<uint32_t>(IterationMode::Generic))); | ||
#endif | ||
doneCases.append(jump()); |
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.
So, iteratorNextTryFastImpl
always returns IterationMode::FastArray
. That's why no need for additional iteration mode check like before for the slowPathCall.call()
path.
callOperation(operationIteratorNextTryFast, argumentGPR0, argumentGPR1, argumentGPR2, argumentGPR3); | ||
emitPutVirtualRegister(bytecode.m_done, returnValueGPR); | ||
emitPutVirtualRegister(bytecode.m_value, returnValueGPR2); | ||
doneCases.append(branchIfEmpty(JSValueRegs { returnValueGPR2 })); |
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.
Should it be branchIfNotEmpty
? Since returnValueGPR2
is the next value.
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.
Oh, nvm we don't need to update the value profile if it's empty.
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.
r=me.
https://bugs.webkit.org/show_bug.cgi?id=271367 rdar://125151326 Reviewed by Keith Miller. This function is very hot since it is invoked for each iteration run for fast arrays. Let's make it extremely optimized: use JITOperations instead of slow path calls. * Source/JavaScriptCore/jit/JITCall.cpp: (JSC::JIT::emit_op_iterator_next): * Source/JavaScriptCore/jit/JITOperations.cpp: (JSC::JSC_DEFINE_JIT_OPERATION): * Source/JavaScriptCore/jit/JITOperations.h: Canonical link: https://commits.webkit.org/276577@main
433b634
to
a50b786
Compare
Committed 276577@main (a50b786): https://commits.webkit.org/276577@main Reviewed commits have been landed. Closing PR #26232 and removing active labels. |
a50b786
433b634