| Index: src/x87/lithium-codegen-x87.cc
|
| diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
|
| index 618d2423e12fcf32f8e4e7c27184f4f4cc17fdba..5ae5081862eda805bd732494a4116c7ff4095206 100644
|
| --- a/src/x87/lithium-codegen-x87.cc
|
| +++ b/src/x87/lithium-codegen-x87.cc
|
| @@ -1413,7 +1413,7 @@ void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) {
|
| __ and_(dividend, mask);
|
| __ neg(dividend);
|
| if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| - DeoptimizeIf(zero, instr, "minus zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| }
|
| __ jmp(&done, Label::kNear);
|
| }
|
| @@ -1430,7 +1430,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
|
| DCHECK(ToRegister(instr->result()).is(eax));
|
|
|
| if (divisor == 0) {
|
| - DeoptimizeIf(no_condition, instr, "division by zero");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kDivisionByZero);
|
| return;
|
| }
|
|
|
| @@ -1445,7 +1445,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, "minus zero");
|
| + DeoptimizeIf(less, instr, Deoptimizer::kMinusZero);
|
| __ bind(&remainder_not_zero);
|
| }
|
| }
|
| @@ -1467,7 +1467,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, "division by zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kDivisionByZero);
|
| }
|
|
|
| // Check for kMinInt % -1, idiv would signal a divide error. We
|
| @@ -1478,7 +1478,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, "minus zero");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kMinusZero);
|
| } else {
|
| __ j(not_equal, &no_overflow_possible, Label::kNear);
|
| __ Move(result_reg, Immediate(0));
|
| @@ -1497,7 +1497,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, "minus zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| __ jmp(&done, Label::kNear);
|
| __ bind(&positive_left);
|
| }
|
| @@ -1517,19 +1517,19 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
|
| HDiv* hdiv = instr->hydrogen();
|
| if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
|
| __ test(dividend, dividend);
|
| - DeoptimizeIf(zero, instr, "minus zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| }
|
| // Check for (kMinInt / -1).
|
| if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
|
| __ cmp(dividend, kMinInt);
|
| - DeoptimizeIf(zero, instr, "overflow");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::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, "lost precision");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kLostPrecision);
|
| }
|
| __ Move(result, dividend);
|
| int32_t shift = WhichPowerOf2Abs(divisor);
|
| @@ -1550,7 +1550,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
|
| DCHECK(ToRegister(instr->result()).is(edx));
|
|
|
| if (divisor == 0) {
|
| - DeoptimizeIf(no_condition, instr, "division by zero");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kDivisionByZero);
|
| return;
|
| }
|
|
|
| @@ -1558,7 +1558,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
|
| HDiv* hdiv = instr->hydrogen();
|
| if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
|
| __ test(dividend, dividend);
|
| - DeoptimizeIf(zero, instr, "minus zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| }
|
|
|
| __ TruncatingDiv(dividend, Abs(divisor));
|
| @@ -1568,7 +1568,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
|
| __ mov(eax, edx);
|
| __ imul(eax, eax, divisor);
|
| __ sub(eax, dividend);
|
| - DeoptimizeIf(not_equal, instr, "lost precision");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kLostPrecision);
|
| }
|
| }
|
|
|
| @@ -1588,7 +1588,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| // Check for x / 0.
|
| if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(zero, instr, "division by zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kDivisionByZero);
|
| }
|
|
|
| // Check for (0 / -x) that will produce negative zero.
|
| @@ -1597,7 +1597,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| __ test(dividend, dividend);
|
| __ j(not_zero, ÷nd_not_zero, Label::kNear);
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(sign, instr, "minus zero");
|
| + DeoptimizeIf(sign, instr, Deoptimizer::kMinusZero);
|
| __ bind(÷nd_not_zero);
|
| }
|
|
|
| @@ -1607,7 +1607,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| __ cmp(dividend, kMinInt);
|
| __ j(not_zero, ÷nd_not_min_int, Label::kNear);
|
| __ cmp(divisor, -1);
|
| - DeoptimizeIf(zero, instr, "overflow");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kOverflow);
|
| __ bind(÷nd_not_min_int);
|
| }
|
|
|
| @@ -1618,7 +1618,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
| if (!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) {
|
| // Deoptimize if remainder is not 0.
|
| __ test(remainder, remainder);
|
| - DeoptimizeIf(not_zero, instr, "lost precision");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kLostPrecision);
|
| }
|
| }
|
|
|
| @@ -1640,13 +1640,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, "minus zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| }
|
|
|
| // Dividing by -1 is basically negation, unless we overflow.
|
| if (divisor == -1) {
|
| if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) {
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| }
|
| return;
|
| }
|
| @@ -1673,7 +1673,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
|
| DCHECK(ToRegister(instr->result()).is(edx));
|
|
|
| if (divisor == 0) {
|
| - DeoptimizeIf(no_condition, instr, "division by zero");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kDivisionByZero);
|
| return;
|
| }
|
|
|
| @@ -1681,7 +1681,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
|
| HMathFloorOfDiv* hdiv = instr->hydrogen();
|
| if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
|
| __ test(dividend, dividend);
|
| - DeoptimizeIf(zero, instr, "minus zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kMinusZero);
|
| }
|
|
|
| // Easy case: We need no dynamic check for the dividend and the flooring
|
| @@ -1728,7 +1728,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
|
| // Check for x / 0.
|
| if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(zero, instr, "division by zero");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kDivisionByZero);
|
| }
|
|
|
| // Check for (0 / -x) that will produce negative zero.
|
| @@ -1737,7 +1737,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
|
| __ test(dividend, dividend);
|
| __ j(not_zero, ÷nd_not_zero, Label::kNear);
|
| __ test(divisor, divisor);
|
| - DeoptimizeIf(sign, instr, "minus zero");
|
| + DeoptimizeIf(sign, instr, Deoptimizer::kMinusZero);
|
| __ bind(÷nd_not_zero);
|
| }
|
|
|
| @@ -1747,7 +1747,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
|
| __ cmp(dividend, kMinInt);
|
| __ j(not_zero, ÷nd_not_min_int, Label::kNear);
|
| __ cmp(divisor, -1);
|
| - DeoptimizeIf(zero, instr, "overflow");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kOverflow);
|
| __ bind(÷nd_not_min_int);
|
| }
|
|
|
| @@ -1825,7 +1825,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
| }
|
|
|
| if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| }
|
|
|
| if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| @@ -1835,15 +1835,15 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
| __ j(not_zero, &done);
|
| if (right->IsConstantOperand()) {
|
| if (ToInteger32(LConstantOperand::cast(right)) < 0) {
|
| - DeoptimizeIf(no_condition, instr, "minus zero");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kMinusZero);
|
| } else if (ToInteger32(LConstantOperand::cast(right)) == 0) {
|
| __ cmp(ToRegister(instr->temp()), Immediate(0));
|
| - DeoptimizeIf(less, instr, "minus zero");
|
| + DeoptimizeIf(less, instr, Deoptimizer::kMinusZero);
|
| }
|
| } else {
|
| // Test the non-zero operand for negative sign.
|
| __ or_(ToRegister(instr->temp()), ToOperand(right));
|
| - DeoptimizeIf(sign, instr, "minus zero");
|
| + DeoptimizeIf(sign, instr, Deoptimizer::kMinusZero);
|
| }
|
| __ bind(&done);
|
| }
|
| @@ -1916,7 +1916,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| __ shr_cl(ToRegister(left));
|
| if (instr->can_deopt()) {
|
| __ test(ToRegister(left), ToRegister(left));
|
| - DeoptimizeIf(sign, instr, "negative value");
|
| + DeoptimizeIf(sign, instr, Deoptimizer::kNegativeValue);
|
| }
|
| break;
|
| case Token::SHL:
|
| @@ -1933,7 +1933,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| case Token::ROR:
|
| if (shift_count == 0 && instr->can_deopt()) {
|
| __ test(ToRegister(left), ToRegister(left));
|
| - DeoptimizeIf(sign, instr, "negative value");
|
| + DeoptimizeIf(sign, instr, Deoptimizer::kNegativeValue);
|
| } else {
|
| __ ror(ToRegister(left), shift_count);
|
| }
|
| @@ -1948,7 +1948,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| __ shr(ToRegister(left), shift_count);
|
| } else if (instr->can_deopt()) {
|
| __ test(ToRegister(left), ToRegister(left));
|
| - DeoptimizeIf(sign, instr, "negative value");
|
| + DeoptimizeIf(sign, instr, Deoptimizer::kNegativeValue);
|
| }
|
| break;
|
| case Token::SHL:
|
| @@ -1959,7 +1959,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| __ shl(ToRegister(left), shift_count - 1);
|
| }
|
| __ SmiTag(ToRegister(left));
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| } else {
|
| __ shl(ToRegister(left), shift_count);
|
| }
|
| @@ -1985,7 +1985,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
|
| __ sub(ToRegister(left), ToOperand(right));
|
| }
|
| if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| }
|
| }
|
|
|
| @@ -2044,9 +2044,9 @@ void LCodeGen::DoDateField(LDateField* instr) {
|
| DCHECK(object.is(eax));
|
|
|
| __ test(object, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(zero, instr, "Smi");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
|
| __ CmpObjectType(object, JS_DATE_TYPE, scratch);
|
| - DeoptimizeIf(not_equal, instr, "not a date object");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotADateObject);
|
|
|
| if (index->value() == 0) {
|
| __ mov(result, FieldOperand(object, JSDate::kValueOffset));
|
| @@ -2176,7 +2176,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
|
| __ add(ToRegister(left), ToOperand(right));
|
| }
|
| if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| }
|
| }
|
| }
|
| @@ -2419,7 +2419,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, "Smi");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
|
| }
|
|
|
| Register map = no_reg; // Keep the compiler happy.
|
| @@ -2476,7 +2476,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, "unexpected object");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kUnexpectedObject);
|
| }
|
| }
|
| }
|
| @@ -3118,7 +3118,7 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
|
| __ mov(result, Operand::ForCell(instr->hydrogen()->cell().handle()));
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| __ cmp(result, factory()->the_hole_value());
|
| - DeoptimizeIf(equal, instr, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| }
|
| }
|
|
|
| @@ -3167,7 +3167,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
|
| // it as no longer deleted. We deoptimize in that case.
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| __ cmp(Operand::ForCell(cell_handle), factory()->the_hole_value());
|
| - DeoptimizeIf(equal, instr, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| }
|
|
|
| // Store the value.
|
| @@ -3184,7 +3184,7 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| __ cmp(result, factory()->the_hole_value());
|
| if (instr->hydrogen()->DeoptimizesOnHole()) {
|
| - DeoptimizeIf(equal, instr, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| } else {
|
| Label is_not_hole;
|
| __ j(not_equal, &is_not_hole, Label::kNear);
|
| @@ -3205,7 +3205,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| __ cmp(target, factory()->the_hole_value());
|
| if (instr->hydrogen()->DeoptimizesOnHole()) {
|
| - DeoptimizeIf(equal, instr, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| } else {
|
| __ j(not_equal, &skip_assignment, Label::kNear);
|
| }
|
| @@ -3299,7 +3299,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, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
|
|
| // If the function does not have an initial map, we're done.
|
| Label done;
|
| @@ -3390,7 +3390,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| __ mov(result, operand);
|
| if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
|
| __ test(result, Operand(result));
|
| - DeoptimizeIf(negative, instr, "negative value");
|
| + DeoptimizeIf(negative, instr, Deoptimizer::kNegativeValue);
|
| }
|
| break;
|
| case EXTERNAL_FLOAT32_ELEMENTS:
|
| @@ -3420,7 +3420,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
|
| FAST_DOUBLE_ELEMENTS,
|
| instr->base_offset() + sizeof(kHoleNanLower32));
|
| __ cmp(hole_check_operand, Immediate(kHoleNanUpper32));
|
| - DeoptimizeIf(equal, instr, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| }
|
|
|
| Operand double_load_operand = BuildFastArrayOperand(
|
| @@ -3446,10 +3446,10 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
|
| __ test(result, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(not_equal, instr, "not a Smi");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotASmi);
|
| } else {
|
| __ cmp(result, factory()->the_hole_value());
|
| - DeoptimizeIf(equal, instr, "hole");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kHole);
|
| }
|
| }
|
| }
|
| @@ -3596,9 +3596,9 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
|
|
| // The receiver should be a JS object.
|
| __ test(receiver, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(equal, instr, "Smi");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kSmi);
|
| __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, scratch);
|
| - DeoptimizeIf(below, instr, "not a JavaScript object");
|
| + DeoptimizeIf(below, instr, Deoptimizer::kNotAJavaScriptObject);
|
|
|
| __ jmp(&receiver_ok, Label::kNear);
|
| __ bind(&global_object);
|
| @@ -3624,7 +3624,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
|
| // adaptor frame below it.
|
| const uint32_t kArgumentsLimit = 1 * KB;
|
| __ cmp(length, kArgumentsLimit);
|
| - DeoptimizeIf(above, instr, "too many arguments");
|
| + DeoptimizeIf(above, instr, Deoptimizer::kTooManyArguments);
|
|
|
| __ push(receiver);
|
| __ mov(receiver, length);
|
| @@ -3849,7 +3849,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, "not a heap number");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
|
|
| Label slow, allocated, done;
|
| Register tmp = input_reg.is(eax) ? ecx : eax;
|
| @@ -3896,7 +3896,7 @@ void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) {
|
| Label is_positive;
|
| __ j(not_sign, &is_positive, Label::kNear);
|
| __ neg(input_reg); // Sets flags.
|
| - DeoptimizeIf(negative, instr, "overflow");
|
| + DeoptimizeIf(negative, instr, Deoptimizer::kOverflow);
|
| __ bind(&is_positive);
|
| }
|
|
|
| @@ -3949,7 +3949,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
|
| __ fldz();
|
| __ fld(1);
|
| __ FCmp();
|
| - DeoptimizeIf(parity_even, instr, "NaN");
|
| + DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN);
|
| __ j(below, ¬_minus_zero, Label::kNear);
|
|
|
| if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
| @@ -3958,7 +3958,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
|
| // +- 0.0.
|
| __ fld(0);
|
| __ FXamSign();
|
| - DeoptimizeIf(not_zero, instr, "minus zero");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| __ Move(output_reg, Immediate(0));
|
| __ jmp(&done, Label::kFar);
|
| }
|
| @@ -3972,7 +3972,7 @@ void LCodeGen::DoMathFloor(LMathFloor* instr) {
|
| __ fist_s(Operand(esp, 0));
|
| __ pop(output_reg);
|
| __ X87CheckIA();
|
| - DeoptimizeIf(equal, instr, "overflow");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kOverflow);
|
| __ fnclex();
|
| __ X87SetRC(0x0000);
|
| __ bind(&done);
|
| @@ -4006,7 +4006,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
|
| // Check overflow.
|
| __ X87CheckIA();
|
| __ pop(result);
|
| - DeoptimizeIf(equal, instr, "conversion overflow");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kConversionOverflow);
|
| __ fnclex();
|
| // Restore round mode.
|
| __ X87SetRC(0x0000);
|
| @@ -4023,7 +4023,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
|
| // If the sign is positive, we return +0.
|
| __ fld(0);
|
| __ FXamSign();
|
| - DeoptimizeIf(not_zero, instr, "minus zero");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| }
|
| __ Move(result, Immediate(0));
|
| __ jmp(&done);
|
| @@ -4040,7 +4040,7 @@ void LCodeGen::DoMathRound(LMathRound* instr) {
|
| // Check overflow.
|
| __ X87CheckIA();
|
| __ pop(result);
|
| - DeoptimizeIf(equal, instr, "conversion overflow");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kConversionOverflow);
|
| __ fnclex();
|
| // Restore round mode.
|
| __ X87SetRC(0x0000);
|
| @@ -4172,7 +4172,7 @@ void LCodeGen::DoPower(LPower* instr) {
|
| X87LoadForUsage(base);
|
| __ JumpIfSmi(exponent, &no_deopt);
|
| __ CmpObjectType(exponent, HEAP_NUMBER_TYPE, temp);
|
| - DeoptimizeIf(not_equal, instr, "not a heap number");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
| // Heap number(double)
|
| __ fld_d(FieldOperand(exponent, HeapNumber::kValueOffset));
|
| __ jmp(&done);
|
| @@ -4574,7 +4574,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
| __ int3();
|
| __ bind(&done);
|
| } else {
|
| - DeoptimizeIf(cc, instr, "out of bounds");
|
| + DeoptimizeIf(cc, instr, Deoptimizer::kOutOfBounds);
|
| }
|
| }
|
|
|
| @@ -4765,7 +4765,7 @@ void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
|
| Register temp = ToRegister(instr->temp());
|
| Label no_memento_found;
|
| __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found);
|
| - DeoptimizeIf(equal, instr, "memento found");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kMementoFound);
|
| __ bind(&no_memento_found);
|
| }
|
|
|
| @@ -5137,12 +5137,12 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
|
| if (hchange->CheckFlag(HValue::kCanOverflow) &&
|
| hchange->value()->CheckFlag(HValue::kUint32)) {
|
| __ test(input, Immediate(0xc0000000));
|
| - DeoptimizeIf(not_zero, instr, "overflow");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kOverflow);
|
| }
|
| __ SmiTag(input);
|
| if (hchange->CheckFlag(HValue::kCanOverflow) &&
|
| !hchange->value()->CheckFlag(HValue::kUint32)) {
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| }
|
| }
|
|
|
| @@ -5153,7 +5153,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, "not a Smi");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kNotASmi);
|
| } else {
|
| __ AssertSmi(result);
|
| }
|
| @@ -5179,14 +5179,14 @@ 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, "not a heap number");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::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, "not a heap number/undefined");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumberUndefined);
|
|
|
| __ bind(&convert);
|
| __ push(Immediate(0xffffffff));
|
| @@ -5212,7 +5212,7 @@ void LCodeGen::EmitNumberUntagDNoSSE2(LNumberUntagD* instr, Register input_reg,
|
|
|
| // Pop FPU stack before deoptimizing.
|
| __ fstp(0);
|
| - DeoptimizeIf(not_zero, instr, "minus zero");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| }
|
| __ jmp(&done, Label::kNear);
|
| } else {
|
| @@ -5265,14 +5265,15 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr, Label* done) {
|
|
|
| __ bind(&check_false);
|
| __ cmp(input_reg, factory()->false_value());
|
| - DeoptimizeIf(not_equal, instr, "not a heap number/undefined/true/false");
|
| + DeoptimizeIf(not_equal, instr,
|
| + Deoptimizer::kNotAHeapNumberUndefinedTrueFalse);
|
| __ 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, "not a heap number");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
|
|
|
| __ sub(esp, Immediate(kPointerSize));
|
| __ fld_d(FieldOperand(input_reg, HeapNumber::kValueOffset));
|
| @@ -5288,12 +5289,12 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr, Label* done) {
|
|
|
| __ j(equal, &no_precision_lost, Label::kNear);
|
| __ fstp(0);
|
| - DeoptimizeIf(no_condition, instr, "lost precision");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kLostPrecision);
|
| __ bind(&no_precision_lost);
|
|
|
| __ j(parity_odd, ¬_nan);
|
| __ fstp(0);
|
| - DeoptimizeIf(no_condition, instr, "NaN");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kNaN);
|
| __ bind(¬_nan);
|
|
|
| __ test(input_reg, Operand(input_reg));
|
| @@ -5308,14 +5309,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, "minus zero");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
|
| } else {
|
| __ fist_s(MemOperand(esp, 0));
|
| __ fild_s(MemOperand(esp, 0));
|
| __ FCmp();
|
| __ pop(input_reg);
|
| - DeoptimizeIf(not_equal, instr, "lost precision");
|
| - DeoptimizeIf(parity_even, instr, "NaN");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kLostPrecision);
|
| + DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN);
|
| }
|
| }
|
| }
|
| @@ -5396,11 +5397,11 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
| &lost_precision, &is_nan, &minus_zero);
|
| __ jmp(&done);
|
| __ bind(&lost_precision);
|
| - DeoptimizeIf(no_condition, instr, "lost precision");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kLostPrecision);
|
| __ bind(&is_nan);
|
| - DeoptimizeIf(no_condition, instr, "NaN");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kNaN);
|
| __ bind(&minus_zero);
|
| - DeoptimizeIf(no_condition, instr, "minus zero");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kMinusZero);
|
| __ bind(&done);
|
| }
|
| }
|
| @@ -5420,21 +5421,21 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
|
| &lost_precision, &is_nan, &minus_zero);
|
| __ jmp(&done);
|
| __ bind(&lost_precision);
|
| - DeoptimizeIf(no_condition, instr, "lost precision");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kLostPrecision);
|
| __ bind(&is_nan);
|
| - DeoptimizeIf(no_condition, instr, "NaN");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kNaN);
|
| __ bind(&minus_zero);
|
| - DeoptimizeIf(no_condition, instr, "minus zero");
|
| + DeoptimizeIf(no_condition, instr, Deoptimizer::kMinusZero);
|
| __ bind(&done);
|
| __ SmiTag(result_reg);
|
| - DeoptimizeIf(overflow, instr, "overflow");
|
| + DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
|
| }
|
|
|
|
|
| void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
|
| LOperand* input = instr->value();
|
| __ test(ToOperand(input), Immediate(kSmiTagMask));
|
| - DeoptimizeIf(not_zero, instr, "not a Smi");
|
| + DeoptimizeIf(not_zero, instr, Deoptimizer::kNotASmi);
|
| }
|
|
|
|
|
| @@ -5442,7 +5443,7 @@ void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
|
| if (!instr->hydrogen()->value()->type().IsHeapObject()) {
|
| LOperand* input = instr->value();
|
| __ test(ToOperand(input), Immediate(kSmiTagMask));
|
| - DeoptimizeIf(zero, instr, "Smi");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
|
| }
|
| }
|
|
|
| @@ -5463,14 +5464,14 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
|
|
| // If there is only one type in the interval check for equality.
|
| if (first == last) {
|
| - DeoptimizeIf(not_equal, instr, "wrong instance type");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongInstanceType);
|
| } else {
|
| - DeoptimizeIf(below, instr, "wrong instance type");
|
| + DeoptimizeIf(below, instr, Deoptimizer::kWrongInstanceType);
|
| // Omit check for the last type.
|
| if (last != LAST_TYPE) {
|
| __ cmpb(FieldOperand(temp, Map::kInstanceTypeOffset),
|
| static_cast<int8_t>(last));
|
| - DeoptimizeIf(above, instr, "wrong instance type");
|
| + DeoptimizeIf(above, instr, Deoptimizer::kWrongInstanceType);
|
| }
|
| }
|
| } else {
|
| @@ -5481,12 +5482,13 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
| if (base::bits::IsPowerOfTwo32(mask)) {
|
| DCHECK(tag == 0 || base::bits::IsPowerOfTwo32(tag));
|
| __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask);
|
| - DeoptimizeIf(tag == 0 ? not_zero : zero, instr, "wrong instance type");
|
| + DeoptimizeIf(tag == 0 ? not_zero : zero, instr,
|
| + Deoptimizer::kWrongInstanceType);
|
| } else {
|
| __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset));
|
| __ and_(temp, mask);
|
| __ cmp(temp, tag);
|
| - DeoptimizeIf(not_equal, instr, "wrong instance type");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongInstanceType);
|
| }
|
| }
|
| }
|
| @@ -5502,7 +5504,7 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) {
|
| Operand operand = ToOperand(instr->value());
|
| __ cmp(operand, object);
|
| }
|
| - DeoptimizeIf(not_equal, instr, "value mismatch");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kValueMismatch);
|
| }
|
|
|
|
|
| @@ -5517,7 +5519,7 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
|
|
|
| __ test(eax, Immediate(kSmiTagMask));
|
| }
|
| - DeoptimizeIf(zero, instr, "instance migration failed");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kInstanceMigrationFailed);
|
| }
|
|
|
|
|
| @@ -5574,7 +5576,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
|
| if (instr->hydrogen()->HasMigrationTarget()) {
|
| __ j(not_equal, deferred->entry());
|
| } else {
|
| - DeoptimizeIf(not_equal, instr, "wrong map");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap);
|
| }
|
|
|
| __ bind(&success);
|
| @@ -5615,7 +5617,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, "not a heap number/undefined");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumberUndefined);
|
| __ jmp(&zero_result, Label::kNear);
|
|
|
| // Heap number
|
| @@ -6186,17 +6188,17 @@ void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
|
| void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
|
| DCHECK(ToRegister(instr->context()).is(esi));
|
| __ cmp(eax, isolate()->factory()->undefined_value());
|
| - DeoptimizeIf(equal, instr, "undefined");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kUndefined);
|
|
|
| __ cmp(eax, isolate()->factory()->null_value());
|
| - DeoptimizeIf(equal, instr, "null");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kNull);
|
|
|
| __ test(eax, Immediate(kSmiTagMask));
|
| - DeoptimizeIf(zero, instr, "Smi");
|
| + DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
|
|
|
| STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
|
| __ CmpObjectType(eax, LAST_JS_PROXY_TYPE, ecx);
|
| - DeoptimizeIf(below_equal, instr, "wrong instance type");
|
| + DeoptimizeIf(below_equal, instr, Deoptimizer::kWrongInstanceType);
|
|
|
| Label use_cache, call_runtime;
|
| __ CheckEnumCache(&call_runtime);
|
| @@ -6211,7 +6213,7 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
|
|
|
| __ cmp(FieldOperand(eax, HeapObject::kMapOffset),
|
| isolate()->factory()->meta_map());
|
| - DeoptimizeIf(not_equal, instr, "wrong map");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap);
|
| __ bind(&use_cache);
|
| }
|
|
|
| @@ -6234,7 +6236,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
|
| FieldOperand(result, FixedArray::SizeFor(instr->idx())));
|
| __ bind(&done);
|
| __ test(result, result);
|
| - DeoptimizeIf(equal, instr, "no cache");
|
| + DeoptimizeIf(equal, instr, Deoptimizer::kNoCache);
|
| }
|
|
|
|
|
| @@ -6242,7 +6244,7 @@ void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
|
| Register object = ToRegister(instr->value());
|
| __ cmp(ToRegister(instr->map()),
|
| FieldOperand(object, HeapObject::kMapOffset));
|
| - DeoptimizeIf(not_equal, instr, "wrong map");
|
| + DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap);
|
| }
|
|
|
|
|
|
|