Bug 1420115 - Avoid a static_assert with JS_CODEGEN_NONE. f=dan_horak, r=me
authorLars T Hansen <lhansen@mozilla.com>
Thu, 23 Nov 2017 13:09:07 +0100
changeset 393334 72fd7816dd7711b8e8d867e50299dbc6fee1bb13
parent 393333 4c669cc6ea5223ace22e47c7af0e15f9dc9911c5
child 393335 a9e5bc0c80e8f4f7dbcfbbfe0d73033b7026dfe5
push id97639
push userlhansen@mozilla.com
push dateThu, 23 Nov 2017 12:29:23 +0000
treeherdermozilla-inbound@72fd7816dd77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1420115
milestone59.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 1420115 - Avoid a static_assert with JS_CODEGEN_NONE. f=dan_horak, r=me
js/src/jit/MacroAssembler.cpp
js/src/wasm/WasmFrameIter.cpp
--- a/js/src/jit/MacroAssembler.cpp
+++ b/js/src/jit/MacroAssembler.cpp
@@ -2932,17 +2932,19 @@ MacroAssembler::maybeBranchTestType(MIRT
 
 void
 MacroAssembler::wasmCallImport(const wasm::CallSiteDesc& desc, const wasm::CalleeDesc& callee)
 {
     // Load the callee, before the caller's registers are clobbered.
     uint32_t globalDataOffset = callee.importGlobalDataOffset();
     loadWasmGlobalPtr(globalDataOffset + offsetof(wasm::FuncImportTls, code), ABINonArgReg0);
 
+#ifndef JS_CODEGEN_NONE
     static_assert(ABINonArgReg0 != WasmTlsReg, "by constraint");
+#endif
 
     // Switch to the callee's TLS and pinned registers and make the call.
     loadWasmGlobalPtr(globalDataOffset + offsetof(wasm::FuncImportTls, tls), WasmTlsReg);
     loadWasmPinnedRegsFromTls();
 
     call(desc, ABINonArgReg0);
 }
 
--- a/js/src/wasm/WasmFrameIter.cpp
+++ b/js/src/wasm/WasmFrameIter.cpp
@@ -272,22 +272,23 @@ static const unsigned PoppedTLSReg = 0;
 static const unsigned BeforePushRetAddr = 0;
 static const unsigned PushedRetAddr = 8;
 static const unsigned PushedTLS = 16;
 static const unsigned PushedFP = 24;
 static const unsigned SetFP = 28;
 static const unsigned PoppedFP = 16;
 static const unsigned PoppedTLSReg = 8;
 #elif defined(JS_CODEGEN_NONE)
+// Synthetic values to satisfy asserts and avoid compiler warnings.
 static const unsigned PushedRetAddr = 0;
 static const unsigned PushedTLS = 1;
-static const unsigned PushedFP = 0;
-static const unsigned SetFP = 0;
-static const unsigned PoppedFP = 0;
-static const unsigned PoppedTLSReg = 0;
+static const unsigned PushedFP = 2;
+static const unsigned SetFP = 3;
+static const unsigned PoppedFP = 4;
+static const unsigned PoppedTLSReg = 5;
 #else
 # error "Unknown architecture!"
 #endif
 
 static void
 PushRetAddr(MacroAssembler& masm, unsigned entry)
 {
 #if defined(JS_CODEGEN_ARM)