Bug 768126 - patch 1 - Add ION exit frame type for OOL calls to PropertyOp. (r=jandem)
authorKannan Vijayan <kvijayan@mozilla.com>
Fri, 28 Sep 2012 11:06:45 -0400
changeset 108605 4858ec60ad5f0bc6f6bd6a77a524fdcca4e4d97c
parent 108604 dacfa6d8c92ed5299b4be3b23a97dcfb1d258a33
child 108606 9386cf1dbde24e6de76374acc5a4cb50d124b8ce
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersjandem
bugs768126
milestone18.0a1
Bug 768126 - patch 1 - Add ION exit frame type for OOL calls to PropertyOp. (r=jandem)
js/src/ion/IonFrameIterator.h
js/src/ion/IonFrames.cpp
js/src/ion/arm/IonFrames-arm.h
js/src/ion/shared/IonFrames-shared.h
js/src/ion/shared/IonFrames-x86-shared.h
--- a/js/src/ion/IonFrameIterator.h
+++ b/js/src/ion/IonFrameIterator.h
@@ -109,16 +109,17 @@ class IonFrameIterator
     bool checkInvalidation(IonScript **ionScript) const;
     bool checkInvalidation() const;
 
     bool isScripted() const {
         return type_ == IonFrame_JS;
     }
     bool isNative() const;
     bool isOOLNativeGetter() const;
+    bool isOOLPropertyOp() const;
     bool isDOMExit() const;
     bool isEntry() const {
         return type_ == IonFrame_Entry;
     }
     bool isFunctionFrame() const;
 
     bool isConstructing() const;
 
--- a/js/src/ion/IonFrames.cpp
+++ b/js/src/ion/IonFrames.cpp
@@ -121,16 +121,24 @@ bool
 IonFrameIterator::isOOLNativeGetter() const
 {
     if (type_ != IonFrame_Exit)
         return false;
     return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER;
 }
 
 bool
+IonFrameIterator::isOOLPropertyOp() const
+{
+    if (type_ != IonFrame_Exit)
+        return false;
+    return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
+}
+
+bool
 IonFrameIterator::isDOMExit() const
 {
     if (type_ != IonFrame_Exit)
         return false;
     return exitFrame()->isDomExit();
 }
 
 bool
@@ -539,16 +547,24 @@ MarkIonExitFrame(JSTracer *trc, const Io
     }
 
     if (frame.isOOLNativeGetter()) {
         IonOOLNativeGetterExitFrameLayout *oolgetter = frame.exitFrame()->oolNativeGetterExit();
         gc::MarkValueRoot(trc, oolgetter->vp(), "ion-ool-getter-callee");
         gc::MarkValueRoot(trc, oolgetter->vp() + 1, "ion-ool-getter-this");
         return;
     }
+ 
+    if (frame.isOOLPropertyOp()) {
+        IonOOLPropertyOpExitFrameLayout *oolgetter = frame.exitFrame()->oolPropertyOpExit();
+        gc::MarkValueRoot(trc, oolgetter->vp(), "ion-ool-property-op-vp");
+        gc::MarkIdRoot(trc, oolgetter->id(), "ion-ool-property-op-id");
+        gc::MarkObjectRoot(trc, oolgetter->obj(), "ion-ool-property-op-obj");
+        return;
+    }
 
     if (frame.isDOMExit()) {
         IonDOMExitFrameLayout *dom = frame.exitFrame()->DOMExit();
         gc::MarkObjectRoot(trc, dom->thisObjAddress(), "ion-dom-args");
         if (dom->isSetterFrame()) {
             gc::MarkValueRoot(trc, dom->vp(), "ion-dom-args");
         } else if (dom->isMethodFrame()) {
             IonDOMMethodExitFrameLayout *method =
--- a/js/src/ion/arm/IonFrames-arm.h
+++ b/js/src/ion/arm/IonFrames-arm.h
@@ -152,16 +152,17 @@ class IonOsrFrameLayout : public IonJSFr
   public:
     static inline size_t Size() {
         return sizeof(IonOsrFrameLayout);
     }
 };
 
 class IonNativeExitFrameLayout;
 class IonOOLNativeGetterExitFrameLayout;
+class IonOOLPropertyOpExitFrameLayout;
 class IonDOMExitFrameLayout;
 
 // this is the frame layout when we are exiting ion code, and about to enter EABI code
 class IonExitFrameLayout : public IonCommonFrameLayout
 {
     inline uint8 *top() {
         return reinterpret_cast<uint8 *>(this + 1);
     }
@@ -191,16 +192,19 @@ class IonExitFrameLayout : public IonCom
         return footer()->function() != NULL;
     }
     inline bool isNativeExit() {
         return footer()->ionCode() == NULL;
     }
     inline bool isOOLNativeGetterExit() {
         return footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER;
     }
+    inline bool isOOLPropertyOpExit() {
+        return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
+    }
     inline bool isDomExit() {
         IonCode *code = footer()->ionCode();
         return
             code == ION_FRAME_DOMGETTER ||
             code == ION_FRAME_DOMSETTER ||
             code == ION_FRAME_DOMMETHOD;
     }
 
@@ -208,16 +212,20 @@ class IonExitFrameLayout : public IonCom
         // see CodeGenerator::visitCallNative
         JS_ASSERT(isNativeExit());
         return reinterpret_cast<IonNativeExitFrameLayout *>(footer());
     }
     inline IonOOLNativeGetterExitFrameLayout *oolNativeGetterExit() {
         JS_ASSERT(isOOLNativeGetterExit());
         return reinterpret_cast<IonOOLNativeGetterExitFrameLayout *>(footer());
     }
+    inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
+        JS_ASSERT(isOOLPropertyOpExit());
+        return reinterpret_cast<IonOOLPropertyOpExitFrameLayout *>(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.
@@ -273,16 +281,51 @@ class IonOOLNativeGetterExitFrameLayout
     inline Value *vp() {
         return reinterpret_cast<Value*>(&loCalleeResult_);
     }
     inline uintptr_t argc() const {
         return 0;
     }
 };
 
+class IonOOLPropertyOpExitFrameLayout
+{
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+
+    // Object for JSHandleObject
+    JSObject *obj_;
+
+    // id for JSHandleId
+    jsid id_;
+
+    // space for JSMutableHandleValue result
+    // use two uint32_t so compiler doesn't align.
+    uint32_t vp0_;
+    uint32_t vp1_;
+
+  public:
+    static inline size_t Size() {
+        return sizeof(IonOOLPropertyOpExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonOOLPropertyOpExitFrameLayout, vp0_);
+    }
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&vp0_);
+    }
+    inline jsid *id() {
+        return &id_;
+    }
+    inline JSObject **obj() {
+        return &obj_;
+    }
+};
+
 class IonDOMExitFrameLayout
 {
     IonExitFooterFrame footer_;
     IonExitFrameLayout exit_;
     JSObject *thisObj;
 
     // We need to split the Value in 2 field of 32 bits, otherwise the C++
     // compiler may add some padding between the fields.
--- a/js/src/ion/shared/IonFrames-shared.h
+++ b/js/src/ion/shared/IonFrames-shared.h
@@ -40,10 +40,11 @@
  * ***** END LICENSE BLOCK ***** */
 #ifndef jsion_ionframes_shared_h__
 #define jsion_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_GETTER ((IonCode *)0x4)
+#define ION_FRAME_OOL_PROPERTY_OP   ((IonCode *)0x5)
 
 #endif
--- a/js/src/ion/shared/IonFrames-x86-shared.h
+++ b/js/src/ion/shared/IonFrames-x86-shared.h
@@ -137,16 +137,17 @@ class IonExitFooterFrame
     // This should only be called for function()->outParam == Type_Handle
     Value *outVp() {
         return reinterpret_cast<Value *>(reinterpret_cast<char *>(this) - sizeof(Value));
     }
 };
 
 class IonNativeExitFrameLayout;
 class IonOOLNativeGetterExitFrameLayout;
+class IonOOLPropertyOpExitFrameLayout;
 class IonDOMExitFrameLayout;
 
 class IonExitFrameLayout : public IonCommonFrameLayout
 {
     inline uint8 *top() {
         return reinterpret_cast<uint8 *>(this + 1);
     }
 
@@ -172,34 +173,43 @@ class IonExitFrameLayout : public IonCom
     }
 
     inline bool isWrapperExit() {
         return footer()->function() != NULL;
     }
     inline bool isNativeExit() {
         return footer()->ionCode() == NULL;
     }
+    inline bool isOOLNativeGetterExit() {
+        return footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER;
+    }
+    inline bool isOOLPropertyOpExit() {
+        return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
+    }
     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 IonOOLNativeGetterExitFrameLayout *oolNativeGetterExit() {
-        // see CodeGenerator::visitCallNative
-        JS_ASSERT(footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER);
+        JS_ASSERT(isOOLNativeGetterExit());
         return reinterpret_cast<IonOOLNativeGetterExitFrameLayout *>(footer());
     }
+    inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
+        JS_ASSERT(isOOLPropertyOpExit());
+        return reinterpret_cast<IonOOLPropertyOpExitFrameLayout *>(footer());
+    }
     inline IonDOMExitFrameLayout *DOMExit() {
         JS_ASSERT(isDomExit());
         return reinterpret_cast<IonDOMExitFrameLayout *>(footer());
     }
 };
 
 class IonNativeExitFrameLayout
 {
@@ -255,16 +265,52 @@ class IonOOLNativeGetterExitFrameLayout
     inline Value *vp() {
         return reinterpret_cast<Value*>(&loCalleeResult_);
     }
     inline uintptr_t argc() const {
         return 0;
     }
 };
 
+class IonOOLPropertyOpExitFrameLayout
+{
+    IonExitFooterFrame footer_;
+    IonExitFrameLayout exit_;
+
+    // Object for JSHandleObject
+    JSObject *obj_;
+
+    // id for JSHandleId
+    jsid id_;
+
+    // space for JSMutableHandleValue result
+    // use two uint32_t so compiler doesn't align.
+    uint32_t vp0_;
+    uint32_t vp1_;
+
+  public:
+    static inline size_t Size() {
+        return sizeof(IonOOLPropertyOpExitFrameLayout);
+    }
+
+    static size_t offsetOfResult() {
+        return offsetof(IonOOLPropertyOpExitFrameLayout, vp0_);
+    }
+
+    inline Value *vp() {
+        return reinterpret_cast<Value*>(&vp0_);
+    }
+    inline jsid *id() {
+        return &id_;
+    }
+    inline JSObject **obj() {
+        return &obj_;
+    }
+};
+
 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 in 2 field of 32 bits, otherwise the C++