Bug 950703 - SpiderMonkey: Merge x86 and ARM's IonFrames.h files into a single file. r=jandem
authorDan Gohman <sunfish@google.com>
Tue, 17 Dec 2013 08:46:37 -0800
changeset 160852 02ead7ab22c4240fc7d633167ac3df817af50d63
parent 160851 f6097fcbd39b8fc97d29d0923c577ca99f5eb22d
child 160853 16f4eae9ae00794eb1663ec7d8a732b08b28bf75
push id37725
push usersunfish@google.com
push dateTue, 17 Dec 2013 16:58:57 +0000
treeherdermozilla-inbound@afe7a6c1c9b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs950703
milestone29.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 950703 - SpiderMonkey: Merge x86 and ARM's IonFrames.h files into a single file. r=jandem
js/src/jit/IonFrames.cpp
js/src/jit/IonFrames.h
js/src/jit/arm/IonFrames-arm.cpp
js/src/jit/arm/IonFrames-arm.h
js/src/jit/shared/IonFrames-shared.h
js/src/jit/shared/IonFrames-x86-shared.cpp
js/src/jit/shared/IonFrames-x86-shared.h
js/src/moz.build
--- a/js/src/jit/IonFrames.cpp
+++ b/js/src/jit/IonFrames.cpp
@@ -1745,10 +1745,31 @@ IonFrameIterator::dump() const
         break;
       case IonFrame_Osr:
         fprintf(stderr, "Warning! OSR frame are not defined yet.\n");
         break;
     };
     fputc('\n', stderr);
 }
 
+IonJSFrameLayout *
+InvalidationBailoutStack::fp() const
+{
+    return (IonJSFrameLayout *) (sp() + ionScript_->frameSize());
+}
+
+void
+InvalidationBailoutStack::checkInvariants() const
+{
+#ifdef DEBUG
+    IonJSFrameLayout *frame = fp();
+    CalleeToken token = frame->calleeToken();
+    JS_ASSERT(token);
+
+    uint8_t *rawBase = ionScript()->method()->raw();
+    uint8_t *rawLimit = rawBase + ionScript()->method()->instructionsSize();
+    uint8_t *osiPoint = osiPointReturnAddress();
+    JS_ASSERT(rawBase <= osiPoint && osiPoint <= rawLimit);
+#endif
+}
+
 } // namespace jit
 } // namespace js
--- a/js/src/jit/IonFrames.h
+++ b/js/src/jit/IonFrames.h
@@ -4,16 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef jit_IonFrames_h
 #define jit_IonFrames_h
 
 #ifdef JS_ION
 
+#include <stdint.h>
+
 #include "jscntxt.h"
 #include "jsfun.h"
 
 #include "jit/IonFrameIterator.h"
 
 namespace js {
 namespace jit {
 
@@ -295,29 +297,555 @@ GetTopIonJSScript(uint8_t *ionTop, void 
         ++iter;
         JS_ASSERT(iter.isBaselineJS());
     }
 
     JS_ASSERT(iter.isScripted());
     return iter.script();
 }
 
-} // namespace jit
-} // namespace js
+static IonCode *const ION_FRAME_DOMGETTER       = (IonCode *)0x1;
+static IonCode *const ION_FRAME_DOMSETTER       = (IonCode *)0x2;
+static IonCode *const ION_FRAME_DOMMETHOD       = (IonCode *)0x3;
+static IonCode *const ION_FRAME_OOL_NATIVE      = (IonCode *)0x4;
+static IonCode *const ION_FRAME_OOL_PROPERTY_OP = (IonCode *)0x5;
+static IonCode *const ION_FRAME_OOL_PROXY       = (IonCode *)0x6;
+
+// Layout of the frame prefix. This assumes the stack architecture grows down.
+// If this is ever not the case, we'll have to refactor.
+class IonCommonFrameLayout
+{
+    uint8_t *returnAddress_;
+    uintptr_t descriptor_;
+
+    static const uintptr_t FrameTypeMask = (1 << FRAMETYPE_BITS) - 1;
+
+  public:
+    static size_t offsetOfDescriptor() {
+        return offsetof(IonCommonFrameLayout, descriptor_);
+    }
+    static size_t offsetOfReturnAddress() {
+        return offsetof(IonCommonFrameLayout, returnAddress_);
+    }
+    FrameType prevType() const {
+        return FrameType(descriptor_ & FrameTypeMask);
+    }
+    void changePrevType(FrameType type) {
+        descriptor_ &= ~FrameTypeMask;
+        descriptor_ |= type;
+    }
+    size_t prevFrameLocalSize() const {
+        return descriptor_ >> FRAMESIZE_SHIFT;
+    }
+    void setFrameDescriptor(size_t size, FrameType type) {
+        descriptor_ = (size << FRAMESIZE_SHIFT) | type;
+    }
+    uint8_t *returnAddress() const {
+        return returnAddress_;
+    }
+    void setReturnAddress(uint8_t *addr) {
+        returnAddress_ = addr;
+    }
+};
+
+class IonJSFrameLayout : public IonCommonFrameLayout
+{
+    CalleeToken calleeToken_;
+    uintptr_t numActualArgs_;
+
+  public:
+    CalleeToken calleeToken() const {
+        return calleeToken_;
+    }
+    void replaceCalleeToken(CalleeToken calleeToken) {
+        calleeToken_ = calleeToken;
+    }
+
+    static size_t offsetOfCalleeToken() {
+        return offsetof(IonJSFrameLayout, calleeToken_);
+    }
+    static size_t offsetOfNumActualArgs() {
+        return offsetof(IonJSFrameLayout, numActualArgs_);
+    }
+    static size_t offsetOfThis() {
+        IonJSFrameLayout *base = nullptr;
+        return reinterpret_cast<size_t>(&base->argv()[0]);
+    }
+    static size_t offsetOfActualArgs() {
+        IonJSFrameLayout *base = nullptr;
+        // +1 to skip |this|.
+        return reinterpret_cast<size_t>(&base->argv()[1]);
+    }
+    static size_t offsetOfActualArg(size_t arg) {
+        return offsetOfActualArgs() + arg * sizeof(Value);
+    }
+
+    Value thisv() {
+        return argv()[0];
+    }
+    Value *argv() {
+        return (Value *)(this + 1);
+    }
+    uintptr_t numActualArgs() const {
+        return numActualArgs_;
+    }
+
+    // Computes a reference to a slot, where a slot is a distance from the base
+    // frame pointer (as would be used for LStackSlot).
+    uintptr_t *slotRef(uint32_t slot) {
+        return (uintptr_t *)((uint8_t *)this - (slot * STACK_SLOT_SIZE));
+    }
+
+    static inline size_t Size() {
+        return sizeof(IonJSFrameLayout);
+    }
+};
+
+// this is the layout of the frame that is used when we enter Ion code from platform ABI code
+class IonEntryFrameLayout : public IonJSFrameLayout
+{
+  public:
+    static inline size_t Size() {
+        return sizeof(IonEntryFrameLayout);
+    }
+};
+
+class IonRectifierFrameLayout : public IonJSFrameLayout
+{
+  public:
+    static inline size_t Size() {
+        return sizeof(IonRectifierFrameLayout);
+    }
+};
+
+// The callee token is now dead.
+class IonUnwoundRectifierFrameLayout : public IonRectifierFrameLayout
+{
+  public:
+    static inline size_t Size() {
+        // It is not necessary to accout for an extra callee token here because
+        // sizeof(IonExitFrameLayout) == sizeof(IonRectifierFrameLayout) due to
+        // extra padding.
+        return sizeof(IonUnwoundRectifierFrameLayout);
+    }
+};
+
+// GC related data used to keep alive data surrounding the Exit frame.
+class IonExitFooterFrame
+{
+    const VMFunction *function_;
+    IonCode *ionCode_;
+
+  public:
+    static inline size_t Size() {
+        return sizeof(IonExitFooterFrame);
+    }
+    inline IonCode *ionCode() const {
+        return ionCode_;
+    }
+    inline IonCode **addressOfIonCode() {
+        return &ionCode_;
+    }
+    inline const VMFunction *function() const {
+        return function_;
+    }
+
+    // This should only be called for function()->outParam == Type_Handle
+    template <typename T>
+    T *outParam() {
+        return reinterpret_cast<T *>(reinterpret_cast<char *>(this) - sizeof(T));
+    }
+};
+
+class IonNativeExitFrameLayout;
+class IonOOLNativeExitFrameLayout;
+class IonOOLPropertyOpExitFrameLayout;
+class IonOOLProxyExitFrameLayout;
+class IonDOMExitFrameLayout;
+
+// this is the frame layout when we are exiting ion code, and about to enter platform ABI code
+class IonExitFrameLayout : public IonCommonFrameLayout
+{
+    inline uint8_t *top() {
+        return reinterpret_cast<uint8_t *>(this + 1);
+    }
+
+  public:
+    static inline size_t Size() {
+        return sizeof(IonExitFrameLayout);
+    }
+    static inline size_t SizeWithFooter() {
+        return Size() + IonExitFooterFrame::Size();
+    }
+
+    inline IonExitFooterFrame *footer() {
+        uint8_t *sp = reinterpret_cast<uint8_t *>(this);
+        return reinterpret_cast<IonExitFooterFrame *>(sp - IonExitFooterFrame::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() {
+        JS_ASSERT(footer()->ionCode() != nullptr);
+        return top();
+    }
+
+    inline bool isWrapperExit() {
+        return footer()->function() != nullptr;
+    }
+    inline bool isNativeExit() {
+        return footer()->ionCode() == nullptr;
+    }
+    inline bool isOOLNativeExit() {
+        return footer()->ionCode() == ION_FRAME_OOL_NATIVE;
+    }
+    inline bool isOOLPropertyOpExit() {
+        return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
+    }
+    inline bool isOOLProxyExit() {
+        return footer()->ionCode() == ION_FRAME_OOL_PROXY;
+    }
+    inline bool isDomExit() {
+        IonCode *code = footer()->ionCode();
+        return
+            code == ION_FRAME_DOMGETTER ||
+            code == ION_FRAME_DOMSETTER ||
+            code == ION_FRAME_DOMMETHOD;
+    }
+
+    inline IonNativeExitFrameLayout *nativeExit() {
+        // see CodeGenerator::visitCallNative
+        JS_ASSERT(isNativeExit());
+        return reinterpret_cast<IonNativeExitFrameLayout *>(footer());
+    }
+    inline IonOOLNativeExitFrameLayout *oolNativeExit() {
+        JS_ASSERT(isOOLNativeExit());
+        return reinterpret_cast<IonOOLNativeExitFrameLayout *>(footer());
+    }
+    inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
+        JS_ASSERT(isOOLPropertyOpExit());
+        return reinterpret_cast<IonOOLPropertyOpExitFrameLayout *>(footer());
+    }
+    inline IonOOLProxyExitFrameLayout *oolProxyExit() {
+        JS_ASSERT(isOOLProxyExit());
+        return reinterpret_cast<IonOOLProxyExitFrameLayout *>(footer());
+    }
+    inline IonDOMExitFrameLayout *DOMExit() {
+        JS_ASSERT(isDomExit());
+        return reinterpret_cast<IonDOMExitFrameLayout *>(footer());
+    }
+};
+
+// Cannot inherit implementa<tion since we need to extend the top of
+// IonExitFrameLayout.
+class IonNativeExitFrameLayout
+{
+  protected: // only to silence a clang warning about unused private fields
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+    uintptr_t argc_;
+
+    // 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 inline size_t Size() {
+        return sizeof(IonNativeExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonNativeExitFrameLayout, loCalleeResult_);
+    }
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&loCalleeResult_);
+    }
+    inline uintptr_t argc() const {
+        return argc_;
+    }
+};
+
+class IonOOLNativeExitFrameLayout
+{
+  protected: // only to silence a clang warning about unused private fields
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
 
-#if defined(JS_CPU_X86) || defined (JS_CPU_X64)
-# include "jit/shared/IonFrames-x86-shared.h"
-#elif defined (JS_CPU_ARM)
-# include "jit/arm/IonFrames-arm.h"
-#else
-# error "unsupported architecture"
-#endif
+    // pointer to root the stub's IonCode
+    IonCode *stubCode_;
+
+    uintptr_t argc_;
+
+    // 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_;
+
+    // Split Value for |this| and args above.
+    uint32_t loThis_;
+    uint32_t hiThis_;
+
+  public:
+    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_);
+    }
+
+    inline IonCode **stubCode() {
+        return &stubCode_;
+    }
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&loCalleeResult_);
+    }
+    inline Value *thisp() {
+        return reinterpret_cast<Value*>(&loThis_);
+    }
+    inline uintptr_t argc() const {
+        return argc_;
+    }
+};
+
+class IonOOLPropertyOpExitFrameLayout
+{
+  protected: // only to silence a clang warning about unused private fields
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+
+    // Object for HandleObject
+    JSObject *obj_;
+
+    // id for HandleId
+    jsid id_;
+
+    // space for MutableHandleValue result
+    // use two uint32_t so compiler doesn't align.
+    uint32_t vp0_;
+    uint32_t vp1_;
+
+    // pointer to root the stub's IonCode
+    IonCode *stubCode_;
+
+  public:
+    static inline size_t Size() {
+        return sizeof(IonOOLPropertyOpExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonOOLPropertyOpExitFrameLayout, vp0_);
+    }
+
+    inline IonCode **stubCode() {
+        return &stubCode_;
+    }
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&vp0_);
+    }
+    inline jsid *id() {
+        return &id_;
+    }
+    inline JSObject **obj() {
+        return &obj_;
+    }
+};
+
+// Proxy::get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,
+//            MutableHandleValue vp)
+// Proxy::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,
+//            bool strict, MutableHandleValue vp)
+class IonOOLProxyExitFrameLayout
+{
+  protected: // only to silence a clang warning about unused private fields
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+
+    // The proxy object.
+    JSObject *proxy_;
+
+    // Object for HandleObject
+    JSObject *receiver_;
+
+    // id for HandleId
+    jsid id_;
+
+    // space for MutableHandleValue result
+    // use two uint32_t so compiler doesn't align.
+    uint32_t vp0_;
+    uint32_t vp1_;
+
+    // pointer to root the stub's IonCode
+    IonCode *stubCode_;
+
+  public:
+    static inline size_t Size() {
+        return sizeof(IonOOLProxyExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonOOLProxyExitFrameLayout, vp0_);
+    }
+
+    inline IonCode **stubCode() {
+        return &stubCode_;
+    }
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&vp0_);
+    }
+    inline jsid *id() {
+        return &id_;
+    }
+    inline JSObject **receiver() {
+        return &receiver_;
+    }
+    inline JSObject **proxy() {
+        return &proxy_;
+    }
+};
 
-namespace js {
-namespace jit {
+class IonDOMExitFrameLayout
+{
+  protected: // only to silence a clang warning about unused private fields
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+    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 inline size_t Size() {
+        return sizeof(IonDOMExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonDOMExitFrameLayout, loCalleeResult_);
+    }
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&loCalleeResult_);
+    }
+    inline JSObject **thisObjAddress() {
+        return &thisObj;
+    }
+    inline bool isMethodFrame() {
+        return footer_.ionCode() == ION_FRAME_DOMMETHOD;
+    }
+};
+
+struct IonDOMMethodExitFrameLayoutTraits;
+
+class IonDOMMethodExitFrameLayout
+{
+  protected: // only to silence a clang warning about unused private fields
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+    // This must be the last thing pushed, so as to stay common with
+    // IonDOMExitFrameLayout.
+    JSObject *thisObj_;
+    Value *argv_;
+    uintptr_t argc_;
+
+    // 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 inline size_t Size() {
+        return sizeof(IonDOMMethodExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
+    }
+
+    inline Value *vp() {
+        // The code in visitCallDOMNative depends on this static assert holding
+        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
+                         (offsetof(IonDOMMethodExitFrameLayout, argc_) + sizeof(uintptr_t)));
+        return reinterpret_cast<Value*>(&loCalleeResult_);
+    }
+    inline JSObject **thisObjAddress() {
+        return &thisObj_;
+    }
+    inline uintptr_t argc() {
+        return argc_;
+    }
+};
+
+struct IonDOMMethodExitFrameLayoutTraits {
+    static const size_t offsetOfArgcFromArgv =
+        offsetof(IonDOMMethodExitFrameLayout, argc_) -
+        offsetof(IonDOMMethodExitFrameLayout, argv_);
+};
+
+class IonOsrFrameLayout : public IonJSFrameLayout
+{
+  public:
+    static inline size_t Size() {
+        return sizeof(IonOsrFrameLayout);
+    }
+};
+
+class ICStub;
+
+class IonBaselineStubFrameLayout : public IonCommonFrameLayout
+{
+  public:
+    static inline size_t Size() {
+        return sizeof(IonBaselineStubFrameLayout);
+    }
+
+    static inline int reverseOffsetOfStubPtr() {
+        return -int(sizeof(void *));
+    }
+    static inline int reverseOffsetOfSavedFramePtr() {
+        return -int(2 * sizeof(void *));
+    }
+
+    inline ICStub *maybeStubPtr() {
+        uint8_t *fp = reinterpret_cast<uint8_t *>(this);
+        return *reinterpret_cast<ICStub **>(fp + reverseOffsetOfStubPtr());
+    }
+};
+
+// An invalidation bailout stack is at the stack pointer for the callee frame.
+class InvalidationBailoutStack
+{
+    mozilla::Array<double, FloatRegisters::Total> fpregs_;
+    mozilla::Array<uintptr_t, Registers::Total> regs_;
+    IonScript   *ionScript_;
+    uint8_t       *osiPointReturnAddress_;
+
+  public:
+    uint8_t *sp() const {
+        return (uint8_t *) this + sizeof(InvalidationBailoutStack);
+    }
+    IonJSFrameLayout *fp() const;
+    MachineState machine() {
+        return MachineState::FromBailout(regs_, fpregs_);
+    }
+
+    IonScript *ionScript() const {
+        return ionScript_;
+    }
+    uint8_t *osiPointReturnAddress() const {
+        return osiPointReturnAddress_;
+    }
+
+    void checkInvariants() const;
+};
 
 void
 GetPcScript(JSContext *cx, JSScript **scriptRes, jsbytecode **pcRes);
 
 CalleeToken
 MarkCalleeToken(JSTracer *trc, CalleeToken token);
 
 } /* namespace jit */
deleted file mode 100644
--- a/js/src/jit/arm/IonFrames-arm.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "jit/Ion.h"
-#include "jit/IonFrames.h"
-
-using namespace js;
-using namespace js::jit;
-
-IonJSFrameLayout *
-InvalidationBailoutStack::fp() const
-{
-    return (IonJSFrameLayout *) (sp() + ionScript_->frameSize());
-}
-
-void
-InvalidationBailoutStack::checkInvariants() const
-{
-#ifdef DEBUG
-    IonJSFrameLayout *frame = fp();
-    CalleeToken token = frame->calleeToken();
-    JS_ASSERT(token);
-
-    uint8_t *rawBase = ionScript()->method()->raw();
-    uint8_t *rawLimit = rawBase + ionScript()->method()->instructionsSize();
-    uint8_t *osiPoint = osiPointReturnAddress();
-    JS_ASSERT(rawBase <= osiPoint && osiPoint <= rawLimit);
-#endif
-}
deleted file mode 100644
--- a/js/src/jit/arm/IonFrames-arm.h
+++ /dev/null
@@ -1,553 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef jit_arm_IonFrames_arm_h
-#define jit_arm_IonFrames_arm_h
-
-#include <stdint.h>
-
-#include "jit/shared/IonFrames-shared.h"
-
-namespace js {
-namespace jit {
-
-// Layout of the frame prefix. This assumes the stack architecture grows down.
-// If this is ever not the case, we'll have to refactor.
-class IonCommonFrameLayout
-{
-    uint8_t *returnAddress_;
-    uintptr_t descriptor_;
-
-    static const uintptr_t FrameTypeMask = (1 << FRAMETYPE_BITS) - 1;
-
-  public:
-    static size_t offsetOfDescriptor() {
-        return offsetof(IonCommonFrameLayout, descriptor_);
-    }
-    static size_t offsetOfReturnAddress() {
-        return offsetof(IonCommonFrameLayout, returnAddress_);
-    }
-    FrameType prevType() const {
-        return FrameType(descriptor_ & FrameTypeMask);
-    }
-    void changePrevType(FrameType type) {
-        descriptor_ &= ~FrameTypeMask;
-        descriptor_ |= type;
-    }
-    size_t prevFrameLocalSize() const {
-        return descriptor_ >> FRAMESIZE_SHIFT;
-    }
-    void setFrameDescriptor(size_t size, FrameType type) {
-        descriptor_ = (size << FRAMESIZE_SHIFT) | type;
-    }
-    uint8_t *returnAddress() const {
-        return returnAddress_;
-    }
-    void setReturnAddress(uint8_t *addr) {
-        returnAddress_ = addr;
-    }
-};
-
-class IonJSFrameLayout : public IonCommonFrameLayout
-{
-    CalleeToken calleeToken_;
-    uintptr_t numActualArgs_;
-
-  public:
-    CalleeToken calleeToken() const {
-        return calleeToken_;
-    }
-    void replaceCalleeToken(CalleeToken calleeToken) {
-        calleeToken_ = calleeToken;
-    }
-
-    static size_t offsetOfCalleeToken() {
-        return offsetof(IonJSFrameLayout, calleeToken_);
-    }
-    static size_t offsetOfNumActualArgs() {
-        return offsetof(IonJSFrameLayout, numActualArgs_);
-    }
-    static size_t offsetOfThis() {
-        IonJSFrameLayout *base = nullptr;
-        return reinterpret_cast<size_t>(&base->argv()[0]);
-    }
-    static size_t offsetOfActualArgs() {
-        IonJSFrameLayout *base = nullptr;
-        // +1 to skip |this|.
-        return reinterpret_cast<size_t>(&base->argv()[1]);
-    }
-    static size_t offsetOfActualArg(size_t arg) {
-        return offsetOfActualArgs() + arg * sizeof(Value);
-    }
-
-    Value thisv() {
-        return argv()[0];
-    }
-    Value *argv() {
-        return (Value *)(this + 1);
-    }
-    uintptr_t numActualArgs() const {
-        return numActualArgs_;
-    }
-
-    // Computes a reference to a slot, where a slot is a distance from the base
-    // frame pointer (as would be used for LStackSlot).
-    uintptr_t *slotRef(uint32_t slot) {
-        return (uintptr_t *)((uint8_t *)this - (slot * STACK_SLOT_SIZE));
-    }
-
-    static inline size_t Size() {
-        return sizeof(IonJSFrameLayout);
-    }
-};
-
-// this is the layout of the frame that is used when we enter Ion code from platform ABI code
-class IonEntryFrameLayout : public IonJSFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonEntryFrameLayout);
-    }
-};
-
-class IonRectifierFrameLayout : public IonJSFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonRectifierFrameLayout);
-    }
-};
-
-// The callee token is now dead.
-class IonUnwoundRectifierFrameLayout : public IonRectifierFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        // It is not necessary to accout for an extra callee token here because
-        // sizeof(IonExitFrameLayout) == sizeof(IonRectifierFrameLayout) due to
-        // extra padding.
-        return sizeof(IonUnwoundRectifierFrameLayout);
-    }
-};
-
-// GC related data used to keep alive data surrounding the Exit frame.
-class IonExitFooterFrame
-{
-    const VMFunction *function_;
-    IonCode *ionCode_;
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonExitFooterFrame);
-    }
-    inline IonCode *ionCode() const {
-        return ionCode_;
-    }
-    inline IonCode **addressOfIonCode() {
-        return &ionCode_;
-    }
-    inline const VMFunction *function() const {
-        return function_;
-    }
-
-    // This should only be called for function()->outParam == Type_Handle
-    template <typename T>
-    T *outParam() {
-        return reinterpret_cast<T *>(reinterpret_cast<char *>(this) - sizeof(T));
-    }
-};
-
-class IonNativeExitFrameLayout;
-class IonOOLNativeExitFrameLayout;
-class IonOOLPropertyOpExitFrameLayout;
-class IonOOLProxyExitFrameLayout;
-class IonDOMExitFrameLayout;
-
-// this is the frame layout when we are exiting ion code, and about to enter platform ABI code
-class IonExitFrameLayout : public IonCommonFrameLayout
-{
-    inline uint8_t *top() {
-        return reinterpret_cast<uint8_t *>(this + 1);
-    }
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonExitFrameLayout);
-    }
-    static inline size_t SizeWithFooter() {
-        return Size() + IonExitFooterFrame::Size();
-    }
-
-    inline IonExitFooterFrame *footer() {
-        uint8_t *sp = reinterpret_cast<uint8_t *>(this);
-        return reinterpret_cast<IonExitFooterFrame *>(sp - IonExitFooterFrame::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() {
-        JS_ASSERT(footer()->ionCode() != nullptr);
-        return top();
-    }
-
-    inline bool isWrapperExit() {
-        return footer()->function() != nullptr;
-    }
-    inline bool isNativeExit() {
-        return footer()->ionCode() == nullptr;
-    }
-    inline bool isOOLNativeExit() {
-        return footer()->ionCode() == ION_FRAME_OOL_NATIVE;
-    }
-    inline bool isOOLPropertyOpExit() {
-        return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
-    }
-    inline bool isOOLProxyExit() {
-        return footer()->ionCode() == ION_FRAME_OOL_PROXY;
-    }
-    inline bool isDomExit() {
-        IonCode *code = footer()->ionCode();
-        return
-            code == ION_FRAME_DOMGETTER ||
-            code == ION_FRAME_DOMSETTER ||
-            code == ION_FRAME_DOMMETHOD;
-    }
-
-    inline IonNativeExitFrameLayout *nativeExit() {
-        // see CodeGenerator::visitCallNative
-        JS_ASSERT(isNativeExit());
-        return reinterpret_cast<IonNativeExitFrameLayout *>(footer());
-    }
-    inline IonOOLNativeExitFrameLayout *oolNativeExit() {
-        JS_ASSERT(isOOLNativeExit());
-        return reinterpret_cast<IonOOLNativeExitFrameLayout *>(footer());
-    }
-    inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
-        JS_ASSERT(isOOLPropertyOpExit());
-        return reinterpret_cast<IonOOLPropertyOpExitFrameLayout *>(footer());
-    }
-    inline IonOOLProxyExitFrameLayout *oolProxyExit() {
-        JS_ASSERT(isOOLProxyExit());
-        return reinterpret_cast<IonOOLProxyExitFrameLayout *>(footer());
-    }
-    inline IonDOMExitFrameLayout *DOMExit() {
-        JS_ASSERT(isDomExit());
-        return reinterpret_cast<IonDOMExitFrameLayout *>(footer());
-    }
-};
-
-// Cannot inherit implementa<tion since we need to extend the top of
-// IonExitFrameLayout.
-class IonNativeExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-    uintptr_t argc_;
-
-    // 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 inline size_t Size() {
-        return sizeof(IonNativeExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonNativeExitFrameLayout, loCalleeResult_);
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline uintptr_t argc() const {
-        return argc_;
-    }
-};
-
-class IonOOLNativeExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-
-    // pointer to root the stub's IonCode
-    IonCode *stubCode_;
-
-    uintptr_t argc_;
-
-    // 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_;
-
-    // Split Value for |this| and args above.
-    uint32_t loThis_;
-    uint32_t hiThis_;
-
-  public:
-    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_);
-    }
-
-    inline IonCode **stubCode() {
-        return &stubCode_;
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline Value *thisp() {
-        return reinterpret_cast<Value*>(&loThis_);
-    }
-    inline uintptr_t argc() const {
-        return argc_;
-    }
-};
-
-class IonOOLPropertyOpExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-
-    // Object for HandleObject
-    JSObject *obj_;
-
-    // id for HandleId
-    jsid id_;
-
-    // space for MutableHandleValue result
-    // use two uint32_t so compiler doesn't align.
-    uint32_t vp0_;
-    uint32_t vp1_;
-
-    // pointer to root the stub's IonCode
-    IonCode *stubCode_;
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonOOLPropertyOpExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonOOLPropertyOpExitFrameLayout, vp0_);
-    }
-
-    inline IonCode **stubCode() {
-        return &stubCode_;
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&vp0_);
-    }
-    inline jsid *id() {
-        return &id_;
-    }
-    inline JSObject **obj() {
-        return &obj_;
-    }
-};
-
-// Proxy::get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,
-//            MutableHandleValue vp)
-// Proxy::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,
-//            bool strict, MutableHandleValue vp)
-class IonOOLProxyExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-
-    // The proxy object.
-    JSObject *proxy_;
-
-    // Object for HandleObject
-    JSObject *receiver_;
-
-    // id for HandleId
-    jsid id_;
-
-    // space for MutableHandleValue result
-    // use two uint32_t so compiler doesn't align.
-    uint32_t vp0_;
-    uint32_t vp1_;
-
-    // pointer to root the stub's IonCode
-    IonCode *stubCode_;
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonOOLProxyExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonOOLProxyExitFrameLayout, vp0_);
-    }
-
-    inline IonCode **stubCode() {
-        return &stubCode_;
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&vp0_);
-    }
-    inline jsid *id() {
-        return &id_;
-    }
-    inline JSObject **receiver() {
-        return &receiver_;
-    }
-    inline JSObject **proxy() {
-        return &proxy_;
-    }
-};
-
-class IonDOMExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-    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 inline size_t Size() {
-        return sizeof(IonDOMExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonDOMExitFrameLayout, loCalleeResult_);
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline JSObject **thisObjAddress() {
-        return &thisObj;
-    }
-    inline bool isMethodFrame() {
-        return footer_.ionCode() == ION_FRAME_DOMMETHOD;
-    }
-};
-
-struct IonDOMMethodExitFrameLayoutTraits;
-
-class IonDOMMethodExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-    // This must be the last thing pushed, so as to stay common with
-    // IonDOMExitFrameLayout.
-    JSObject *thisObj_;
-    Value *argv_;
-    uintptr_t argc_;
-
-    // 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 inline size_t Size() {
-        return sizeof(IonDOMMethodExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
-    }
-
-    inline Value *vp() {
-        // The code in visitCallDOMNative depends on this static assert holding
-        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
-                         (offsetof(IonDOMMethodExitFrameLayout, argc_) + sizeof(uintptr_t)));
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline JSObject **thisObjAddress() {
-        return &thisObj_;
-    }
-    inline uintptr_t argc() {
-        return argc_;
-    }
-};
-
-struct IonDOMMethodExitFrameLayoutTraits {
-    static const size_t offsetOfArgcFromArgv =
-        offsetof(IonDOMMethodExitFrameLayout, argc_) -
-        offsetof(IonDOMMethodExitFrameLayout, argv_);
-};
-
-class IonOsrFrameLayout : public IonJSFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonOsrFrameLayout);
-    }
-};
-
-class ICStub;
-
-class IonBaselineStubFrameLayout : public IonCommonFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonBaselineStubFrameLayout);
-    }
-
-    static inline int reverseOffsetOfStubPtr() {
-        return -int(sizeof(void *));
-    }
-    static inline int reverseOffsetOfSavedFramePtr() {
-        return -int(2 * sizeof(void *));
-    }
-
-    inline ICStub *maybeStubPtr() {
-        uint8_t *fp = reinterpret_cast<uint8_t *>(this);
-        return *reinterpret_cast<ICStub **>(fp + reverseOffsetOfStubPtr());
-    }
-};
-
-// An invalidation bailout stack is at the stack pointer for the callee frame.
-class InvalidationBailoutStack
-{
-    mozilla::Array<double, FloatRegisters::Total> fpregs_;
-    mozilla::Array<uintptr_t, Registers::Total> regs_;
-    IonScript   *ionScript_;
-    uint8_t       *osiPointReturnAddress_;
-
-  public:
-    uint8_t *sp() const {
-        return (uint8_t *) this + sizeof(InvalidationBailoutStack);
-    }
-    IonJSFrameLayout *fp() const;
-    MachineState machine() {
-        return MachineState::FromBailout(regs_, fpregs_);
-    }
-
-    IonScript *ionScript() const {
-        return ionScript_;
-    }
-    uint8_t *osiPointReturnAddress() const {
-        return osiPointReturnAddress_;
-    }
-
-    void checkInvariants() const;
-};
-
-} // namespace jit
-} // namespace js
-
-#endif /* jit_arm_IonFrames_arm_h */
deleted file mode 100644
--- a/js/src/jit/shared/IonFrames-shared.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef jit_shared_IonFrames_shared_h
-#define jit_shared_IonFrames_shared_h
-
-#define ION_FRAME_DOMGETTER ((IonCode *)0x1)
-#define ION_FRAME_DOMSETTER ((IonCode *)0x2)
-#define ION_FRAME_DOMMETHOD ((IonCode *)0x3)
-#define ION_FRAME_OOL_NATIVE        ((IonCode *)0x4)
-#define ION_FRAME_OOL_PROPERTY_OP   ((IonCode *)0x5)
-#define ION_FRAME_OOL_PROXY         ((IonCode *)0x6)
-
-#endif /* jit_shared_IonFrames_shared_h */
deleted file mode 100644
--- a/js/src/jit/shared/IonFrames-x86-shared.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "jit/IonFrames.h"
-
-using namespace js;
-using namespace js::jit;
-
-IonJSFrameLayout *
-InvalidationBailoutStack::fp() const
-{
-    return (IonJSFrameLayout *) (sp() + ionScript_->frameSize());
-}
-
-void
-InvalidationBailoutStack::checkInvariants() const
-{
-#ifdef DEBUG
-    IonJSFrameLayout *frame = fp();
-    CalleeToken token = frame->calleeToken();
-    JS_ASSERT(token);
-
-    uint8_t *rawBase = ionScript()->method()->raw();
-    uint8_t *rawLimit = rawBase + ionScript()->method()->instructionsSize();
-    uint8_t *osiPoint = osiPointReturnAddress();
-    JS_ASSERT(rawBase <= osiPoint && osiPoint <= rawLimit);
-#endif
-}
deleted file mode 100644
--- a/js/src/jit/shared/IonFrames-x86-shared.h
+++ /dev/null
@@ -1,553 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef jit_shared_IonFrames_x86_shared_h
-#define jit_shared_IonFrames_x86_shared_h
-
-#include <stdint.h>
-
-#include "jit/shared/IonFrames-shared.h"
-
-namespace js {
-namespace jit {
-
-// Layout of the frame prefix. This assumes the stack architecture grows down.
-// If this is ever not the case, we'll have to refactor.
-class IonCommonFrameLayout
-{
-    uint8_t *returnAddress_;
-    uintptr_t descriptor_;
-
-    static const uintptr_t FrameTypeMask = (1 << FRAMETYPE_BITS) - 1;
-
-  public:
-    static size_t offsetOfDescriptor() {
-        return offsetof(IonCommonFrameLayout, descriptor_);
-    }
-    static size_t offsetOfReturnAddress() {
-        return offsetof(IonCommonFrameLayout, returnAddress_);
-    }
-    FrameType prevType() const {
-        return FrameType(descriptor_ & FrameTypeMask);
-    }
-    void changePrevType(FrameType type) {
-        descriptor_ &= ~FrameTypeMask;
-        descriptor_ |= type;
-    }
-    size_t prevFrameLocalSize() const {
-        return descriptor_ >> FRAMESIZE_SHIFT;
-    }
-    void setFrameDescriptor(size_t size, FrameType type) {
-        descriptor_ = (size << FRAMESIZE_SHIFT) | type;
-    }
-    uint8_t *returnAddress() const {
-        return returnAddress_;
-    }
-    void setReturnAddress(uint8_t *addr) {
-        returnAddress_ = addr;
-    }
-};
-
-class IonJSFrameLayout : public IonCommonFrameLayout
-{
-    CalleeToken calleeToken_;
-    uintptr_t numActualArgs_;
-
-  public:
-    CalleeToken calleeToken() const {
-        return calleeToken_;
-    }
-    void replaceCalleeToken(CalleeToken calleeToken) {
-        calleeToken_ = calleeToken;
-    }
-
-    static size_t offsetOfCalleeToken() {
-        return offsetof(IonJSFrameLayout, calleeToken_);
-    }
-    static size_t offsetOfNumActualArgs() {
-        return offsetof(IonJSFrameLayout, numActualArgs_);
-    }
-    static size_t offsetOfThis() {
-        IonJSFrameLayout *base = nullptr;
-        return reinterpret_cast<size_t>(&base->argv()[0]);
-    }
-    static size_t offsetOfActualArgs() {
-        IonJSFrameLayout *base = nullptr;
-        // +1 to skip |this|.
-        return reinterpret_cast<size_t>(&base->argv()[1]);
-    }
-    static size_t offsetOfActualArg(size_t arg) {
-        return offsetOfActualArgs() + arg * sizeof(Value);
-    }
-
-    Value thisv() {
-        return argv()[0];
-    }
-    Value *argv() {
-        return (Value *)(this + 1);
-    }
-    uintptr_t numActualArgs() const {
-        return numActualArgs_;
-    }
-
-    // Computes a reference to a slot, where a slot is a distance from the base
-    // frame pointer (as would be used for LStackSlot).
-    uintptr_t *slotRef(uint32_t slot) {
-        return (uintptr_t *)((uint8_t *)this - (slot * STACK_SLOT_SIZE));
-    }
-
-    static inline size_t Size() {
-        return sizeof(IonJSFrameLayout);
-    }
-};
-
-// this is the layout of the frame that is used when we enter Ion code from platform ABI code
-class IonEntryFrameLayout : public IonJSFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonEntryFrameLayout);
-    }
-};
-
-class IonRectifierFrameLayout : public IonJSFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonRectifierFrameLayout);
-    }
-};
-
-// The callee token is now dead.
-class IonUnwoundRectifierFrameLayout : public IonRectifierFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        // It is not necessary to accout for an extra callee token here because
-        // sizeof(IonExitFrameLayout) == sizeof(IonRectifierFrameLayout) due to
-        // extra padding.
-        return sizeof(IonUnwoundRectifierFrameLayout);
-    }
-};
-
-// GC related data used to keep alive data surrounding the Exit frame.
-class IonExitFooterFrame
-{
-    const VMFunction *function_;
-    IonCode *ionCode_;
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonExitFooterFrame);
-    }
-    inline IonCode *ionCode() const {
-        return ionCode_;
-    }
-    inline IonCode **addressOfIonCode() {
-        return &ionCode_;
-    }
-    inline const VMFunction *function() const {
-        return function_;
-    }
-
-    // This should only be called for function()->outParam == Type_Handle
-    template <typename T>
-    T *outParam() {
-        return reinterpret_cast<T *>(reinterpret_cast<char *>(this) - sizeof(T));
-    }
-};
-
-class IonNativeExitFrameLayout;
-class IonOOLNativeExitFrameLayout;
-class IonOOLPropertyOpExitFrameLayout;
-class IonOOLProxyExitFrameLayout;
-class IonDOMExitFrameLayout;
-
-// this is the frame layout when we are exiting ion code, and about to enter platform ABI code
-class IonExitFrameLayout : public IonCommonFrameLayout
-{
-    inline uint8_t *top() {
-        return reinterpret_cast<uint8_t *>(this + 1);
-    }
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonExitFrameLayout);
-    }
-    static inline size_t SizeWithFooter() {
-        return Size() + IonExitFooterFrame::Size();
-    }
-
-    inline IonExitFooterFrame *footer() {
-        uint8_t *sp = reinterpret_cast<uint8_t *>(this);
-        return reinterpret_cast<IonExitFooterFrame *>(sp - IonExitFooterFrame::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() {
-        JS_ASSERT(footer()->ionCode() != nullptr);
-        return top();
-    }
-
-    inline bool isWrapperExit() {
-        return footer()->function() != nullptr;
-    }
-    inline bool isNativeExit() {
-        return footer()->ionCode() == nullptr;
-    }
-    inline bool isOOLNativeExit() {
-        return footer()->ionCode() == ION_FRAME_OOL_NATIVE;
-    }
-    inline bool isOOLPropertyOpExit() {
-        return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
-    }
-    inline bool isOOLProxyExit() {
-        return footer()->ionCode() == ION_FRAME_OOL_PROXY;
-    }
-    inline bool isDomExit() {
-        IonCode *code = footer()->ionCode();
-        return
-            code == ION_FRAME_DOMGETTER ||
-            code == ION_FRAME_DOMSETTER ||
-            code == ION_FRAME_DOMMETHOD;
-    }
-
-    inline IonNativeExitFrameLayout *nativeExit() {
-        // see CodeGenerator::visitCallNative
-        JS_ASSERT(isNativeExit());
-        return reinterpret_cast<IonNativeExitFrameLayout *>(footer());
-    }
-    inline IonOOLNativeExitFrameLayout *oolNativeExit() {
-        JS_ASSERT(isOOLNativeExit());
-        return reinterpret_cast<IonOOLNativeExitFrameLayout *>(footer());
-    }
-    inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
-        JS_ASSERT(isOOLPropertyOpExit());
-        return reinterpret_cast<IonOOLPropertyOpExitFrameLayout *>(footer());
-    }
-    inline IonOOLProxyExitFrameLayout *oolProxyExit() {
-        JS_ASSERT(isOOLProxyExit());
-        return reinterpret_cast<IonOOLProxyExitFrameLayout *>(footer());
-    }
-    inline IonDOMExitFrameLayout *DOMExit() {
-        JS_ASSERT(isDomExit());
-        return reinterpret_cast<IonDOMExitFrameLayout *>(footer());
-    }
-};
-
-// Cannot inherit implementa<tion since we need to extend the top of
-// IonExitFrameLayout.
-class IonNativeExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-    uintptr_t argc_;
-
-    // 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 inline size_t Size() {
-        return sizeof(IonNativeExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonNativeExitFrameLayout, loCalleeResult_);
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline uintptr_t argc() const {
-        return argc_;
-    }
-};
-
-class IonOOLNativeExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-
-    // pointer to root the stub's IonCode
-    IonCode *stubCode_;
-
-    uintptr_t argc_;
-
-    // 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_;
-
-    // Split Value for |this| and args above.
-    uint32_t loThis_;
-    uint32_t hiThis_;
-
-  public:
-    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_);
-    }
-
-    inline IonCode **stubCode() {
-        return &stubCode_;
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline Value *thisp() {
-        return reinterpret_cast<Value*>(&loThis_);
-    }
-    inline uintptr_t argc() const {
-        return argc_;
-    }
-};
-
-class IonOOLPropertyOpExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-
-    // Object for HandleObject
-    JSObject *obj_;
-
-    // id for HandleId
-    jsid id_;
-
-    // space for MutableHandleValue result
-    // use two uint32_t so compiler doesn't align.
-    uint32_t vp0_;
-    uint32_t vp1_;
-
-    // pointer to root the stub's IonCode
-    IonCode *stubCode_;
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonOOLPropertyOpExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonOOLPropertyOpExitFrameLayout, vp0_);
-    }
-
-    inline IonCode **stubCode() {
-        return &stubCode_;
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&vp0_);
-    }
-    inline jsid *id() {
-        return &id_;
-    }
-    inline JSObject **obj() {
-        return &obj_;
-    }
-};
-
-// Proxy::get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,
-//            MutableHandleValue vp)
-// Proxy::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,
-//            bool strict, MutableHandleValue vp)
-class IonOOLProxyExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-
-    // The proxy object.
-    JSObject *proxy_;
-
-    // Object for HandleObject
-    JSObject *receiver_;
-
-    // id for HandleId
-    jsid id_;
-
-    // space for MutableHandleValue result
-    // use two uint32_t so compiler doesn't align.
-    uint32_t vp0_;
-    uint32_t vp1_;
-
-    // pointer to root the stub's IonCode
-    IonCode *stubCode_;
-
-  public:
-    static inline size_t Size() {
-        return sizeof(IonOOLProxyExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonOOLProxyExitFrameLayout, vp0_);
-    }
-
-    inline IonCode **stubCode() {
-        return &stubCode_;
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&vp0_);
-    }
-    inline jsid *id() {
-        return &id_;
-    }
-    inline JSObject **receiver() {
-        return &receiver_;
-    }
-    inline JSObject **proxy() {
-        return &proxy_;
-    }
-};
-
-class IonDOMExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-    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 inline size_t Size() {
-        return sizeof(IonDOMExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonDOMExitFrameLayout, loCalleeResult_);
-    }
-    inline Value *vp() {
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline JSObject **thisObjAddress() {
-        return &thisObj;
-    }
-    inline bool isMethodFrame() {
-        return footer_.ionCode() == ION_FRAME_DOMMETHOD;
-    }
-};
-
-struct IonDOMMethodExitFrameLayoutTraits;
-
-class IonDOMMethodExitFrameLayout
-{
-  protected: // only to silence a clang warning about unused private fields
-    IonExitFooterFrame footer_;
-    IonExitFrameLayout exit_;
-    // This must be the last thing pushed, so as to stay common with
-    // IonDOMExitFrameLayout.
-    JSObject *thisObj_;
-    Value *argv_;
-    uintptr_t argc_;
-
-    // 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 inline size_t Size() {
-        return sizeof(IonDOMMethodExitFrameLayout);
-    }
-
-    static size_t offsetOfResult() {
-        return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
-    }
-
-    inline Value *vp() {
-        // The code in visitCallDOMNative depends on this static assert holding
-        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
-                         (offsetof(IonDOMMethodExitFrameLayout, argc_) + sizeof(uintptr_t)));
-        return reinterpret_cast<Value*>(&loCalleeResult_);
-    }
-    inline JSObject **thisObjAddress() {
-        return &thisObj_;
-    }
-    inline uintptr_t argc() {
-        return argc_;
-    }
-};
-
-struct IonDOMMethodExitFrameLayoutTraits {
-    static const size_t offsetOfArgcFromArgv =
-        offsetof(IonDOMMethodExitFrameLayout, argc_) -
-        offsetof(IonDOMMethodExitFrameLayout, argv_);
-};
-
-class IonOsrFrameLayout : public IonJSFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonOsrFrameLayout);
-    }
-};
-
-class ICStub;
-
-class IonBaselineStubFrameLayout : public IonCommonFrameLayout
-{
-  public:
-    static inline size_t Size() {
-        return sizeof(IonBaselineStubFrameLayout);
-    }
-
-    static inline int reverseOffsetOfStubPtr() {
-        return -int(sizeof(void *));
-    }
-    static inline int reverseOffsetOfSavedFramePtr() {
-        return -int(2 * sizeof(void *));
-    }
-
-    inline ICStub *maybeStubPtr() {
-        uint8_t *fp = reinterpret_cast<uint8_t *>(this);
-        return *reinterpret_cast<ICStub **>(fp + reverseOffsetOfStubPtr());
-    }
-};
-
-// An invalidation bailout stack is at the stack pointer for the callee frame.
-class InvalidationBailoutStack
-{
-    mozilla::Array<double, FloatRegisters::Total> fpregs_;
-    mozilla::Array<uintptr_t, Registers::Total> regs_;
-    IonScript   *ionScript_;
-    uint8_t       *osiPointReturnAddress_;
-
-  public:
-    uint8_t *sp() const {
-        return (uint8_t *) this + sizeof(InvalidationBailoutStack);
-    }
-    IonJSFrameLayout *fp() const;
-    MachineState machine() {
-        return MachineState::FromBailout(regs_, fpregs_);
-    }
-
-    IonScript *ionScript() const {
-        return ionScript_;
-    }
-    uint8_t *osiPointReturnAddress() const {
-        return osiPointReturnAddress_;
-    }
-
-    void checkInvariants() const;
-};
-
-} // namespace jit
-} // namespace js
-
-#endif /* jit_shared_IonFrames_x86_shared_h */
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -285,17 +285,16 @@ if CONFIG['ENABLE_ION']:
         'jit/VMFunctions.cpp',
     ]
     if CONFIG['TARGET_CPU'].find('86') != -1:
         UNIFIED_SOURCES += [
             'jit/shared/Assembler-x86-shared.cpp',
             'jit/shared/BaselineCompiler-x86-shared.cpp',
             'jit/shared/BaselineIC-x86-shared.cpp',
             'jit/shared/CodeGenerator-x86-shared.cpp',
-            'jit/shared/IonFrames-x86-shared.cpp',
             'jit/shared/Lowering-x86-shared.cpp',
             'jit/shared/MoveEmitter-x86-shared.cpp',
         ]
         if CONFIG['TARGET_CPU'] == 'x86_64':
             UNIFIED_SOURCES += [
                 'jit/x64/Assembler-x64.cpp',
                 'jit/x64/Bailouts-x64.cpp',
                 'jit/x64/BaselineCompiler-x64.cpp',
@@ -319,17 +318,16 @@ if CONFIG['ENABLE_ION']:
     elif CONFIG['TARGET_CPU'].find('arm') != -1:
         UNIFIED_SOURCES += [
             'jit/arm/Architecture-arm.cpp',
             'jit/arm/Assembler-arm.cpp',
             'jit/arm/Bailouts-arm.cpp',
             'jit/arm/BaselineCompiler-arm.cpp',
             'jit/arm/BaselineIC-arm.cpp',
             'jit/arm/CodeGenerator-arm.cpp',
-            'jit/arm/IonFrames-arm.cpp',
             'jit/arm/Lowering-arm.cpp',
             'jit/arm/MacroAssembler-arm.cpp',
             'jit/arm/MoveEmitter-arm.cpp',
             'jit/arm/Trampoline-arm.cpp',
         ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [