Bug 1522300 - ARM64: Restore the Pseudo stack pointer before asserting that it has the correct alignment. r=sstangl
authorNicolas B. Pierron <nicolas.b.pierron@nbp.name>
Tue, 12 Feb 2019 19:49:34 +0000
changeset 458880 ce68e72b6fb6
parent 458879 6dd68e1928a6
child 458881 a3ef08e9f99e
push id35551
push usershindli@mozilla.com
push dateWed, 13 Feb 2019 21:34:09 +0000
treeherdermozilla-central@08f794a4928e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs1522300
milestone67.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 1522300 - ARM64: Restore the Pseudo stack pointer before asserting that it has the correct alignment. r=sstangl Differential Revision: https://phabricator.services.mozilla.com/D19543
js/src/wasm/WasmStubs.cpp
--- a/js/src/wasm/WasmStubs.cpp
+++ b/js/src/wasm/WasmStubs.cpp
@@ -1092,23 +1092,22 @@ void wasm::GenerateDirectCallFromJit(Mac
   // Actual call.
   const CodeTier& codeTier = inst.code().codeTier(inst.code().bestTier());
   const MetadataTier& metadata = codeTier.metadata();
   const CodeRange& codeRange = metadata.codeRange(fe);
   void* callee = codeTier.segment().base() + codeRange.funcNormalEntry();
 
   masm.assertStackAlignment(WasmStackAlignment);
   masm.callJit(ImmPtr(callee));
-  masm.assertStackAlignment(WasmStackAlignment);
-
 #ifdef JS_CODEGEN_ARM64
   // WASM does not use the emulated stack pointer, so reinitialize it as it
   // might be clobbered either by WASM or by any C++ calls within.
   masm.initPseudoStackPtr();
 #endif
+  masm.assertStackAlignment(WasmStackAlignment);
 
   masm.branchPtr(Assembler::Equal, FramePointer, Imm32(wasm::FailFP),
                  masm.exceptionLabel());
 
   // Store the return value in the appropriate place.
   GenPrintf(DebugChannel::Function, masm, "wasm-function[%d]; returns ", fe.funcIndex());
   switch (fe.funcType().ret().code()) {
     case wasm::ExprType::Void: