Bug 1149352 - Part 8: Move Object marking to TraceEdge; r=jonco

This commit is contained in:
Terrence Cole 2015-03-30 16:08:06 -07:00
parent 0c906c7f3f
commit 1ca6faa3e8
42 changed files with 175 additions and 223 deletions

View File

@ -134,7 +134,7 @@ AsmJSModule::trace(JSTracer* trc)
globals_[i].trace(trc);
for (unsigned i = 0; i < exits_.length(); i++) {
if (exitIndexToGlobalDatum(i).fun)
MarkObject(trc, &exitIndexToGlobalDatum(i).fun, "asm.js imported function");
TraceEdge(trc, &exitIndexToGlobalDatum(i).fun, "asm.js imported function");
}
for (unsigned i = 0; i < exports_.length(); i++)
exports_[i].trace(trc);
@ -155,7 +155,7 @@ AsmJSModule::trace(JSTracer* trc)
if (bufferArgumentName_)
TraceManuallyBarrieredEdge(trc, &bufferArgumentName_, "asm.js buffer argument name");
if (maybeHeap_)
gc::MarkObject(trc, &maybeHeap_, "asm.js heap");
TraceEdge(trc, &maybeHeap_, "asm.js heap");
}
void

View File

@ -1641,7 +1641,7 @@ OutlineTypedObject::obj_trace(JSTracer* trc, JSObject* object)
// Mark the owner, watching in case it is moved by the tracer.
JSObject* oldOwner = typedObj.owner_;
gc::MarkObjectUnbarriered(trc, &typedObj.owner_, "typed object owner");
TraceManuallyBarrieredEdge(trc, &typedObj.owner_, "typed object owner");
JSObject* owner = typedObj.owner_;
uint8_t* oldData = typedObj.outOfLineTypedMem();
@ -2946,7 +2946,7 @@ MemoryTracingVisitor::visitReference(ReferenceTypeDescr& descr, uint8_t* mem)
{
HeapPtrObject* objectPtr = reinterpret_cast<js::HeapPtrObject*>(mem);
if (*objectPtr)
gc::MarkObject(trace_, objectPtr, "reference-obj");
TraceEdge(trace_, objectPtr, "reference-obj");
return;
}

View File

@ -1128,7 +1128,7 @@ ObjectBox::trace(JSTracer* trc)
{
ObjectBox* box = this;
while (box) {
MarkObjectRoot(trc, &box->object, "parser.object");
TraceRoot(trc, &box->object, "parser.object");
if (box->isFunctionBox())
box->asFunctionBox()->bindings.trace(trc);
box = box->traceLink;

View File

@ -292,13 +292,6 @@ SetMaybeAliveFlag(JSObject* thing)
thing->compartment()->maybeAlive = true;
}
template<>
void
SetMaybeAliveFlag(NativeObject* thing)
{
thing->compartment()->maybeAlive = true;
}
template<>
void
SetMaybeAliveFlag(JSScript* thing)
@ -342,6 +335,7 @@ FOR_EACH_GC_LAYOUT(NAMES)
D(PlainObject*) \
D(SavedFrame*) \
D(ScopeObject*) \
D(ScriptSourceObject*) \
D(SharedArrayBufferObject*) \
D(SharedTypedArrayObject*) \
D(JSScript*) \
@ -1094,24 +1088,6 @@ Update##base##IfRelocated(JSRuntime* rt, type** thingp)
return UpdateIfRelocated<type>(rt, thingp); \
}
DeclMarkerImpl(Object, NativeObject)
DeclMarkerImpl(Object, ArrayObject)
DeclMarkerImpl(Object, ArgumentsObject)
DeclMarkerImpl(Object, ArrayBufferObject)
DeclMarkerImpl(Object, ArrayBufferObjectMaybeShared)
DeclMarkerImpl(Object, ArrayBufferViewObject)
DeclMarkerImpl(Object, DebugScopeObject)
DeclMarkerImpl(Object, GlobalObject)
DeclMarkerImpl(Object, JSObject)
DeclMarkerImpl(Object, JSFunction)
DeclMarkerImpl(Object, NestedScopeObject)
DeclMarkerImpl(Object, PlainObject)
DeclMarkerImpl(Object, SavedFrame)
DeclMarkerImpl(Object, ScopeObject)
DeclMarkerImpl(Object, SharedArrayBufferObject)
DeclMarkerImpl(Object, SharedTypedArrayObject)
} /* namespace gc */
} /* namespace js */
@ -1357,7 +1333,7 @@ BaseShape::markChildren(JSTracer* trc)
JSObject* global = compartment()->unsafeUnbarrieredMaybeGlobal();
if (global)
MarkObjectUnbarriered(trc, &global, "global");
TraceManuallyBarrieredEdge(trc, &global, "global");
}
static void
@ -1558,7 +1534,7 @@ gc::MarkCycleCollectorChildren(JSTracer* trc, Shape* shape)
*/
JSObject* global = shape->compartment()->unsafeUnbarrieredMaybeGlobal();
MOZ_ASSERT(global);
MarkObjectUnbarriered(trc, &global, "global");
TraceManuallyBarrieredEdge(trc, &global, "global");
do {
MOZ_ASSERT(global == shape->compartment()->unsafeUnbarrieredMaybeGlobal());
@ -1570,13 +1546,13 @@ gc::MarkCycleCollectorChildren(JSTracer* trc, Shape* shape)
if (shape->hasGetterObject()) {
JSObject* tmp = shape->getterObject();
MarkObjectUnbarriered(trc, &tmp, "getter");
TraceManuallyBarrieredEdge(trc, &tmp, "getter");
MOZ_ASSERT(tmp == shape->getterObject());
}
if (shape->hasSetterObject()) {
JSObject* tmp = shape->setterObject();
MarkObjectUnbarriered(trc, &tmp, "setter");
TraceManuallyBarrieredEdge(trc, &tmp, "setter");
MOZ_ASSERT(tmp == shape->setterObject());
}
@ -1630,7 +1606,7 @@ gc::MarkChildren(JSTracer* trc, ObjectGroup* group)
}
if (group->proto().isObject())
MarkObject(trc, &group->protoRaw(), "group_proto");
TraceEdge(trc, &group->protoRaw(), "group_proto");
if (group->newScript())
group->newScript()->trace(trc);
@ -1647,12 +1623,12 @@ gc::MarkChildren(JSTracer* trc, ObjectGroup* group)
}
if (JSObject* descr = group->maybeTypeDescr()) {
MarkObjectUnbarriered(trc, &descr, "group_type_descr");
TraceManuallyBarrieredEdge(trc, &descr, "group_type_descr");
group->setTypeDescr(&descr->as<TypeDescr>());
}
if (JSObject* fun = group->maybeInterpretedFunction()) {
MarkObjectUnbarriered(trc, &fun, "group_function");
TraceManuallyBarrieredEdge(trc, &fun, "group_function");
group->setInterpretedFunction(&fun->as<JSFunction>());
}
}

View File

@ -142,24 +142,6 @@ bool Is##base##AboutToBeFinalized(type** thingp);
bool Is##base##AboutToBeFinalized(BarrieredBase<type*>* thingp); \
type* Update##base##IfRelocated(JSRuntime* rt, BarrieredBase<type*>* thingp); \
type* Update##base##IfRelocated(JSRuntime* rt, type** thingp);
DeclMarker(Object, NativeObject)
DeclMarker(Object, ArrayObject)
DeclMarker(Object, ArgumentsObject)
DeclMarker(Object, ArrayBufferObject)
DeclMarker(Object, ArrayBufferObjectMaybeShared)
DeclMarker(Object, ArrayBufferViewObject)
DeclMarker(Object, DebugScopeObject)
DeclMarker(Object, GlobalObject)
DeclMarker(Object, JSObject)
DeclMarker(Object, JSFunction)
DeclMarker(Object, NestedScopeObject)
DeclMarker(Object, PlainObject)
DeclMarker(Object, SavedFrame)
DeclMarker(Object, ScopeObject)
DeclMarker(Object, SharedArrayBufferObject)
DeclMarker(Object, SharedTypedArrayObject)
#undef DeclMarker
void

View File

@ -94,7 +94,7 @@ template<class T>
static void
MarkExactStackRootsAcrossTypes(T context, JSTracer* trc)
{
MarkExactStackRootList<JSObject*, MarkObjectRoot>(trc, context, "exact-object");
MarkExactStackRootList<JSObject*, TraceRoot>(trc, context, "exact-object");
MarkExactStackRootList<Shape*, TraceRoot>(trc, context, "exact-shape");
MarkExactStackRootList<BaseShape*, TraceRoot>(trc, context, "exact-baseshape");
MarkExactStackRootList<ObjectGroup*, TraceRoot>(
@ -179,13 +179,13 @@ AutoGCRooter::trace(JSTracer* trc)
case OBJVECTOR: {
AutoObjectVector::VectorImpl& vector = static_cast<AutoObjectVector*>(this)->vector;
MarkObjectRootRange(trc, vector.length(), vector.begin(), "js::AutoObjectVector.vector");
TraceRootRange(trc, vector.length(), vector.begin(), "js::AutoObjectVector.vector");
return;
}
case FUNVECTOR: {
AutoFunctionVector::VectorImpl& vector = static_cast<AutoFunctionVector*>(this)->vector;
MarkObjectRootRange(trc, vector.length(), vector.begin(), "js::AutoFunctionVector.vector");
TraceRootRange(trc, vector.length(), vector.begin(), "js::AutoFunctionVector.vector");
return;
}
@ -220,10 +220,10 @@ AutoGCRooter::trace(JSTracer* trc)
case OBJOBJHASHMAP: {
AutoObjectObjectHashMap::HashMapImpl& map = static_cast<AutoObjectObjectHashMap*>(this)->map;
for (AutoObjectObjectHashMap::Enum e(map); !e.empty(); e.popFront()) {
MarkObjectRoot(trc, &e.front().value(), "AutoObjectObjectHashMap value");
TraceRoot(trc, &e.front().value(), "AutoObjectObjectHashMap value");
trc->setTracingLocation((void*)&e.front().key());
JSObject* key = e.front().key();
MarkObjectRoot(trc, &key, "AutoObjectObjectHashMap key");
TraceRoot(trc, &key, "AutoObjectObjectHashMap key");
if (key != e.front().key())
e.rekeyFront(key);
}
@ -235,7 +235,7 @@ AutoGCRooter::trace(JSTracer* trc)
AutoObjectUnsigned32HashMap::HashMapImpl& map = self->map;
for (AutoObjectUnsigned32HashMap::Enum e(map); !e.empty(); e.popFront()) {
JSObject* key = e.front().key();
MarkObjectRoot(trc, &key, "AutoObjectUnsignedHashMap key");
TraceRoot(trc, &key, "AutoObjectUnsignedHashMap key");
if (key != e.front().key())
e.rekeyFront(key);
}
@ -247,7 +247,7 @@ AutoGCRooter::trace(JSTracer* trc)
AutoObjectHashSet::HashSetImpl& set = self->set;
for (AutoObjectHashSet::Enum e(set); !e.empty(); e.popFront()) {
JSObject* obj = e.front();
MarkObjectRoot(trc, &obj, "AutoObjectHashSet value");
TraceRoot(trc, &obj, "AutoObjectHashSet value");
if (obj != e.front())
e.rekeyFront(obj);
}
@ -335,26 +335,26 @@ StackShape::trace(JSTracer* trc)
TraceRoot(trc, (jsid*) &propid, "StackShape id");
if ((attrs & JSPROP_GETTER) && rawGetter)
MarkObjectRoot(trc, (JSObject**)&rawGetter, "StackShape getter");
TraceRoot(trc, (JSObject**)&rawGetter, "StackShape getter");
if ((attrs & JSPROP_SETTER) && rawSetter)
MarkObjectRoot(trc, (JSObject**)&rawSetter, "StackShape setter");
TraceRoot(trc, (JSObject**)&rawSetter, "StackShape setter");
}
void
JSPropertyDescriptor::trace(JSTracer* trc)
{
if (obj)
MarkObjectRoot(trc, &obj, "Descriptor::obj");
TraceRoot(trc, &obj, "Descriptor::obj");
TraceRoot(trc, &value, "Descriptor::value");
if ((attrs & JSPROP_GETTER) && getter) {
JSObject* tmp = JS_FUNC_TO_DATA_PTR(JSObject*, getter);
MarkObjectRoot(trc, &tmp, "Descriptor::get");
TraceRoot(trc, &tmp, "Descriptor::get");
getter = JS_DATA_TO_FUNC_PTR(JSGetterOp, tmp);
}
if ((attrs & JSPROP_SETTER) && setter) {
JSObject* tmp = JS_FUNC_TO_DATA_PTR(JSObject*, setter);
MarkObjectRoot(trc, &tmp, "Descriptor::set");
TraceRoot(trc, &tmp, "Descriptor::set");
setter = JS_DATA_TO_FUNC_PTR(JSSetterOp, tmp);
}
}
@ -369,22 +369,20 @@ struct PersistentRootedMarker
typedef mozilla::LinkedList<Element> List;
typedef void (*MarkFunc)(JSTracer* trc, T* ref, const char* name);
template <MarkFunc Mark>
static void
markChainIfNotNull(JSTracer* trc, List& list, const char* name)
{
for (Element* r = list.getFirst(); r; r = r->getNext()) {
if (r->get())
Mark(trc, r->address(), name);
TraceRoot(trc, r->address(), name);
}
}
template <MarkFunc Mark>
static void
markChain(JSTracer* trc, List& list, const char* name)
{
for (Element* r = list.getFirst(); r; r = r->getNext())
Mark(trc, r->address(), name);
TraceRoot(trc, r->address(), name);
}
};
}
@ -396,20 +394,20 @@ js::gc::MarkPersistentRootedChains(JSTracer* trc)
JSRuntime* rt = trc->runtime();
// Mark the PersistentRooted chains of types that may be null.
PersistentRootedMarker<JSFunction*>::markChainIfNotNull<MarkObjectRoot>(
trc, rt->functionPersistentRooteds, "PersistentRooted<JSFunction*>");
PersistentRootedMarker<JSObject*>::markChainIfNotNull<MarkObjectRoot>(
trc, rt->objectPersistentRooteds, "PersistentRooted<JSObject*>");
PersistentRootedMarker<JSScript*>::markChainIfNotNull<TraceRoot>(
trc, rt->scriptPersistentRooteds, "PersistentRooted<JSScript*>");
PersistentRootedMarker<JSString*>::markChainIfNotNull<TraceRoot>(
trc, rt->stringPersistentRooteds, "PersistentRooted<JSString*>");
PersistentRootedMarker<JSFunction*>::markChainIfNotNull(trc, rt->functionPersistentRooteds,
"PersistentRooted<JSFunction*>");
PersistentRootedMarker<JSObject*>::markChainIfNotNull(trc, rt->objectPersistentRooteds,
"PersistentRooted<JSObject*>");
PersistentRootedMarker<JSScript*>::markChainIfNotNull(trc, rt->scriptPersistentRooteds,
"PersistentRooted<JSScript*>");
PersistentRootedMarker<JSString*>::markChainIfNotNull(trc, rt->stringPersistentRooteds,
"PersistentRooted<JSString*>");
// Mark the PersistentRooted chains of types that are never null.
PersistentRootedMarker<jsid>::markChain<TraceRoot>(trc, rt->idPersistentRooteds,
"PersistentRooted<jsid>");
PersistentRootedMarker<Value>::markChain<TraceRoot>(trc, rt->valuePersistentRooteds,
"PersistentRooted<Value>");
PersistentRootedMarker<jsid>::markChain(trc, rt->idPersistentRooteds,
"PersistentRooted<jsid>");
PersistentRootedMarker<Value>::markChain(trc, rt->valuePersistentRooteds,
"PersistentRooted<Value>");
}
void
@ -453,8 +451,7 @@ js::gc::GCRuntime::markRuntime(JSTracer* trc,
}
if (rt->asyncStackForNewActivations)
MarkObjectRoot(trc, &rt->asyncStackForNewActivations,
"asyncStackForNewActivations");
TraceRoot(trc, &rt->asyncStackForNewActivations, "asyncStackForNewActivations");
if (rt->asyncCauseForNewActivations)
TraceRoot(trc, &rt->asyncCauseForNewActivations, "asyncCauseForNewActivations");

View File

@ -69,7 +69,7 @@ StoreBuffer::CellPtrEdge::mark(JSTracer* trc) const
return;
MOZ_ASSERT(GetGCThingTraceKind(*edge) == JSTRACE_OBJECT);
MarkObjectRoot(trc, reinterpret_cast<JSObject**>(edge), "store buffer edge");
TraceRoot(trc, reinterpret_cast<JSObject**>(edge), "store buffer edge");
}
void

View File

@ -44,7 +44,7 @@ JS_CallUnbarrieredIdTracer(JSTracer* trc, jsid* idp, const char* name)
JS_PUBLIC_API(void)
JS_CallUnbarrieredObjectTracer(JSTracer* trc, JSObject** objp, const char* name)
{
MarkObjectUnbarriered(trc, objp, name);
TraceManuallyBarrieredEdge(trc, objp, name);
}
JS_PUBLIC_API(void)
@ -74,7 +74,7 @@ JS_CallIdTracer(JSTracer* trc, JS::Heap<jsid>* idp, const char* name)
JS_PUBLIC_API(void)
JS_CallObjectTracer(JSTracer* trc, JS::Heap<JSObject*>* objp, const char* name)
{
MarkObjectUnbarriered(trc, objp->unsafeGet(), name);
TraceManuallyBarrieredEdge(trc, objp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
@ -92,7 +92,7 @@ JS_CallScriptTracer(JSTracer* trc, JS::Heap<JSScript*>* scriptp, const char* nam
JS_PUBLIC_API(void)
JS_CallFunctionTracer(JSTracer* trc, JS::Heap<JSFunction*>* funp, const char* name)
{
MarkObjectUnbarriered(trc, funp->unsafeGet(), name);
TraceManuallyBarrieredEdge(trc, funp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
@ -103,7 +103,7 @@ JS_CallTenuredObjectTracer(JSTracer* trc, JS::TenuredHeap<JSObject*>* objp, cons
return;
trc->setTracingLocation((void*)objp);
MarkObjectUnbarriered(trc, &obj, name);
TraceManuallyBarrieredEdge(trc, &obj, name);
objp->setPtr(obj);
}
@ -156,7 +156,7 @@ JS_TraceIncomingCCWs(JSTracer* trc, const JS::ZoneSet& zones)
if (!zones.has(obj->zone()))
continue;
MarkObjectUnbarriered(trc, &obj, "cross-compartment wrapper");
TraceManuallyBarrieredEdge(trc, &obj, "cross-compartment wrapper");
MOZ_ASSERT(obj == key.wrapped);
break;

View File

@ -150,7 +150,7 @@ Zone::sweepBreakpoints(FreeOp* fop)
HeapPtrNativeObject& dbgobj = bp->debugger->toJSObjectRef();
MOZ_ASSERT_IF(isGCSweeping() && dbgobj->zone()->isCollecting(),
dbgobj->zone()->isGCSweeping());
bool dying = scriptGone || IsObjectAboutToBeFinalized(&dbgobj);
bool dying = scriptGone || IsAboutToBeFinalized(&dbgobj);
MOZ_ASSERT_IF(!dying, !IsAboutToBeFinalized(&bp->getHandlerRef()));
if (dying)
bp->destroy(fop);

View File

@ -42,7 +42,7 @@ BaselineFrame::trace(JSTracer* trc, JitFrameIterator& frameIterator)
// Mark scope chain, if it exists.
if (scopeChain_)
gc::MarkObjectRoot(trc, &scopeChain_, "baseline-scopechain");
TraceRoot(trc, &scopeChain_, "baseline-scopechain");
// Mark return value.
if (hasReturnValue())
@ -52,7 +52,7 @@ BaselineFrame::trace(JSTracer* trc, JitFrameIterator& frameIterator)
TraceRoot(trc, &evalScript_, "baseline-evalscript");
if (hasArgsObj())
gc::MarkObjectRoot(trc, &argsObj_, "baseline-args-obj");
TraceRoot(trc, &argsObj_, "baseline-args-obj");
// Mark locals and stack values.
JSScript* script = this->script();

View File

@ -201,27 +201,27 @@ ICStub::trace(JSTracer* trc)
switch (kind()) {
case ICStub::Call_Scripted: {
ICCall_Scripted* callStub = toCall_Scripted();
MarkObject(trc, &callStub->callee(), "baseline-callscripted-callee");
TraceEdge(trc, &callStub->callee(), "baseline-callscripted-callee");
if (callStub->templateObject())
MarkObject(trc, &callStub->templateObject(), "baseline-callscripted-template");
TraceEdge(trc, &callStub->templateObject(), "baseline-callscripted-template");
break;
}
case ICStub::Call_Native: {
ICCall_Native* callStub = toCall_Native();
MarkObject(trc, &callStub->callee(), "baseline-callnative-callee");
TraceEdge(trc, &callStub->callee(), "baseline-callnative-callee");
if (callStub->templateObject())
MarkObject(trc, &callStub->templateObject(), "baseline-callnative-template");
TraceEdge(trc, &callStub->templateObject(), "baseline-callnative-template");
break;
}
case ICStub::Call_ClassHook: {
ICCall_ClassHook* callStub = toCall_ClassHook();
if (callStub->templateObject())
MarkObject(trc, &callStub->templateObject(), "baseline-callclasshook-template");
TraceEdge(trc, &callStub->templateObject(), "baseline-callclasshook-template");
break;
}
case ICStub::Call_StringSplit: {
ICCall_StringSplit* callStub = toCall_StringSplit();
MarkObject(trc, &callStub->templateObject(), "baseline-callstringsplit-template");
TraceEdge(trc, &callStub->templateObject(), "baseline-callstringsplit-template");
TraceEdge(trc, &callStub->expectedArg(), "baseline-callstringsplit-arg");
TraceEdge(trc, &callStub->expectedThis(), "baseline-callstringsplit-this");
break;
@ -236,7 +236,7 @@ ICStub::trace(JSTracer* trc)
ICGetElem_NativePrototypeSlot* getElemStub = toGetElem_NativePrototypeSlot();
TraceEdge(trc, &getElemStub->shape(), "baseline-getelem-nativeproto-shape");
TraceEdge(trc, &getElemStub->name(), "baseline-getelem-nativeproto-name");
MarkObject(trc, &getElemStub->holder(), "baseline-getelem-nativeproto-holder");
TraceEdge(trc, &getElemStub->holder(), "baseline-getelem-nativeproto-holder");
TraceEdge(trc, &getElemStub->holderShape(), "baseline-getelem-nativeproto-holdershape");
break;
}
@ -246,8 +246,8 @@ ICStub::trace(JSTracer* trc)
reinterpret_cast<ICGetElemNativePrototypeCallStub*>(this);
TraceEdge(trc, &callStub->shape(), "baseline-getelem-nativeprotocall-shape");
TraceEdge(trc, &callStub->name(), "baseline-getelem-nativeprotocall-name");
MarkObject(trc, &callStub->getter(), "baseline-getelem-nativeprotocall-getter");
MarkObject(trc, &callStub->holder(), "baseline-getelem-nativeprotocall-holder");
TraceEdge(trc, &callStub->getter(), "baseline-getelem-nativeprotocall-getter");
TraceEdge(trc, &callStub->holder(), "baseline-getelem-nativeprotocall-holder");
TraceEdge(trc, &callStub->holderShape(), "baseline-getelem-nativeprotocall-holdershape");
break;
}
@ -290,7 +290,7 @@ ICStub::trace(JSTracer* trc)
}
case ICStub::TypeMonitor_SingleObject: {
ICTypeMonitor_SingleObject* monitorStub = toTypeMonitor_SingleObject();
MarkObject(trc, &monitorStub->object(), "baseline-monitor-singleton");
TraceEdge(trc, &monitorStub->object(), "baseline-monitor-singleton");
break;
}
case ICStub::TypeMonitor_ObjectGroup: {
@ -300,7 +300,7 @@ ICStub::trace(JSTracer* trc)
}
case ICStub::TypeUpdate_SingleObject: {
ICTypeUpdate_SingleObject* updateStub = toTypeUpdate_SingleObject();
MarkObject(trc, &updateStub->object(), "baseline-update-singleton");
TraceEdge(trc, &updateStub->object(), "baseline-update-singleton");
break;
}
case ICStub::TypeUpdate_ObjectGroup: {
@ -352,7 +352,7 @@ ICStub::trace(JSTracer* trc)
case ICStub::GetProp_NativePrototype: {
ICGetProp_NativePrototype* propStub = toGetProp_NativePrototype();
propStub->receiverGuard().trace(trc);
MarkObject(trc, &propStub->holder(), "baseline-getpropnativeproto-stub-holder");
TraceEdge(trc, &propStub->holder(), "baseline-getpropnativeproto-stub-holder");
TraceEdge(trc, &propStub->holderShape(), "baseline-getpropnativeproto-stub-holdershape");
break;
}
@ -396,9 +396,9 @@ ICStub::trace(JSTracer* trc)
TraceEdge(trc, &propStub->expandoShape(),
"baseline-getproplistbasenative-stub-expandoshape");
}
MarkObject(trc, &propStub->holder(), "baseline-getproplistbasenative-stub-holder");
TraceEdge(trc, &propStub->holder(), "baseline-getproplistbasenative-stub-holder");
TraceEdge(trc, &propStub->holderShape(), "baseline-getproplistbasenative-stub-holdershape");
MarkObject(trc, &propStub->getter(), "baseline-getproplistbasenative-stub-getter");
TraceEdge(trc, &propStub->getter(), "baseline-getproplistbasenative-stub-getter");
break;
}
case ICStub::GetProp_DOMProxyShadowed: {
@ -410,17 +410,17 @@ ICStub::trace(JSTracer* trc)
case ICStub::GetProp_CallScripted: {
ICGetProp_CallScripted* callStub = toGetProp_CallScripted();
callStub->receiverGuard().trace(trc);
MarkObject(trc, &callStub->holder(), "baseline-getpropcallscripted-stub-holder");
TraceEdge(trc, &callStub->holder(), "baseline-getpropcallscripted-stub-holder");
TraceEdge(trc, &callStub->holderShape(), "baseline-getpropcallscripted-stub-holdershape");
MarkObject(trc, &callStub->getter(), "baseline-getpropcallscripted-stub-getter");
TraceEdge(trc, &callStub->getter(), "baseline-getpropcallscripted-stub-getter");
break;
}
case ICStub::GetProp_CallNative: {
ICGetProp_CallNative* callStub = toGetProp_CallNative();
callStub->receiverGuard().trace(trc);
MarkObject(trc, &callStub->holder(), "baseline-getpropcallnative-stub-holder");
TraceEdge(trc, &callStub->holder(), "baseline-getpropcallnative-stub-holder");
TraceEdge(trc, &callStub->holderShape(), "baseline-getpropcallnative-stub-holdershape");
MarkObject(trc, &callStub->getter(), "baseline-getpropcallnative-stub-getter");
TraceEdge(trc, &callStub->getter(), "baseline-getpropcallnative-stub-getter");
break;
}
case ICStub::SetProp_Native: {
@ -460,39 +460,39 @@ ICStub::trace(JSTracer* trc)
case ICStub::SetProp_CallScripted: {
ICSetProp_CallScripted* callStub = toSetProp_CallScripted();
callStub->guard().trace(trc);
MarkObject(trc, &callStub->holder(), "baseline-setpropcallscripted-stub-holder");
TraceEdge(trc, &callStub->holder(), "baseline-setpropcallscripted-stub-holder");
TraceEdge(trc, &callStub->holderShape(), "baseline-setpropcallscripted-stub-holdershape");
MarkObject(trc, &callStub->setter(), "baseline-setpropcallscripted-stub-setter");
TraceEdge(trc, &callStub->setter(), "baseline-setpropcallscripted-stub-setter");
break;
}
case ICStub::SetProp_CallNative: {
ICSetProp_CallNative* callStub = toSetProp_CallNative();
callStub->guard().trace(trc);
MarkObject(trc, &callStub->holder(), "baseline-setpropcallnative-stub-holder");
TraceEdge(trc, &callStub->holder(), "baseline-setpropcallnative-stub-holder");
TraceEdge(trc, &callStub->holderShape(), "baseline-setpropcallnative-stub-holdershape");
MarkObject(trc, &callStub->setter(), "baseline-setpropcallnative-stub-setter");
TraceEdge(trc, &callStub->setter(), "baseline-setpropcallnative-stub-setter");
break;
}
case ICStub::InstanceOf_Function: {
ICInstanceOf_Function* instanceofStub = toInstanceOf_Function();
TraceEdge(trc, &instanceofStub->shape(), "baseline-instanceof-fun-shape");
MarkObject(trc, &instanceofStub->prototypeObject(), "baseline-instanceof-fun-prototype");
TraceEdge(trc, &instanceofStub->prototypeObject(), "baseline-instanceof-fun-prototype");
break;
}
case ICStub::NewArray_Fallback: {
ICNewArray_Fallback* stub = toNewArray_Fallback();
MarkObject(trc, &stub->templateObject(), "baseline-newarray-template");
TraceEdge(trc, &stub->templateObject(), "baseline-newarray-template");
break;
}
case ICStub::NewObject_Fallback: {
ICNewObject_Fallback* stub = toNewObject_Fallback();
if (stub->templateObject())
MarkObject(trc, &stub->templateObject(), "baseline-newobject-template");
TraceEdge(trc, &stub->templateObject(), "baseline-newobject-template");
break;
}
case ICStub::Rest_Fallback: {
ICRest_Fallback* stub = toRest_Fallback();
MarkObject(trc, &stub->templateObject(), "baseline-rest-template");
TraceEdge(trc, &stub->templateObject(), "baseline-rest-template");
break;
}
default:

View File

@ -414,7 +414,7 @@ BaselineScript::trace(JSTracer* trc)
{
TraceEdge(trc, &method_, "baseline-method");
if (templateScope_)
MarkObject(trc, &templateScope_, "baseline-template-scope");
TraceEdge(trc, &templateScope_, "baseline-template-scope");
// Mark all IC stub codes hanging off the IC stub entries.
for (size_t i = 0; i < numICEntries(); i++) {

View File

@ -554,7 +554,7 @@ JitCompartment::sweep(FreeOp* fop, JSCompartment* compartment)
for (size_t i = 0; i <= SimdTypeDescr::LAST_TYPE; i++) {
ReadBarrieredObject& obj = simdTemplateObjects_[i];
if (obj && IsObjectAboutToBeFinalized(obj.unsafeGet()))
if (obj && IsAboutToBeFinalized(&obj))
obj.set(nullptr);
}
}
@ -1714,7 +1714,7 @@ AttachFinishedCompilations(JSContext* cx)
void
MIRGenerator::traceNurseryObjects(JSTracer* trc)
{
MarkObjectRootRange(trc, nurseryObjects_.length(), nurseryObjects_.begin(), "ion-nursery-objects");
TraceRootRange(trc, nurseryObjects_.length(), nurseryObjects_.begin(), "ion-nursery-objects");
}
class MarkOffThreadNurseryObjects : public gc::BufferableRef

View File

@ -972,7 +972,7 @@ MarkCalleeToken(JSTracer* trc, CalleeToken token)
case CalleeToken_FunctionConstructing:
{
JSFunction* fun = CalleeTokenToFunction(token);
MarkObjectRoot(trc, &fun, "jit-callee");
TraceRoot(trc, &fun, "jit-callee");
return CalleeToToken(fun, tag == CalleeToken_FunctionConstructing);
}
case CalleeToken_Script:
@ -1347,7 +1347,7 @@ MarkJitExitFrame(JSTracer* trc, const JitFrameIterator& frame)
TraceRoot(trc, oolgetter->stubCode(), "ion-ool-property-op-code");
TraceRoot(trc, oolgetter->vp(), "ion-ool-property-op-vp");
TraceRoot(trc, oolgetter->id(), "ion-ool-property-op-id");
gc::MarkObjectRoot(trc, oolgetter->obj(), "ion-ool-property-op-obj");
TraceRoot(trc, oolgetter->obj(), "ion-ool-property-op-obj");
return;
}
@ -1356,14 +1356,14 @@ MarkJitExitFrame(JSTracer* trc, const JitFrameIterator& frame)
TraceRoot(trc, oolproxy->stubCode(), "ion-ool-proxy-code");
TraceRoot(trc, oolproxy->vp(), "ion-ool-proxy-vp");
TraceRoot(trc, oolproxy->id(), "ion-ool-proxy-id");
gc::MarkObjectRoot(trc, oolproxy->proxy(), "ion-ool-proxy-proxy");
gc::MarkObjectRoot(trc, oolproxy->receiver(), "ion-ool-proxy-receiver");
TraceRoot(trc, oolproxy->proxy(), "ion-ool-proxy-proxy");
TraceRoot(trc, oolproxy->receiver(), "ion-ool-proxy-receiver");
return;
}
if (frame.isExitFrameLayout<IonDOMExitFrameLayout>()) {
IonDOMExitFrameLayout* dom = frame.exitFrame()->as<IonDOMExitFrameLayout>();
gc::MarkObjectRoot(trc, dom->thisObjAddress(), "ion-dom-args");
TraceRoot(trc, dom->thisObjAddress(), "ion-dom-args");
if (dom->isMethodFrame()) {
IonDOMMethodExitFrameLayout* method =
reinterpret_cast<IonDOMMethodExitFrameLayout*>(dom);
@ -1408,7 +1408,7 @@ MarkJitExitFrame(JSTracer* trc, const JitFrameIterator& frame)
// Sometimes we can bake in HandleObjects to nullptr.
JSObject** pobj = reinterpret_cast<JSObject**>(argBase);
if (*pobj)
gc::MarkObjectRoot(trc, pobj, "ion-vm-args");
TraceRoot(trc, pobj, "ion-vm-args");
break;
}
case VMFunction::RootString:
@ -1416,7 +1416,7 @@ MarkJitExitFrame(JSTracer* trc, const JitFrameIterator& frame)
TraceRoot(trc, reinterpret_cast<JSString**>(argBase), "ion-vm-args");
break;
case VMFunction::RootFunction:
gc::MarkObjectRoot(trc, reinterpret_cast<JSFunction**>(argBase), "ion-vm-args");
TraceRoot(trc, reinterpret_cast<JSFunction**>(argBase), "ion-vm-args");
break;
case VMFunction::RootValue:
TraceRoot(trc, reinterpret_cast<Value*>(argBase), "ion-vm-args");
@ -1443,14 +1443,14 @@ MarkJitExitFrame(JSTracer* trc, const JitFrameIterator& frame)
case VMFunction::RootNone:
MOZ_CRASH("Handle outparam must have root type");
case VMFunction::RootObject:
gc::MarkObjectRoot(trc, footer->outParam<JSObject*>(), "ion-vm-out");
TraceRoot(trc, footer->outParam<JSObject*>(), "ion-vm-out");
break;
case VMFunction::RootString:
case VMFunction::RootPropertyName:
TraceRoot(trc, footer->outParam<JSString*>(), "ion-vm-out");
break;
case VMFunction::RootFunction:
gc::MarkObjectRoot(trc, footer->outParam<JSFunction*>(), "ion-vm-out");
TraceRoot(trc, footer->outParam<JSFunction*>(), "ion-vm-out");
break;
case VMFunction::RootValue:
TraceRoot(trc, footer->outParam<Value>(), "ion-vm-outvp");

View File

@ -871,9 +871,9 @@ JitcodeGlobalEntry::IonEntry::markIfUnmarked(JSTracer* trc)
TraceManuallyBarrieredEdge(trc, &iter->script,
"jitcodeglobaltable-ionentry-type-addendum-script");
markedAny = true;
} else if (iter->hasConstructor() && !IsObjectMarked(&iter->constructor)) {
MarkObjectUnbarriered(trc, &iter->constructor,
"jitcodeglobaltable-ionentry-type-addendum-constructor");
} else if (iter->hasConstructor() && !IsMarkedUnbarriered(&iter->constructor)) {
TraceManuallyBarrieredEdge(trc, &iter->constructor,
"jitcodeglobaltable-ionentry-type-addendum-constructor");
markedAny = true;
}
}
@ -899,7 +899,7 @@ JitcodeGlobalEntry::IonEntry::sweep()
if (iter->hasAllocationSite())
MOZ_ALWAYS_FALSE(IsAboutToBeFinalizedUnbarriered(&iter->script));
else if (iter->hasConstructor())
MOZ_ALWAYS_FALSE(IsObjectAboutToBeFinalized(&iter->constructor));
MOZ_ALWAYS_FALSE(IsAboutToBeFinalizedUnbarriered(&iter->constructor));
}
}

View File

@ -148,7 +148,7 @@ void
RematerializedFrame::mark(JSTracer* trc)
{
TraceRoot(trc, &script_, "remat ion frame script");
gc::MarkObjectRoot(trc, &scopeChain_, "remat ion frame scope chain");
TraceRoot(trc, &scopeChain_, "remat ion frame scope chain");
TraceRoot(trc, &returnValue_, "remat ion frame return value");
TraceRoot(trc, &thisValue_, "remat ion frame this");
TraceRootRange(trc, numActualArgs_ + script_->nfixed(), slots_, "remat ion frame stack");

View File

@ -1259,7 +1259,7 @@ void
MarkObjectFromIon(JSRuntime* rt, JSObject** objp)
{
if (*objp)
gc::MarkObjectUnbarriered(&rt->gc.marker, objp, "write barrier");
TraceManuallyBarrieredEdge(&rt->gc.marker, objp, "write barrier");
}
void

View File

@ -1521,7 +1521,7 @@ JS_UpdateWeakPointerAfterGC(JS::Heap<JSObject*>* objp)
JS_PUBLIC_API(void)
JS_UpdateWeakPointerAfterGCUnbarriered(JSObject** objp)
{
if (IsObjectAboutToBeFinalized(objp))
if (IsAboutToBeFinalizedUnbarriered(objp))
*objp = nullptr;
}

View File

@ -87,7 +87,7 @@ js::TraceCycleDetectionSet(JSTracer* trc, js::ObjectSet& set)
for (js::ObjectSet::Enum e(set); !e.empty(); e.popFront()) {
JSObject* key = e.front();
trc->setTracingLocation((void*)&e.front());
MarkObjectRoot(trc, &key, "cycle detector table entry");
TraceRoot(trc, &key, "cycle detector table entry");
if (key != e.front())
e.rekeyFront(key);
}

View File

@ -516,7 +516,7 @@ JSCompartment::markRoots(JSTracer* trc)
* JSContext::global() remains valid.
*/
if (enterCompartmentDepth && global_.unbarrieredGet())
MarkObjectRoot(trc, global_.unsafeGet(), "on-stack compartment global");
TraceRoot(trc, global_.unsafeGet(), "on-stack compartment global");
}
void
@ -534,7 +534,7 @@ JSCompartment::sweepSavedStacks()
void
JSCompartment::sweepGlobalObject(FreeOp* fop)
{
if (global_.unbarrieredGet() && IsObjectAboutToBeFinalized(global_.unsafeGet())) {
if (global_.unbarrieredGet() && IsAboutToBeFinalized(&global_)) {
if (isDebuggee())
Debugger::detachAllDebuggersFromGlobal(fop, global_);
global_.set(nullptr);
@ -545,7 +545,7 @@ void
JSCompartment::sweepSelfHostingScriptSource()
{
if (selfHostingScriptSource.unbarrieredGet() &&
IsObjectAboutToBeFinalized((JSObject**) selfHostingScriptSource.unsafeGet()))
IsAboutToBeFinalized(&selfHostingScriptSource))
{
selfHostingScriptSource.set(nullptr);
}
@ -592,7 +592,7 @@ JSCompartment::sweepNativeIterators()
while (ni != enumerators) {
JSObject* iterObj = ni->iterObj();
NativeIterator* next = ni->next();
if (gc::IsObjectAboutToBeFinalized(&iterObj))
if (gc::IsAboutToBeFinalizedUnbarriered(&iterObj))
ni->unlink();
ni = next;
}
@ -617,7 +617,7 @@ JSCompartment::sweepCrossCompartmentWrappers()
case CrossCompartmentKey::DebuggerSource:
MOZ_ASSERT(IsInsideNursery(key.wrapped) ||
key.wrapped->asTenured().getTraceKind() == JSTRACE_OBJECT);
keyDying = IsObjectAboutToBeFinalized(
keyDying = IsAboutToBeFinalizedUnbarriered(
reinterpret_cast<JSObject**>(&key.wrapped));
break;
case CrossCompartmentKey::StringWrapper:
@ -634,7 +634,7 @@ JSCompartment::sweepCrossCompartmentWrappers()
MOZ_CRASH("Unknown key kind");
}
bool valDying = IsAboutToBeFinalized(&e.front().value());
bool dbgDying = key.debugger && IsObjectAboutToBeFinalized(&key.debugger);
bool dbgDying = key.debugger && IsAboutToBeFinalizedUnbarriered(&key.debugger);
if (keyDying || valDying || dbgDying) {
MOZ_ASSERT(key.kind != CrossCompartmentKey::StringWrapper);
e.removeFront();

View File

@ -1044,7 +1044,7 @@ js::GetAnyCompartmentInZone(JS::Zone* zone)
void
JS::ObjectPtr::updateWeakPointerAfterGC()
{
if (js::gc::IsObjectAboutToBeFinalized(value.unsafeGet()))
if (js::gc::IsAboutToBeFinalizedUnbarriered(value.unsafeGet()))
value = nullptr;
}

View File

@ -758,7 +758,7 @@ JSFunction::trace(JSTracer* trc)
TraceManuallyBarrieredEdge(trc, &u.i.s.lazy_, "lazyScript");
}
if (u.i.env_)
MarkObjectUnbarriered(trc, &u.i.env_, "fun_environment");
TraceManuallyBarrieredEdge(trc, &u.i.env_, "fun_environment");
}
}

View File

@ -4554,11 +4554,11 @@ MarkIncomingCrossCompartmentPointers(JSRuntime* rt, const uint32_t color)
MOZ_ASSERT(dst->compartment() == c);
if (color == GRAY) {
if (IsObjectMarked(&src) && src->asTenured().isMarked(GRAY))
if (IsMarkedUnbarriered(&src) && src->asTenured().isMarked(GRAY))
MarkGCThingUnbarriered(&rt->gc.marker, (void**)&dst,
"cross-compartment gray pointer");
} else {
if (IsObjectMarked(&src) && !src->asTenured().isMarked(GRAY))
if (IsMarkedUnbarriered(&src) && !src->asTenured().isMarked(GRAY))
MarkGCThingUnbarriered(&rt->gc.marker, (void**)&dst,
"cross-compartment black pointer");
}
@ -5669,7 +5669,7 @@ GCRuntime::pushZealSelectedObjects()
#ifdef JS_GC_ZEAL
/* Push selected objects onto the mark stack and clear the list. */
for (JSObject** obj = selectedForMarking.begin(); obj != selectedForMarking.end(); obj++)
MarkObjectUnbarriered(&marker, obj, "selected obj");
TraceManuallyBarrieredEdge(&marker, obj, "selected obj");
#endif
}

View File

@ -60,12 +60,12 @@ NativeIterator::mark(JSTracer* trc)
for (HeapPtrFlatString* str = begin(); str < end(); str++)
TraceEdge(trc, str, "prop");
if (obj)
MarkObject(trc, &obj, "obj");
TraceEdge(trc, &obj, "obj");
// The SuppressDeletedPropertyHelper loop can GC, so make sure that if the
// GC removes any elements from the list, it won't remove this one.
if (iterObj_)
MarkObjectUnbarriered(trc, &iterObj_, "iterObj");
TraceManuallyBarrieredEdge(trc, &iterObj_, "iterObj");
}
struct IdHashPolicy {

View File

@ -3977,7 +3977,7 @@ JSObject::markChildren(JSTracer* trc)
if (nobj->denseElementsAreCopyOnWrite()) {
HeapPtrNativeObject& owner = nobj->getElementsHeader()->ownerObject();
if (owner != nobj) {
MarkObject(trc, &owner, "objectElementsOwner");
TraceEdge(trc, &owner, "objectElementsOwner");
break;
}
}

View File

@ -3439,12 +3439,12 @@ JSScript::markChildren(JSTracer* trc)
if (hasObjects()) {
ObjectArray* objarray = objects();
MarkObjectRange(trc, objarray->length, objarray->vector, "objects");
TraceRange(trc, objarray->length, objarray->vector, "objects");
}
if (hasRegexps()) {
ObjectArray* objarray = regexps();
MarkObjectRange(trc, objarray->length, objarray->vector, "objects");
TraceRange(trc, objarray->length, objarray->vector, "objects");
}
if (hasConsts()) {
@ -3454,14 +3454,14 @@ JSScript::markChildren(JSTracer* trc)
if (sourceObject()) {
MOZ_ASSERT(MaybeForwarded(sourceObject())->compartment() == compartment());
MarkObject(trc, &sourceObject_, "sourceObject");
TraceEdge(trc, &sourceObject_, "sourceObject");
}
if (functionNonDelazifying())
MarkObject(trc, &function_, "function");
TraceEdge(trc, &function_, "function");
if (enclosingStaticScope_)
MarkObject(trc, &enclosingStaticScope_, "enclosingStaticScope");
TraceEdge(trc, &enclosingStaticScope_, "enclosingStaticScope");
if (maybeLazyScript())
TraceManuallyBarrieredEdge(trc, &lazyScript, "lazyScript");
@ -3482,13 +3482,13 @@ void
LazyScript::markChildren(JSTracer* trc)
{
if (function_)
MarkObject(trc, &function_, "function");
TraceEdge(trc, &function_, "function");
if (sourceObject_)
MarkObject(trc, &sourceObject_, "sourceObject");
TraceEdge(trc, &sourceObject_, "sourceObject");
if (enclosingScope_)
MarkObject(trc, &enclosingScope_, "enclosingScope");
TraceEdge(trc, &enclosingScope_, "enclosingScope");
if (script_)
TraceEdge(trc, &script_, "realScript");
@ -3502,7 +3502,7 @@ LazyScript::markChildren(JSTracer* trc)
HeapPtrFunction* innerFunctions = this->innerFunctions();
for (size_t i = 0; i < numInnerFunctions(); i++)
MarkObject(trc, &innerFunctions[i], "lazyScriptInnerFunction");
TraceEdge(trc, &innerFunctions[i], "lazyScriptInnerFunction");
}
void

View File

@ -161,10 +161,10 @@ WatchpointMap::markIteratively(JSTracer* trc)
JSObject* priorKeyObj = entry.key().object;
jsid priorKeyId(entry.key().id.get());
bool objectIsLive =
IsObjectMarked(const_cast<PreBarrieredObject*>(&entry.key().object));
IsMarked(const_cast<PreBarrieredObject*>(&entry.key().object));
if (objectIsLive || entry.value().held) {
if (!objectIsLive) {
MarkObject(trc, const_cast<PreBarrieredObject*>(&entry.key().object),
TraceEdge(trc, const_cast<PreBarrieredObject*>(&entry.key().object),
"held Watchpoint object");
marked = true;
}
@ -174,8 +174,8 @@ WatchpointMap::markIteratively(JSTracer* trc)
JSID_IS_SYMBOL(priorKeyId));
TraceEdge(trc, const_cast<PreBarrieredId*>(&entry.key().id), "WatchKey::id");
if (entry.value().closure && !IsObjectMarked(&entry.value().closure)) {
MarkObject(trc, &entry.value().closure, "Watchpoint::closure");
if (entry.value().closure && !IsMarked(&entry.value().closure)) {
TraceEdge(trc, &entry.value().closure, "Watchpoint::closure");
marked = true;
}
@ -196,10 +196,10 @@ WatchpointMap::markAll(JSTracer* trc)
WatchKey prior = key;
MOZ_ASSERT(JSID_IS_STRING(prior.id) || JSID_IS_INT(prior.id) || JSID_IS_SYMBOL(prior.id));
MarkObject(trc, const_cast<PreBarrieredObject*>(&key.object),
TraceEdge(trc, const_cast<PreBarrieredObject*>(&key.object),
"held Watchpoint object");
TraceEdge(trc, const_cast<PreBarrieredId*>(&key.id), "WatchKey::id");
MarkObject(trc, &entry.value().closure, "Watchpoint::closure");
TraceEdge(trc, &entry.value().closure, "Watchpoint::closure");
if (prior.object != key.object || prior.id != key.id)
e.rekeyFront(key);
@ -221,7 +221,7 @@ WatchpointMap::sweep()
for (Map::Enum e(map); !e.empty(); e.popFront()) {
Map::Entry& entry = e.front();
JSObject* obj(entry.key().object);
if (IsObjectAboutToBeFinalized(&obj)) {
if (IsAboutToBeFinalizedUnbarriered(&obj)) {
MOZ_ASSERT(!entry.value().held);
e.removeFront();
} else if (obj != entry.key().object) {

View File

@ -81,7 +81,7 @@ WeakMapBase::markAll(JSCompartment* c, JSTracer* tracer)
for (WeakMapBase* m = c->gcWeakMapList; m; m = m->next) {
m->trace(tracer);
if (m->memberOf)
gc::MarkObject(tracer, &m->memberOf, "memberOf");
TraceEdge(tracer, &m->memberOf, "memberOf");
}
}

View File

@ -188,7 +188,7 @@ class WeakMap : public HashMap<Key, Value, HashPolicy, RuntimeAllocPolicy>, publ
* gray marking when the key's delegate is black and the map is
* gray.
*/
return delegate && gc::IsObjectMarked(&delegate);
return delegate && gc::IsMarkedUnbarriered(&delegate);
}
return false;
}

View File

@ -969,7 +969,7 @@ ArrayBufferObject::trace(JSTracer* trc, JSObject* obj)
JSObject* view = MaybeForwarded(buf.firstView());
MOZ_ASSERT(view && view->is<InlineTransparentTypedObject>());
gc::MarkObjectUnbarriered(trc, &view, "array buffer inline typed object owner");
TraceManuallyBarrieredEdge(trc, &view, "array buffer inline typed object owner");
buf.setSlot(DATA_SLOT, PrivateValue(view->as<InlineTransparentTypedObject>().inlineTypedMem()));
}
@ -1090,12 +1090,12 @@ InnerViewTable::removeViews(ArrayBufferObject* obj)
bool
InnerViewTable::sweepEntry(JSObject** pkey, ViewVector& views)
{
if (IsObjectAboutToBeFinalized(pkey))
if (IsAboutToBeFinalizedUnbarriered(pkey))
return true;
MOZ_ASSERT(!views.empty());
for (size_t i = 0; i < views.length(); i++) {
if (IsObjectAboutToBeFinalized(&views[i])) {
if (IsAboutToBeFinalizedUnbarriered(&views[i])) {
views[i--] = views.back();
views.popBack();
}
@ -1191,7 +1191,7 @@ ArrayBufferViewObject::trace(JSTracer* trc, JSObject* objArg)
JSObject* view = buf.firstView();
// Mark the object to move it into the tenured space.
MarkObjectUnbarriered(trc, &view, "typed array nursery owner");
TraceManuallyBarrieredEdge(trc, &view, "typed array nursery owner");
MOZ_ASSERT(view->is<InlineTypedObject>() && view != obj);
void* srcData = obj->getPrivate();

View File

@ -2272,7 +2272,7 @@ Debugger::markAllIteratively(GCMarker* trc)
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
if (c->isDebuggee()) {
GlobalObject* global = c->maybeGlobal();
if (!IsObjectMarked(&global))
if (!IsMarkedUnbarriered(&global))
continue;
/*
@ -2294,13 +2294,13 @@ Debugger::markAllIteratively(GCMarker* trc)
if (!dbgobj->zone()->isGCMarking())
continue;
bool dbgMarked = IsObjectMarked(&dbgobj);
bool dbgMarked = IsMarked(&dbgobj);
if (!dbgMarked && dbg->hasAnyLiveHooks()) {
/*
* obj could be reachable only via its live, enabled
* debugger hooks, which may yet be called.
*/
MarkObject(trc, &dbgobj, "enabled Debugger");
TraceEdge(trc, &dbgobj, "enabled Debugger");
markedAny = true;
dbgMarked = true;
}
@ -2313,8 +2313,8 @@ Debugger::markAllIteratively(GCMarker* trc)
* The debugger and the script are both live.
* Therefore the breakpoint handler is live.
*/
if (!IsObjectMarked(&bp->getHandlerRef())) {
MarkObject(trc, &bp->getHandlerRef(), "breakpoint handler");
if (!IsMarked(&bp->getHandlerRef())) {
TraceEdge(trc, &bp->getHandlerRef(), "breakpoint handler");
markedAny = true;
}
}
@ -2339,13 +2339,13 @@ Debugger::markAll(JSTracer* trc)
WeakGlobalObjectSet& debuggees = dbg->debuggees;
for (WeakGlobalObjectSet::Enum e(debuggees); !e.empty(); e.popFront()) {
GlobalObject* global = e.front();
MarkObjectUnbarriered(trc, &global, "Global Object");
TraceManuallyBarrieredEdge(trc, &global, "Global Object");
if (global != e.front())
e.rekeyFront(ReadBarrieredGlobalObject(global));
}
HeapPtrNativeObject& dbgobj = dbg->toJSObjectRef();
MarkObject(trc, &dbgobj, "Debugger Object");
TraceEdge(trc, &dbgobj, "Debugger Object");
dbg->scripts.trace(trc);
dbg->sources.trace(trc);
@ -2354,7 +2354,7 @@ Debugger::markAll(JSTracer* trc)
for (Breakpoint* bp = dbg->firstBreakpoint(); bp; bp = bp->nextInDebugger()) {
TraceManuallyBarrieredEdge(trc, &bp->site->script, "breakpoint script");
MarkObject(trc, &bp->getHandlerRef(), "breakpoint handler");
TraceEdge(trc, &bp->getHandlerRef(), "breakpoint handler");
}
}
}
@ -2370,7 +2370,7 @@ void
Debugger::trace(JSTracer* trc)
{
if (uncaughtExceptionHook)
MarkObject(trc, &uncaughtExceptionHook, "hooks");
TraceEdge(trc, &uncaughtExceptionHook, "hooks");
/*
* Mark Debugger.Frame objects. These are all reachable from JS, because the
@ -2383,7 +2383,7 @@ Debugger::trace(JSTracer* trc)
for (FrameMap::Range r = frames.all(); !r.empty(); r.popFront()) {
RelocatablePtrNativeObject& frameobj = r.front().value();
MOZ_ASSERT(MaybeForwarded(frameobj.get())->getPrivate());
MarkObject(trc, &frameobj, "live Debugger.Frame");
TraceEdge(trc, &frameobj, "live Debugger.Frame");
}
/*
@ -2391,7 +2391,7 @@ Debugger::trace(JSTracer* trc)
*/
for (AllocationSite* s = allocationsLog.getFirst(); s; s = s->getNext()) {
if (s->frame)
MarkObject(trc, &s->frame, "allocation log SavedFrame");
TraceEdge(trc, &s->frame, "allocation log SavedFrame");
}
/* Trace the weak map from JSScript instances to Debugger.Script objects. */
@ -2413,7 +2413,7 @@ Debugger::sweepAll(FreeOp* fop)
JSRuntime* rt = fop->runtime();
for (Debugger* dbg = rt->debuggerList.getFirst(); dbg; dbg = dbg->getNext()) {
if (IsObjectAboutToBeFinalized(&dbg->object)) {
if (IsAboutToBeFinalized(&dbg->object)) {
/*
* dbg is being GC'd. Detach it from its debuggees. The debuggee
* might be GC'd too. Since detaching requires access to both

View File

@ -1411,7 +1411,7 @@ ObjectGroupCompartment::sweep(FreeOp* fop)
key.type = TypeSet::ObjectType(group);
}
if (key.proto && key.proto != TaggedProto::LazyProto &&
IsObjectAboutToBeFinalized(&key.proto))
IsAboutToBeFinalizedUnbarriered(&key.proto))
{
remove = true;
}
@ -1480,7 +1480,7 @@ ObjectGroupCompartment::sweepNewTable(NewTable* table)
for (NewTable::Enum e(*table); !e.empty(); e.popFront()) {
NewEntry entry = e.front();
if (IsAboutToBeFinalized(&entry.group) ||
(entry.associated && IsObjectAboutToBeFinalized(&entry.associated)))
(entry.associated && IsAboutToBeFinalizedUnbarriered(&entry.associated)))
{
e.removeFront();
} else {

View File

@ -254,8 +254,8 @@ js::ForOfPIC::Chain::mark(JSTracer* trc)
if (!initialized_ || disabled_)
return;
gc::MarkObject(trc, &arrayProto_, "ForOfPIC Array.prototype.");
gc::MarkObject(trc, &arrayIteratorProto_, "ForOfPIC ArrayIterator.prototype.");
TraceEdge(trc, &arrayProto_, "ForOfPIC Array.prototype.");
TraceEdge(trc, &arrayIteratorProto_, "ForOfPIC ArrayIterator.prototype.");
TraceEdge(trc, &arrayProtoShape_, "ForOfPIC Array.prototype shape.");
TraceEdge(trc, &arrayIteratorProtoShape_, "ForOfPIC ArrayIterator.prototype shape.");

View File

@ -930,7 +930,7 @@ RegExpCompartment::sweep(JSRuntime* rt)
}
if (matchResultTemplateObject_ &&
IsObjectAboutToBeFinalized(matchResultTemplateObject_.unsafeGet()))
IsAboutToBeFinalized(&matchResultTemplateObject_))
{
matchResultTemplateObject_.set(nullptr);
}

View File

@ -84,14 +84,10 @@ struct SavedFrame::Lookup {
TraceManuallyBarrieredEdge(trc, &functionDisplayName,
"SavedFrame::Lookup::functionDisplayName");
}
if (asyncCause) {
TraceManuallyBarrieredEdge(trc, &asyncCause,
"SavedFrame::Lookup::asyncCause");
}
if (parent) {
gc::MarkObjectUnbarriered(trc, &parent,
"SavedFrame::Lookup::parent");
}
if (asyncCause)
TraceManuallyBarrieredEdge(trc, &asyncCause, "SavedFrame::Lookup::asyncCause");
if (parent)
TraceManuallyBarrieredEdge(trc, &parent, "SavedFrame::Lookup::parent");
}
};
@ -817,7 +813,7 @@ SavedStacks::sweep(JSRuntime* rt)
JSObject* obj = e.front().unbarrieredGet();
JSObject* temp = obj;
if (IsObjectAboutToBeFinalized(&obj)) {
if (IsAboutToBeFinalizedUnbarriered(&obj)) {
e.removeFront();
} else {
SavedFrame* frame = &obj->as<SavedFrame>();

View File

@ -1172,7 +1172,7 @@ void
LiveScopeVal::sweep()
{
if (staticScope_)
MOZ_ALWAYS_FALSE(IsObjectAboutToBeFinalized(staticScope_.unsafeGet()));
MOZ_ALWAYS_FALSE(IsAboutToBeFinalized(&staticScope_));
}
// Live ScopeIter values may be added to DebugScopes::liveScopes, as
@ -1871,7 +1871,7 @@ DebugScopes::sweep(JSRuntime* rt)
*/
for (MissingScopeMap::Enum e(missingScopes); !e.empty(); e.popFront()) {
DebugScopeObject** debugScope = e.front().value().unsafeGet();
if (IsObjectAboutToBeFinalized(debugScope)) {
if (IsAboutToBeFinalizedUnbarriered(debugScope)) {
/*
* Note that onPopCall and onPopBlock rely on missingScopes to find
* scope objects that we synthesized for the debugger's sake, and
@ -1909,7 +1909,7 @@ DebugScopes::sweep(JSRuntime* rt)
* Scopes can be finalized when a debugger-synthesized ScopeObject is
* no longer reachable via its DebugScopeObject.
*/
if (IsObjectAboutToBeFinalized(&scope))
if (IsAboutToBeFinalizedUnbarriered(&scope))
e.removeFront();
else if (scope != e.front().key())
e.rekeyFront(scope);

View File

@ -1210,7 +1210,7 @@ void
JSRuntime::markSelfHostingGlobal(JSTracer* trc)
{
if (selfHostingGlobal_ && !parentRuntime)
MarkObjectRoot(trc, &selfHostingGlobal_, "self-hosting global");
TraceRoot(trc, &selfHostingGlobal_, "self-hosting global");
}
bool

View File

@ -1538,7 +1538,7 @@ JSCompartment::sweepInitialShapeTable()
Shape* shape = entry.shape.unbarrieredGet();
JSObject* proto = entry.proto.raw();
if (IsAboutToBeFinalizedUnbarriered(&shape) ||
(entry.proto.isObject() && IsObjectAboutToBeFinalized(&proto)))
(entry.proto.isObject() && IsAboutToBeFinalizedUnbarriered(&proto)))
{
e.removeFront();
} else {
@ -1583,7 +1583,7 @@ void
AutoRooterGetterSetter::Inner::trace(JSTracer* trc)
{
if ((attrs & JSPROP_GETTER) && *pgetter)
gc::MarkObjectRoot(trc, (JSObject**) pgetter, "AutoRooterGetterSetter getter");
TraceRoot(trc, (JSObject**) pgetter, "AutoRooterGetterSetter getter");
if ((attrs & JSPROP_SETTER) && *psetter)
gc::MarkObjectRoot(trc, (JSObject**) psetter, "AutoRooterGetterSetter setter");
TraceRoot(trc, (JSObject**) psetter, "AutoRooterGetterSetter setter");
}

View File

@ -1366,10 +1366,10 @@ Shape::markChildren(JSTracer* trc)
TraceEdge(trc, &parent, "parent");
if (hasGetterObject())
gc::MarkObjectUnbarriered(trc, &asAccessorShape().getterObj, "getter");
TraceManuallyBarrieredEdge(trc, &asAccessorShape().getterObj, "getter");
if (hasSetterObject())
gc::MarkObjectUnbarriered(trc, &asAccessorShape().setterObj, "setter");
TraceManuallyBarrieredEdge(trc, &asAccessorShape().setterObj, "setter");
}
/*

View File

@ -333,11 +333,11 @@ InterpreterFrame::mark(JSTracer* trc)
* frame is copied to the floating frame. Therefore, no barrier is needed.
*/
if (flags_ & HAS_SCOPECHAIN)
gc::MarkObjectUnbarriered(trc, &scopeChain_, "scope chain");
TraceManuallyBarrieredEdge(trc, &scopeChain_, "scope chain");
if (flags_ & HAS_ARGS_OBJ)
gc::MarkObjectUnbarriered(trc, &argsObj_, "arguments");
TraceManuallyBarrieredEdge(trc, &argsObj_, "arguments");
if (isFunctionFrame()) {
gc::MarkObjectUnbarriered(trc, &exec.fun, "fun");
TraceManuallyBarrieredEdge(trc, &exec.fun, "fun");
if (isEvalFrame())
TraceManuallyBarrieredEdge(trc, &u.evalScript, "eval script");
} else {

View File

@ -714,7 +714,7 @@ TypeSet::IsTypeMarked(TypeSet::Type* v)
bool rv;
if (v->isSingletonUnchecked()) {
JSObject* obj = v->singletonNoBarrier();
rv = IsObjectMarked(&obj);
rv = IsMarkedUnbarriered(&obj);
*v = TypeSet::ObjectType(obj);
} else if (v->isGroupUnchecked()) {
ObjectGroup* group = v->groupNoBarrier();
@ -755,7 +755,7 @@ IsObjectKeyAboutToBeFinalized(TypeSet::ObjectKey** keyp)
} else {
MOZ_ASSERT(key->isSingleton());
JSObject* singleton = key->singletonNoBarrier();
isAboutToBeFinalized = IsObjectAboutToBeFinalized(&singleton);
isAboutToBeFinalized = IsAboutToBeFinalizedUnbarriered(&singleton);
if (!isAboutToBeFinalized)
*keyp = TypeSet::ObjectKey::get(singleton);
}
@ -1815,7 +1815,7 @@ class ConstraintDataFreezeObjectForTypedArrayData
bool shouldSweep() {
// Note: |viewData| is only used for equality testing.
return IsObjectAboutToBeFinalized(&obj);
return IsAboutToBeFinalizedUnbarriered(&obj);
}
};
@ -3329,7 +3329,7 @@ PreliminaryObjectArray::sweep()
// destroyed.
for (size_t i = 0; i < COUNT; i++) {
JSObject** ptr = &objects[i];
if (*ptr && IsObjectAboutToBeFinalized(ptr))
if (*ptr && IsAboutToBeFinalizedUnbarriered(ptr))
*ptr = nullptr;
}
}
@ -3880,10 +3880,10 @@ TypeNewScript::rollbackPartiallyInitializedObjects(JSContext* cx, ObjectGroup* g
void
TypeNewScript::trace(JSTracer* trc)
{
MarkObject(trc, &function_, "TypeNewScript_function");
TraceEdge(trc, &function_, "TypeNewScript_function");
if (templateObject_)
MarkObject(trc, &templateObject_, "TypeNewScript_templateObject");
TraceEdge(trc, &templateObject_, "TypeNewScript_templateObject");
if (initializedShape_)
TraceEdge(trc, &initializedShape_, "TypeNewScript_initializedShape");

View File

@ -352,8 +352,9 @@ void
UnboxedPlainObject::trace(JSTracer* trc, JSObject* obj)
{
if (obj->as<UnboxedPlainObject>().expando_) {
MarkObjectUnbarriered(trc, reinterpret_cast<NativeObject**>(&obj->as<UnboxedPlainObject>().expando_),
"unboxed_expando");
TraceManuallyBarrieredEdge(trc,
reinterpret_cast<NativeObject**>(&obj->as<UnboxedPlainObject>().expando_),
"unboxed_expando");
}
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layoutDontCheckGeneration();
@ -371,7 +372,7 @@ UnboxedPlainObject::trace(JSTracer* trc, JSObject* obj)
while (*list != -1) {
HeapPtrObject* heap = reinterpret_cast<HeapPtrObject*>(data + *list);
if (*heap)
MarkObject(trc, heap, "unboxed_object");
TraceEdge(trc, heap, "unboxed_object");
list++;
}