Bug 1417038 part 2 - Shrink ExitFooterFrame to one word. r=nbp
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 15 Nov 2017 14:39:39 +0100
changeset 391995 0b10cf1da7f21e67fd70e631f082e3b52a66f19d
parent 391994 c2e4e6d7886e75c3f545526880aa914abbde5ea0
child 391996 94111a55e8c3dfc3cb526650c7a18ea9e7f5d85e
push id32909
push usercbrindusan@mozilla.com
push dateWed, 15 Nov 2017 22:25:14 +0000
treeherdermozilla-central@f41930a869a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1417038
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 1417038 part 2 - Shrink ExitFooterFrame to one word. r=nbp
js/src/jit/CodeGenerator.cpp
js/src/jit/IonCacheIRCompiler.cpp
js/src/jit/JitFrames.cpp
js/src/jit/JitFrames.h
js/src/jit/MacroAssembler-inl.h
js/src/jit/MacroAssembler.cpp
js/src/jit/MacroAssembler.h
js/src/jit/arm/Trampoline-arm.cpp
js/src/jit/arm64/Trampoline-arm64.cpp
js/src/jit/mips32/Trampoline-mips32.cpp
js/src/jit/mips64/Trampoline-mips64.cpp
js/src/jit/x64/Trampoline-x64.cpp
js/src/jit/x86/Trampoline-x86.cpp
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -4165,17 +4165,17 @@ CodeGenerator::visitCallDOMNative(LCallD
     // maintain the same sp-relative location of the object pointer with other
     // DOMExitFrames.
     masm.Push(argObj);
     masm.moveStackPtrTo(argObj);
 
     // Construct native exit frame.
     uint32_t safepointOffset = masm.buildFakeExitFrame(argJSContext);
     masm.loadJSContext(argJSContext);
-    masm.enterFakeExitFrame(argJSContext, argJSContext, ExitFrameToken::IonDOMMethod);
+    masm.enterFakeExitFrame(argJSContext, argJSContext, ExitFrameType::IonDOMMethod);
 
     markSafepointAt(safepointOffset, call);
 
     // Construct and execute call.
     masm.setupUnalignedABICall(argJSContext);
     masm.loadJSContext(argJSContext);
     masm.passABIArg(argJSContext);
     masm.passABIArg(argObj);
@@ -8043,17 +8043,17 @@ JitRuntime::generateLazyLinkStub(JSConte
 #ifdef JS_USE_LINK_REGISTER
     masm.pushReturnAddress();
 #endif
 
     AllocatableGeneralRegisterSet regs(GeneralRegisterSet::Volatile());
     Register temp0 = regs.takeAny();
 
     masm.loadJSContext(temp0);
-    masm.enterFakeExitFrame(temp0, temp0, ExitFrameToken::LazyLink);
+    masm.enterFakeExitFrame(temp0, temp0, ExitFrameType::LazyLink);
     masm.PushStubCode();
 
     masm.setupUnalignedABICall(temp0);
     masm.passABIArg(temp0);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, LazyLinkTopActivation), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     masm.leaveExitFrame(/* stub code */ sizeof(JitCode*));
@@ -11663,17 +11663,17 @@ CodeGenerator::visitGetDOMProperty(LGetD
 
     LoadDOMPrivate(masm, ObjectReg, PrivateReg);
 
     // Rooting will happen at GC time.
     masm.moveStackPtrTo(ObjectReg);
 
     uint32_t safepointOffset = masm.buildFakeExitFrame(JSContextReg);
     masm.loadJSContext(JSContextReg);
-    masm.enterFakeExitFrame(JSContextReg, JSContextReg, ExitFrameToken::IonDOMGetter);
+    masm.enterFakeExitFrame(JSContextReg, JSContextReg, ExitFrameType::IonDOMGetter);
 
     markSafepointAt(safepointOffset, ins);
 
     masm.setupUnalignedABICall(JSContextReg);
     masm.loadJSContext(JSContextReg);
     masm.passABIArg(JSContextReg);
     masm.passABIArg(ObjectReg);
     masm.passABIArg(PrivateReg);
@@ -11762,17 +11762,17 @@ CodeGenerator::visitSetDOMProperty(LSetD
 
     LoadDOMPrivate(masm, ObjectReg, PrivateReg);
 
     // Rooting will happen at GC time.
     masm.moveStackPtrTo(ObjectReg);
 
     uint32_t safepointOffset = masm.buildFakeExitFrame(JSContextReg);
     masm.loadJSContext(JSContextReg);
-    masm.enterFakeExitFrame(JSContextReg, JSContextReg, ExitFrameToken::IonDOMSetter);
+    masm.enterFakeExitFrame(JSContextReg, JSContextReg, ExitFrameType::IonDOMSetter);
 
     markSafepointAt(safepointOffset, ins);
 
     masm.setupUnalignedABICall(JSContextReg);
     masm.loadJSContext(JSContextReg);
     masm.passABIArg(JSContextReg);
     masm.passABIArg(ObjectReg);
     masm.passABIArg(PrivateReg);
--- a/js/src/jit/IonCacheIRCompiler.cpp
+++ b/js/src/jit/IonCacheIRCompiler.cpp
@@ -1088,17 +1088,17 @@ IonCacheIRCompiler::emitCallNativeGetter
     masm.moveStackPtrTo(argVp.get());
 
     // Push marking data for later use.
     masm.Push(argUintN);
     pushStubCodePointer();
 
     if (!masm.icBuildOOLFakeExitFrame(GetReturnAddressToIonCode(cx_), save))
         return false;
-    masm.enterFakeExitFrame(argJSContext, scratch, ExitFrameToken::IonOOLNative);
+    masm.enterFakeExitFrame(argJSContext, scratch, ExitFrameType::IonOOLNative);
 
     // Construct and execute call.
     masm.setupUnalignedABICall(scratch);
     masm.passABIArg(argJSContext);
     masm.passABIArg(argUintN);
     masm.passABIArg(argVp);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
@@ -1146,17 +1146,17 @@ IonCacheIRCompiler::emitCallProxyGetResu
     // Push the proxy. Also used as receiver.
     masm.Push(obj);
     masm.moveStackPtrTo(argProxy.get());
 
     masm.loadJSContext(argJSContext);
 
     if (!masm.icBuildOOLFakeExitFrame(GetReturnAddressToIonCode(cx_), save))
         return false;
-    masm.enterFakeExitFrame(argJSContext, scratch, ExitFrameToken::IonOOLProxy);
+    masm.enterFakeExitFrame(argJSContext, scratch, ExitFrameType::IonOOLProxy);
 
     // Make the call.
     masm.setupUnalignedABICall(scratch);
     masm.passABIArg(argJSContext);
     masm.passABIArg(argProxy);
     masm.passABIArg(argId);
     masm.passABIArg(argVp);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ProxyGetProperty), MoveOp::GENERAL,
@@ -1999,17 +1999,17 @@ IonCacheIRCompiler::emitCallNativeSetter
     masm.move32(Imm32(1), argUintN);
 
     // Push marking data for later use.
     masm.Push(argUintN);
     pushStubCodePointer();
 
     if (!masm.icBuildOOLFakeExitFrame(GetReturnAddressToIonCode(cx_), save))
         return false;
-    masm.enterFakeExitFrame(argJSContext, scratch, ExitFrameToken::IonOOLNative);
+    masm.enterFakeExitFrame(argJSContext, scratch, ExitFrameType::IonOOLNative);
 
     // Make the call.
     masm.setupUnalignedABICall(scratch);
     masm.passABIArg(argJSContext);
     masm.passABIArg(argUintN);
     masm.passABIArg(argVp);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -781,17 +781,17 @@ EnsureBareExitFrame(JSContext* cx, JitFr
     MOZ_ASSERT(iter.current() == frame, "|frame| must be the top JS frame");
 
     MOZ_ASSERT(!!cx->activation()->asJit()->jsExitFP());
     MOZ_ASSERT((uint8_t*)exitFrame->footer() >= cx->activation()->asJit()->jsExitFP(),
                "Must have space for ExitFooterFrame before jsExitFP");
 #endif
 
     cx->activation()->asJit()->setJSExitFP((uint8_t*)frame);
-    *exitFrame->footer()->addressOfJitCode() = ExitFrameLayout::BareToken();
+    exitFrame->footer()->setBareExitFrame();
     MOZ_ASSERT(exitFrame->isBareExit());
 }
 
 CalleeToken
 TraceCalleeToken(JSTracer* trc, CalleeToken token)
 {
     switch (CalleeTokenTag tag = GetCalleeTokenTag(token)) {
       case CalleeToken_Function:
@@ -1095,23 +1095,16 @@ TraceJitExitFrameCopiedArguments(JSTrace
 }
 #endif
 
 static void
 TraceJitExitFrame(JSTracer* trc, const JSJitFrameIter& frame)
 {
     ExitFooterFrame* footer = frame.exitFrame()->footer();
 
-    // Trace the code of the code handling the exit path.  This is needed because
-    // invalidated script are no longer traced because data are erased by the
-    // invalidation and relocation data are no longer reliable.  So the VM
-    // wrapper or the invalidation code may be GC if no JitCode keep reference
-    // on them.
-    MOZ_ASSERT(uintptr_t(footer->jitCode()) != uintptr_t(-1));
-
     // This corresponds to the case where we have build a fake exit frame which
     // handles the case of a native function call. We need to trace the argument
     // vector of the function call, and also new.target if it was a constructing
     // call.
     if (frame.isExitFrameLayout<NativeExitFrameLayout>()) {
         NativeExitFrameLayout* native = frame.exitFrame()->as<NativeExitFrameLayout>();
         size_t len = native->argc() + 2;
         Value* vp = native->vp();
@@ -1169,18 +1162,17 @@ TraceJitExitFrame(JSTracer* trc, const J
         // Nothing to trace. Fake exit frame pushed for VM functions with
         // nothing to trace on the stack.
         return;
     }
 
     MOZ_ASSERT(frame.exitFrame()->isWrapperExit());
 
     const VMFunction* f = footer->function();
-    if (f == nullptr)
-        return;
+    MOZ_ASSERT(f);
 
     // Trace arguments of the VM wrapper.
     uint8_t* argBase = frame.exitFrame()->argBase();
     for (uint32_t explicitArg = 0; explicitArg < f->explicitArgs; explicitArg++) {
         switch (f->argRootType(explicitArg)) {
           case VMFunction::RootNone:
             break;
           case VMFunction::RootObject: {
--- a/js/src/jit/JitFrames.h
+++ b/js/src/jit/JitFrames.h
@@ -463,76 +463,83 @@ class IonICCallFrameLayout : public Comm
     JitCode** stubCode() {
         return &stubCode_;
     }
     static size_t Size() {
         return sizeof(IonICCallFrameLayout);
     }
 };
 
+enum class ExitFrameType : uint8_t
+{
+    CallNative        = 0x0,
+    ConstructNative   = 0x1,
+    IonDOMGetter      = 0x2,
+    IonDOMSetter      = 0x3,
+    IonDOMMethod      = 0x4,
+    IonOOLNative      = 0x5,
+    IonOOLProxy       = 0x6,
+    VMFunction        = 0xFD,
+    LazyLink          = 0xFE,
+    Bare              = 0xFF,
+};
+
 // GC related data used to keep alive data surrounding the Exit frame.
 class ExitFooterFrame
 {
-    const VMFunction* function_;
-    JitCode* jitCode_;
+    // Stores the ExitFrameType or, for ExitFrameType::VMFunction, the
+    // VMFunction*.
+    uintptr_t data_;
 
   public:
     static inline size_t Size() {
         return sizeof(ExitFooterFrame);
     }
-    inline JitCode* jitCode() const {
-        return jitCode_;
+    void setBareExitFrame() {
+        data_ = uintptr_t(ExitFrameType::Bare);
     }
-    inline JitCode** addressOfJitCode() {
-        return &jitCode_;
+    ExitFrameType type() const {
+        static_assert(sizeof(ExitFrameType) == sizeof(uint8_t),
+                      "Code assumes ExitFrameType fits in a byte");
+        if (data_ > UINT8_MAX)
+            return ExitFrameType::VMFunction;
+        MOZ_ASSERT(ExitFrameType(data_) != ExitFrameType::VMFunction);
+        return ExitFrameType(data_);
     }
     inline const VMFunction* function() const {
-        return function_;
+        MOZ_ASSERT(type() == ExitFrameType::VMFunction);
+        return reinterpret_cast<const VMFunction*>(data_);
     }
 
     // This should only be called for function()->outParam == Type_Handle
     template <typename T>
     T* outParam() {
         uint8_t* address = reinterpret_cast<uint8_t*>(this);
         address = alignDoubleSpillWithOffset(address, sizeof(intptr_t));
         return reinterpret_cast<T*>(address - sizeof(T));
     }
 };
 
 class NativeExitFrameLayout;
 class IonOOLNativeExitFrameLayout;
 class IonOOLProxyExitFrameLayout;
 class IonDOMExitFrameLayout;
 
-enum class ExitFrameToken : uint8_t
-{
-    CallNative        = 0x0,
-    ConstructNative   = 0x1,
-    IonDOMGetter      = 0x2,
-    IonDOMSetter      = 0x3,
-    IonDOMMethod      = 0x4,
-    IonOOLNative      = 0x5,
-    IonOOLProxy       = 0x8,
-    VMFunction        = 0xFD,
-    LazyLink          = 0xFE,
-    Bare              = 0xFF
-};
-
 // this is the frame layout when we are exiting ion code, and about to enter platform ABI code
 class ExitFrameLayout : public CommonFrameLayout
 {
     inline uint8_t* top() {
         return reinterpret_cast<uint8_t*>(this + 1);
     }
 
   public:
     // Pushed for "bare" fake exit frames that have no GC things on stack to be
     // traced.
-    static JitCode* BareToken() { return (JitCode*)ExitFrameToken::Bare; }
-    static JitCode* VMFunctionToken() { return (JitCode*)ExitFrameToken::VMFunction; }
+    static ExitFrameType BareType() { return ExitFrameType::Bare; }
+    static ExitFrameType VMFunctionType() { return ExitFrameType::VMFunction; }
 
     static inline size_t Size() {
         return sizeof(ExitFrameLayout);
     }
     static inline size_t SizeWithFooter() {
         return Size() + ExitFooterFrame::Size();
     }
 
@@ -540,30 +547,30 @@ class ExitFrameLayout : public CommonFra
         uint8_t* sp = reinterpret_cast<uint8_t*>(this);
         return reinterpret_cast<ExitFooterFrame*>(sp - ExitFooterFrame::Size());
     }
 
     // argBase targets the point which precedes the exit frame. Arguments of VM
     // each wrapper are pushed before the exit frame.  This correspond exactly
     // to the value of the argBase register of the generateVMWrapper function.
     inline uint8_t* argBase() {
-        MOZ_ASSERT(footer()->jitCode() != nullptr);
+        MOZ_ASSERT(isWrapperExit());
         return top();
     }
 
     inline bool isWrapperExit() {
-        return footer()->jitCode() == VMFunctionToken();
+        return footer()->type() == ExitFrameType::VMFunction;
     }
     inline bool isBareExit() {
-        return footer()->jitCode() == BareToken();
+        return footer()->type() == ExitFrameType::Bare;
     }
 
     // See the various exit frame layouts below.
     template <typename T> inline bool is() {
-        return footer()->jitCode() == T::Token();
+        return footer()->type() == T::Type();
     }
     template <typename T> inline T* as() {
         MOZ_ASSERT(this->is<T>());
         return reinterpret_cast<T*>(footer());
     }
 };
 
 // Cannot inherit implementation since we need to extend the top of
@@ -594,23 +601,23 @@ class NativeExitFrameLayout
     inline uintptr_t argc() const {
         return argc_;
     }
 };
 
 class CallNativeExitFrameLayout : public NativeExitFrameLayout
 {
   public:
-    static JitCode* Token() { return (JitCode*)ExitFrameToken::CallNative; }
+    static ExitFrameType Type() { return ExitFrameType::CallNative; }
 };
 
 class ConstructNativeExitFrameLayout : public NativeExitFrameLayout
 {
   public:
-    static JitCode* Token() { return (JitCode*)ExitFrameToken::ConstructNative; }
+    static ExitFrameType Type() { return ExitFrameType::ConstructNative; }
 };
 
 template<>
 inline bool
 ExitFrameLayout::is<NativeExitFrameLayout>()
 {
     return is<CallNativeExitFrameLayout>() || is<ConstructNativeExitFrameLayout>();
 }
@@ -631,17 +638,17 @@ class IonOOLNativeExitFrameLayout
     uint32_t loCalleeResult_;
     uint32_t hiCalleeResult_;
 
     // Split Value for |this| and args above.
     uint32_t loThis_;
     uint32_t hiThis_;
 
   public:
-    static JitCode* Token() { return (JitCode*)ExitFrameToken::IonOOLNative; }
+    static ExitFrameType Type() { return ExitFrameType::IonOOLNative; }
 
     static inline size_t Size(size_t argc) {
         // The frame accounts for the callee/result and |this|, so we only need args.
         return sizeof(IonOOLNativeExitFrameLayout) + (argc * sizeof(Value));
     }
 
     static size_t offsetOfResult() {
         return offsetof(IonOOLNativeExitFrameLayout, loCalleeResult_);
@@ -681,17 +688,17 @@ class IonOOLProxyExitFrameLayout
     // use two uint32_t so compiler doesn't align.
     uint32_t vp0_;
     uint32_t vp1_;
 
     // pointer to root the stub's JitCode
     JitCode* stubCode_;
 
   public:
-    static JitCode* Token() { return (JitCode*)ExitFrameToken::IonOOLProxy; }
+    static ExitFrameType Type() { return ExitFrameType::IonOOLProxy; }
 
     static inline size_t Size() {
         return sizeof(IonOOLProxyExitFrameLayout);
     }
 
     static size_t offsetOfResult() {
         return offsetof(IonOOLProxyExitFrameLayout, vp0_);
     }
@@ -718,18 +725,18 @@ class IonDOMExitFrameLayout
     JSObject* thisObj;
 
     // We need to split the Value into 2 fields of 32 bits, otherwise the C++
     // compiler may add some padding between the fields.
     uint32_t loCalleeResult_;
     uint32_t hiCalleeResult_;
 
   public:
-    static JitCode* GetterToken() { return (JitCode*)ExitFrameToken::IonDOMGetter; }
-    static JitCode* SetterToken() { return (JitCode*)ExitFrameToken::IonDOMSetter; }
+    static ExitFrameType GetterType() { return ExitFrameType::IonDOMGetter; }
+    static ExitFrameType SetterType() { return ExitFrameType::IonDOMSetter; }
 
     static inline size_t Size() {
         return sizeof(IonDOMExitFrameLayout);
     }
 
     static size_t offsetOfResult() {
         return offsetof(IonDOMExitFrameLayout, loCalleeResult_);
     }
@@ -758,17 +765,17 @@ class IonDOMMethodExitFrameLayout
     // We need to split the Value into 2 fields of 32 bits, otherwise the C++
     // compiler may add some padding between the fields.
     uint32_t loCalleeResult_;
     uint32_t hiCalleeResult_;
 
     friend struct IonDOMMethodExitFrameLayoutTraits;
 
   public:
-    static JitCode* Token() { return (JitCode*)ExitFrameToken::IonDOMMethod; }
+    static ExitFrameType Type() { return ExitFrameType::IonDOMMethod; }
 
     static inline size_t Size() {
         return sizeof(IonDOMMethodExitFrameLayout);
     }
 
     static size_t offsetOfResult() {
         return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
     }
@@ -785,28 +792,28 @@ class IonDOMMethodExitFrameLayout
     inline uintptr_t argc() {
         return argc_;
     }
 };
 
 inline bool
 IonDOMExitFrameLayout::isMethodFrame()
 {
-    return footer_.jitCode() == IonDOMMethodExitFrameLayout::Token();
+    return footer_.type() == IonDOMMethodExitFrameLayout::Type();
 }
 
 template <>
 inline bool
 ExitFrameLayout::is<IonDOMExitFrameLayout>()
 {
-    JitCode* code = footer()->jitCode();
+    ExitFrameType type = footer()->type();
     return
-        code == IonDOMExitFrameLayout::GetterToken() ||
-        code == IonDOMExitFrameLayout::SetterToken() ||
-        code == IonDOMMethodExitFrameLayout::Token();
+        type == IonDOMExitFrameLayout::GetterType() ||
+        type == IonDOMExitFrameLayout::SetterType() ||
+        type == IonDOMMethodExitFrameLayout::Type();
 }
 
 template <>
 inline IonDOMExitFrameLayout*
 ExitFrameLayout::as<IonDOMExitFrameLayout>()
 {
     MOZ_ASSERT(is<IonDOMExitFrameLayout>());
     return reinterpret_cast<IonDOMExitFrameLayout*>(footer());
@@ -823,17 +830,17 @@ struct IonDOMMethodExitFrameLayoutTraits
 class LazyLinkExitFrameLayout
 {
   protected: // silence clang warning about unused private fields
     JitCode* stubCode_;
     ExitFooterFrame footer_;
     JitFrameLayout exit_;
 
   public:
-    static JitCode* Token() { return (JitCode*)ExitFrameToken::LazyLink; }
+    static ExitFrameType Type() { return ExitFrameType::LazyLink; }
 
     static inline size_t Size() {
         return sizeof(LazyLinkExitFrameLayout);
     }
 
     inline JitCode** stubCode() {
         return &stubCode_;
     }
--- a/js/src/jit/MacroAssembler-inl.h
+++ b/js/src/jit/MacroAssembler-inl.h
@@ -310,35 +310,34 @@ MacroAssembler::PushStubCode()
     // Make sure that we do not erase an existing self-reference.
     MOZ_ASSERT(!hasSelfReference());
     selfReferencePatch_ = PushWithPatch(ImmWord(-1));
 }
 
 void
 MacroAssembler::enterExitFrame(Register cxreg, Register scratch, const VMFunction* f)
 {
+    MOZ_ASSERT(f);
     linkExitFrame(cxreg, scratch);
-    Push(Imm32(int32_t(ExitFrameToken::VMFunction)));
     // Push VMFunction pointer, to mark arguments.
     Push(ImmPtr(f));
 }
 
 void
-MacroAssembler::enterFakeExitFrame(Register cxreg, Register scratch, ExitFrameToken token)
+MacroAssembler::enterFakeExitFrame(Register cxreg, Register scratch, ExitFrameType type)
 {
     linkExitFrame(cxreg, scratch);
-    Push(Imm32(int32_t(token)));
-    Push(ImmPtr(nullptr));
+    Push(Imm32(int32_t(type)));
 }
 
 void
 MacroAssembler::enterFakeExitFrameForNative(Register cxreg, Register scratch, bool isConstructing)
 {
-    enterFakeExitFrame(cxreg, scratch, isConstructing ? ExitFrameToken::ConstructNative
-                                                      : ExitFrameToken::CallNative);
+    enterFakeExitFrame(cxreg, scratch, isConstructing ? ExitFrameType::ConstructNative
+                                                      : ExitFrameType::CallNative);
 }
 
 void
 MacroAssembler::leaveExitFrame(size_t extraFrame)
 {
     freeStack(ExitFooterFrame::Size() + extraFrame);
 }
 
--- a/js/src/jit/MacroAssembler.cpp
+++ b/js/src/jit/MacroAssembler.cpp
@@ -1500,17 +1500,17 @@ BailoutReportOverRecursed(JSContext* cx)
 {
     ReportOverRecursed(cx);
 }
 
 void
 MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
 {
     loadJSContext(scratch);
-    enterExitFrame(scratch, scratch);
+    enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
     Label baseline;
 
     // The return value from Bailout is tagged as:
     // - 0x0: done (enter baseline)
     // - 0x1: error (handle exception)
     // - 0x2: overrecursed
     JS_STATIC_ASSERT(BAILOUT_RETURN_OK == 0);
@@ -1563,17 +1563,17 @@ MacroAssembler::generateBailoutTail(Regi
         // Enter exit frame for the FinishBailoutToBaseline call.
         loadPtr(Address(bailoutInfo, offsetof(BaselineBailoutInfo, resumeFramePtr)), temp);
         load32(Address(temp, BaselineFrame::reverseOffsetOfFrameSize()), temp);
         makeFrameDescriptor(temp, JitFrame_BaselineJS, ExitFrameLayout::Size());
         push(temp);
         push(Address(bailoutInfo, offsetof(BaselineBailoutInfo, resumeAddr)));
         // No GC things to mark on the stack, push a bare token.
         loadJSContext(scratch);
-        enterFakeExitFrame(scratch, scratch, ExitFrameToken::Bare);
+        enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
         // If monitorStub is non-null, handle resumeAddr appropriately.
         Label noMonitor;
         Label done;
         branchPtr(Assembler::Equal,
                   Address(bailoutInfo, offsetof(BaselineBailoutInfo, monitorStub)),
                   ImmPtr(nullptr),
                   &noMonitor);
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -184,17 +184,17 @@ using mozilla::FloatingPoint;
 #else
 #define IMM32_16ADJ(X) X
 #endif
 
 namespace js {
 namespace jit {
 
 // Defined in JitFrames.h
-enum class ExitFrameToken : uint8_t;
+enum class ExitFrameType : uint8_t;
 
 class AutoSaveLiveRegisters;
 
 enum class CheckUnsafeCallWithABI {
     // Require the callee to use AutoUnsafeCallWithABI.
     Check,
 
     // We pushed an exit frame so this callWithABI can safely GC and walk the
@@ -707,21 +707,21 @@ class MacroAssembler : public MacroAssem
     // is linked.
     inline void PushStubCode();
 
     // Return true if the code contains a self-reference which needs to be
     // patched when the code is linked.
     inline bool hasSelfReference() const;
 
     // Push stub code and the VMFunction pointer.
-    inline void enterExitFrame(Register cxreg, Register scratch, const VMFunction* f = nullptr);
+    inline void enterExitFrame(Register cxreg, Register scratch, const VMFunction* f);
 
     // Push an exit frame token to identify which fake exit frame this footer
     // corresponds to.
-    inline void enterFakeExitFrame(Register cxreg, Register scratch, ExitFrameToken token);
+    inline void enterFakeExitFrame(Register cxreg, Register scratch, ExitFrameType type);
 
     // Push an exit frame token for a native call.
     inline void enterFakeExitFrameForNative(Register cxreg, Register scratch, bool isConstructing);
 
     // Pop ExitFrame footer in addition to the extra frame.
     inline void leaveExitFrame(size_t extraFrame = 0);
 
   private:
--- a/js/src/jit/arm/Trampoline-arm.cpp
+++ b/js/src/jit/arm/Trampoline-arm.cpp
@@ -282,17 +282,17 @@ JitRuntime::generateEnterJIT(JSContext* 
 
         // Enter exit frame.
         masm.addPtr(Imm32(BaselineFrame::Size() + BaselineFrame::FramePointerOffset), scratch);
         masm.makeFrameDescriptor(scratch, JitFrame_BaselineJS, ExitFrameLayout::Size());
         masm.push(scratch);
         masm.push(Imm32(0)); // Fake return address.
         // No GC things to mark on the stack, push a bare token.
         masm.loadJSContext(scratch);
-        masm.enterFakeExitFrame(scratch, scratch, ExitFrameToken::Bare);
+        masm.enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
         masm.push(framePtr); // BaselineFrame
         masm.push(r0); // jitcode
 
         masm.setupUnalignedABICall(scratch);
         masm.passABIArg(r11); // BaselineFrame
         masm.passABIArg(OsrFrameReg); // InterpreterFrame
         masm.passABIArg(numStackValues);
--- a/js/src/jit/arm64/Trampoline-arm64.cpp
+++ b/js/src/jit/arm64/Trampoline-arm64.cpp
@@ -185,17 +185,17 @@ JitRuntime::generateEnterJIT(JSContext* 
         masm.subFromStackPtr(r19);
 
         // Enter exit frame.
         masm.addPtr(Imm32(BaselineFrame::Size() + BaselineFrame::FramePointerOffset), r19);
         masm.makeFrameDescriptor(r19, JitFrame_BaselineJS, ExitFrameLayout::Size());
         masm.asVIXL().Push(x19, xzr); // Push xzr for a fake return address.
         // No GC things to mark: push a bare token.
         masm.loadJSContext(r19);
-        masm.enterFakeExitFrame(r19, r19, ExitFrameToken::Bare);
+        masm.enterFakeExitFrame(r19, r19, ExitFrameType::Bare);
 
         masm.push(BaselineFrameReg, reg_code);
 
         // Initialize the frame, including filling in the slots.
         masm.setupUnalignedABICall(r19);
         masm.passABIArg(BaselineFrameReg); // BaselineFrame.
         masm.passABIArg(reg_osrFrame); // InterpreterFrame.
         masm.passABIArg(reg_osrNStack);
--- a/js/src/jit/mips32/Trampoline-mips32.cpp
+++ b/js/src/jit/mips32/Trampoline-mips32.cpp
@@ -249,17 +249,17 @@ JitRuntime::generateEnterJIT(JSContext* 
 
         // Push frame descriptor and fake return address.
         masm.reserveStack(2 * sizeof(uintptr_t));
         masm.storePtr(scratch, Address(StackPointer, sizeof(uintptr_t))); // Frame descriptor
         masm.storePtr(zero, Address(StackPointer, 0)); // fake return address
 
         // No GC things to mark, push a bare token.
         masm.loadJSContext(scratch);
-        masm.enterFakeExitFrame(scratch, scratch, ExitFrameToken::Bare);
+        masm.enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
         masm.reserveStack(2 * sizeof(uintptr_t));
         masm.storePtr(framePtr, Address(StackPointer, sizeof(uintptr_t))); // BaselineFrame
         masm.storePtr(reg_code, Address(StackPointer, 0)); // jitcode
 
         masm.setupUnalignedABICall(scratch);
         masm.passABIArg(BaselineFrameReg); // BaselineFrame
         masm.passABIArg(OsrFrameReg); // InterpreterFrame
--- a/js/src/jit/mips64/Trampoline-mips64.cpp
+++ b/js/src/jit/mips64/Trampoline-mips64.cpp
@@ -273,17 +273,17 @@ JitRuntime::generateEnterJIT(JSContext* 
 
         // Push frame descriptor and fake return address.
         masm.reserveStack(2 * sizeof(uintptr_t));
         masm.storePtr(scratch, Address(StackPointer, sizeof(uintptr_t))); // Frame descriptor
         masm.storePtr(zero, Address(StackPointer, 0)); // fake return address
 
         // No GC things to mark, push a bare token.
         masm.loadJSContext(scratch);
-        masm.enterFakeExitFrame(scratch, scratch, ExitFrameToken::Bare);
+        masm.enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
         masm.reserveStack(2 * sizeof(uintptr_t));
         masm.storePtr(framePtr, Address(StackPointer, sizeof(uintptr_t))); // BaselineFrame
         masm.storePtr(reg_code, Address(StackPointer, 0)); // jitcode
 
         masm.setupUnalignedABICall(scratch);
         masm.passABIArg(BaselineFrameReg); // BaselineFrame
         masm.passABIArg(OsrFrameReg); // InterpreterFrame
--- a/js/src/jit/x64/Trampoline-x64.cpp
+++ b/js/src/jit/x64/Trampoline-x64.cpp
@@ -226,17 +226,17 @@ JitRuntime::generateEnterJIT(JSContext* 
 
         // Enter exit frame.
         masm.addPtr(Imm32(BaselineFrame::Size() + BaselineFrame::FramePointerOffset), valuesSize);
         masm.makeFrameDescriptor(valuesSize, JitFrame_BaselineJS, ExitFrameLayout::Size());
         masm.push(valuesSize);
         masm.push(Imm32(0)); // Fake return address.
         // No GC things to mark, push a bare token.
         masm.loadJSContext(scratch);
-        masm.enterFakeExitFrame(scratch, scratch, ExitFrameToken::Bare);
+        masm.enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
         regs.add(valuesSize);
 
         masm.push(framePtr);
         masm.push(reg_code);
 
         masm.setupUnalignedABICall(scratch);
         masm.passABIArg(framePtr); // BaselineFrame
--- a/js/src/jit/x86/Trampoline-x86.cpp
+++ b/js/src/jit/x86/Trampoline-x86.cpp
@@ -221,17 +221,17 @@ JitRuntime::generateEnterJIT(JSContext* 
 
         // Enter exit frame.
         masm.addPtr(Imm32(BaselineFrame::Size() + BaselineFrame::FramePointerOffset), scratch);
         masm.makeFrameDescriptor(scratch, JitFrame_BaselineJS, ExitFrameLayout::Size());
         masm.push(scratch); // Fake return address.
         masm.push(Imm32(0));
         // No GC things to mark on the stack, push a bare token.
         masm.loadJSContext(scratch);
-        masm.enterFakeExitFrame(scratch, scratch, ExitFrameToken::Bare);
+        masm.enterFakeExitFrame(scratch, scratch, ExitFrameType::Bare);
 
         masm.push(framePtr);
         masm.push(jitcode);
 
         masm.setupUnalignedABICall(scratch);
         masm.passABIArg(framePtr); // BaselineFrame
         masm.passABIArg(OsrFrameReg); // InterpreterFrame
         masm.passABIArg(numStackValues);