Commit 2e1f0b3c authored by Tom Schuster's avatar Tom Schuster
Browse files

Bug 1385278 - Move GetReturnAddress into IonCacheIRCompiler. r=jandem

parent 8db9707f
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -10,13 +10,14 @@
#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"

@@ -324,6 +325,21 @@ CacheRegisterAllocator::restoreIonLiveRegisters(MacroAssembler& masm, LiveRegist
    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)
{
+0 −16
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@
#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"
@@ -85,18 +84,3 @@ CodeOffsetJump::fixup(MacroAssembler* masm)
     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;
}
+0 −8
Original line number Diff line number Diff line
@@ -23,12 +23,4 @@

#include "vm/TypedArrayObject.h"

namespace js {
namespace jit {

void* GetReturnAddressToIonCode(JSContext* cx);

} // namespace jit
} // namespace js

#endif /* jit_IonCaches_h */