mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 1187511 - IonMonkey: Make use of callsite type information when refining |this| parameter. r=jandem
This commit is contained in:
parent
df37acf297
commit
eb06b5c771
@ -10116,6 +10116,27 @@ IonBuilder::maybeUnboxForPropertyAccess(MDefinition* def)
|
||||
|
||||
MUnbox* unbox = MUnbox::New(alloc(), def, type, MUnbox::Fallible);
|
||||
current->add(unbox);
|
||||
|
||||
// Fixup type information for a common case where a property call
|
||||
// is converted to the following bytecodes
|
||||
//
|
||||
// a.foo()
|
||||
// ================= Compiles to ================
|
||||
// LOAD "a"
|
||||
// DUP
|
||||
// CALLPROP "foo"
|
||||
// SWAP
|
||||
// CALL 0
|
||||
//
|
||||
// If we have better type information to unbox the first copy going into
|
||||
// the CALLPROP operation, we can replace the duplicated copy on the
|
||||
// stack as well.
|
||||
if (*pc == JSOP_CALLPROP || *pc == JSOP_CALLELEM) {
|
||||
uint32_t idx = current->stackDepth() - 1;
|
||||
MOZ_ASSERT(current->getSlot(idx) == def);
|
||||
current->setSlot(idx, unbox);
|
||||
}
|
||||
|
||||
return unbox;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user