Skip to content

Conversation

@karlseguin
Copy link
Collaborator

@karlseguin karlseguin commented Dec 30, 2025

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 a v8.Context which has a *const c.Context which 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).

@karlseguin karlseguin marked this pull request as ready for review January 2, 2026 08:19
@karlseguin karlseguin force-pushed the direct_v8 branch 2 times, most recently from 0e6acf0 to d5748c4 Compare January 2, 2026 23:19
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.
Base automatically changed from zigdom to main January 8, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants