We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, when we load polyfills, we always compile and run javascript scripts. It would be better to compile once and run multiple times.
An idea would be:
create a ScriptCompiler::Source [0]
ScriptCompiler::Source
replace the usage of ScriptCompiler::Compile [1] with ScriptCompiler::CompileUnboundScript [2]. Use the created ScriptCompiler::Source. ⚠️ The doc is wrong, the func needs a context (see https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/api/api.cc#2582 and https://groups.google.com/u/1/g/v8-users/c/btTLjLN9uZg/m/v6cZ64RKBQAJ
ScriptCompiler::Compile
ScriptCompiler::CompileUnboundScript
call ScriptCompiler::CreateCodeCache [3] to save a CachedDate.
ScriptCompiler::CreateCodeCache
CachedDate
call UnboundScript::BindToCurrentContext [4] to bind with the current context an retrieve a Script.
UnboundScript::BindToCurrentContext
Script
run the script [5]
The next start, pass the saved CachedData when creating the ScriptCompiler::Source [0]
CachedData
repeat the following steps.
lightpanda-io/zig-js-runtime#263 and lightpanda-io/zig-v8-fork#32 expose the UnboundScript functions but CachedData funcs are missing. A question is: how to encapsulate and expose v8 CachedData logic in zig-js-runtime?
UnboundScript
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, when we load polyfills, we always compile and run javascript scripts.
It would be better to compile once and run multiple times.
An idea would be:
create a
ScriptCompiler::Source
[0]replace the usage of
⚠️ The doc is wrong, the func needs a context (see https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/api/api.cc#2582 and https://groups.google.com/u/1/g/v8-users/c/btTLjLN9uZg/m/v6cZ64RKBQAJ
ScriptCompiler::Compile
[1] withScriptCompiler::CompileUnboundScript
[2]. Use the createdScriptCompiler::Source
.call
ScriptCompiler::CreateCodeCache
[3] to save aCachedDate
.call
UnboundScript::BindToCurrentContext
[4] to bind with the current context an retrieve aScript
.run the script [5]
The next start, pass the saved
CachedData
when creating theScriptCompiler::Source
[0]repeat the following steps.
lightpanda-io/zig-js-runtime#263 and lightpanda-io/zig-v8-fork#32 expose the
UnboundScript
functions butCachedData
funcs are missing. A question is: how to encapsulate and expose v8CachedData
logic in zig-js-runtime?The text was updated successfully, but these errors were encountered: