| Index: src/crankshaft/x87/lithium-codegen-x87.cc
|
| diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc
|
| index 05eb10fa7c7e5e4e439ac73dbc672e6be6fa56e0..2648681b42e0c8bf21c67f958101aa1451e47044 100644
|
| --- a/src/crankshaft/x87/lithium-codegen-x87.cc
|
| +++ b/src/crankshaft/x87/lithium-codegen-x87.cc
|
| @@ -952,9 +952,8 @@ void LCodeGen::RegisterEnvironmentForDeoptimization(
|
| }
|
| }
|
|
|
| -
|
| void LCodeGen::DeoptimizeIf(Condition cc, LInstruction* instr,
|
| - Deoptimizer::DeoptReason deopt_reason,
|
| + DeoptimizeReason deopt_reason,
|
| Deoptimizer::BailoutType bailout_type) {
|
| LEnvironment* environment = instr->environment();
|
| RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
|
| @@ -1040,9 +1039,8 @@ void LCodeGen::DeoptimizeIf(Condition cc, LInstruction* instr,
|
| }
|
| }
|
|
|
| -
|
| void LCodeGen::DeoptimizeIf(Condition cc, LInstruction* instr,
|
| - Deoptimizer::DeoptReason deopt_reason) {
|
| + DeoptimizeReason deopt_reason) {
|
| Deoptimizer::BailoutType bailout_type = info()->IsStub()
|
| ? Deoptimizer::LAZY
|
| : Deoptimizer::EAGER;
|
| @@ -1183,7 +1181,7 @@ void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) {
|
| __ and_(dividend, mask);
|
| __ neg(dividend);
|
| if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
| __ jmp(&done, Label::kNear);
|
| }
|
| @@ -1200,7 +1198,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
|
| DCHECK(ToRegister(instr->result()).is(eax));
|
|
|
| if (divisor == 0) {
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kDivisionByZero);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kDivisionByZero);
|
| return;
|
| }
|
|
|
| @@ -1215,7 +1213,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
|
| Label remainder_not_zero;
|
| __ j(not_zero, &remainder_not_zero, Label::kNear);
|
| __ cmp(dividend, Immediate(0));
|
| - DeoptimizeIf(less, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(less, instr, DeoptimizeReason::kMinusZero);
|
| __ bind(&remainder_not_zero);
|
| }
|
| }
|
| @@ -1237,7 +1235,7 @@ void LCodeGen::DoModI(LModI* instr) {
|
| // deopt in this case because we can't return a NaN.
|
| if (hmod->CheckFlag(HValue::kCanBeDivByZero)) {
|
| __ test(right_reg, Operand(right_reg));
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kDivisionByZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kDivisionByZero);
|
| }
|
|
|
| // Check for kMinInt % -1, idiv would signal a divide error. We
|
| @@ -1248,7 +1246,7 @@ void LCodeGen::DoModI(LModI* instr) {
|
| __ j(not_equal, &no_overflow_possible, Label::kNear);
|
| __ cmp(right_reg, -1);
|
| if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kMinusZero);
|
| } else {
|
| __ j(not_equal, &no_overflow_possible, Label::kNear);
|
| __ Move(result_reg, Immediate(0));
|
| @@ -1267,7 +1265,7 @@ void LCodeGen::DoModI(LModI* instr) {
|
| __ j(not_sign, &positive_left, Label::kNear);
|
| __ idiv(right_reg);
|
| __ test(result_reg, Operand(result_reg));
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kMinusZero);
|
| __ jmp(&done, Label::kNear);
|
| __ bind(&positive_left);
|
| }
|
| @@ -1287,19 +1285,19 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
|
| HDiv* hdiv = instr->hydrogen();
|
| if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
|
| __ test(dividend, dividend);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
| // Check for (kMinInt / -1).
|
| if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
|
| __ cmp(dividend, kMinInt);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kOverflow);
|
| }
|
| // 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);
|
| __ test(dividend, Immediate(mask));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kLostPrecision);
|
| }
|
| __ Move(result, dividend);
|
| int32_t shift = WhichPowerOf2Abs(divisor);
|
| @@ -1320,7 +1318,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
|
| DCHECK(ToRegister(instr->result()).is(edx));
|
|
|
| if (divisor == 0) {
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kDivisionByZero);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kDivisionByZero);
|
| return;
|
| }
|
|
|
| @@ -1328,7 +1326,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
|
| HDiv* hdiv = instr->hydrogen();
|
| if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
|
| __ test(dividend, dividend);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
|
|
| __ TruncatingDiv(dividend, Abs(divisor));
|
| @@ -1338,7 +1336,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
|
| __ mov(eax, edx);
|
| __ imul(eax, eax, divisor);
|
| __ sub(eax, dividend);
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kLostPrecision);
|
| }
|
| }
|
|
|
| @@ -1358,7 +1356,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| // Check for x / 0.
|
| if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kDivisionByZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kDivisionByZero);
|
| }
|
|
|
| // Check for (0 / -x) that will produce negative zero.
|
| @@ -1367,7 +1365,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| __ test(dividend, dividend);
|
| __ j(not_zero, ÷nd_not_zero, Label::kNear);
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(sign, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(sign, instr, DeoptimizeReason::kMinusZero);
|
| __ bind(÷nd_not_zero);
|
| }
|
|
|
| @@ -1377,7 +1375,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| __ cmp(dividend, kMinInt);
|
| __ j(not_zero, ÷nd_not_min_int, Label::kNear);
|
| __ cmp(divisor, -1);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kOverflow);
|
| __ bind(÷nd_not_min_int);
|
| }
|
|
|
| @@ -1388,7 +1386,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| if (!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) {
|
| // Deoptimize if remainder is not 0.
|
| __ test(remainder, remainder);
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kLostPrecision);
|
| }
|
| }
|
|
|
| @@ -1410,13 +1408,13 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
|
| // If the divisor is negative, we have to negate and handle edge cases.
|
| __ neg(dividend);
|
| if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
|
|
| // Dividing by -1 is basically negation, unless we overflow.
|
| if (divisor == -1) {
|
| if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) {
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| }
|
| return;
|
| }
|
| @@ -1443,7 +1441,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
|
| DCHECK(ToRegister(instr->result()).is(edx));
|
|
|
| if (divisor == 0) {
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kDivisionByZero);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kDivisionByZero);
|
| return;
|
| }
|
|
|
| @@ -1451,7 +1449,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
|
| HMathFloorOfDiv* hdiv = instr->hydrogen();
|
| if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
|
| __ test(dividend, dividend);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
|
|
| // Easy case: We need no dynamic check for the dividend and the flooring
|
| @@ -1498,7 +1496,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
|
| // Check for x / 0.
|
| if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kDivisionByZero);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kDivisionByZero);
|
| }
|
|
|
| // Check for (0 / -x) that will produce negative zero.
|
| @@ -1507,7 +1505,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
|
| __ test(dividend, dividend);
|
| __ j(not_zero, ÷nd_not_zero, Label::kNear);
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(sign, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(sign, instr, DeoptimizeReason::kMinusZero);
|
| __ bind(÷nd_not_zero);
|
| }
|
|
|
| @@ -1517,7 +1515,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
|
| __ cmp(dividend, kMinInt);
|
| __ j(not_zero, ÷nd_not_min_int, Label::kNear);
|
| __ cmp(divisor, -1);
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kOverflow);
|
| __ bind(÷nd_not_min_int);
|
| }
|
|
|
| @@ -1595,7 +1593,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
| }
|
|
|
| if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| }
|
|
|
| if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| @@ -1605,15 +1603,15 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
| __ j(not_zero, &done);
|
| if (right->IsConstantOperand()) {
|
| if (ToInteger32(LConstantOperand::cast(right)) < 0) {
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kMinusZero);
|
| } else if (ToInteger32(LConstantOperand::cast(right)) == 0) {
|
| __ cmp(ToRegister(instr->temp()), Immediate(0));
|
| - DeoptimizeIf(less, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(less, instr, DeoptimizeReason::kMinusZero);
|
| }
|
| } else {
|
| // Test the non-zero operand for negative sign.
|
| __ or_(ToRegister(instr->temp()), ToOperand(right));
|
| - DeoptimizeIf(sign, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(sign, instr, DeoptimizeReason::kMinusZero);
|
| }
|
| __ bind(&done);
|
| }
|
| @@ -1686,7 +1684,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| __ shr_cl(ToRegister(left));
|
| if (instr->can_deopt()) {
|
| __ test(ToRegister(left), ToRegister(left));
|
| - DeoptimizeIf(sign, instr, Deoptimizer::kNegativeValue);
|
| + DeoptimizeIf(sign, instr, DeoptimizeReason::kNegativeValue);
|
| }
|
| break;
|
| case Token::SHL:
|
| @@ -1703,7 +1701,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| case Token::ROR:
|
| if (shift_count == 0 && instr->can_deopt()) {
|
| __ test(ToRegister(left), ToRegister(left));
|
| - DeoptimizeIf(sign, instr, Deoptimizer::kNegativeValue);
|
| + DeoptimizeIf(sign, instr, DeoptimizeReason::kNegativeValue);
|
| } else {
|
| __ ror(ToRegister(left), shift_count);
|
| }
|
| @@ -1718,7 +1716,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| __ shr(ToRegister(left), shift_count);
|
| } else if (instr->can_deopt()) {
|
| __ test(ToRegister(left), ToRegister(left));
|
| - DeoptimizeIf(sign, instr, Deoptimizer::kNegativeValue);
|
| + DeoptimizeIf(sign, instr, DeoptimizeReason::kNegativeValue);
|
| }
|
| break;
|
| case Token::SHL:
|
| @@ -1729,7 +1727,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| __ shl(ToRegister(left), shift_count - 1);
|
| }
|
| __ SmiTag(ToRegister(left));
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| } else {
|
| __ shl(ToRegister(left), shift_count);
|
| }
|
| @@ -1755,7 +1753,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
|
| __ sub(ToRegister(left), ToOperand(right));
|
| }
|
| if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| }
|
| }
|
|
|
| @@ -1903,7 +1901,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
|
| __ add(ToRegister(left), ToOperand(right));
|
| }
|
| if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| }
|
| }
|
| }
|
| @@ -2157,7 +2155,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
|
| } else if (expected.NeedsMap()) {
|
| // If we need a map later and have a Smi -> deopt.
|
| __ test(reg, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kSmi);
|
| }
|
|
|
| Register map = no_reg; // Keep the compiler happy.
|
| @@ -2220,7 +2218,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(no_condition, instr, Deoptimizer::kUnexpectedObject);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kUnexpectedObject);
|
| }
|
| }
|
| }
|
| @@ -2592,10 +2590,10 @@ void LCodeGen::DoHasInPrototypeChainAndBranch(
|
| // Deoptimize if the object needs to be access checked.
|
| __ test_b(FieldOperand(object_map, Map::kBitFieldOffset),
|
| Immediate(1 << Map::kIsAccessCheckNeeded));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kAccessCheck);
|
| // Deoptimize for proxies.
|
| __ CmpInstanceType(object_map, JS_PROXY_TYPE);
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kProxy);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kProxy);
|
|
|
| __ mov(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset));
|
| __ cmp(object_prototype, factory()->null_value());
|
| @@ -2716,7 +2714,7 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| __ cmp(result, factory()->the_hole_value());
|
| if (instr->hydrogen()->DeoptimizesOnHole()) {
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
| } else {
|
| Label is_not_hole;
|
| __ j(not_equal, &is_not_hole, Label::kNear);
|
| @@ -2737,7 +2735,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| __ cmp(target, factory()->the_hole_value());
|
| if (instr->hydrogen()->DeoptimizesOnHole()) {
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
| } else {
|
| __ j(not_equal, &skip_assignment, Label::kNear);
|
| }
|
| @@ -2828,7 +2826,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
|
|
|
| // Check that the function has a prototype or an initial map.
|
| __ cmp(Operand(result), Immediate(factory()->the_hole_value()));
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
|
|
| // If the function does not have an initial map, we're done.
|
| Label done;
|
| @@ -2910,7 +2908,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| __ mov(result, operand);
|
| if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
|
| __ test(result, Operand(result));
|
| - DeoptimizeIf(negative, instr, Deoptimizer::kNegativeValue);
|
| + DeoptimizeIf(negative, instr, DeoptimizeReason::kNegativeValue);
|
| }
|
| break;
|
| case FLOAT32_ELEMENTS:
|
| @@ -2942,7 +2940,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
|
| FAST_DOUBLE_ELEMENTS,
|
| instr->base_offset() + sizeof(kHoleNanLower32));
|
| __ cmp(hole_check_operand, Immediate(kHoleNanUpper32));
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
| }
|
|
|
| Operand double_load_operand = BuildFastArrayOperand(
|
| @@ -2968,10 +2966,10 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
|
| __ test(result, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotASmi);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kNotASmi);
|
| } else {
|
| __ cmp(result, factory()->the_hole_value());
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
|
| }
|
| } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
|
| DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
|
| @@ -2985,7 +2983,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
|
| __ LoadRoot(result, Heap::kArrayProtectorRootIndex);
|
| __ cmp(FieldOperand(result, PropertyCell::kValueOffset),
|
| Immediate(Smi::FromInt(Isolate::kArrayProtectorValid)));
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kHole);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kHole);
|
| }
|
| __ mov(result, isolate()->factory()->undefined_value());
|
| __ bind(&done);
|
| @@ -3135,9 +3133,9 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
|
|
| // The receiver should be a JS object.
|
| __ test(receiver, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kSmi);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kSmi);
|
| __ CmpObjectType(receiver, FIRST_JS_RECEIVER_TYPE, scratch);
|
| - DeoptimizeIf(below, instr, Deoptimizer::kNotAJavaScriptObject);
|
| + DeoptimizeIf(below, instr, DeoptimizeReason::kNotAJavaScriptObject);
|
|
|
| __ jmp(&receiver_ok, Label::kNear);
|
| __ bind(&global_object);
|
| @@ -3161,7 +3159,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
|
| // adaptor frame below it.
|
| const uint32_t kArgumentsLimit = 1 * KB;
|
| __ cmp(length, kArgumentsLimit);
|
| - DeoptimizeIf(above, instr, Deoptimizer::kTooManyArguments);
|
| + DeoptimizeIf(above, instr, DeoptimizeReason::kTooManyArguments);
|
|
|
| __ push(receiver);
|
| __ mov(receiver, length);
|
| @@ -3337,7 +3335,7 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
|
| Register input_reg = ToRegister(instr->value());
|
| __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
|
| factory()->heap_number_map());
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kNotAHeapNumber);
|
|
|
| Label slow, allocated, done;
|
| uint32_t available_regs = eax.bit() | ecx.bit() | edx.bit() | ebx.bit();
|
| @@ -3395,7 +3393,7 @@ void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) {
|
| Label is_positive;
|
| __ j(not_sign, &is_positive, Label::kNear);
|
| __ neg(input_reg); // Sets flags.
|
| - DeoptimizeIf(negative, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(negative, instr, DeoptimizeReason::kOverflow);
|
| __ bind(&is_positive);
|
| }
|
|
|
| @@ -3448,7 +3446,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
|
| __ fldz();
|
| __ fld(1);
|
| __ FCmp();
|
| - DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN);
|
| + DeoptimizeIf(parity_even, instr, DeoptimizeReason::kNaN);
|
| __ j(below, ¬_minus_zero, Label::kNear);
|
|
|
| if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| @@ -3457,7 +3455,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
|
| // +- 0.0.
|
| __ fld(0);
|
| __ FXamSign();
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kMinusZero);
|
| __ Move(output_reg, Immediate(0));
|
| __ jmp(&done, Label::kFar);
|
| }
|
| @@ -3472,7 +3470,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
|
| __ pop(output_reg);
|
| __ X87SetRC(0x0000);
|
| __ X87CheckIA();
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kOverflow);
|
| __ fnclex();
|
| __ X87SetRC(0x0000);
|
| __ bind(&done);
|
| @@ -3508,7 +3506,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
|
| // Check overflow.
|
| __ X87CheckIA();
|
| __ pop(result);
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kConversionOverflow);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kConversionOverflow);
|
| __ fnclex();
|
| // Restore round mode.
|
| __ X87SetRC(0x0000);
|
| @@ -3525,7 +3523,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
|
| // If the sign is positive, we return +0.
|
| __ fld(0);
|
| __ FXamSign();
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
| __ Move(result, Immediate(0));
|
| __ jmp(&done);
|
| @@ -3544,7 +3542,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
|
| // Check overflow.
|
| __ X87CheckIA();
|
| __ pop(result);
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kConversionOverflow);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kConversionOverflow);
|
| __ fnclex();
|
| // Restore round mode.
|
| __ X87SetRC(0x0000);
|
| @@ -3622,7 +3620,7 @@ void LCodeGen::DoPower(LPower* instr) {
|
| X87LoadForUsage(base);
|
| __ JumpIfSmi(exponent, &no_deopt);
|
| __ CmpObjectType(exponent, HEAP_NUMBER_TYPE, temp);
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kNotAHeapNumber);
|
| // Heap number(double)
|
| __ fld_d(FieldOperand(exponent, HeapNumber::kValueOffset));
|
| __ jmp(&done);
|
| @@ -4012,7 +4010,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
| __ int3();
|
| __ bind(&done);
|
| } else {
|
| - DeoptimizeIf(cc, instr, Deoptimizer::kOutOfBounds);
|
| + DeoptimizeIf(cc, instr, DeoptimizeReason::kOutOfBounds);
|
| }
|
| }
|
|
|
| @@ -4220,7 +4218,7 @@ void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
|
| Register temp = ToRegister(instr->temp());
|
| Label no_memento_found;
|
| __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found);
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kMementoFound);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kMementoFound);
|
| __ bind(&no_memento_found);
|
| }
|
|
|
| @@ -4320,7 +4318,7 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
|
|
|
| // Deopt on smi, which means the elements array changed to dictionary mode.
|
| __ test(result, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kSmi);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kSmi);
|
| }
|
|
|
|
|
| @@ -4686,12 +4684,12 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
|
| if (hchange->CheckFlag(HValue::kCanOverflow) &&
|
| hchange->value()->CheckFlag(HValue::kUint32)) {
|
| __ test(input, Immediate(0xc0000000));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kOverflow);
|
| }
|
| __ SmiTag(input);
|
| if (hchange->CheckFlag(HValue::kCanOverflow) &&
|
| !hchange->value()->CheckFlag(HValue::kUint32)) {
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| }
|
| }
|
|
|
| @@ -4702,7 +4700,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
|
| DCHECK(input->IsRegister() && input->Equals(instr->result()));
|
| if (instr->needs_check()) {
|
| __ test(result, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kNotASmi);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kNotASmi);
|
| } else {
|
| __ AssertSmi(result);
|
| }
|
| @@ -4728,14 +4726,15 @@ void LCodeGen::EmitNumberUntagDNoSSE2(LNumberUntagD* instr, Register input_reg,
|
| __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
|
| factory()->heap_number_map());
|
| if (!can_convert_undefined_to_nan) {
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kNotAHeapNumber);
|
| } else {
|
| Label heap_number, convert;
|
| __ j(equal, &heap_number);
|
|
|
| // Convert undefined (or hole) to NaN.
|
| __ cmp(input_reg, factory()->undefined_value());
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumberUndefined);
|
| + DeoptimizeIf(not_equal, instr,
|
| + DeoptimizeReason::kNotAHeapNumberUndefined);
|
|
|
| __ bind(&convert);
|
| __ push(Immediate(0xffffffff));
|
| @@ -4761,7 +4760,7 @@ void LCodeGen::EmitNumberUntagDNoSSE2(LNumberUntagD* instr, Register input_reg,
|
|
|
| // Pop FPU stack before deoptimizing.
|
| __ fstp(0);
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kMinusZero);
|
| }
|
| __ jmp(&done, Label::kNear);
|
| } else {
|
| @@ -4815,14 +4814,14 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr, Label* done) {
|
| __ bind(&check_false);
|
| __ cmp(input_reg, factory()->false_value());
|
| DeoptimizeIf(not_equal, instr,
|
| - Deoptimizer::kNotAHeapNumberUndefinedBoolean);
|
| + DeoptimizeReason::kNotAHeapNumberUndefinedBoolean);
|
| __ Move(input_reg, Immediate(0));
|
| } else {
|
| // TODO(olivf) Converting a number on the fpu is actually quite slow. We
|
| // should first try a fast conversion and then bailout to this slow case.
|
| __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
|
| isolate()->factory()->heap_number_map());
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kNotAHeapNumber);
|
|
|
| __ sub(esp, Immediate(kPointerSize));
|
| __ fld_d(FieldOperand(input_reg, HeapNumber::kValueOffset));
|
| @@ -4838,12 +4837,12 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr, Label* done) {
|
|
|
| __ j(equal, &no_precision_lost, Label::kNear);
|
| __ fstp(0);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kLostPrecision);
|
| __ bind(&no_precision_lost);
|
|
|
| __ j(parity_odd, ¬_nan);
|
| __ fstp(0);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kNaN);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kNaN);
|
| __ bind(¬_nan);
|
|
|
| __ test(input_reg, Operand(input_reg));
|
| @@ -4858,14 +4857,14 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr, Label* done) {
|
| __ fstp_s(Operand(esp, 0));
|
| __ pop(input_reg);
|
| __ test(input_reg, Operand(input_reg));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kMinusZero);
|
| } else {
|
| __ fist_s(MemOperand(esp, 0));
|
| __ fild_s(MemOperand(esp, 0));
|
| __ FCmp();
|
| __ pop(input_reg);
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kLostPrecision);
|
| - DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kLostPrecision);
|
| + DeoptimizeIf(parity_even, instr, DeoptimizeReason::kNaN);
|
| }
|
| }
|
| }
|
| @@ -4946,11 +4945,11 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
| &lost_precision, &is_nan, &minus_zero);
|
| __ jmp(&done);
|
| __ bind(&lost_precision);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kLostPrecision);
|
| __ bind(&is_nan);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kNaN);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kNaN);
|
| __ bind(&minus_zero);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kMinusZero);
|
| __ bind(&done);
|
| }
|
| }
|
| @@ -4970,21 +4969,21 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
|
| &lost_precision, &is_nan, &minus_zero);
|
| __ jmp(&done);
|
| __ bind(&lost_precision);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kLostPrecision);
|
| __ bind(&is_nan);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kNaN);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kNaN);
|
| __ bind(&minus_zero);
|
| - DeoptimizeIf(no_condition, instr, Deoptimizer::kMinusZero);
|
| + DeoptimizeIf(no_condition, instr, DeoptimizeReason::kMinusZero);
|
| __ bind(&done);
|
| __ SmiTag(result_reg);
|
| - DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| + DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow);
|
| }
|
|
|
|
|
| void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
|
| LOperand* input = instr->value();
|
| __ test(ToOperand(input), Immediate(kSmiTagMask));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kNotASmi);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kNotASmi);
|
| }
|
|
|
|
|
| @@ -4992,7 +4991,7 @@ void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
|
| if (!instr->hydrogen()->value()->type().IsHeapObject()) {
|
| LOperand* input = instr->value();
|
| __ test(ToOperand(input), Immediate(kSmiTagMask));
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kSmi);
|
| }
|
| }
|
|
|
| @@ -5005,7 +5004,7 @@ void LCodeGen::DoCheckArrayBufferNotNeutered(
|
| __ mov(scratch, FieldOperand(view, JSArrayBufferView::kBufferOffset));
|
| __ test_b(FieldOperand(scratch, JSArrayBuffer::kBitFieldOffset),
|
| Immediate(1 << JSArrayBuffer::WasNeutered::kShift));
|
| - DeoptimizeIf(not_zero, instr, Deoptimizer::kOutOfBounds);
|
| + DeoptimizeIf(not_zero, instr, DeoptimizeReason::kOutOfBounds);
|
| }
|
|
|
|
|
| @@ -5024,13 +5023,13 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
|
|
| // If there is only one type in the interval check for equality.
|
| if (first == last) {
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongInstanceType);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kWrongInstanceType);
|
| } else {
|
| - DeoptimizeIf(below, instr, Deoptimizer::kWrongInstanceType);
|
| + DeoptimizeIf(below, instr, DeoptimizeReason::kWrongInstanceType);
|
| // Omit check for the last type.
|
| if (last != LAST_TYPE) {
|
| __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset), Immediate(last));
|
| - DeoptimizeIf(above, instr, Deoptimizer::kWrongInstanceType);
|
| + DeoptimizeIf(above, instr, DeoptimizeReason::kWrongInstanceType);
|
| }
|
| }
|
| } else {
|
| @@ -5042,12 +5041,12 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
| DCHECK(tag == 0 || base::bits::IsPowerOfTwo32(tag));
|
| __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), Immediate(mask));
|
| DeoptimizeIf(tag == 0 ? not_zero : zero, instr,
|
| - Deoptimizer::kWrongInstanceType);
|
| + DeoptimizeReason::kWrongInstanceType);
|
| } else {
|
| __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset));
|
| __ and_(temp, mask);
|
| __ cmp(temp, tag);
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongInstanceType);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kWrongInstanceType);
|
| }
|
| }
|
| }
|
| @@ -5063,7 +5062,7 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) {
|
| Operand operand = ToOperand(instr->value());
|
| __ cmp(operand, object);
|
| }
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kValueMismatch);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kValueMismatch);
|
| }
|
|
|
|
|
| @@ -5078,7 +5077,7 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
|
|
|
| __ test(eax, Immediate(kSmiTagMask));
|
| }
|
| - DeoptimizeIf(zero, instr, Deoptimizer::kInstanceMigrationFailed);
|
| + DeoptimizeIf(zero, instr, DeoptimizeReason::kInstanceMigrationFailed);
|
| }
|
|
|
|
|
| @@ -5135,7 +5134,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
|
| if (instr->hydrogen()->HasMigrationTarget()) {
|
| __ j(not_equal, deferred->entry());
|
| } else {
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kWrongMap);
|
| }
|
|
|
| __ bind(&success);
|
| @@ -5176,7 +5175,7 @@ void LCodeGen::DoClampTToUint8NoSSE2(LClampTToUint8NoSSE2* instr) {
|
| // Check for undefined. Undefined is converted to zero for clamping
|
| // conversions.
|
| __ cmp(input_reg, factory()->undefined_value());
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumberUndefined);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kNotAHeapNumberUndefined);
|
| __ jmp(&zero_result, Label::kNear);
|
|
|
| // Heap number
|
| @@ -5692,7 +5691,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
|
| FieldOperand(result, FixedArray::SizeFor(instr->idx())));
|
| __ bind(&done);
|
| __ test(result, result);
|
| - DeoptimizeIf(equal, instr, Deoptimizer::kNoCache);
|
| + DeoptimizeIf(equal, instr, DeoptimizeReason::kNoCache);
|
| }
|
|
|
|
|
| @@ -5700,7 +5699,7 @@ void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
|
| Register object = ToRegister(instr->value());
|
| __ cmp(ToRegister(instr->map()),
|
| FieldOperand(object, HeapObject::kMapOffset));
|
| - DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap);
|
| + DeoptimizeIf(not_equal, instr, DeoptimizeReason::kWrongMap);
|
| }
|
|
|
|
|
|
|