mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1012798 part 3. When doing a DOM slot get in Ion, check whether we're doing a get of a constant value on a singleton object (e.g. .window) and if so just use the constant value directly. r=efaust
This commit is contained in:
parent
30dbf04fde
commit
d29d4a299d
@ -9704,6 +9704,16 @@ IonBuilder::getPropTryCommonGetter(bool *emitted, MDefinition *obj, PropertyName
|
||||
const JSJitInfo *jitinfo = commonGetter->jitInfo();
|
||||
MInstruction *get;
|
||||
if (jitinfo->isAlwaysInSlot) {
|
||||
// If our object is a singleton and we know the property is
|
||||
// constant (which is true if and only if the get doesn't alias
|
||||
// anything), we can just read the slot here and use that constant.
|
||||
JSObject *singleton = objTypes->getSingleton();
|
||||
if (singleton && jitinfo->aliasSet() == JSJitInfo::AliasNone) {
|
||||
size_t slot = jitinfo->slotIndex;
|
||||
*emitted = true;
|
||||
return pushConstant(GetReservedSlot(singleton, slot));
|
||||
}
|
||||
|
||||
// We can't use MLoadFixedSlot here because it might not have the
|
||||
// right aliasing behavior; we want to alias DOM setters as needed.
|
||||
get = MGetDOMMember::New(alloc(), jitinfo, obj, guard, globalGuard);
|
||||
|
Loading…
Reference in New Issue
Block a user