summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-29 11:22:30 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-29 14:28:55 +0000
commit323288bc72c48e7e7bedb17a93893bd37ece33b7 (patch)
tree835d3d34a6a73c8454188ab72d68d599d6230d06
parent3323a8eda3d4cbb29909f6761cee96cc5e164cf2 (diff)
downloadUXP-323288bc72c48e7e7bedb17a93893bd37ece33b7.tar
UXP-323288bc72c48e7e7bedb17a93893bd37ece33b7.tar.gz
UXP-323288bc72c48e7e7bedb17a93893bd37ece33b7.tar.lz
UXP-323288bc72c48e7e7bedb17a93893bd37ece33b7.tar.xz
UXP-323288bc72c48e7e7bedb17a93893bd37ece33b7.zip
[js] Don't improve TypeSets containing the magic-args type.
JIT optimizations involving the Javascript 'arguments' object could potentially confuse later optimizations, so we simply disable these optimizations as a DiD measure.
-rw-r--r--js/src/jit/IonBuilder.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
index f08baf865..3d0b73f04 100644
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -3823,7 +3823,7 @@ IonBuilder::improveTypesAtTypeOfCompare(MCompare* ins, bool trueBranch, MTest* t
tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(subject->type())), alloc_->lifoAlloc());
}
- if (inputTypes->unknown())
+ if (inputTypes->unknown() || inputTypes->hasType(TypeSet::MagicArgType()))
return true;
// Note: we cannot remove the AnyObject type in the false branch,
@@ -3905,7 +3905,7 @@ IonBuilder::improveTypesAtNullOrUndefinedCompare(MCompare* ins, bool trueBranch,
tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(subject->type())), alloc_->lifoAlloc());
}
- if (inputTypes->unknown())
+ if (inputTypes->unknown() || inputTypes->hasType(TypeSet::MagicArgType()))
return true;
TemporaryTypeSet* type;
@@ -3969,7 +3969,7 @@ IonBuilder::improveTypesAtTest(MDefinition* ins, bool trueBranch, MTest* test)
tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(subject->type())), alloc_->lifoAlloc());
}
- if (oldType->unknown())
+ if (oldType->unknown() || oldType->hasType(TypeSet::MagicArgType()))
return true;
TemporaryTypeSet* type = nullptr;
@@ -4049,7 +4049,7 @@ IonBuilder::improveTypesAtTest(MDefinition* ins, bool trueBranch, MTest* test)
}
// If ins does not have a typeset we return as we cannot optimize.
- if (oldType->unknown())
+ if (oldType->unknown() || oldType->hasType(TypeSet::MagicArgType()))
return true;
// Decide either to set or remove.