From 2c429f7732011fa7fa9ff68eb9c251ef79f9b77b Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 5 Sep 2021 16:48:26 -0700 Subject: [PATCH] guess Former-commit-id: 6e95bd8a1457d3c514adb0af6ae0c5feb1564a80 --- src/javascript/jsc/bindings/ZigGlobalObject.cpp | 8 +++++++- src/javascript/jsc/bindings/sizes.zig | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/javascript/jsc/bindings/ZigGlobalObject.cpp b/src/javascript/jsc/bindings/ZigGlobalObject.cpp index 2b95b108a7..edebae6dea 100644 --- a/src/javascript/jsc/bindings/ZigGlobalObject.cpp +++ b/src/javascript/jsc/bindings/ZigGlobalObject.cpp @@ -93,7 +93,13 @@ extern "C" JSC__JSGlobalObject *Zig__GlobalObject__create(JSClassRef *globalObje // JSC::Options::useCodeCache() = false; - JSC::VM &vm = JSC::VM::create(JSC::LargeHeap).leakRef(); +#ifdef WTF_CPU_ARM64 + auto heapSize = JSC::SmallHeap; +#else + auto heapSize = JSC::LargeHeap; +#endif + + JSC::VM &vm = JSC::VM::create(heapSize).leakRef(); vm.heap.acquireAccess(); #if ENABLE(WEBASSEMBLY) JSC::Wasm::enableFastMemory(); diff --git a/src/javascript/jsc/bindings/sizes.zig b/src/javascript/jsc/bindings/sizes.zig index 3eb86f2fb1..7b00cf3ce6 100644 --- a/src/javascript/jsc/bindings/sizes.zig +++ b/src/javascript/jsc/bindings/sizes.zig @@ -6,13 +6,13 @@ // 1. We can't dynamically link JavaScriptCore // 2. It's important that this is run whenever JavaScriptCore is updated or the bindings on the Zig side change. // Failure to do so will lead to undefined behavior and probably some frustrated people. -// --- Regenerate this: --- +// --- Regenerate this: --- // 1. "make jsc-bindings-headers" -// 2. "makpe sizegen" +// 2. "make sizegen" // 3. "make jsc-bindings-headers" // ------------------------ // You can verify the numbers written in this file at runtime via the `extern`d types -// Run "jsc-bindings-headers" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values. +// Run "jsc-bindings-headers" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values. pub const JSC__JSObject = 16; pub const JSC__JSObject_align = 8; pub const JSC__JSCell = 8;