Backed out changeset 1b720320ccf4 (bug 939993) for rootanalysis assertions on a CLOSED TREE

This commit is contained in:
Ed Morley 2013-11-20 16:38:41 +00:00
parent bc86ea8de4
commit 8291c4ed9e
2 changed files with 5 additions and 21 deletions

View File

@ -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));

View File

@ -1466,7 +1466,6 @@ BaseShape::getUnowned(ExclusiveContext *cx, const StackBaseShape &base)
if (!table.initialized() && !table.init())
return nullptr;
uint64_t originalGcNumber = cx->zone()->gcNumber();
BaseShapeSet::AddPtr p = table.lookupForAdd(&base);
if (p)
@ -1482,14 +1481,7 @@ BaseShape::getUnowned(ExclusiveContext *cx, const StackBaseShape &base)
UnownedBaseShape *nbase = static_cast<UnownedBaseShape *>(nbase_);
/*
* If a GC 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->zone()->gcNumber() != 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;
@ -1601,7 +1593,6 @@ EmptyShape::getInitialShape(ExclusiveContext *cx, const Class *clasp, TaggedProt
return nullptr;
typedef InitialShapeEntry::Lookup Lookup;
uint64_t originalGcNumber = cx->zone()->gcNumber();
InitialShapeSet::AddPtr p =
table.lookupForAdd(Lookup(clasp, proto, parent, metadata, nfixed, objectFlags));
@ -1623,17 +1614,11 @@ EmptyShape::getInitialShape(ExclusiveContext *cx, const Class *clasp, TaggedProt
return nullptr;
new (shape) EmptyShape(nbase, nfixed);
/*
* If a GC 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->zone()->gcNumber() != 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;
}