Bug 1773778 - Part 3: Remove deprecated PreBarrieredValue typedef r=tcampbell
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 14 Jun 2022 12:30:08 +0000 (2022-06-14)
changeset 620840 7c481f5d479035a99f2a4b27b8fdfa21c58641a7
parent 620839 e3c016c6d10c1961a33fa0af19b77880436ad51b
child 620841 de60b0087d84be9d604a4989d40f9af55db8e586
push id39850
push userctuns@mozilla.com
push dateTue, 14 Jun 2022 21:37:29 +0000 (2022-06-14)
treeherdermozilla-central@43f3eb2819cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1773778
milestone103.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 1773778 - Part 3: Remove deprecated PreBarrieredValue typedef r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D149113
js/src/builtin/MapObject.cpp
js/src/builtin/MapObject.h
js/src/gc/Barrier.h
js/src/gdb/tests/test-Root.cpp
js/src/jit/IonScript.h
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -36,17 +36,17 @@
 
 using namespace js;
 
 using mozilla::IsNaN;
 using mozilla::NumberEqualsInt32;
 
 /*** HashableValue **********************************************************/
 
-static PreBarrieredValue NormalizeDoubleValue(double d) {
+static PreBarriered<Value> NormalizeDoubleValue(double d) {
   int32_t i;
   if (NumberEqualsInt32(d, &i)) {
     // Normalize int32_t-valued doubles to int32_t for faster hashing and
     // testing. Note: we use NumberEqualsInt32 here instead of NumberIsInt32
     // because we want -0 and 0 to be normalized to the same thing.
     return Int32Value(i);
   }
 
@@ -133,18 +133,18 @@ static HashNumber HashValue(const Value&
   return mozilla::HashGeneric(v.asRawBits());
 }
 
 HashNumber HashableValue::hash(const mozilla::HashCodeScrambler& hcs) const {
   return HashValue(value, hcs);
 }
 
 #ifdef ENABLE_RECORD_TUPLE
-inline bool SameExtendedPrimitiveType(const PreBarrieredValue& a,
-                                      const PreBarrieredValue& b) {
+inline bool SameExtendedPrimitiveType(const PreBarriered<Value>& a,
+                                      const PreBarriered<Value>& b) {
   return a.toExtendedPrimitive().getClass() ==
          b.toExtendedPrimitive().getClass();
 }
 #endif
 
 bool HashableValue::operator==(const HashableValue& other) const {
   // Two HashableValues are equal if they have equal bits.
   bool b = (value.asRawBits() == other.value.asRawBits());
--- a/js/src/builtin/MapObject.h
+++ b/js/src/builtin/MapObject.h
@@ -24,17 +24,17 @@ namespace js {
  * all values to be converted to hashable form before being used as a key
  * in a Map or Set object.
  *
  * All values except ropes are hashable as-is.
  */
 class HashableValue {
   // This is used for map and set keys. We use OrderedHashTableRef to update all
   // nursery keys on minor GC, so a post barrier is not required here.
-  PreBarrieredValue value;
+  PreBarriered<Value> value;
 
  public:
   struct Hasher {
     using Lookup = HashableValue;
     static HashNumber hash(const Lookup& v,
                            const mozilla::HashCodeScrambler& hcs) {
       return v.hash(hcs);
     }
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -1236,18 +1236,16 @@ namespace js {
 
 class DebugEnvironmentProxy;
 class PropertyName;
 
 namespace jit {
 class JitCode;
 }  // namespace jit
 
-using PreBarrieredValue = PreBarriered<Value>;
-
 using GCPtrAtom = GCPtr<JSAtom*>;
 using GCPtrFunction = GCPtr<JSFunction*>;
 using GCPtrLinearString = GCPtr<JSLinearString*>;
 using GCPtrObject = GCPtr<JSObject*>;
 using GCPtrValue = GCPtr<Value>;
 
 using ImmutablePropertyNamePtr = ImmutableTenuredPtr<PropertyName*>;
 using ImmutableSymbolPtr = ImmutableTenuredPtr<JS::Symbol*>;
--- a/js/src/gdb/tests/test-Root.cpp
+++ b/js/src/gdb/tests/test-Root.cpp
@@ -3,16 +3,18 @@
 #include "jsapi.h"
 
 #include "gc/Barrier.h"
 #include "js/Array.h"  // JS::NewArrayObject
 #include "js/GlobalObject.h"
 #include "js/ValueArray.h"
 #include "vm/JSFunction.h"
 
+using namespace js;
+
 FRAGMENT(Root, null) {
   JS::Rooted<JSObject*> null(cx, nullptr);
 
   breakpoint();
 
   use(null);
 }
 
@@ -39,24 +41,24 @@ FRAGMENT(Root, HeapSlot) {
   breakpoint();
 
   use(plinth);
   use(array);
 }
 
 FRAGMENT(Root, barriers) {
   JSObject* obj = JS_NewPlainObject(cx);
-  js::PreBarriered<JSObject*> prebarriered(obj);
-  js::GCPtrObject heapptr(obj);
-  js::HeapPtr<JSObject*> relocatable(obj);
+  PreBarriered<JSObject*> prebarriered(obj);
+  GCPtrObject heapptr(obj);
+  HeapPtr<JSObject*> relocatable(obj);
 
   JS::Value val = JS::ObjectValue(*obj);
-  js::PreBarrieredValue prebarrieredValue(JS::ObjectValue(*obj));
-  js::GCPtrValue heapValue(JS::ObjectValue(*obj));
-  js::HeapPtr<JS::Value> relocatableValue(JS::ObjectValue(*obj));
+  PreBarriered<JS::Value> prebarrieredValue(JS::ObjectValue(*obj));
+  GCPtrValue heapValue(JS::ObjectValue(*obj));
+  HeapPtr<JS::Value> relocatableValue(JS::ObjectValue(*obj));
 
   breakpoint();
 
   use(prebarriered);
   use(heapptr);
   use(relocatable);
   use(val);
   use(prebarrieredValue);
--- a/js/src/jit/IonScript.h
+++ b/js/src/jit/IonScript.h
@@ -9,17 +9,17 @@
 
 #include "mozilla/MemoryReporting.h"  // MallocSizeOf
 
 #include <stddef.h>  // size_t
 #include <stdint.h>  // uint8_t, uint32_t
 
 #include "jstypes.h"
 
-#include "gc/Barrier.h"          // HeapPtr{JitCode,Object}, PreBarrieredValue
+#include "gc/Barrier.h"          // HeapPtr{JitCode,Object}
 #include "jit/IonTypes.h"        // IonCompilationId
 #include "jit/JitCode.h"         // JitCode
 #include "jit/JitOptions.h"      // JitOptions
 #include "js/TypeDecls.h"        // jsbytecode
 #include "util/TrailingArray.h"  // TrailingArray
 #include "vm/TraceLogging.h"     // TraceLoggerEvent
 
 namespace js {
@@ -36,17 +36,17 @@ class OsiIndex;
 class IonIC;
 
 // An IonScript attaches Ion-generated information to a JSScript. The header
 // structure is followed by several arrays of data. These trailing arrays have a
 // layout based on offsets (bytes from 'this') stored in the IonScript header.
 //
 //    <IonScript itself>
 //    --
-//    PreBarrieredValue[]   constantTable()
+//    PreBarriered<Value>[] constantTable()
 //    uint8_t[]             runtimeData()
 //    OsiIndex[]            osiIndex()
 //    SafepointIndex[]      safepointIndex()
 //    uint32_t[]            icIndex()
 //    --
 //    uint8_t[]             safepoints()
 //    uint8_t[]             snapshots()
 //    uint8_t[]             snapshotsRVATable()
@@ -157,24 +157,24 @@ class alignas(8) IonScript final : publi
   // Hardcode size of incomplete types. These are verified in Ion.cpp.
   static constexpr size_t SizeOf_OsiIndex = 2 * sizeof(uint32_t);
   static constexpr size_t SizeOf_SafepointIndex = 2 * sizeof(uint32_t);
 
  public:
   //
   // Table of constants referenced in snapshots. (JS::Value alignment)
   //
-  PreBarrieredValue* constants() {
+  PreBarriered<Value>* constants() {
     // Nursery constants are manually barriered in CodeGenerator::link() so a
     // post barrier is not required..
-    return offsetToPointer<PreBarrieredValue>(constantTableOffset());
+    return offsetToPointer<PreBarriered<Value>>(constantTableOffset());
   }
   size_t numConstants() const {
-    return numElements<PreBarrieredValue>(constantTableOffset(),
-                                          runtimeDataOffset());
+    return numElements<PreBarriered<Value>>(constantTableOffset(),
+                                            runtimeDataOffset());
   }
 
   //
   // IonIC data structures. (uint64_t alignment)
   //
   uint8_t* runtimeData() {
     return offsetToPointer<uint8_t>(runtimeDataOffset());
   }
@@ -357,17 +357,17 @@ class alignas(8) IonScript final : publi
   }
   [[nodiscard]] bool addTraceLoggerEvent(TraceLoggerEvent& event) {
     MOZ_ASSERT(event.hasTextId());
     return traceLoggerEvents_.append(std::move(event));
   }
   size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
     return mallocSizeOf(this);
   }
-  PreBarrieredValue& getConstant(size_t index) {
+  PreBarriered<Value>& getConstant(size_t index) {
     MOZ_ASSERT(index < numConstants());
     return constants()[index];
   }
   uint32_t localSlotsSize() const { return localSlotsSize_; }
   uint32_t argumentSlotsSize() const { return argumentSlotsSize_; }
   uint32_t frameSize() const { return frameSize_; }
   const SafepointIndex* getSafepointIndex(uint32_t disp) const;
   const SafepointIndex* getSafepointIndex(uint8_t* retAddr) const {