mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1063598 - Infer constant properties even when the type property has not yet been instantiated, r=jandem.
This commit is contained in:
parent
e288a72efd
commit
97130a2dda
@ -1752,20 +1752,20 @@ HeapTypeSetKey::constant(CompilerConstraintList *constraints, Value *valOut)
|
||||
if (nonData(constraints))
|
||||
return false;
|
||||
|
||||
if (!maybeTypes())
|
||||
return false;
|
||||
|
||||
if (maybeTypes()->nonConstantProperty())
|
||||
return false;
|
||||
|
||||
// Only singleton object properties can be marked as constants.
|
||||
JS_ASSERT(object()->singleton());
|
||||
JSObject *obj = object()->singleton();
|
||||
if (!obj || !obj->isNative())
|
||||
return false;
|
||||
|
||||
if (maybeTypes() && maybeTypes()->nonConstantProperty())
|
||||
return false;
|
||||
|
||||
// Get the current value of the property.
|
||||
Shape *shape = object()->singleton()->nativeLookupPure(id());
|
||||
if (!shape)
|
||||
Shape *shape = obj->nativeLookupPure(id());
|
||||
if (!shape || !shape->hasDefaultGetter() || !shape->hasSlot() || shape->hadOverwrite())
|
||||
return false;
|
||||
Value val = object()->singleton()->nativeGetSlot(shape->slot());
|
||||
|
||||
Value val = obj->nativeGetSlot(shape->slot());
|
||||
|
||||
// If the value is a pointer to an object in the nursery, don't optimize.
|
||||
if (val.isGCThing() && IsInsideNursery(val.toGCThing()))
|
||||
|
Loading…
Reference in New Issue
Block a user