Bug 1449051 - Further minifications to JS::Value's internal structure. r=jandem
authorJeff Walden <jwalden@mit.edu>
Tue, 27 Mar 2018 17:13:08 -0700
changeset 410756 92d1872f4a238b7f1bdfb0cc92432928bf619af0
parent 410755 6e15ed6f59148d126a692135793663b1e04a3b04
child 410757 a05e09c6fde3780a474a7e8964da03ca4decd05b
push id33736
push usershindli@mozilla.com
push dateFri, 30 Mar 2018 09:56:41 +0000
treeherdermozilla-central@b7fa9d95150e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1449051
milestone61.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 1449051 - Further minifications to JS::Value's internal structure. r=jandem
js/public/Value.h
js/src/jit/JitFrames.cpp
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -807,38 +807,26 @@ class MOZ_NON_PARAM alignas(8) Value
 #endif
         data.asBits = bitsFromTagAndPayload(JSVAL_TAG_PRIVATE_GCTHING, PayloadType(cell));
     }
 
     bool isPrivateGCThing() const {
         return toTag() == JSVAL_TAG_PRIVATE_GCTHING;
     }
 
-    const uintptr_t* payloadUIntPtr() const {
-#if defined(JS_NUNBOX32)
-        return &data.s.payload.uintptr;
-#elif defined(JS_PUNBOX64)
-        return &data.asUIntPtr;
-#endif
-    }
-
 #if !defined(_MSC_VER) && !defined(__sparc)
   // Value must be POD so that MSVC will pass it by value and not in memory
   // (bug 689101); the same is true for SPARC as well (bug 737344).  More
   // precisely, we don't want Value return values compiled as out params.
   private:
 #endif
 
     union layout {
         uint64_t asBits;
         double asDouble;
-        void* asPtr;
-#if defined(JS_PUNBOX64)
-        uintptr_t asUIntPtr;
-#endif // defined(JS_PUNBOX64)
 
 #if defined(JS_PUNBOX64) && !defined(_WIN64)
         /* MSVC does not pack these correctly :-( */
         struct {
 #  if MOZ_LITTLE_ENDIAN
             uint64_t   payload47 : 47;
             JSValueTag tag : 17;
 #  else
@@ -867,17 +855,16 @@ class MOZ_NON_PARAM alignas(8) Value
                 uint32_t       u32;
                 uint32_t       boo;     // Don't use |bool| -- it must be four bytes.
                 JSString*      str;
                 JS::Symbol*    sym;
                 JSObject*      obj;
                 js::gc::Cell*  cell;
                 void*          ptr;
                 JSWhyMagic     why;
-                uintptr_t      uintptr;
             } payload;
 #  if MOZ_LITTLE_ENDIAN
             JSValueTag tag;
 #  endif // MOZ_LITTLE_ENDIAN
 #endif // defined(JS_PUNBOX64)
         } s;
 
         layout() : asBits(JSVAL_RAW64_UNDEFINED) {}
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -926,17 +926,17 @@ TraceIonJSFrame(JSTracer* trc, const JSJ
         JSValueTag tag = JSValueTag(ReadAllocation(frame, &type));
         uintptr_t rawPayload = ReadAllocation(frame, &payload);
 
         Value v = Value::fromTagAndPayload(tag, rawPayload);
         TraceRoot(trc, &v, "ion-torn-value");
 
         if (v != Value::fromTagAndPayload(tag, rawPayload)) {
             // GC moved the value, replace the stored payload.
-            rawPayload = *v.payloadUIntPtr();
+            rawPayload = v.toNunboxPayload();
             WriteAllocation(frame, &payload, rawPayload);
         }
     }
 #endif
 }
 
 static void
 TraceBailoutFrame(JSTracer* trc, const JSJitFrameIter& frame)