-
Notifications
You must be signed in to change notification settings - Fork 330
Direct v8 #1307
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
Open
karlseguin
wants to merge
21
commits into
main
Choose a base branch
from
direct_v8
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Direct v8 #1307
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0e6acf0 to
d5748c4
Compare
Use js.Value in apis that should take values (not objects), like console.log and setTimeout and reportError.
This means the C funtions/types now sit in the root of v8.
Persist function callback in PerformanceObserver
This lets us load the isolate without having to create a temp/dummy context just to get the templates. Call ContextDisposedNotification when a context is removed. Supposedly this can help/hint to the isolate about memory management.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on lightpanda-io/zig-v8-fork#130
This PR is intended to be merged after zigdom is merged into main.
Currently there are 3 layers between our code and v8. For example, if you look at our Context (
js.Context), it has av8.Contextwhich has a*const c.Contextwhich itself is a C wrapper to the C++ v8::Context. The idea for this PR is for our js.Context to directly hold the*const c.Context, thus eliminating the "v8.zig" file in zig-v8-fork.As part of this PR, we'll be moving from v8::Persistent to v8::Global. lightpanda-io/zig-v8-fork#130 As part of this effort, all "global" objects now behave the same, e.g. calling
persist()on the local.The PR also fixes a few APIs which accepted a js.Object but should have accepted a more general js.Value (e.g. console.log). This worked before because we failed to do proper type checking of the incoming JS value.
Fundamentally, the goal is to tighten the code so that future memory improvements are easier to make. Just having fewer abstractions and few conversions (e..g from a js.Function to a v8.Function to a v8::Function).