Bug 1472974: Add more ENABLE_WASM_GC in Spidermonkey; r=jseward;
authorBenjamin Bouvier <benj@benj.me>
Tue, 03 Jul 2018 15:43:36 +0200
changeset 480127 db22593e5f457f0d4ddac095c5997a0ab3c03b08
parent 480126 5019176ab037fe17b5eb38e6cbb08f562fc102c0
child 480128 7a80adc796d7e53033c668630655def2874c4ce3
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjseward
bugs1472974
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1472974: Add more ENABLE_WASM_GC in Spidermonkey; r=jseward;
js/src/wasm/WasmBuiltins.cpp
js/src/wasm/WasmFrameIter.cpp
js/src/wasm/WasmInstance.cpp
js/src/wasm/WasmInstance.h
js/src/wasm/WasmTypes.h
--- a/js/src/wasm/WasmBuiltins.cpp
+++ b/js/src/wasm/WasmBuiltins.cpp
@@ -672,20 +672,22 @@ AddressOf(SymbolicAddress imm, ABIFuncti
         *abiType = Args_General3;
         return FuncCast(Instance::wake, *abiType);
       case SymbolicAddress::MemCopy:
         *abiType = Args_General4;
         return FuncCast(Instance::memCopy, *abiType);
       case SymbolicAddress::MemFill:
         *abiType = Args_General4;
         return FuncCast(Instance::memFill, *abiType);
+#ifdef ENABLE_WASM_GC
       case SymbolicAddress::PostBarrier:
         *abiType = Args_General2;
         static_assert(sizeof(PostBarrierArg) == sizeof(uint32_t), "passed arg is a u32");
         return FuncCast(Instance::postBarrier, *abiType);
+#endif
 #if defined(JS_CODEGEN_MIPS32)
       case SymbolicAddress::js_jit_gAtomic64Lock:
         return &js::jit::gAtomic64Lock;
 #endif
       case SymbolicAddress::Limit:
         break;
     }
 
@@ -754,17 +756,19 @@ wasm::NeedsBuiltinThunk(SymbolicAddress 
       case SymbolicAddress::CurrentMemory:
       case SymbolicAddress::WaitI32:
       case SymbolicAddress::WaitI64:
       case SymbolicAddress::Wake:
       case SymbolicAddress::CoerceInPlace_JitEntry:
       case SymbolicAddress::ReportInt64JSCall:
       case SymbolicAddress::MemCopy:
       case SymbolicAddress::MemFill:
+#ifdef ENABLE_WASM_GC
       case SymbolicAddress::PostBarrier:
+#endif
         return true;
       case SymbolicAddress::Limit:
         break;
     }
 
     MOZ_CRASH("unexpected symbolic address");
 }
 
--- a/js/src/wasm/WasmFrameIter.cpp
+++ b/js/src/wasm/WasmFrameIter.cpp
@@ -1262,18 +1262,20 @@ ThunkedNativeToDescription(SymbolicAddre
       case SymbolicAddress::CoerceInPlace_JitEntry:
         return "out-of-line coercion for jit entry arguments (in wasm)";
       case SymbolicAddress::ReportInt64JSCall:
         return "jit call to int64 wasm function";
       case SymbolicAddress::MemCopy:
         return "call to native memory.copy function";
       case SymbolicAddress::MemFill:
         return "call to native memory.fill function";
+#ifdef ENABLE_WASM_GC
       case SymbolicAddress::PostBarrier:
         return "call to native GC postbarrier (in wasm)";
+#endif
 #if defined(JS_CODEGEN_MIPS32)
       case SymbolicAddress::js_jit_gAtomic64Lock:
         MOZ_CRASH();
 #endif
       case SymbolicAddress::Limit:
         break;
     }
     return "?";
--- a/js/src/wasm/WasmInstance.cpp
+++ b/js/src/wasm/WasmInstance.cpp
@@ -473,16 +473,17 @@ Instance::memFill(Instance* instance, ui
         // else fall through to failure case
     }
 
     JSContext* cx = TlsContext.get();
     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_OUT_OF_BOUNDS);
     return -1;
 }
 
+#ifdef ENABLE_WASM_GC
 /* static */ void
 Instance::postBarrier(Instance* instance, PostBarrierArg arg)
 {
     gc::Cell** cell = nullptr;
     switch (arg.type()) {
       case PostBarrierArg::Type::Global: {
         const GlobalDesc& global = instance->metadata().globals[arg.globalIndex()];
         MOZ_ASSERT(!global.isConstant());
@@ -494,16 +495,17 @@ Instance::postBarrier(Instance* instance
         cell = (gc::Cell**) globalAddr;
         break;
       }
     }
 
     MOZ_ASSERT(cell);
     TlsContext.get()->runtime()->gc.storeBuffer().putCell(cell);
 }
+#endif // ENABLE_WASM_GC
 
 Instance::Instance(JSContext* cx,
                    Handle<WasmInstanceObject*> object,
                    SharedCode code,
                    UniqueDebugState debug,
                    UniqueTlsData tlsDataIn,
                    HandleWasmMemoryObject memory,
                    SharedTableVector&& tables,
@@ -657,17 +659,19 @@ Instance::init(JSContext* cx)
         }
     }
 
     JitRuntime* jitRuntime = cx->runtime()->getJitRuntime(cx);
     if (!jitRuntime)
         return false;
     jsJitArgsRectifier_ = jitRuntime->getArgumentsRectifier();
     jsJitExceptionHandler_ = jitRuntime->getExceptionTail();
+#ifdef ENABLE_WASM_GC
     preBarrierCode_ = jitRuntime->preBarrier(MIRType::Object);
+#endif
     return true;
 }
 
 Instance::~Instance()
 {
     realm_->wasm.unregisterInstance(*this);
 
     const FuncImportVector& funcImports = metadata(code().stableTier()).funcImports;
--- a/js/src/wasm/WasmInstance.h
+++ b/js/src/wasm/WasmInstance.h
@@ -174,17 +174,19 @@ class Instance
     static int32_t callImport_ref(Instance*, int32_t, int32_t, uint64_t*);
     static uint32_t growMemory_i32(Instance* instance, uint32_t delta);
     static uint32_t currentMemory_i32(Instance* instance);
     static int32_t wait_i32(Instance* instance, uint32_t byteOffset, int32_t value, int64_t timeout);
     static int32_t wait_i64(Instance* instance, uint32_t byteOffset, int64_t value, int64_t timeout);
     static int32_t wake(Instance* instance, uint32_t byteOffset, int32_t count);
     static int32_t memCopy(Instance* instance, uint32_t destByteOffset, uint32_t srcByteOffset, uint32_t len);
     static int32_t memFill(Instance* instance, uint32_t byteOffset, uint32_t value, uint32_t len);
+#ifdef ENABLE_WASM_GC
     static void postBarrier(Instance* instance, PostBarrierArg arg);
+#endif
 };
 
 typedef UniquePtr<Instance> UniqueInstance;
 
 } // namespace wasm
 } // namespace js
 
 #endif // wasm_instance_h
--- a/js/src/wasm/WasmTypes.h
+++ b/js/src/wasm/WasmTypes.h
@@ -1976,17 +1976,19 @@ enum class SymbolicAddress
     Int64ToDouble,
     GrowMemory,
     CurrentMemory,
     WaitI32,
     WaitI64,
     Wake,
     MemCopy,
     MemFill,
+#ifdef ENABLE_WASM_GC
     PostBarrier,
+#endif
 #if defined(JS_CODEGEN_MIPS32)
     js_jit_gAtomic64Lock,
 #endif
     Limit
 };
 
 bool
 IsRoundingFunction(SymbolicAddress callee, jit::RoundingMode* mode);