Bug 877281 bustage fix. Deal with the fact that Value has 8-byte alignment. r=jandem
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 07 Jun 2013 23:40:35 -0400
changeset 134440 39a59be2a4cc43ed9b658dcfd1187ebb0c312600
parent 134439 efe5d05176dc955e9eba349f5c3d0c7c08c195f9
child 134441 697190293f4e1d4692a42055696ba11534b31476
push id29213
push userbzbarsky@mozilla.com
push dateSat, 08 Jun 2013 03:42:34 +0000
treeherdermozilla-inbound@39a59be2a4cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs877281
milestone24.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 877281 bustage fix. Deal with the fact that Value has 8-byte alignment. r=jandem
js/src/ion/arm/IonFrames-arm.h
js/src/ion/shared/IonFrames-x86-shared.h
--- a/js/src/ion/arm/IonFrames-arm.h
+++ b/js/src/ion/arm/IonFrames-arm.h
@@ -433,17 +433,17 @@ class IonOOLProxyGetExitFrameLayout
 };
 
 class IonDOMExitFrameLayout
 {
     IonExitFooterFrame footer_;
     IonExitFrameLayout exit_;
     JSObject *thisObj;
 
-    // We need to split the Value in 2 field of 32 bits, otherwise the C++
+    // We need to split the Value in 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);
     }
@@ -467,35 +467,38 @@ class IonDOMMethodExitFrameLayout
     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_;
 
-    Value CalleeResult_;
+    // We need to split the Value in 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(IonDOMMethodExitFrameLayout);
     }
 
     static size_t offsetOfResult() {
-        return offsetof(IonDOMMethodExitFrameLayout, CalleeResult_);
+        return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
     }
     static size_t offsetOfArgcFromArgv() {
         return offsetof(IonDOMMethodExitFrameLayout, argc_) -
             offsetof(IonDOMMethodExitFrameLayout, argv_);
     }
     inline Value *vp() {
         // The code in visitCallDOMNative depends on this static assert holding
-        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, CalleeResult_) ==
+        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
                          (offsetof(IonDOMMethodExitFrameLayout, argc_) + sizeof(uintptr_t)));
-        return &CalleeResult_;
+        return reinterpret_cast<Value*>(&loCalleeResult_);
     }
     inline JSObject **thisObjAddress() {
         return &thisObj_;
     }
     inline uintptr_t argc() {
         return argc_;
     }
 };
--- a/js/src/ion/shared/IonFrames-x86-shared.h
+++ b/js/src/ion/shared/IonFrames-x86-shared.h
@@ -398,17 +398,17 @@ class IonOOLProxyGetExitFrameLayout
 
 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++
+    // We need to split the Value in 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);
     }
@@ -433,35 +433,38 @@ class IonDOMMethodExitFrameLayout
     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_;
 
-    Value CalleeResult_;
+    // 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(IonDOMMethodExitFrameLayout);
     }
 
     static size_t offsetOfResult() {
-        return offsetof(IonDOMMethodExitFrameLayout, CalleeResult_);
+        return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
     }
     static size_t offsetOfArgcFromArgv() {
         return offsetof(IonDOMMethodExitFrameLayout, argc_) -
             offsetof(IonDOMMethodExitFrameLayout, argv_);
     }
 
     inline Value *vp() {
-        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, CalleeResult_) ==
+        JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
                          (offsetof(IonDOMMethodExitFrameLayout, argc_) + sizeof(uintptr_t)));
-        return &CalleeResult_;
+        return reinterpret_cast<Value*>(&loCalleeResult_);
     }
     inline JSObject **thisObjAddress() {
         return &thisObj_;
     }
     inline uintptr_t argc() {
         return argc_;
     }
 };