Uh oh!
There was an error while loading. Please reload this page.
bootstrap: support more builtins in the embedded code cache - #44018
bootstrap: support more builtins in the embedded code cache#44018joyeecheung wants to merge 3 commits into
Conversation
nodejs-github-bot
commented
Jul 28, 2022
Review requested:
|
nodejs-github-bot
commented
Jul 28, 2022
nodejs-github-bot
commented
Jul 29, 2022
nodejs-github-bot
commented
Jul 29, 2022
This patch: - Make NativeModuleLoader::LookupAndCompile() detect parameters based on module IDs. This allows us to compile more builtins when generating the embedded bootstrap, including - internal/per_context/* - internal/bootstrap/* - internal/main/* - Move pre_execution.js to lib/internal/process as it needs to be compiled as a regular built-in module, unlike other scripts in lib/internal/bootstrap - Move markBootstrapComplete() to the performance binding instead of making it a function-wrapper-based global to reduce number of special cases.
nodejs-github-bot
commented
Aug 3, 2022
joyeecheung
commented
Aug 3, 2022
Rebased to resolve the merge conflict |
nodejs-github-bot
commented
Aug 4, 2022
This patch: - Make NativeModuleLoader::LookupAndCompile() detect parameters based on module IDs. This allows us to compile more builtins when generating the embedded bootstrap, including - internal/per_context/* - internal/bootstrap/* - internal/main/* - Move pre_execution.js to lib/internal/process as it needs to be compiled as a regular built-in module, unlike other scripts in lib/internal/bootstrap - Move markBootstrapComplete() to the performance binding instead of making it a function-wrapper-based global to reduce number of special cases. PR-URL: #44018 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
joyeecheung
commented
Aug 4, 2022
Landed in 06f5d45 |
This patch: - Make NativeModuleLoader::LookupAndCompile() detect parameters based on module IDs. This allows us to compile more builtins when generating the embedded bootstrap, including - internal/per_context/* - internal/bootstrap/* - internal/main/* - Move pre_execution.js to lib/internal/process as it needs to be compiled as a regular built-in module, unlike other scripts in lib/internal/bootstrap - Move markBootstrapComplete() to the performance binding instead of making it a function-wrapper-based global to reduce number of special cases. PR-URL: #44018 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This patch: - Make NativeModuleLoader::LookupAndCompile() detect parameters based on module IDs. This allows us to compile more builtins when generating the embedded bootstrap, including - internal/per_context/* - internal/bootstrap/* - internal/main/* - Move pre_execution.js to lib/internal/process as it needs to be compiled as a regular built-in module, unlike other scripts in lib/internal/bootstrap - Move markBootstrapComplete() to the performance binding instead of making it a function-wrapper-based global to reduce number of special cases. PR-URL: #44018 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
mmomtchev
commented
Aug 30, 2022
@joyeecheung I am late to the party, but aren't the new |
@mmomtchev The parameters are guarded by the linter and when passed wrong it’s likely to trigger an error early in the bootstrap process. It’s inevitable that some of the arguments are just unavailable to some scripts (because they are not initialized yet or aren’t supposed to be accessible), it would be nicer to see a ReferenceError instead of a TypeError (something is undefined) in that case. Personally I would find it more error-prone if per-context scripts get an undefined internalBinding or process… |
mmomtchev
commented
Sep 1, 2022
@joyeecheung You can always skip those values that are undefined - you check if it has been initialised and then add it only it has a value. What I meant is that the part that adds the names and the part that adds the values are in two different files and they must have the exactly same order. Isn't it possible to generate the values in |
legendecas
commented
Sep 2, 2022
Isn't this already the fact of how we define the function parameters and how we invoke functions with arguments? |
I gave it a try in #44488 - some of the values can be generated, but not all of them (e.g. the per-context arguments, the ones generated by the JS-land loader). And as @legendecas pointed out that's just how JS functions work, it's sometimes possible to place the definition and the callsite closer together, other times you just have to look up the parameters somewhere else and make sure that the arguments passed into it are in the right order. |
This patch:
on module IDs. This allows us to compile more builtins when
generating the embedded bootstrap, including
compiled as a regular built-in module, unlike other scripts
in lib/internal/bootstrap
making it a function-wrapper-based global to reduce number of
special cases.