зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1384737 - Retain result type information for getprop caches that only produce null/undefined values, r=jandem.
This commit is contained in:
Родитель
60b7d9f697
Коммит
4d5f6268b5
|
@ -0,0 +1,8 @@
|
|||
function f(x) {
|
||||
var count = 0;
|
||||
for (var i = 0; i < x.length; ++i)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
assertEq(f(Error()), 0);
|
||||
assertEq(f([[]]), 1);
|
|
@ -11367,8 +11367,13 @@ IonBuilder::getPropAddCache(MDefinition* obj, PropertyName* name,
|
|||
MOZ_TRY(resumeAfter(load));
|
||||
|
||||
MIRType rvalType = types->getKnownMIRType();
|
||||
if (barrier != BarrierKind::NoBarrier || IsNullOrUndefined(rvalType))
|
||||
if (barrier != BarrierKind::NoBarrier) {
|
||||
rvalType = MIRType::Value;
|
||||
} else {
|
||||
load->setResultTypeSet(types);
|
||||
if (IsNullOrUndefined(rvalType))
|
||||
rvalType = MIRType::Value;
|
||||
}
|
||||
load->setResultType(rvalType);
|
||||
|
||||
if (*pc != JSOP_CALLPROP || !IsNullOrUndefined(obj->type())) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче