зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1526840 - Adapt ToBoolean Ion type inference for false BigInt values r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D19477 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
3421b8fcff
Коммит
0f6dea9684
|
@ -0,0 +1,12 @@
|
|||
|
||||
setJitCompilerOption("offthread-compilation.enable", 0);
|
||||
setJitCompilerOption("ion.warmup.trigger", 0);
|
||||
|
||||
for (let j = 0; j < 2; ++j) {
|
||||
let z = j ? 0n : 1;
|
||||
if (z) {
|
||||
z = 0;
|
||||
} else {
|
||||
z = 0;
|
||||
}
|
||||
}
|
|
@ -2805,7 +2805,13 @@ AbortReasonOr<Ok> IonBuilder::improveTypesAtTypeOfCompare(MCompare* ins,
|
|||
filter.addType(TypeSet::StringType(), alloc_->lifoAlloc());
|
||||
} else if (constant->toString() == TypeName(JSTYPE_SYMBOL, names)) {
|
||||
filter.addType(TypeSet::SymbolType(), alloc_->lifoAlloc());
|
||||
} else if (constant->toString() == TypeName(JSTYPE_OBJECT, names)) {
|
||||
}
|
||||
#ifdef ENABLE_BIGINT
|
||||
else if (constant->toString() == TypeName(JSTYPE_BIGINT, names)) {
|
||||
filter.addType(TypeSet::BigIntType(), alloc_->lifoAlloc());
|
||||
}
|
||||
#endif
|
||||
else if (constant->toString() == TypeName(JSTYPE_OBJECT, names)) {
|
||||
filter.addType(TypeSet::NullType(), alloc_->lifoAlloc());
|
||||
if (trueBranch) {
|
||||
filter.addType(TypeSet::AnyObjectType(), alloc_->lifoAlloc());
|
||||
|
@ -3049,6 +3055,10 @@ AbortReasonOr<Ok> IonBuilder::improveTypesAtTest(MDefinition* ins,
|
|||
alloc_->lifoAlloc()); // ToBoolean(0.0) == false
|
||||
base.addType(TypeSet::StringType(),
|
||||
alloc_->lifoAlloc()); // ToBoolean("") == false
|
||||
#ifdef ENABLE_BIGINT
|
||||
base.addType(TypeSet::BigIntType(),
|
||||
alloc_->lifoAlloc()); // ToBoolean(0n) == false
|
||||
#endif
|
||||
|
||||
// If the typeset does emulate undefined, then we cannot filter out
|
||||
// objects.
|
||||
|
|
|
@ -6206,7 +6206,11 @@ static bool TryAddTypeBarrierForWrite(TempAllocator& alloc,
|
|||
case MIRType::Int32:
|
||||
case MIRType::Double:
|
||||
case MIRType::String:
|
||||
case MIRType::Symbol: {
|
||||
case MIRType::Symbol:
|
||||
#ifdef ENABLE_BIGINT
|
||||
case MIRType::BigInt:
|
||||
#endif
|
||||
{
|
||||
// The property is a particular primitive type, guard by unboxing the
|
||||
// value before the write.
|
||||
if (!(*pvalue)->mightBeType(propertyType)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче