Bug 1328148: IonMonkey - Use MConcat for more cases, r=jandem

This commit is contained in:
Hannes Verschore 2017-01-05 10:22:16 +01:00
parent 54c8c2b1da
commit 642bdf9008
3 changed files with 14 additions and 6 deletions

View File

@ -107,6 +107,7 @@ namespace JS {
_(OperandNotNumber) \
_(OperandNotStringOrNumber) \
_(OperandNotSimpleArith) \
_(OperandNotEasilyCoercibleToString) \
_(StaticTypedArrayUint32) \
_(StaticTypedArrayCantComputeMask) \
_(OutOfBounds) \

View File

@ -188,6 +188,10 @@ Optimization failed because of failing to speculate the operand is a string or a
Optimization failed because of failing to speculate the operand is a simple arithmetic type. I.e. definitely not an object, string, symbol or internal magic type.
### OperandNotEasilyCoercibleToString
Optimization failed because of failing to speculate the operand can be easily coerced to a string. I.e. definitely not an object or symbol.
### StaticTypedArrayUint32
Typed Arrays of uint32 values are not yet fully optimized.

View File

@ -3180,14 +3180,17 @@ IonBuilder::binaryArithTryConcat(bool* emitted, JSOp op, MDefinition* left, MDef
return Ok();
}
// The none-string input (if present) should be atleast a numerical type.
// Which we can easily coerce to string.
if (right->type() != MIRType::String && !IsNumberType(right->type())) {
trackOptimizationOutcome(TrackedOutcome::OperandNotStringOrNumber);
// The non-string input (if present) should be atleast easily coercible to string.
if (right->type() != MIRType::String &&
(right->mightBeType(MIRType::Symbol) || right->mightBeType(MIRType::Object)))
{
trackOptimizationOutcome(TrackedOutcome::OperandNotEasilyCoercibleToString);
return Ok();
}
if (left->type() != MIRType::String && !IsNumberType(left->type())) {
trackOptimizationOutcome(TrackedOutcome::OperandNotStringOrNumber);
if (left->type() != MIRType::String &&
(left->mightBeType(MIRType::Symbol) || left->mightBeType(MIRType::Object)))
{
trackOptimizationOutcome(TrackedOutcome::OperandNotEasilyCoercibleToString);
return Ok();
}