Index: src/mips64/lithium-codegen-mips64.cc |
diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc |
index 02abc0ad97c751a16ddb5542a36641e4fba75a82..81b87d55c8ccbacbfe95fe2eb60bab1d9790f465 100644 |
--- a/src/mips64/lithium-codegen-mips64.cc |
+++ b/src/mips64/lithium-codegen-mips64.cc |
@@ -1067,8 +1067,7 @@ |
__ dsubu(dividend, zero_reg, dividend); |
__ And(dividend, dividend, Operand(mask)); |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, dividend, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", dividend, Operand(zero_reg)); |
} |
__ Branch(USE_DELAY_SLOT, &done); |
__ dsubu(dividend, zero_reg, dividend); |
@@ -1087,7 +1086,7 @@ |
DCHECK(!dividend.is(result)); |
if (divisor == 0) { |
- DeoptimizeIf(al, instr, Deoptimizer::kDivisionByZero); |
+ DeoptimizeIf(al, instr, "division by zero"); |
return; |
} |
@@ -1100,8 +1099,7 @@ |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
Label remainder_not_zero; |
__ Branch(&remainder_not_zero, ne, result, Operand(zero_reg)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, dividend, |
- Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "minus zero", dividend, Operand(zero_reg)); |
__ bind(&remainder_not_zero); |
} |
} |
@@ -1120,8 +1118,7 @@ |
// Check for x % 0, we have to deopt in this case because we can't return a |
// NaN. |
if (hmod->CheckFlag(HValue::kCanBeDivByZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, right_reg, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "division by zero", right_reg, Operand(zero_reg)); |
} |
// Check for kMinInt % -1, div will return kMinInt, which is not what we |
@@ -1130,7 +1127,7 @@ |
Label no_overflow_possible; |
__ Branch(&no_overflow_possible, ne, left_reg, Operand(kMinInt)); |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, right_reg, Operand(-1)); |
+ DeoptimizeIf(eq, instr, "minus zero", right_reg, Operand(-1)); |
} else { |
__ Branch(&no_overflow_possible, ne, right_reg, Operand(-1)); |
__ Branch(USE_DELAY_SLOT, &done); |
@@ -1143,8 +1140,7 @@ |
__ Branch(&done, ge, left_reg, Operand(zero_reg)); |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, result_reg, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", result_reg, Operand(zero_reg)); |
} |
__ bind(&done); |
} |
@@ -1160,19 +1156,18 @@ |
// Check for (0 / -x) that will produce negative zero. |
HDiv* hdiv = instr->hydrogen(); |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, dividend, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", dividend, Operand(zero_reg)); |
} |
// Check for (kMinInt / -1). |
if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kOverflow, dividend, Operand(kMinInt)); |
+ DeoptimizeIf(eq, instr, "overflow", dividend, Operand(kMinInt)); |
} |
// Deoptimize if remainder will not be 0. |
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) && |
divisor != 1 && divisor != -1) { |
int32_t mask = divisor < 0 ? -(divisor + 1) : (divisor - 1); |
__ And(at, dividend, Operand(mask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision, at, Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "lost precision", at, Operand(zero_reg)); |
} |
if (divisor == -1) { // Nice shortcut, not needed for correctness. |
@@ -1202,15 +1197,14 @@ |
DCHECK(!dividend.is(result)); |
if (divisor == 0) { |
- DeoptimizeIf(al, instr, Deoptimizer::kDivisionByZero); |
+ DeoptimizeIf(al, instr, "division by zero"); |
return; |
} |
// Check for (0 / -x) that will produce negative zero. |
HDiv* hdiv = instr->hydrogen(); |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, dividend, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", dividend, Operand(zero_reg)); |
} |
__ TruncatingDiv(result, dividend, Abs(divisor)); |
@@ -1219,8 +1213,7 @@ |
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { |
__ Dmul(scratch0(), result, Operand(divisor)); |
__ Dsubu(scratch0(), scratch0(), dividend); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision, scratch0(), |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "lost precision", scratch0(), Operand(zero_reg)); |
} |
} |
@@ -1238,16 +1231,14 @@ |
// Check for x / 0. |
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "division by zero", divisor, Operand(zero_reg)); |
} |
// Check for (0 / -x) that will produce negative zero. |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { |
Label left_not_zero; |
__ Branch(&left_not_zero, ne, dividend, Operand(zero_reg)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, divisor, |
- Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "minus zero", divisor, Operand(zero_reg)); |
__ bind(&left_not_zero); |
} |
@@ -1256,7 +1247,7 @@ |
!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) { |
Label left_not_min_int; |
__ Branch(&left_not_min_int, ne, dividend, Operand(kMinInt)); |
- DeoptimizeIf(eq, instr, Deoptimizer::kOverflow, divisor, Operand(-1)); |
+ DeoptimizeIf(eq, instr, "overflow", divisor, Operand(-1)); |
__ bind(&left_not_min_int); |
} |
@@ -1268,8 +1259,7 @@ |
} else { |
__ dmod(remainder, dividend, divisor); |
} |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision, remainder, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "lost precision", remainder, Operand(zero_reg)); |
} |
} |
@@ -1314,14 +1304,14 @@ |
__ Dsubu(result, zero_reg, dividend); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, result, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", result, Operand(zero_reg)); |
} |
__ Xor(scratch, scratch, result); |
// Dividing by -1 is basically negation, unless we overflow. |
if (divisor == -1) { |
if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) { |
- DeoptimizeIf(gt, instr, Deoptimizer::kOverflow, result, Operand(kMaxInt)); |
+ DeoptimizeIf(gt, instr, "overflow", result, Operand(kMaxInt)); |
} |
return; |
} |
@@ -1349,15 +1339,14 @@ |
DCHECK(!dividend.is(result)); |
if (divisor == 0) { |
- DeoptimizeIf(al, instr, Deoptimizer::kDivisionByZero); |
+ DeoptimizeIf(al, instr, "division by zero"); |
return; |
} |
// Check for (0 / -x) that will produce negative zero. |
HMathFloorOfDiv* hdiv = instr->hydrogen(); |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, dividend, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", dividend, Operand(zero_reg)); |
} |
// Easy case: We need no dynamic check for the dividend and the flooring |
@@ -1401,16 +1390,14 @@ |
// Check for x / 0. |
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "division by zero", divisor, Operand(zero_reg)); |
} |
// Check for (0 / -x) that will produce negative zero. |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { |
Label left_not_zero; |
__ Branch(&left_not_zero, ne, dividend, Operand(zero_reg)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, divisor, |
- Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "minus zero", divisor, Operand(zero_reg)); |
__ bind(&left_not_zero); |
} |
@@ -1419,7 +1406,7 @@ |
!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) { |
Label left_not_min_int; |
__ Branch(&left_not_min_int, ne, dividend, Operand(kMinInt)); |
- DeoptimizeIf(eq, instr, Deoptimizer::kOverflow, divisor, Operand(-1)); |
+ DeoptimizeIf(eq, instr, "overflow", divisor, Operand(-1)); |
__ bind(&left_not_min_int); |
} |
@@ -1456,15 +1443,14 @@ |
if (bailout_on_minus_zero && (constant < 0)) { |
// The case of a null constant will be handled separately. |
// If constant is negative and left is null, the result should be -0. |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, left, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", left, Operand(zero_reg)); |
} |
switch (constant) { |
case -1: |
if (overflow) { |
__ SubuAndCheckForOverflow(result, zero_reg, left, scratch); |
- DeoptimizeIf(gt, instr, Deoptimizer::kOverflow, scratch, |
- Operand(kMaxInt)); |
+ DeoptimizeIf(gt, instr, "overflow", scratch, Operand(kMaxInt)); |
} else { |
__ Dsubu(result, zero_reg, left); |
} |
@@ -1473,8 +1459,7 @@ |
if (bailout_on_minus_zero) { |
// If left is strictly negative and the constant is null, the |
// result is -0. Deoptimize if required, otherwise return 0. |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, left, |
- Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "minus zero", left, Operand(zero_reg)); |
} |
__ mov(result, zero_reg); |
break; |
@@ -1529,7 +1514,7 @@ |
if (instr->hydrogen()->representation().IsSmi()) { |
__ SmiTag(result); |
} |
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow, scratch, Operand(at)); |
+ DeoptimizeIf(ne, instr, "overflow", scratch, Operand(at)); |
} else { |
if (instr->hydrogen()->representation().IsSmi()) { |
__ SmiUntag(result, left); |
@@ -1544,8 +1529,7 @@ |
__ Xor(at, left, right); |
__ Branch(&done, ge, at, Operand(zero_reg)); |
// Bail out if the result is minus zero. |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, result, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "minus zero", result, Operand(zero_reg)); |
__ bind(&done); |
} |
} |
@@ -1609,10 +1593,8 @@ |
__ srlv(result, left, ToRegister(right_op)); |
if (instr->can_deopt()) { |
// TODO(yy): (-1) >>> 0. anything else? |
- DeoptimizeIf(lt, instr, Deoptimizer::kNegativeValue, result, |
- Operand(zero_reg)); |
- DeoptimizeIf(gt, instr, Deoptimizer::kNegativeValue, result, |
- Operand(kMaxInt)); |
+ DeoptimizeIf(lt, instr, "negative value", result, Operand(zero_reg)); |
+ DeoptimizeIf(gt, instr, "negative value", result, Operand(kMaxInt)); |
} |
break; |
case Token::SHL: |
@@ -1647,8 +1629,7 @@ |
} else { |
if (instr->can_deopt()) { |
__ And(at, left, Operand(0x80000000)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNegativeValue, at, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "negative value", at, Operand(zero_reg)); |
} |
__ Move(result, left); |
} |
@@ -1704,13 +1685,10 @@ |
ToRegister(right), |
overflow); // Reg at also used as scratch. |
} |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow, |
- Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "overflow", overflow, Operand(zero_reg)); |
if (!instr->hydrogen()->representation().IsSmi()) { |
- DeoptimizeIf(gt, instr, Deoptimizer::kOverflow, ToRegister(result), |
- Operand(kMaxInt)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, ToRegister(result), |
- Operand(kMinInt)); |
+ DeoptimizeIf(gt, instr, "overflow", ToRegister(result), Operand(kMaxInt)); |
+ DeoptimizeIf(lt, instr, "overflow", ToRegister(result), Operand(kMinInt)); |
} |
} |
} |
@@ -1765,10 +1743,9 @@ |
DCHECK(!scratch.is(object)); |
__ SmiTst(object, at); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "Smi", at, Operand(zero_reg)); |
__ GetObjectType(object, scratch, scratch); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotADateObject, scratch, |
- Operand(JS_DATE_TYPE)); |
+ DeoptimizeIf(ne, instr, "not a date object", scratch, Operand(JS_DATE_TYPE)); |
if (index->value() == 0) { |
__ ld(result, FieldMemOperand(object, JSDate::kValueOffset)); |
@@ -1903,14 +1880,11 @@ |
ToRegister(right), |
overflow); // Reg at also used as scratch. |
} |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow, |
- Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "overflow", overflow, Operand(zero_reg)); |
// if not smi, it must int32. |
if (!instr->hydrogen()->representation().IsSmi()) { |
- DeoptimizeIf(gt, instr, Deoptimizer::kOverflow, ToRegister(result), |
- Operand(kMaxInt)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, ToRegister(result), |
- Operand(kMinInt)); |
+ DeoptimizeIf(gt, instr, "overflow", ToRegister(result), Operand(kMaxInt)); |
+ DeoptimizeIf(lt, instr, "overflow", ToRegister(result), Operand(kMinInt)); |
} |
} |
} |
@@ -2172,7 +2146,7 @@ |
} else if (expected.NeedsMap()) { |
// If we need a map later and have a Smi -> deopt. |
__ SmiTst(reg, at); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "Smi", at, Operand(zero_reg)); |
} |
const Register map = scratch0(); |
@@ -2228,7 +2202,7 @@ |
if (!expected.IsGeneric()) { |
// We've seen something for the first time -> deopt. |
// This can only happen if we are not generic already. |
- DeoptimizeIf(al, instr, Deoptimizer::kUnexpectedObject, zero_reg, |
+ DeoptimizeIf(al, instr, "unexpected object", zero_reg, |
Operand(zero_reg)); |
} |
} |
@@ -2878,7 +2852,7 @@ |
__ ld(result, FieldMemOperand(at, Cell::kValueOffset)); |
if (instr->hydrogen()->RequiresHoleCheck()) { |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); |
+ DeoptimizeIf(eq, instr, "hole", result, Operand(at)); |
} |
} |
@@ -2933,7 +2907,7 @@ |
Register payload = ToRegister(instr->temp()); |
__ ld(payload, FieldMemOperand(cell, Cell::kValueOffset)); |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, payload, Operand(at)); |
+ DeoptimizeIf(eq, instr, "hole", payload, Operand(at)); |
} |
// Store the value. |
@@ -2951,7 +2925,7 @@ |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
if (instr->hydrogen()->DeoptimizesOnHole()) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); |
+ DeoptimizeIf(eq, instr, "hole", result, Operand(at)); |
} else { |
Label is_not_hole; |
__ Branch(&is_not_hole, ne, result, Operand(at)); |
@@ -2975,7 +2949,7 @@ |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
if (instr->hydrogen()->DeoptimizesOnHole()) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch, Operand(at)); |
+ DeoptimizeIf(eq, instr, "hole", scratch, Operand(at)); |
} else { |
__ Branch(&skip_assignment, ne, scratch, Operand(at)); |
} |
@@ -3070,7 +3044,7 @@ |
// Check that the function has a prototype or an initial map. |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); |
+ DeoptimizeIf(eq, instr, "hole", result, Operand(at)); |
// If the function does not have an initial map, we're done. |
Label done; |
@@ -3216,8 +3190,8 @@ |
case UINT32_ELEMENTS: |
__ lw(result, mem_operand); |
if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { |
- DeoptimizeIf(Ugreater_equal, instr, Deoptimizer::kNegativeValue, |
- result, Operand(0x80000000)); |
+ DeoptimizeIf(Ugreater_equal, instr, "negative value", result, |
+ Operand(0x80000000)); |
} |
break; |
case FLOAT32_ELEMENTS: |
@@ -3277,7 +3251,7 @@ |
if (instr->hydrogen()->RequiresHoleCheck()) { |
__ lwu(scratch, MemOperand(scratch, sizeof(kHoleNanLower32))); |
- DeoptimizeIf(eq, instr, Deopt::kHole, scratch, Operand(kHoleNanUpper32)); |
+ DeoptimizeIf(eq, instr, "hole", scratch, Operand(kHoleNanUpper32)); |
} |
} |
@@ -3331,11 +3305,10 @@ |
if (hinstr->RequiresHoleCheck()) { |
if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
__ SmiTst(result, scratch); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "not a Smi", scratch, Operand(zero_reg)); |
} else { |
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); |
+ DeoptimizeIf(eq, instr, "hole", result, Operand(scratch)); |
} |
} |
} |
@@ -3491,10 +3464,10 @@ |
// Deoptimize if the receiver is not a JS object. |
__ SmiTst(receiver, scratch); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, scratch, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "Smi", scratch, Operand(zero_reg)); |
__ GetObjectType(receiver, scratch, scratch); |
- DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject, scratch, |
+ DeoptimizeIf(lt, instr, "not a JavaScript object", scratch, |
Operand(FIRST_SPEC_OBJECT_TYPE)); |
__ Branch(&result_in_receiver); |
@@ -3530,7 +3503,7 @@ |
// Copy the arguments to this function possibly from the |
// adaptor frame below it. |
const uint32_t kArgumentsLimit = 1 * KB; |
- DeoptimizeIf(hi, instr, Deoptimizer::kTooManyArguments, length, |
+ DeoptimizeIf(hi, instr, "too many arguments", length, |
Operand(kArgumentsLimit)); |
// Push the receiver and use the register to keep the original |
@@ -3656,7 +3629,7 @@ |
// Deoptimize if not a heap number. |
__ ld(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, scratch, Operand(at)); |
+ DeoptimizeIf(ne, instr, "not a heap number", scratch, Operand(at)); |
Label done; |
Register exponent = scratch0(); |
@@ -3723,7 +3696,7 @@ |
__ mov(result, input); |
__ dsubu(result, zero_reg, input); |
// Overflow if result is still negative, i.e. 0x80000000. |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, result, Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "overflow", result, Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -3778,7 +3751,7 @@ |
except_flag); |
// Deopt if the operation did not succeed. |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, "lost precision or NaN", except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -3787,8 +3760,7 @@ |
__ Branch(&done, ne, result, Operand(zero_reg)); |
__ mfhc1(scratch1, input); // Get exponent/sign bits. |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "minus zero", scratch1, Operand(zero_reg)); |
__ bind(&done); |
} |
} |
@@ -3821,7 +3793,7 @@ |
// The following conversion will not work with numbers |
// outside of ]-2^32, 2^32[. |
- DeoptimizeIf(ge, instr, Deoptimizer::kOverflow, scratch, |
+ DeoptimizeIf(ge, instr, "overflow", scratch, |
Operand(HeapNumber::kExponentBias + 32)); |
// Save the original sign for later comparison. |
@@ -3839,7 +3811,7 @@ |
__ Xor(result, result, Operand(scratch)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
// ARM uses 'mi' here, which is 'lt' |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, result, Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "minus zero", result, Operand(zero_reg)); |
} else { |
Label skip2; |
// ARM uses 'mi' here, which is 'lt' |
@@ -3858,7 +3830,7 @@ |
double_scratch1, |
except_flag); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, "lost precision or NaN", except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -3867,8 +3839,7 @@ |
__ bind(&check_sign_on_zero); |
__ mfhc1(scratch, input); // Get exponent/sign bits. |
__ And(scratch, scratch, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "minus zero", scratch, Operand(zero_reg)); |
} |
__ bind(&done); |
} |
@@ -3934,7 +3905,7 @@ |
DCHECK(!a7.is(tagged_exponent)); |
__ lw(a7, FieldMemOperand(tagged_exponent, HeapObject::kMapOffset)); |
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, a7, Operand(at)); |
+ DeoptimizeIf(ne, instr, "not a heap number", a7, Operand(at)); |
__ bind(&no_deopt); |
MathPowStub stub(isolate(), MathPowStub::TAGGED); |
__ CallStub(&stub); |
@@ -4335,7 +4306,7 @@ |
__ stop("eliminated bounds check failed"); |
__ bind(&done); |
} else { |
- DeoptimizeIf(cc, instr, Deoptimizer::kOutOfBounds, reg, operand); |
+ DeoptimizeIf(cc, instr, "out of bounds", reg, operand); |
} |
} |
@@ -4626,7 +4597,7 @@ |
Label no_memento_found; |
__ TestJSArrayForAllocationMemento(object, temp, &no_memento_found, |
ne, &no_memento_found); |
- DeoptimizeIf(al, instr, Deoptimizer::kMementoFound); |
+ DeoptimizeIf(al, instr, "memento found"); |
__ bind(&no_memento_found); |
} |
@@ -4929,12 +4900,12 @@ |
if (hchange->CheckFlag(HValue::kCanOverflow) && |
hchange->value()->CheckFlag(HValue::kUint32)) { |
__ And(at, input, Operand(0x80000000)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow, at, Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "overflow", at, Operand(zero_reg)); |
} |
if (hchange->CheckFlag(HValue::kCanOverflow) && |
!hchange->value()->CheckFlag(HValue::kUint32)) { |
__ SmiTagCheckOverflow(output, input, at); |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, at, Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, "overflow", at, Operand(zero_reg)); |
} else { |
__ SmiTag(output, input); |
} |
@@ -4950,7 +4921,7 @@ |
// If the input is a HeapObject, value of scratch won't be zero. |
__ And(scratch, input, Operand(kHeapObjectTag)); |
__ SmiUntag(result, input); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "not a Smi", scratch, Operand(zero_reg)); |
} else { |
__ SmiUntag(result, input); |
} |
@@ -4975,8 +4946,7 @@ |
if (can_convert_undefined_to_nan) { |
__ Branch(&convert, ne, scratch, Operand(at)); |
} else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, scratch, |
- Operand(at)); |
+ DeoptimizeIf(ne, instr, "not a heap number", scratch, Operand(at)); |
} |
// Load heap number. |
__ ldc1(result_reg, FieldMemOperand(input_reg, HeapNumber::kValueOffset)); |
@@ -4984,7 +4954,7 @@ |
__ mfc1(at, result_reg); |
__ Branch(&done, ne, at, Operand(zero_reg)); |
__ mfhc1(scratch, result_reg); // Get exponent/sign bits. |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, scratch, |
+ DeoptimizeIf(eq, instr, "minus zero", scratch, |
Operand(HeapNumber::kSignMask)); |
} |
__ Branch(&done); |
@@ -4992,7 +4962,7 @@ |
__ bind(&convert); |
// Convert undefined (and hole) to NaN. |
__ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefined, input_reg, |
+ DeoptimizeIf(ne, instr, "not a heap number/undefined", input_reg, |
Operand(at)); |
__ LoadRoot(scratch, Heap::kNanValueRootIndex); |
__ ldc1(result_reg, FieldMemOperand(scratch, HeapNumber::kValueOffset)); |
@@ -5057,13 +5027,12 @@ |
__ bind(&check_false); |
__ LoadRoot(at, Heap::kFalseValueRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefinedTrueFalse, |
- scratch2, Operand(at)); |
+ DeoptimizeIf(ne, instr, "not a heap number/undefined/true/false", scratch2, |
+ Operand(at)); |
__ Branch(USE_DELAY_SLOT, &done); |
__ mov(input_reg, zero_reg); // In delay slot. |
} else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, scratch1, |
- Operand(at)); |
+ DeoptimizeIf(ne, instr, "not a heap number", scratch1, Operand(at)); |
// Load the double value. |
__ ldc1(double_scratch, |
@@ -5078,7 +5047,7 @@ |
except_flag, |
kCheckForInexactConversion); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, "lost precision or NaN", except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -5086,8 +5055,7 @@ |
__ mfhc1(scratch1, double_scratch); // Get exponent/sign bits. |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "minus zero", scratch1, Operand(zero_reg)); |
} |
} |
__ bind(&done); |
@@ -5163,7 +5131,7 @@ |
kCheckForInexactConversion); |
// Deopt if the operation did not succeed (except_flag != 0). |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, "lost precision or NaN", except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -5171,8 +5139,7 @@ |
__ Branch(&done, ne, result_reg, Operand(zero_reg)); |
__ mfhc1(scratch1, double_input); // Get exponent/sign bits. |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "minus zero", scratch1, Operand(zero_reg)); |
__ bind(&done); |
} |
} |
@@ -5198,7 +5165,7 @@ |
kCheckForInexactConversion); |
// Deopt if the operation did not succeed (except_flag != 0). |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, "lost precision or NaN", except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -5206,8 +5173,7 @@ |
__ Branch(&done, ne, result_reg, Operand(zero_reg)); |
__ mfhc1(scratch1, double_input); // Get exponent/sign bits. |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
- Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "minus zero", scratch1, Operand(zero_reg)); |
__ bind(&done); |
} |
} |
@@ -5218,7 +5184,7 @@ |
void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
LOperand* input = instr->value(); |
__ SmiTst(ToRegister(input), at); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, at, Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, "not a Smi", at, Operand(zero_reg)); |
} |
@@ -5226,7 +5192,7 @@ |
if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
LOperand* input = instr->value(); |
__ SmiTst(ToRegister(input), at); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "Smi", at, Operand(zero_reg)); |
} |
} |
@@ -5244,15 +5210,12 @@ |
// If there is only one type in the interval check for equality. |
if (first == last) { |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongInstanceType, scratch, |
- Operand(first)); |
+ DeoptimizeIf(ne, instr, "wrong instance type", scratch, Operand(first)); |
} else { |
- DeoptimizeIf(lo, instr, Deoptimizer::kWrongInstanceType, scratch, |
- Operand(first)); |
+ DeoptimizeIf(lo, instr, "wrong instance type", scratch, Operand(first)); |
// Omit check for the last type. |
if (last != LAST_TYPE) { |
- DeoptimizeIf(hi, instr, Deoptimizer::kWrongInstanceType, scratch, |
- Operand(last)); |
+ DeoptimizeIf(hi, instr, "wrong instance type", scratch, Operand(last)); |
} |
} |
} else { |
@@ -5263,12 +5226,11 @@ |
if (base::bits::IsPowerOfTwo32(mask)) { |
DCHECK(tag == 0 || base::bits::IsPowerOfTwo32(tag)); |
__ And(at, scratch, mask); |
- DeoptimizeIf(tag == 0 ? ne : eq, instr, Deoptimizer::kWrongInstanceType, |
- at, Operand(zero_reg)); |
+ DeoptimizeIf(tag == 0 ? ne : eq, instr, "wrong instance type", at, |
+ Operand(zero_reg)); |
} else { |
__ And(scratch, scratch, Operand(mask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongInstanceType, scratch, |
- Operand(tag)); |
+ DeoptimizeIf(ne, instr, "wrong instance type", scratch, Operand(tag)); |
} |
} |
} |
@@ -5283,9 +5245,9 @@ |
Handle<Cell> cell = isolate()->factory()->NewCell(object); |
__ li(at, Operand(Handle<Object>(cell))); |
__ ld(at, FieldMemOperand(at, Cell::kValueOffset)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(at)); |
- } else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(object)); |
+ DeoptimizeIf(ne, instr, "value mismatch", reg, Operand(at)); |
+ } else { |
+ DeoptimizeIf(ne, instr, "value mismatch", reg, Operand(object)); |
} |
} |
@@ -5301,8 +5263,7 @@ |
__ StoreToSafepointRegisterSlot(v0, scratch0()); |
} |
__ SmiTst(scratch0(), at); |
- DeoptimizeIf(eq, instr, Deoptimizer::kInstanceMigrationFailed, at, |
- Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "instance migration failed", at, Operand(zero_reg)); |
} |
@@ -5356,7 +5317,7 @@ |
if (instr->hydrogen()->HasMigrationTarget()) { |
__ Branch(deferred->entry(), ne, map_reg, Operand(map)); |
} else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap, map_reg, Operand(map)); |
+ DeoptimizeIf(ne, instr, "wrong map", map_reg, Operand(map)); |
} |
__ bind(&success); |
@@ -5394,7 +5355,7 @@ |
// Check for undefined. Undefined is converted to zero for clamping |
// conversions. |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefined, input_reg, |
+ DeoptimizeIf(ne, instr, "not a heap number/undefined", input_reg, |
Operand(factory()->undefined_value())); |
__ mov(result_reg, zero_reg); |
__ jmp(&done); |
@@ -5910,18 +5871,18 @@ |
Register result = ToRegister(instr->result()); |
Register object = ToRegister(instr->object()); |
__ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kUndefined, object, Operand(at)); |
+ DeoptimizeIf(eq, instr, "undefined", object, Operand(at)); |
Register null_value = a5; |
__ LoadRoot(null_value, Heap::kNullValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kNull, object, Operand(null_value)); |
+ DeoptimizeIf(eq, instr, "null", object, Operand(null_value)); |
__ And(at, object, kSmiTagMask); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "Smi", at, Operand(zero_reg)); |
STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
__ GetObjectType(object, a1, a1); |
- DeoptimizeIf(le, instr, Deoptimizer::kNotAJavaScriptObject, a1, |
+ DeoptimizeIf(le, instr, "not a JavaScript object", a1, |
Operand(LAST_JS_PROXY_TYPE)); |
Label use_cache, call_runtime; |
@@ -5939,7 +5900,7 @@ |
__ ld(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
DCHECK(result.is(v0)); |
__ LoadRoot(at, Heap::kMetaMapRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap, a1, Operand(at)); |
+ DeoptimizeIf(ne, instr, "wrong map", a1, Operand(at)); |
__ bind(&use_cache); |
} |
@@ -5959,7 +5920,7 @@ |
FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); |
__ ld(result, |
FieldMemOperand(result, FixedArray::SizeFor(instr->idx()))); |
- DeoptimizeIf(eq, instr, Deoptimizer::kNoCache, result, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, "no cache", result, Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -5969,7 +5930,7 @@ |
Register object = ToRegister(instr->value()); |
Register map = ToRegister(instr->map()); |
__ ld(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap, map, Operand(scratch0())); |
+ DeoptimizeIf(ne, instr, "wrong map", map, Operand(scratch0())); |
} |