diff --git a/.github/workflows/test262.yml b/.github/workflows/test262.yml index 95822eae107..4565f495ad5 100644 --- a/.github/workflows/test262.yml +++ b/.github/workflows/test262.yml @@ -16,10 +16,10 @@ concurrency: jobs: run_test262: - if: ${{ github.base_ref != 'dev/oscars-gc' }} + if: true name: Run the test262 test suite runs-on: ubuntu-latest - timeout-minutes: 60 + timeout-minutes: 120 steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/Cargo.lock b/Cargo.lock index b35b89ecf19..c980b4b5fb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -618,6 +618,7 @@ version = "0.23.0-dev" dependencies = [ "bitflags", "boa_engine", + "boa_gc", "boa_runtime", "clap", "color-eyre", @@ -2859,7 +2860,7 @@ dependencies = [ [[package]] name = "oscars" version = "0.1.0" -source = "git+https://github.com/boa-dev/oscars.git?branch=main#6af6e1a2b1689c7eeff9675352a8d3bccf5abc11" +source = "git+https://github.com/shruti2522/oscars.git?branch=fix-oom#f243432479c161b8c893c08e4054ab217417f7d7" dependencies = [ "arrayvec", "either", @@ -2874,7 +2875,7 @@ dependencies = [ [[package]] name = "oscars_derive" version = "0.1.0" -source = "git+https://github.com/boa-dev/oscars.git?branch=main#6af6e1a2b1689c7eeff9675352a8d3bccf5abc11" +source = "git+https://github.com/shruti2522/oscars.git?branch=fix-oom#f243432479c161b8c893c08e4054ab217417f7d7" dependencies = [ "cfg-if", "proc-macro2", diff --git a/core/gc/Cargo.toml b/core/gc/Cargo.toml index 030298d6d33..fc8b9eea6cd 100644 --- a/core/gc/Cargo.toml +++ b/core/gc/Cargo.toml @@ -34,7 +34,7 @@ either = { workspace = true, optional = true } thin-vec = { workspace = true, optional = true } icu_locale_core = { workspace = true, optional = true } arrayvec = { workspace = true, optional = true } -oscars = { git = "https://github.com/boa-dev/oscars.git", branch = "main", features = ["mark_sweep_branded"], optional = true } +oscars = { git = "https://github.com/shruti2522/oscars.git", branch = "fix-oom", features = ["mark_sweep_branded"], optional = true } typeid = { workspace = true, optional = true } [lints] diff --git a/core/gc/src/context.rs b/core/gc/src/context.rs index 5250d0f2266..f41a8dd2d4e 100644 --- a/core/gc/src/context.rs +++ b/core/gc/src/context.rs @@ -27,16 +27,11 @@ impl GcContext { #[must_use] pub fn gc_collector(&self) -> &'static MutationContext<'static, 'static> { thread_local! { - static COLLECTOR: &'static oscars::collectors::mark_sweep_branded::Collector = - Box::leak(Box::new(oscars::collectors::mark_sweep_branded::Collector::new())); - - static DUMMY: &'static MutationContext<'static, 'static> = COLLECTOR.with(|c| { - Box::leak(Box::new(unsafe { - MutationContext::from_collector_erased(c) - })) - }); + static GLOBAL_CTX: &'static MutationContext<'static, 'static> = { + Box::leak(Box::new(MutationContext::global())) + }; } - DUMMY.with(|dummy| *dummy) + GLOBAL_CTX.with(|ctx| *ctx) } } diff --git a/core/gc/src/lib.rs b/core/gc/src/lib.rs index 2296038dc87..ac4d0e654d6 100644 --- a/core/gc/src/lib.rs +++ b/core/gc/src/lib.rs @@ -171,4 +171,6 @@ mod test; #[cfg(feature = "oscars_backend")] /// Forces a garbage collection -pub fn force_collect() {} +pub fn force_collect() { + oscars::collectors::mark_sweep_branded::MutationContext::global().collect(); +} diff --git a/core/string/Cargo.toml b/core/string/Cargo.toml index 89ee9a52791..8f1247e6f14 100644 --- a/core/string/Cargo.toml +++ b/core/string/Cargo.toml @@ -12,7 +12,7 @@ repository.workspace = true rust-version.workspace = true [dependencies] -oscars = { git = "https://github.com/boa-dev/oscars.git", branch = "main", features = ["mark_sweep_branded"], optional = true } +oscars = { git = "https://github.com/shruti2522/oscars.git", branch = "fix-oom", features = ["mark_sweep_branded"], optional = true } itoa.workspace = true rustc-hash = { workspace = true, features = ["std"] } ryu-js.workspace = true diff --git a/tests/tester/Cargo.toml b/tests/tester/Cargo.toml index f1fe5cad1bf..7d9b827bd90 100644 --- a/tests/tester/Cargo.toml +++ b/tests/tester/Cargo.toml @@ -14,6 +14,7 @@ rust-version.workspace = true [dependencies] boa_engine = { workspace = true, features = ["float16"] } boa_runtime = { workspace = true, features = ["test262"] } +boa_gc = { workspace = true } clap = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] } serde_yaml = "0.9.34" # TODO: Track https://github.com/saphyr-rs/saphyr. diff --git a/tests/tester/src/exec/mod.rs b/tests/tester/src/exec/mod.rs index 4fbe43a7a9d..8147b427c35 100644 --- a/tests/tester/src/exec/mod.rs +++ b/tests/tester/src/exec/mod.rs @@ -515,6 +515,8 @@ impl Test { }, ); + boa_gc::force_collect(); + self.create_result(result, result_text, strict, verbosity) }