Index: src/crankshaft/mips/lithium-codegen-mips.cc |
diff --git a/src/crankshaft/mips/lithium-codegen-mips.cc b/src/crankshaft/mips/lithium-codegen-mips.cc |
index d1df69d7af53e41f4ec0d37c440320a45b420597..e2b781efa72b932193f833c9b0fa6d90f6204421 100644 |
--- a/src/crankshaft/mips/lithium-codegen-mips.cc |
+++ b/src/crankshaft/mips/lithium-codegen-mips.cc |
@@ -744,9 +744,8 @@ void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment, |
} |
} |
- |
void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, |
- Deoptimizer::DeoptReason deopt_reason, |
+ DeoptimizeReason deopt_reason, |
Deoptimizer::BailoutType bailout_type, |
Register src1, const Operand& src2) { |
LEnvironment* environment = instr->environment(); |
@@ -811,10 +810,9 @@ void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, |
} |
} |
- |
void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr, |
- Deoptimizer::DeoptReason deopt_reason, |
- Register src1, const Operand& src2) { |
+ DeoptimizeReason deopt_reason, Register src1, |
+ const Operand& src2) { |
Deoptimizer::BailoutType bailout_type = info()->IsStub() |
? Deoptimizer::LAZY |
: Deoptimizer::EAGER; |
@@ -946,7 +944,7 @@ void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) { |
__ subu(dividend, zero_reg, dividend); |
__ And(dividend, dividend, Operand(mask)); |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, dividend, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, dividend, |
Operand(zero_reg)); |
} |
__ Branch(USE_DELAY_SLOT, &done); |
@@ -979,7 +977,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) { |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
Label remainder_not_zero; |
__ Branch(&remainder_not_zero, ne, result, Operand(zero_reg)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, dividend, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero, dividend, |
Operand(zero_reg)); |
__ bind(&remainder_not_zero); |
} |
@@ -999,7 +997,7 @@ void LCodeGen::DoModI(LModI* instr) { |
// 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, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kDivisionByZero, right_reg, |
Operand(zero_reg)); |
} |
@@ -1009,7 +1007,8 @@ void LCodeGen::DoModI(LModI* instr) { |
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, DeoptimizeReason::kMinusZero, right_reg, |
+ Operand(-1)); |
} else { |
__ Branch(&no_overflow_possible, ne, right_reg, Operand(-1)); |
__ Branch(USE_DELAY_SLOT, &done); |
@@ -1021,7 +1020,7 @@ void LCodeGen::DoModI(LModI* instr) { |
// If we care about -0, test if the dividend is <0 and the result is 0. |
__ Branch(&done, ge, left_reg, Operand(zero_reg)); |
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, result_reg, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, result_reg, |
Operand(zero_reg)); |
} |
__ bind(&done); |
@@ -1038,19 +1037,21 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) { |
// 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, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, 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, DeoptimizeReason::kOverflow, 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, DeoptimizeReason::kLostPrecision, at, |
+ Operand(zero_reg)); |
} |
if (divisor == -1) { // Nice shortcut, not needed for correctness. |
@@ -1087,7 +1088,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) { |
// 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, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, dividend, |
Operand(zero_reg)); |
} |
@@ -1097,7 +1098,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) { |
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { |
__ Mul(scratch0(), result, Operand(divisor)); |
__ Subu(scratch0(), scratch0(), dividend); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision, scratch0(), |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecision, scratch0(), |
Operand(zero_reg)); |
} |
} |
@@ -1117,7 +1118,7 @@ void LCodeGen::DoDivI(LDivI* instr) { |
// Check for x / 0. |
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kDivisionByZero, divisor, |
Operand(zero_reg)); |
} |
@@ -1125,7 +1126,7 @@ void LCodeGen::DoDivI(LDivI* instr) { |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { |
Label left_not_zero; |
__ Branch(&left_not_zero, ne, dividend, Operand(zero_reg)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, divisor, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero, divisor, |
Operand(zero_reg)); |
__ bind(&left_not_zero); |
} |
@@ -1135,12 +1136,12 @@ void LCodeGen::DoDivI(LDivI* instr) { |
!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, DeoptimizeReason::kOverflow, divisor, Operand(-1)); |
__ bind(&left_not_min_int); |
} |
if (!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) { |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision, remainder, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecision, remainder, |
Operand(zero_reg)); |
} |
} |
@@ -1187,14 +1188,15 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) { |
__ Subu(result, zero_reg, dividend); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, result, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, result, |
+ Operand(zero_reg)); |
} |
// Dividing by -1 is basically negation, unless we overflow. |
__ Xor(scratch, scratch, result); |
if (divisor == -1) { |
if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) { |
- DeoptimizeIf(ge, instr, Deoptimizer::kOverflow, scratch, |
+ DeoptimizeIf(ge, instr, DeoptimizeReason::kOverflow, scratch, |
Operand(zero_reg)); |
} |
return; |
@@ -1230,7 +1232,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) { |
// 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, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, dividend, |
Operand(zero_reg)); |
} |
@@ -1275,7 +1277,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) { |
// Check for x / 0. |
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kDivisionByZero, divisor, |
Operand(zero_reg)); |
} |
@@ -1283,7 +1285,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) { |
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { |
Label left_not_zero; |
__ Branch(&left_not_zero, ne, dividend, Operand(zero_reg)); |
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero, divisor, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero, divisor, |
Operand(zero_reg)); |
__ bind(&left_not_zero); |
} |
@@ -1293,7 +1295,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) { |
!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, DeoptimizeReason::kOverflow, divisor, Operand(-1)); |
__ bind(&left_not_min_int); |
} |
@@ -1324,7 +1326,8 @@ void LCodeGen::DoMulI(LMulI* instr) { |
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, DeoptimizeReason::kMinusZero, left, |
+ Operand(zero_reg)); |
} |
switch (constant) { |
@@ -1342,7 +1345,7 @@ void LCodeGen::DoMulI(LMulI* instr) { |
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, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero, left, |
Operand(zero_reg)); |
} |
__ mov(result, zero_reg); |
@@ -1394,7 +1397,8 @@ void LCodeGen::DoMulI(LMulI* instr) { |
__ Mul(scratch, result, left, right); |
} |
__ sra(at, result, 31); |
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow, scratch, Operand(at)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow, scratch, |
+ Operand(at)); |
} else { |
if (instr->hydrogen()->representation().IsSmi()) { |
__ SmiUntag(result, left); |
@@ -1409,7 +1413,7 @@ void LCodeGen::DoMulI(LMulI* instr) { |
__ 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, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, result, |
Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -1474,7 +1478,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
case Token::SHR: |
__ srlv(result, left, ToRegister(right_op)); |
if (instr->can_deopt()) { |
- DeoptimizeIf(lt, instr, Deoptimizer::kNegativeValue, result, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kNegativeValue, result, |
Operand(zero_reg)); |
} |
break; |
@@ -1510,7 +1514,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
} else { |
if (instr->can_deopt()) { |
__ And(at, left, Operand(0x80000000)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNegativeValue, at, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNegativeValue, at, |
Operand(zero_reg)); |
} |
__ Move(result, left); |
@@ -1526,7 +1530,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
} else { |
__ SmiTagCheckOverflow(result, left, scratch); |
} |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, scratch, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, scratch, |
Operand(zero_reg)); |
} else { |
__ sll(result, left, shift_count); |
@@ -1959,7 +1963,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
} 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, DeoptimizeReason::kSmi, at, Operand(zero_reg)); |
} |
const Register map = scratch0(); |
@@ -2023,7 +2027,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
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, DeoptimizeReason::kUnexpectedObject, zero_reg, |
Operand(zero_reg)); |
} |
} |
@@ -2402,12 +2406,12 @@ void LCodeGen::DoHasInPrototypeChainAndBranch( |
FieldMemOperand(object_map, Map::kBitFieldOffset)); |
__ And(object_instance_type, object_instance_type, |
Operand(1 << Map::kIsAccessCheckNeeded)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kAccessCheck, object_instance_type, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kAccessCheck, object_instance_type, |
Operand(zero_reg)); |
// Deoptimize for proxies. |
__ lbu(object_instance_type, |
FieldMemOperand(object_map, Map::kInstanceTypeOffset)); |
- DeoptimizeIf(eq, instr, Deoptimizer::kProxy, object_instance_type, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kProxy, object_instance_type, |
Operand(JS_PROXY_TYPE)); |
__ lw(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); |
@@ -2528,7 +2532,7 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
if (instr->hydrogen()->DeoptimizesOnHole()) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, Operand(at)); |
} else { |
Label is_not_hole; |
__ Branch(&is_not_hole, ne, result, Operand(at)); |
@@ -2552,7 +2556,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
__ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
if (instr->hydrogen()->DeoptimizesOnHole()) { |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch, Operand(at)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, scratch, Operand(at)); |
} else { |
__ Branch(&skip_assignment, ne, scratch, Operand(at)); |
} |
@@ -2629,7 +2633,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
// 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, DeoptimizeReason::kHole, result, Operand(at)); |
// If the function does not have an initial map, we're done. |
Label done; |
@@ -2749,7 +2753,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { |
case UINT32_ELEMENTS: |
__ lw(result, mem_operand); |
if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { |
- DeoptimizeIf(Ugreater_equal, instr, Deoptimizer::kNegativeValue, |
+ DeoptimizeIf(Ugreater_equal, instr, DeoptimizeReason::kNegativeValue, |
result, Operand(0x80000000)); |
} |
break; |
@@ -2804,7 +2808,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { |
if (instr->hydrogen()->RequiresHoleCheck()) { |
__ lw(scratch, MemOperand(scratch, kHoleNanUpper32Offset)); |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, scratch, |
Operand(kHoleNanUpper32)); |
} |
} |
@@ -2839,11 +2843,12 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
if (instr->hydrogen()->RequiresHoleCheck()) { |
if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
__ SmiTst(result, scratch); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, scratch, |
Operand(zero_reg)); |
} else { |
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
- DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, |
+ Operand(scratch)); |
} |
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); |
@@ -2856,7 +2861,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
// it needs to bail out. |
__ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
__ lw(result, FieldMemOperand(result, Cell::kValueOffset)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kHole, result, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kHole, result, |
Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); |
} |
__ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
@@ -3006,10 +3011,10 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
// Deoptimize if the receiver is not a JS object. |
__ SmiTst(receiver, scratch); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, scratch, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, scratch, Operand(zero_reg)); |
__ GetObjectType(receiver, scratch, scratch); |
- DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject, scratch, |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kNotAJavaScriptObject, scratch, |
Operand(FIRST_JS_RECEIVER_TYPE)); |
__ Branch(&result_in_receiver); |
@@ -3043,7 +3048,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
// 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, DeoptimizeReason::kTooManyArguments, length, |
Operand(kArgumentsLimit)); |
// Push the receiver and use the register to keep the original |
@@ -3196,7 +3201,8 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { |
// Deoptimize if not a heap number. |
__ lw(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, scratch, Operand(at)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber, scratch, |
+ Operand(at)); |
Label done; |
Register exponent = scratch0(); |
@@ -3263,7 +3269,8 @@ void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) { |
__ mov(result, input); |
__ subu(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, DeoptimizeReason::kOverflow, result, |
+ Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -3318,7 +3325,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) { |
except_flag); |
// Deopt if the operation did not succeed. |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN, except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -3327,7 +3334,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) { |
__ Branch(&done, ne, result, Operand(zero_reg)); |
__ Mfhc1(scratch1, input); |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kMinusZero, scratch1, |
Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -3361,7 +3368,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { |
// The following conversion will not work with numbers |
// outside of ]-2^32, 2^32[. |
- DeoptimizeIf(ge, instr, Deoptimizer::kOverflow, scratch, |
+ DeoptimizeIf(ge, instr, DeoptimizeReason::kOverflow, scratch, |
Operand(HeapNumber::kExponentBias + 32)); |
// Save the original sign for later comparison. |
@@ -3376,7 +3383,8 @@ void LCodeGen::DoMathRound(LMathRound* instr) { |
__ 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, DeoptimizeReason::kMinusZero, result, |
+ Operand(zero_reg)); |
} else { |
Label skip2; |
// ARM uses 'mi' here, which is 'lt' |
@@ -3395,7 +3403,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { |
double_scratch1, |
except_flag); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN, except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -3404,7 +3412,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) { |
__ bind(&check_sign_on_zero); |
__ Mfhc1(scratch, input); |
__ And(scratch, scratch, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kMinusZero, scratch, |
Operand(zero_reg)); |
} |
__ bind(&done); |
@@ -3471,7 +3479,7 @@ void LCodeGen::DoPower(LPower* instr) { |
DCHECK(!t3.is(tagged_exponent)); |
__ lw(t3, FieldMemOperand(tagged_exponent, HeapObject::kMapOffset)); |
__ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, t3, Operand(at)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber, t3, Operand(at)); |
__ bind(&no_deopt); |
MathPowStub stub(isolate(), MathPowStub::TAGGED); |
__ CallStub(&stub); |
@@ -3825,7 +3833,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
__ stop("eliminated bounds check failed"); |
__ bind(&done); |
} else { |
- DeoptimizeIf(cc, instr, Deoptimizer::kOutOfBounds, reg, operand); |
+ DeoptimizeIf(cc, instr, DeoptimizeReason::kOutOfBounds, reg, operand); |
} |
} |
@@ -4131,7 +4139,7 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) { |
// Deopt on smi, which means the elements array changed to dictionary mode. |
__ SmiTst(result, at); |
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, at, Operand(zero_reg)); |
} |
@@ -4498,12 +4506,12 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) { |
if (hchange->CheckFlag(HValue::kCanOverflow) && |
hchange->value()->CheckFlag(HValue::kUint32)) { |
__ And(at, input, Operand(0xc0000000)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow, at, Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow, 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, DeoptimizeReason::kOverflow, at, Operand(zero_reg)); |
} else { |
__ SmiTag(output, input); |
} |
@@ -4519,7 +4527,8 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
// 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, DeoptimizeReason::kNotASmi, scratch, |
+ Operand(zero_reg)); |
} else { |
__ SmiUntag(result, input); |
} |
@@ -4544,7 +4553,7 @@ void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg, |
if (can_convert_undefined_to_nan) { |
__ Branch(&convert, ne, scratch, Operand(at)); |
} else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, scratch, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber, scratch, |
Operand(at)); |
} |
// Load heap number. |
@@ -4553,7 +4562,7 @@ void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg, |
__ mfc1(at, result_reg.low()); |
__ Branch(&done, ne, at, Operand(zero_reg)); |
__ Mfhc1(scratch, result_reg); |
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, scratch, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, scratch, |
Operand(HeapNumber::kSignMask)); |
} |
__ Branch(&done); |
@@ -4561,8 +4570,8 @@ void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg, |
__ bind(&convert); |
// Convert undefined (and hole) to NaN. |
__ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefined, input_reg, |
- Operand(at)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefined, |
+ input_reg, Operand(at)); |
__ LoadRoot(scratch, Heap::kNanValueRootIndex); |
__ ldc1(result_reg, FieldMemOperand(scratch, HeapNumber::kValueOffset)); |
__ Branch(&done); |
@@ -4626,12 +4635,12 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
__ bind(&check_false); |
__ LoadRoot(at, Heap::kFalseValueRootIndex); |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefinedBoolean, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefinedBoolean, |
scratch2, Operand(at)); |
__ Branch(USE_DELAY_SLOT, &done); |
__ mov(input_reg, zero_reg); // In delay slot. |
} else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber, scratch1, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber, scratch1, |
Operand(at)); |
// Load the double value. |
@@ -4647,7 +4656,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
except_flag, |
kCheckForInexactConversion); |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN, except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -4655,7 +4664,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
__ Mfhc1(scratch1, double_scratch); |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kMinusZero, scratch1, |
Operand(zero_reg)); |
} |
} |
@@ -4732,7 +4741,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
kCheckForInexactConversion); |
// Deopt if the operation did not succeed (except_flag != 0). |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN, except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -4740,7 +4749,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
__ Branch(&done, ne, result_reg, Operand(zero_reg)); |
__ Mfhc1(scratch1, double_input); |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kMinusZero, scratch1, |
Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -4767,7 +4776,7 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) { |
kCheckForInexactConversion); |
// Deopt if the operation did not succeed (except_flag != 0). |
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN, except_flag, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN, except_flag, |
Operand(zero_reg)); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
@@ -4775,20 +4784,21 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) { |
__ Branch(&done, ne, result_reg, Operand(zero_reg)); |
__ Mfhc1(scratch1, double_input); |
__ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kMinusZero, scratch1, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kMinusZero, scratch1, |
Operand(zero_reg)); |
__ bind(&done); |
} |
} |
__ SmiTagCheckOverflow(result_reg, result_reg, scratch1); |
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, scratch1, Operand(zero_reg)); |
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, scratch1, |
+ Operand(zero_reg)); |
} |
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, DeoptimizeReason::kNotASmi, at, Operand(zero_reg)); |
} |
@@ -4796,7 +4806,7 @@ void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
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, DeoptimizeReason::kSmi, at, Operand(zero_reg)); |
} |
} |
@@ -4809,7 +4819,8 @@ void LCodeGen::DoCheckArrayBufferNotNeutered( |
__ lw(scratch, FieldMemOperand(view, JSArrayBufferView::kBufferOffset)); |
__ lw(scratch, FieldMemOperand(scratch, JSArrayBuffer::kBitFieldOffset)); |
__ And(at, scratch, 1 << JSArrayBuffer::WasNeutered::kShift); |
- DeoptimizeIf(ne, instr, Deoptimizer::kOutOfBounds, at, Operand(zero_reg)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOutOfBounds, at, |
+ Operand(zero_reg)); |
} |
@@ -4826,14 +4837,14 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
// If there is only one type in the interval check for equality. |
if (first == last) { |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongInstanceType, scratch, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongInstanceType, scratch, |
Operand(first)); |
} else { |
- DeoptimizeIf(lo, instr, Deoptimizer::kWrongInstanceType, scratch, |
+ DeoptimizeIf(lo, instr, DeoptimizeReason::kWrongInstanceType, scratch, |
Operand(first)); |
// Omit check for the last type. |
if (last != LAST_TYPE) { |
- DeoptimizeIf(hi, instr, Deoptimizer::kWrongInstanceType, scratch, |
+ DeoptimizeIf(hi, instr, DeoptimizeReason::kWrongInstanceType, scratch, |
Operand(last)); |
} |
} |
@@ -4845,11 +4856,11 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
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, |
+ DeoptimizeReason::kWrongInstanceType, at, Operand(zero_reg)); |
} else { |
__ And(scratch, scratch, Operand(mask)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongInstanceType, scratch, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongInstanceType, scratch, |
Operand(tag)); |
} |
} |
@@ -4865,9 +4876,10 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) { |
Handle<Cell> cell = isolate()->factory()->NewCell(object); |
__ li(at, Operand(cell)); |
__ lw(at, FieldMemOperand(at, Cell::kValueOffset)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(at)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kValueMismatch, reg, Operand(at)); |
} else { |
- DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(object)); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kValueMismatch, reg, |
+ Operand(object)); |
} |
} |
@@ -4883,7 +4895,7 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { |
__ StoreToSafepointRegisterSlot(v0, scratch0()); |
} |
__ SmiTst(scratch0(), at); |
- DeoptimizeIf(eq, instr, Deoptimizer::kInstanceMigrationFailed, at, |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kInstanceMigrationFailed, at, |
Operand(zero_reg)); |
} |
@@ -4938,7 +4950,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
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, DeoptimizeReason::kWrongMap, map_reg, Operand(map)); |
} |
__ bind(&success); |
@@ -4976,7 +4988,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { |
// Check for undefined. Undefined is converted to zero for clamping |
// conversions. |
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefined, input_reg, |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefined, input_reg, |
Operand(factory()->undefined_value())); |
__ mov(result_reg, zero_reg); |
__ jmp(&done); |
@@ -5442,7 +5454,8 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); |
__ lw(result, |
FieldMemOperand(result, FixedArray::SizeFor(instr->idx()))); |
- DeoptimizeIf(eq, instr, Deoptimizer::kNoCache, result, Operand(zero_reg)); |
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kNoCache, result, |
+ Operand(zero_reg)); |
__ bind(&done); |
} |
@@ -5452,7 +5465,8 @@ void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { |
Register object = ToRegister(instr->value()); |
Register map = ToRegister(instr->map()); |
__ lw(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset)); |
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap, map, Operand(scratch0())); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongMap, map, |
+ Operand(scratch0())); |
} |