Skip to content
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

feat(jstz_engine): add skeletons for Context and Compartment #658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

johnyob
Copy link
Collaborator

@johnyob johnyob commented Nov 14, 2024

Context

A SpiderMonkey Runtime contains the state of the garbage collector. The collector partitions the JavaScript heap into compartments. Compartments have the invariant that no object in the compartment can contain pointers to another compartment.

A Context contains the state for a virtual machine that executes and manages JavaScript objects within a Runtime. It can compile and execute scripts, get and set object properties, call JavaScript functions, convert JavaScript data from one type to another, create objects, and so on.

Description

This PR adds the skeletons for the Compartment and Context types & traits.

We track the compartment that an object or context is in at the type-level using capability traits.

Manually testing the PR

cargo nextest run --package jstz_engine

@johnyob johnyob self-assigned this Nov 14, 2024
@johnyob johnyob force-pushed the ajob410@jstz-191-add-context-and-compartment branch 2 times, most recently from b0fa870 to 4a3e746 Compare November 27, 2024 16:41
@johnyob johnyob marked this pull request as ready for review November 27, 2024 16:41
@johnyob johnyob requested a review from zcabter November 27, 2024 16:41
@johnyob johnyob force-pushed the ajob410@jstz-191-add-context-and-compartment branch from 4a3e746 to f81b82c Compare November 27, 2024 16:42
@johnyob johnyob force-pushed the ajob410@jstz-191-add-context-and-compartment branch from f81b82c to 9c26683 Compare November 27, 2024 16:48
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 59.64912% with 23 lines in your changes missing coverage. Please review.

Project coverage is 45.83%. Comparing base (5fbe97d) to head (9c26683).

Files with missing lines Patch % Lines
crates/jstz_engine/src/context.rs 59.64% 23 Missing ⚠️
Files with missing lines Coverage Δ
crates/jstz_engine/src/lib.rs 100.00% <ø> (+7.31%) ⬆️
crates/jstz_engine/src/context.rs 38.63% <59.64%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fbe97d...9c26683. Read the comment docs.

@johnyob johnyob assigned zcabter and unassigned johnyob Nov 27, 2024
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