diff --git a/js/src/asmjs/AsmJSModule.h b/js/src/asmjs/AsmJSModule.h index ed573143296..a1cff5cd65e 100644 --- a/js/src/asmjs/AsmJSModule.h +++ b/js/src/asmjs/AsmJSModule.h @@ -851,7 +851,7 @@ class AsmJSModule uint8_t * interruptExit_; uint8_t * outOfBoundsExit_; StaticLinkData staticLinkData_; - RelocatablePtrArrayBufferObjectMaybeShared maybeHeap_; + HeapPtrArrayBufferObjectMaybeShared maybeHeap_; AsmJSModule ** prevLinked_; AsmJSModule * nextLinked_; bool dynamicallyLinked_; diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index 1b2308eb915..617926b30ed 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -1199,7 +1199,7 @@ MapObject::set(JSContext* cx, HandleObject obj, HandleValue k, HandleValue v) if (!key.setValue(cx, k)) return false; - RelocatableValue rval(v); + HeapValue rval(v); if (!map->put(key, rval)) { ReportOutOfMemory(cx); return false; @@ -1294,7 +1294,7 @@ MapObject::construct(JSContext* cx, unsigned argc, Value* vp) if (!hkey.setValue(cx, key)) return false; - RelocatableValue rval(val); + HeapValue rval(val); if (!map->put(hkey, rval)) { ReportOutOfMemory(cx); return false; @@ -1451,7 +1451,7 @@ MapObject::set_impl(JSContext* cx, CallArgs args) ValueMap& map = extract(args); ARG0_KEY(cx, args, key); - RelocatableValue rval(args.get(1)); + HeapValue rval(args.get(1)); if (!map.put(key, rval)) { ReportOutOfMemory(cx); return false; @@ -1472,14 +1472,14 @@ bool MapObject::delete_impl(JSContext* cx, CallArgs args) { // MapObject::mark does not mark deleted entries. Incremental GC therefore - // requires that no RelocatableValue objects pointing to heap values be - // left alive in the ValueMap. + // requires that no HeapValue objects pointing to heap values be left alive + // in the ValueMap. // // OrderedHashMap::remove() doesn't destroy the removed entry. It merely // calls OrderedHashMap::MapOps::makeEmpty. But that is sufficient, because // makeEmpty clears the value by doing e->value = Value(), and in the case - // of a ValueMap, Value() means RelocatableValue(), which is the same as - // RelocatableValue(UndefinedValue()). + // of a ValueMap, Value() means HeapValue(), which is the same as + // HeapValue(UndefinedValue()). MOZ_ASSERT(MapObject::is(args.thisv())); ValueMap& map = extract(args); diff --git a/js/src/builtin/MapObject.h b/js/src/builtin/MapObject.h index abf1b6ffe42..2e96d23d46d 100644 --- a/js/src/builtin/MapObject.h +++ b/js/src/builtin/MapObject.h @@ -77,7 +77,7 @@ template class OrderedHashSet; typedef OrderedHashMap ValueMap; diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 9a135784eab..c4cd8e2f42c 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -133,15 +133,13 @@ * the init naming idiom in many places to signify that a field is being * assigned for the first time. * - * This file implements four classes, illustrated here: + * This file implements three classes, illustrated here: * - * BarrieredBase abstract base class which provides common operations - * | | | - * | | PreBarriered provides pre-barriers only - * | | - * | HeapPtr provides pre- and post-barriers - * | - * RelocatablePtr provides pre- and post-barriers and is relocatable + * BarrieredBase abstract base class which provides common operations + * | | + * | PreBarriered provides pre-barriers only + * | + * HeapPtr provides pre- and post-barriers * * The implementation of the barrier logic is implemented on T::writeBarrier.*, * via: @@ -154,7 +152,7 @@ * -> InternalGCMethods::preBarrier * -> T::writeBarrierPre * - * HeapPtr::post and RelocatablePtr::post + * HeapPtr::post * -> InternalGCMethods::postBarrier * -> T::writeBarrierPost * -> InternalGCMethods::postBarrier @@ -348,10 +346,10 @@ class BarrieredBaseMixins : public ValueOperations class PreBarriered : public BarrieredBase @@ -449,13 +447,6 @@ class HeapPtr : public BarrieredBase } }; -/* - * This name is kept so that complete conversion to HeapPtr can be done - * incrementally. - */ -template -using RelocatablePtr = HeapPtr; - /* * This is a hack for RegExpStatics::updateFromMatch. It allows us to do two * barriers with only one branch to check if we're in an incremental GC. @@ -463,8 +454,8 @@ using RelocatablePtr = HeapPtr; template static inline void BarrieredSetPair(Zone* zone, - RelocatablePtr& v1, T1* val1, - RelocatablePtr& v2, T2* val2) + HeapPtr& v1, T1* val1, + HeapPtr& v2, T2* val2) { if (T1::needWriteBarrierPre(zone)) { v1.pre(); @@ -615,20 +606,6 @@ typedef PreBarriered PreBarrieredJitCode; typedef PreBarriered PreBarrieredString; typedef PreBarriered PreBarrieredAtom; -typedef RelocatablePtr RelocatablePtrObject; -typedef RelocatablePtr RelocatablePtrFunction; -typedef RelocatablePtr RelocatablePtrPlainObject; -typedef RelocatablePtr RelocatablePtrScript; -typedef RelocatablePtr RelocatablePtrNativeObject; -typedef RelocatablePtr RelocatablePtrNestedScopeObject; -typedef RelocatablePtr RelocatablePtrShape; -typedef RelocatablePtr RelocatablePtrObjectGroup; -typedef RelocatablePtr RelocatablePtrJitCode; -typedef RelocatablePtr RelocatablePtrLinearString; -typedef RelocatablePtr RelocatablePtrString; -typedef RelocatablePtr RelocatablePtrAtom; -typedef RelocatablePtr RelocatablePtrArrayBufferObjectMaybeShared; - typedef HeapPtr HeapPtrNativeObject; typedef HeapPtr HeapPtrArrayObject; typedef HeapPtr HeapPtrArrayBufferObjectMaybeShared; @@ -649,11 +626,9 @@ typedef HeapPtr HeapPtrJitCode; typedef HeapPtr HeapPtrObjectGroup; typedef PreBarriered PreBarrieredValue; -typedef RelocatablePtr RelocatableValue; typedef HeapPtr HeapValue; typedef PreBarriered PreBarrieredId; -typedef RelocatablePtr RelocatableId; typedef HeapPtr HeapId; typedef ImmutableTenuredPtr ImmutablePropertyNamePtr; @@ -676,7 +651,7 @@ typedef ReadBarriered ReadBarrieredValue; // A pre- and post-barriered Value that is specialized to be aware that it // resides in a slots or elements vector. This allows it to be relocated in -// memory, but with substantially less overhead than a RelocatablePtr. +// memory, but with substantially less overhead than a HeapPtr. class HeapSlot : public BarrieredBase { public: diff --git a/js/src/gdb/tests/test-Root.cpp b/js/src/gdb/tests/test-Root.cpp index d877418587d..f5561039a6f 100644 --- a/js/src/gdb/tests/test-Root.cpp +++ b/js/src/gdb/tests/test-Root.cpp @@ -41,21 +41,17 @@ FRAGMENT(Root, barriers) { JSObject* obj = JS_NewPlainObject(cx); js::PreBarriered prebarriered(obj); js::HeapPtr heapptr(obj); - js::RelocatablePtr relocatable(obj); JS::Value val = JS::ObjectValue(*obj); js::PreBarrieredValue prebarrieredValue(JS::ObjectValue(*obj)); js::HeapValue heapValue(JS::ObjectValue(*obj)); - js::RelocatableValue relocatableValue(JS::ObjectValue(*obj)); breakpoint(); (void) prebarriered; (void) heapptr; - (void) relocatable; (void) val; (void) prebarrieredValue; (void) heapValue; - (void) relocatableValue; } diff --git a/js/src/jit/BaselineJIT.h b/js/src/jit/BaselineJIT.h index 8bb3a97cf56..9199e0b7f9f 100644 --- a/js/src/jit/BaselineJIT.h +++ b/js/src/jit/BaselineJIT.h @@ -119,11 +119,11 @@ struct BaselineScript private: // Code pointer containing the actual method. - RelocatablePtrJitCode method_; + HeapPtrJitCode method_; // For heavyweight scripts, template objects to use for the call object and // decl env object (linked via the call object's enclosing scope). - RelocatablePtrObject templateScope_; + HeapPtrObject templateScope_; // Allocated space for fallback stubs. FallbackICStubSpace fallbackStubSpace_; diff --git a/js/src/jit/JitFrameIterator.h b/js/src/jit/JitFrameIterator.h index 1358c5687ad..35b4e049080 100644 --- a/js/src/jit/JitFrameIterator.h +++ b/js/src/jit/JitFrameIterator.h @@ -316,7 +316,7 @@ class JitProfilingFrameIterator class RInstructionResults { // Vector of results of recover instructions. - typedef mozilla::Vector Values; + typedef mozilla::Vector Values; mozilla::UniquePtr > results_; // The frame pointer is used as a key to check if the current frame already @@ -341,7 +341,7 @@ class RInstructionResults JitFrameLayout* frame() const; - RelocatableValue& operator[](size_t index); + HeapValue& operator[](size_t index); void trace(JSTracer* trc); }; diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp index b96be72e4ec..6f6f591091f 100644 --- a/js/src/jit/JitFrames.cpp +++ b/js/src/jit/JitFrames.cpp @@ -1745,7 +1745,7 @@ RInstructionResults::frame() const return fp_; } -RelocatableValue& +HeapValue& RInstructionResults::operator [](size_t index) { return (*results_)[index]; diff --git a/js/src/jsapi-tests/testGCStoreBufferRemoval.cpp b/js/src/jsapi-tests/testGCStoreBufferRemoval.cpp index 5d0412884f2..6d866b3d03e 100644 --- a/js/src/jsapi-tests/testGCStoreBufferRemoval.cpp +++ b/js/src/jsapi-tests/testGCStoreBufferRemoval.cpp @@ -32,54 +32,54 @@ BEGIN_TEST(testGCStoreBufferRemoval) // Hide the horrors herein from the static rooting analysis. AutoIgnoreRootingHazards ignore; - // Test removal of store buffer entries added by RelocatablePtr. + // Test removal of store buffer entries added by HeapPtr. { JSObject* badObject = reinterpret_cast(1); JSObject* punnedPtr = nullptr; - RelocatablePtrObject* relocPtr = - reinterpret_cast(&punnedPtr); - new (relocPtr) RelocatablePtrObject; + HeapPtrObject* relocPtr = + reinterpret_cast(&punnedPtr); + new (relocPtr) HeapPtrObject; *relocPtr = NurseryObject(); - relocPtr->~RelocatablePtrObject(); + relocPtr->~HeapPtrObject(); punnedPtr = badObject; JS_GC(cx->runtime()); - new (relocPtr) RelocatablePtrObject; + new (relocPtr) HeapPtrObject; *relocPtr = NurseryObject(); *relocPtr = tenuredObject; - relocPtr->~RelocatablePtrObject(); + relocPtr->~HeapPtrObject(); punnedPtr = badObject; JS_GC(cx->runtime()); - new (relocPtr) RelocatablePtrObject; + new (relocPtr) HeapPtrObject; *relocPtr = NurseryObject(); *relocPtr = nullptr; - relocPtr->~RelocatablePtrObject(); + relocPtr->~HeapPtrObject(); punnedPtr = badObject; JS_GC(cx->runtime()); } - // Test removal of store buffer entries added by RelocatableValue. + // Test removal of store buffer entries added by HeapValue. { Value punnedValue; - RelocatableValue* relocValue = reinterpret_cast(&punnedValue); - new (relocValue) RelocatableValue; + HeapValue* relocValue = reinterpret_cast(&punnedValue); + new (relocValue) HeapValue; *relocValue = ObjectValue(*NurseryObject()); - relocValue->~RelocatableValue(); + relocValue->~HeapValue(); punnedValue = ObjectValueCrashOnTouch(); JS_GC(cx->runtime()); - new (relocValue) RelocatableValue; + new (relocValue) HeapValue; *relocValue = ObjectValue(*NurseryObject()); *relocValue = ObjectValue(*tenuredObject); - relocValue->~RelocatableValue(); + relocValue->~HeapValue(); punnedValue = ObjectValueCrashOnTouch(); JS_GC(cx->runtime()); - new (relocValue) RelocatableValue; + new (relocValue) HeapValue; *relocValue = ObjectValue(*NurseryObject()); *relocValue = NullValue(); - relocValue->~RelocatableValue(); + relocValue->~HeapValue(); punnedValue = ObjectValueCrashOnTouch(); JS_GC(cx->runtime()); } diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 7e2ddacf7f6..1e28d57d541 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -201,7 +201,7 @@ class Bindings friend class BindingIter; friend class AliasedFormalIter; - RelocatablePtrShape callObjShape_; + HeapPtrShape callObjShape_; uintptr_t bindingArrayAndFlag_; uint16_t numArgs_; uint16_t numBlockScoped_; diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 46d14f9fdec..6f613ce24b8 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -2486,7 +2486,7 @@ Debugger::trace(JSTracer* trc) * frames.) */ for (FrameMap::Range r = frames.all(); !r.empty(); r.popFront()) { - RelocatablePtrNativeObject& frameobj = r.front().value(); + HeapPtrNativeObject& frameobj = r.front().value(); MOZ_ASSERT(MaybeForwarded(frameobj.get())->getPrivate()); TraceEdge(trc, &frameobj, "live Debugger.Frame"); } diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index 93c0ccd5c54..7345746471e 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -64,11 +64,11 @@ typedef HashSet -class DebuggerWeakMap : private WeakMap, RelocatablePtrObject> +class DebuggerWeakMap : private WeakMap, HeapPtrObject> { private: typedef PreBarriered Key; - typedef RelocatablePtrObject Value; + typedef HeapPtrObject Value; typedef HashMap static AllocationSite* create(JSContext* cx, HandleObject frame, double when, HandleObject obj); - RelocatablePtrObject frame; + HeapPtrObject frame; double when; const char* className; - RelocatablePtrAtom ctorName; + HeapPtrAtom ctorName; }; typedef mozilla::LinkedList AllocationSiteList; @@ -362,7 +362,7 @@ class Debugger : private mozilla::LinkedListElement * has to be different. */ typedef HashMap, RuntimeAllocPolicy> FrameMap; FrameMap frames; diff --git a/js/src/vm/DebuggerMemory.cpp b/js/src/vm/DebuggerMemory.cpp index 69923b9d263..91771af6eac 100644 --- a/js/src/vm/DebuggerMemory.cpp +++ b/js/src/vm/DebuggerMemory.cpp @@ -218,9 +218,9 @@ DebuggerMemory::drainAllocationsLog(JSContext* cx, unsigned argc, Value* vp) result->setDenseElement(i, ObjectValue(*obj)); - // Pop the front queue entry, and delete it immediately, so that - // the GC sees the AllocationSite's RelocatablePtr barriers run - // atomically with the change to the graph (the queue link). + // Pop the front queue entry, and delete it immediately, so that the GC + // sees the AllocationSite's HeapPtr barriers run atomically with the + // change to the graph (the queue link). MOZ_ALWAYS_TRUE(dbg->allocationsLog.popFirst() == allocSite); js_delete(allocSite); } diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h index 3c8ce26ce5c..99050463e14 100644 --- a/js/src/vm/RegExpObject.h +++ b/js/src/vm/RegExpObject.h @@ -120,7 +120,7 @@ class RegExpShared struct RegExpCompilation { - RelocatablePtrJitCode jitCode; + HeapPtrJitCode jitCode; uint8_t* byteCode; RegExpCompilation() : byteCode(nullptr) {} @@ -132,7 +132,7 @@ class RegExpShared }; /* Source to the RegExp, for lazy compilation. */ - RelocatablePtrAtom source; + HeapPtrAtom source; RegExpFlag flags; size_t parenCount; diff --git a/js/src/vm/RegExpStatics.h b/js/src/vm/RegExpStatics.h index 1b268bd9fd4..7813a8c6ac2 100644 --- a/js/src/vm/RegExpStatics.h +++ b/js/src/vm/RegExpStatics.h @@ -21,19 +21,19 @@ class RegExpStatics { /* The latest RegExp output, set after execution. */ VectorMatchPairs matches; - RelocatablePtrLinearString matchesInput; + HeapPtrLinearString matchesInput; /* * The previous RegExp input, used to resolve lazy state. * A raw RegExpShared cannot be stored because it may be in * a different compartment via evalcx(). */ - RelocatablePtrAtom lazySource; + HeapPtrAtom lazySource; RegExpFlag lazyFlags; size_t lazyIndex; /* The latest RegExp input, set before execution. */ - RelocatablePtrString pendingInput; + HeapPtrString pendingInput; RegExpFlag flags; /* diff --git a/js/src/vm/ScopeObject.h b/js/src/vm/ScopeObject.h index 9a74dd4004d..59c62a66faa 100644 --- a/js/src/vm/ScopeObject.h +++ b/js/src/vm/ScopeObject.h @@ -829,7 +829,7 @@ class LiveScopeVal friend class MissingScopeKey; AbstractFramePtr frame_; - RelocatablePtrObject staticScope_; + HeapPtrObject staticScope_; void sweep(); static void staticAsserts(); diff --git a/js/src/vm/TypeInference.h b/js/src/vm/TypeInference.h index feaae7154b2..ff157d2c705 100644 --- a/js/src/vm/TypeInference.h +++ b/js/src/vm/TypeInference.h @@ -804,7 +804,7 @@ class PreliminaryObjectArray class PreliminaryObjectArrayWithTemplate : public PreliminaryObjectArray { - RelocatablePtrShape shape_; + HeapPtrShape shape_; public: explicit PreliminaryObjectArrayWithTemplate(Shape* shape) @@ -881,7 +881,7 @@ class TypeNewScript private: // Scripted function which this information was computed for. - RelocatablePtrFunction function_; + HeapPtrFunction function_; // Any preliminary objects with the type. The analyses are not performed // until this array is cleared. @@ -893,7 +893,7 @@ class TypeNewScript // allocation kind to use. This is null if the new objects have an unboxed // layout, in which case the UnboxedLayout provides the initial structure // of the object. - RelocatablePtrPlainObject templateObject_; + HeapPtrPlainObject templateObject_; // Order in which definite properties become initialized. We need this in // case the definite properties are invalidated (such as by adding a setter @@ -910,11 +910,11 @@ class TypeNewScript // shape contains all such additional properties (plus the definite // properties). When an object of this group acquires this shape, it is // fully initialized and its group can be changed to initializedGroup. - RelocatablePtrShape initializedShape_; + HeapPtrShape initializedShape_; // Group with definite properties set for all properties found by // both the definite and acquired properties analyses. - RelocatablePtrObjectGroup initializedGroup_; + HeapPtrObjectGroup initializedGroup_; public: TypeNewScript() { mozilla::PodZero(this); } diff --git a/js/src/vm/WeakMapObject.h b/js/src/vm/WeakMapObject.h index 18a8be353f1..d250b226b9a 100644 --- a/js/src/vm/WeakMapObject.h +++ b/js/src/vm/WeakMapObject.h @@ -12,11 +12,11 @@ namespace js { -class ObjectValueMap : public WeakMap +class ObjectValueMap : public WeakMap { public: ObjectValueMap(JSContext* cx, JSObject* obj) - : WeakMap(cx, obj) {} + : WeakMap(cx, obj) {} virtual bool findZoneEdges(); };