зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 1469f9e856c0 (bug 939993) for SM rootanalysis crashes.
CLOSED TREE
This commit is contained in:
Родитель
4864326b61
Коммит
0b04f14b61
|
@ -1511,7 +1511,6 @@ class HashTable : private AllocPolicy
|
|||
p.mutationCount = mutationCount;
|
||||
{
|
||||
mozilla::ReentrancyGuard g(*this);
|
||||
JS_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
|
||||
p.entry_ = &lookup(l, p.keyHash, sCollisionBit);
|
||||
}
|
||||
return p.found() || add(p, mozilla::Forward<U>(u));
|
||||
|
|
|
@ -227,18 +227,6 @@ struct ThreadSafeContext : ContextFriendFields,
|
|||
}
|
||||
#endif
|
||||
|
||||
uint64_t generationalGcNumber() {
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
return hasNursery() ? runtime_->gcNumber : 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t hasGenerationalGcHappened(uint64_t originalGcNumber) {
|
||||
return generationalGcNumber() != originalGcNumber;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocator used when allocating GCThings on this context. If we are a
|
||||
* JSContext, this is the Zone allocator of the JSContext's zone.
|
||||
|
|
|
@ -3744,7 +3744,7 @@ ExclusiveContext::getNewType(const Class *clasp, TaggedProto proto_, JSFunction
|
|||
|
||||
TypeObjectSet::AddPtr p = newTypeObjects.lookupForAdd(TypeObjectSet::Lookup(clasp, proto_));
|
||||
SkipRoot skipHash(this, &p); /* Prevent the hash from being poisoned. */
|
||||
uint64_t originalGcNumber = generationalGcNumber();
|
||||
uint64_t originalGcNumber = zone()->gcNumber();
|
||||
if (p) {
|
||||
TypeObject *type = *p;
|
||||
JS_ASSERT(type->clasp == clasp);
|
||||
|
@ -3783,14 +3783,13 @@ ExclusiveContext::getNewType(const Class *clasp, TaggedProto proto_, JSFunction
|
|||
return nullptr;
|
||||
|
||||
/*
|
||||
* If a generational collection has occurred, then the hash we calculated may
|
||||
* be invalid, as it is based on proto, which may have been moved.
|
||||
* If a GC has occured, then the hash we calculated may be invalid, as it
|
||||
* is based on proto, which may have been moved.
|
||||
*/
|
||||
TypeObjectSet::Lookup lookup(clasp, proto);
|
||||
bool gcHappened = hasGenerationalGcHappened(originalGcNumber);
|
||||
bool gcHappened = zone()->gcNumber() != originalGcNumber;
|
||||
bool added =
|
||||
gcHappened ? newTypeObjects.putNew(lookup, type.get())
|
||||
: newTypeObjects.relookupOrAdd(p, lookup, type.get());
|
||||
gcHappened ? newTypeObjects.putNew(TypeObjectSet::Lookup(clasp, proto), type.get())
|
||||
: newTypeObjects.relookupOrAdd(p, TypeObjectSet::Lookup(clasp, proto), type.get());
|
||||
if (!added)
|
||||
return nullptr;
|
||||
|
||||
|
|
|
@ -1468,7 +1468,6 @@ BaseShape::getUnowned(ExclusiveContext *cx, const StackBaseShape &base)
|
|||
if (!table.initialized() && !table.init())
|
||||
return nullptr;
|
||||
|
||||
uint64_t originalGcNumber = cx->generationalGcNumber();
|
||||
BaseShapeSet::AddPtr p = table.lookupForAdd(&base);
|
||||
|
||||
if (p)
|
||||
|
@ -1484,15 +1483,7 @@ BaseShape::getUnowned(ExclusiveContext *cx, const StackBaseShape &base)
|
|||
|
||||
UnownedBaseShape *nbase = static_cast<UnownedBaseShape *>(nbase_);
|
||||
|
||||
/*
|
||||
* If a generational collection has occurred then the hash we calculated may
|
||||
* be invalid, as it is based on the objects inside StackBaseShape, which
|
||||
* may have been moved.
|
||||
*/
|
||||
bool gcHappened = cx->hasGenerationalGcHappened(originalGcNumber);
|
||||
bool added = gcHappened ? table.putNew(&base, nbase)
|
||||
: table.relookupOrAdd(p, &base, nbase);
|
||||
if (!added)
|
||||
if (!table.relookupOrAdd(p, &base, nbase))
|
||||
return nullptr;
|
||||
|
||||
return nbase;
|
||||
|
@ -1604,7 +1595,6 @@ EmptyShape::getInitialShape(ExclusiveContext *cx, const Class *clasp, TaggedProt
|
|||
return nullptr;
|
||||
|
||||
typedef InitialShapeEntry::Lookup Lookup;
|
||||
uint64_t originalGcNumber = cx->generationalGcNumber();
|
||||
InitialShapeSet::AddPtr p =
|
||||
table.lookupForAdd(Lookup(clasp, proto, parent, metadata, nfixed, objectFlags));
|
||||
|
||||
|
@ -1626,17 +1616,11 @@ EmptyShape::getInitialShape(ExclusiveContext *cx, const Class *clasp, TaggedProt
|
|||
return nullptr;
|
||||
new (shape) EmptyShape(nbase, nfixed);
|
||||
|
||||
/*
|
||||
* If a generational collection has occurred, then the hash we calculated
|
||||
* may be invalid, as it is based on objects which may have been moved.
|
||||
*/
|
||||
Lookup lookup(clasp, protoRoot, parentRoot, metadataRoot, nfixed, objectFlags);
|
||||
InitialShapeEntry entry(shape, protoRoot);
|
||||
bool gcHappened = cx->hasGenerationalGcHappened(originalGcNumber);
|
||||
bool added = gcHappened ? table.putNew(lookup, entry)
|
||||
: table.relookupOrAdd(p, lookup, entry);
|
||||
if (!added)
|
||||
if (!table.relookupOrAdd(p, Lookup(clasp, protoRoot, parentRoot, metadataRoot, nfixed, objectFlags),
|
||||
InitialShapeEntry(shape, protoRoot)))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче