Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- releases/**
- dev/oscars-gc

permissions:
contents: read
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- main
- releases/**
- dev/oscars-gc
push:
branches:
- main
- releases/**
- dev/oscars-gc
merge_group:
types: [checks_requested]
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test262.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- releases/**
- dev/oscars-gc

permissions:
contents: read
Expand All @@ -15,6 +16,7 @@ concurrency:

jobs:
run_test262:
if: ${{ github.base_ref != 'dev/oscars-gc' }}
name: Run the test262 test suite
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- main
- releases/**
- dev/oscars-gc
push:
branches:
- main
- releases/**
- dev/oscars-gc
merge_group:
types: [checks_requested]

Expand Down
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ num-integer = "0.1.46"
ryu-js = "1.0.2"
tap = "1.0.1"
thiserror = { version = "2.0.18", default-features = false }
typeid = "1.0.3"
dashmap = "6.2.1"
num_enum = "0.7.6"
itertools = { version = "0.15.0", default-features = false }
Expand Down Expand Up @@ -267,3 +268,6 @@ complexity = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }

[patch."https://github.com/boa-dev/boa.git"]
boa_string = { path = "core/string" }

104 changes: 64 additions & 40 deletions cli/src/debug/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,48 +64,72 @@ fn set_backtrace(_: &JsValue, args: &[JsValue], context: &mut Context) -> JsResu
}

pub(super) fn create_object(context: &mut Context) -> JsObject {
let get_loop =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(get_loop))
.name(js_string!("get loop"))
.length(0)
.build();
let set_loop =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(set_loop))
.name(js_string!("set loop"))
.length(1)
.build();
let get_loop = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(get_loop),
)
.name(js_string!("get loop"))
.length(0)
.build();
let set_loop = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(set_loop),
)
.name(js_string!("set loop"))
.length(1)
.build();

let get_stack =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(get_stack))
.name(js_string!("get stack"))
.length(0)
.build();
let set_stack =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(set_stack))
.name(js_string!("set stack"))
.length(1)
.build();
let get_stack = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(get_stack),
)
.name(js_string!("get stack"))
.length(0)
.build();
let set_stack = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(set_stack),
)
.name(js_string!("set stack"))
.length(1)
.build();

let get_recursion =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(get_recursion))
.name(js_string!("get recursion"))
.length(0)
.build();
let set_recursion =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(set_recursion))
.name(js_string!("set recursion"))
.length(1)
.build();
let get_backtrace =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(get_backtrace))
.name(js_string!("get backtrace"))
.length(0)
.build();
let set_backtrace =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(set_backtrace))
.name(js_string!("set backtrace"))
.length(1)
.build();
let get_recursion = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(get_recursion),
)
.name(js_string!("get recursion"))
.length(0)
.build();
let set_recursion = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(set_recursion),
)
.name(js_string!("set recursion"))
.length(1)
.build();
let get_backtrace = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(get_backtrace),
)
.name(js_string!("get backtrace"))
.length(0)
.build();
let set_backtrace = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(set_backtrace),
)
.name(js_string!("set backtrace"))
.length(1)
.build();

ObjectInitializer::new(context)
.accessor(
Expand Down
28 changes: 18 additions & 10 deletions cli/src/debug/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,37 @@ fn set_statistics(_: &JsValue, args: &[JsValue], context: &mut Context) -> JsRes
pub(super) fn create_object(context: &mut Context) -> JsObject {
let get_constant_folding = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(get_constant_folding),
)
.name("get constantFolding")
.length(0)
.build();
let set_constant_folding = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(set_constant_folding),
)
.name("set constantFolding")
.length(1)
.build();

let get_statistics =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(get_statistics))
.name("get statistics")
.length(0)
.build();
let set_statistics =
FunctionObjectBuilder::new(context.realm(), NativeFunction::from_fn_ptr(set_statistics))
.name("set statistics")
.length(1)
.build();
let get_statistics = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(get_statistics),
)
.name("get statistics")
.length(0)
.build();
let set_statistics = FunctionObjectBuilder::new(
context.realm(),
context.gc_collector(),
NativeFunction::from_fn_ptr(set_statistics),
)
.name("set statistics")
.length(1)
.build();
ObjectInitializer::new(context)
.accessor(
js_string!("constantFolding"),
Expand Down
3 changes: 2 additions & 1 deletion core/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository.workspace = true
rust-version.workspace = true

[features]
default = ["float16", "xsum", "temporal"]
default = ["float16", "xsum", "temporal", "oscars_backend"]

embedded_lz4 = ["boa_macros/embedded_lz4", "lz4_flex"]

Expand All @@ -26,6 +26,7 @@ embedded_lz4 = ["boa_macros/embedded_lz4", "lz4_flex"]
jsvalue-enum = []
deser = ["boa_interner/serde", "boa_ast/serde"]
either = ["dep:either", "boa_gc/either"]
oscars_backend = ["boa_gc/oscars_backend", "boa_string/oscars_backend"]

# Enables the `Intl` builtin object and bundles a default ICU4X data provider.
# Prefer this over `intl` if you just want to enable `Intl` without dealing with the
Expand Down
8 changes: 6 additions & 2 deletions core/engine/benches/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn create_realm(c: &mut Criterion) {
c.bench_function("Create Realm", move |b| {
let root_shape = RootShape::default();
b.iter(|| Realm::create(&DefaultHooks, &root_shape));
let root_shape = RootShape::new(&unsafe { boa_gc::MutationContext::global() });
b.iter(|| {
Realm::create(&DefaultHooks, &root_shape, &unsafe {
boa_gc::MutationContext::global()
})
});
});
}

Expand Down
5 changes: 3 additions & 2 deletions core/engine/src/builtins/array/array_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pub(crate) struct ArrayIterator {
}

impl IntrinsicObject for ArrayIterator {
fn init(realm: &Realm) {
BuiltInBuilder::with_intrinsic::<Self>(realm)
fn init(realm: &Realm, mc: &boa_gc::MutationContext<'static, '_>) {
BuiltInBuilder::with_intrinsic::<Self>(realm, mc)
.prototype(realm.intrinsics().constructors().iterator().prototype())
.static_method(Self::next, js_string!("next"), 0)
.static_property(
Expand Down Expand Up @@ -78,6 +78,7 @@ impl ArrayIterator {
context: &Context,
) -> JsValue {
let array_iterator = JsObject::from_proto_and_data_with_shared_shape(
context.gc_collector(),
context.root_shape(),
context.intrinsics().objects().iterator_prototypes().array(),
Self::new(array, kind),
Expand Down
Loading
Loading