mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063598 - Infer constant properties even when the type property has not yet been instantiated, r=jandem.
This commit is contained in:
parent
0751d5228c
commit
0597c16533
@ -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