Bug 1385278 - Move GetReturnAddress into IonCacheIRCompiler. r=jandem
authorTom Schuster <evilpies@gmail.com>
Fri, 08 Sep 2017 18:54:04 +0200
changeset 379705 ec521bf6357cf3564d5785a66da787be53be45cd
parent 379704 c5047f299f6072182266ef9a9be65cd5d7a9b51b
child 379706 9b4e5a1ce001141c01399a76666e50a8c6308179
child 379814 ea7b55d65d76214f97aaae502d65cb26fc6f5659
push id94730
push userevilpies@gmail.com
push dateFri, 08 Sep 2017 16:54:27 +0000
treeherdermozilla-inbound@ec521bf6357c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1385278
milestone57.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 1385278 - Move GetReturnAddress into IonCacheIRCompiler. r=jandem
js/src/jit/IonCacheIRCompiler.cpp
js/src/jit/IonCaches.cpp
js/src/jit/IonCaches.h
--- a/js/src/jit/IonCacheIRCompiler.cpp
+++ b/js/src/jit/IonCacheIRCompiler.cpp
@@ -5,23 +5,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/DebugOnly.h"
 
 #include "jit/BaselineIC.h"
 #include "jit/CacheIRCompiler.h"
 #include "jit/IonCaches.h"
 #include "jit/IonIC.h"
-
+#include "jit/JSJitFrameIter.h"
 #include "jit/Linker.h"
 #include "jit/SharedICHelpers.h"
 #include "proxy/Proxy.h"
 
 #include "jscompartmentinlines.h"
 
+#include "jit/JSJitFrameIter-inl.h"
 #include "jit/MacroAssembler-inl.h"
 #include "vm/TypeInference-inl.h"
 
 using namespace js;
 using namespace js::jit;
 
 using mozilla::DebugOnly;
 
@@ -319,16 +320,31 @@ void
 CacheRegisterAllocator::restoreIonLiveRegisters(MacroAssembler& masm, LiveRegisterSet liveRegs)
 {
     masm.PopRegsInMask(liveRegs);
 
     availableRegs_.set() = GeneralRegisterSet();
     availableRegsAfterSpill_.set() = GeneralRegisterSet::All();
 }
 
+static void*
+GetReturnAddressToIonCode(JSContext* cx)
+{
+    JSJitFrameIter frame(cx);
+    MOZ_ASSERT(frame.type() == JitFrame_Exit,
+               "An exit frame is expected as update functions are called with a VMFunction.");
+
+    void* returnAddr = frame.returnAddress();
+#ifdef DEBUG
+    ++frame;
+    MOZ_ASSERT(frame.isIonJS());
+#endif
+    return returnAddr;
+}
+
 void
 IonCacheIRCompiler::prepareVMCall(MacroAssembler& masm)
 {
     uint32_t descriptor = MakeFrameDescriptor(masm.framePushed(), JitFrame_IonJS,
                                               IonICCallFrameLayout::Size());
     pushStubCodePointer();
     masm.Push(Imm32(descriptor));
     masm.Push(ImmPtr(GetReturnAddressToIonCode(cx_)));
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -21,17 +21,16 @@
 # include "jit/PerfSpewer.h"
 #endif
 #include "jit/VMFunctions.h"
 #include "js/Proxy.h"
 #include "proxy/Proxy.h"
 #include "vm/Shape.h"
 #include "vm/Stack.h"
 
-#include "jit/JitFrames-inl.h"
 #include "jit/MacroAssembler-inl.h"
 #include "jit/shared/Lowering-shared-inl.h"
 #include "vm/Interpreter-inl.h"
 #include "vm/Shape-inl.h"
 
 using namespace js;
 using namespace js::jit;
 
@@ -80,23 +79,8 @@ CodeLocationLabel::repoint(JitCode* code
 
 void
 CodeOffsetJump::fixup(MacroAssembler* masm)
 {
 #ifdef JS_SMALL_BRANCH
      jumpTableIndex_ = masm->actualIndex(jumpTableIndex_);
 #endif
 }
-
-void*
-jit::GetReturnAddressToIonCode(JSContext* cx)
-{
-    JSJitFrameIter frame(cx);
-    MOZ_ASSERT(frame.type() == JitFrame_Exit,
-               "An exit frame is expected as update functions are called with a VMFunction.");
-
-    void* returnAddr = frame.returnAddress();
-#ifdef DEBUG
-    ++frame;
-    MOZ_ASSERT(frame.isIonJS());
-#endif
-    return returnAddr;
-}
--- a/js/src/jit/IonCaches.h
+++ b/js/src/jit/IonCaches.h
@@ -18,17 +18,9 @@
 #endif
 #include "jit/JitCompartment.h"
 #include "jit/Registers.h"
 #include "jit/shared/Assembler-shared.h"
 #include "js/TrackedOptimizationInfo.h"
 
 #include "vm/TypedArrayObject.h"
 
-namespace js {
-namespace jit {
-
-void* GetReturnAddressToIonCode(JSContext* cx);
-
-} // namespace jit
-} // namespace js
-
 #endif /* jit_IonCaches_h */