-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
src: simplify embedder entry point execution. #51557
src: simplify embedder entry point execution. #51557
Conversation
Review requested:
|
@nodejs/startup @nodejs/cpp-reviewers Can I get some reviews please? Thanks! |
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes.
b6a6a81
to
4a6c71e
Compare
|
||
return scope.EscapeMaybe(StartExecution(env, entry)); | ||
env->performance_state()->Mark( | ||
performance::NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
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 this can still be marked in JS with markBootstrapComplete
, similar to other entry points.
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.
The other entry points don't take callbacks. I think it's less convoluted to mark this right before we invoke the callback, otherwise it's quite difficult to wrap your head around things going back and forth between C++ and JS for these entry points that take callbacks (that's what I feel whenever I looked at these two, and I even reviewed the original changes).
Landed in f29d2b7 |
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: #51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: #51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: #51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: #51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: #51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: nodejs#51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set
PauseOnNextJavascriptStatement()
for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes.