Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: src/arm64/lithium-codegen-arm64.cc

Issue 598953002: Make the detailed reason for deopts mandatory on all platforms. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/lithium-codegen-arm64.h ('k') | src/mips/lithium-codegen-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc
index 29986424629cf601c9a5045b04db266f74477da7..b9b67d9bbd01b1d5a5ce108e753d64d1f6fdd6eb 100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -1063,9 +1063,8 @@ void LCodeGen::DeoptimizeBranch(
}
-void LCodeGen::Deoptimize(LInstruction* instr,
- Deoptimizer::BailoutType* override_bailout_type,
- const char* detail) {
+void LCodeGen::Deoptimize(LInstruction* instr, const char* detail,
+ Deoptimizer::BailoutType* override_bailout_type) {
DeoptimizeBranch(instr, detail, always, NoReg, -1, override_bailout_type);
}
@@ -1516,7 +1515,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
if (can_overflow) {
__ Adds(result, left, right);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Add(result, left, right);
}
@@ -1530,7 +1529,7 @@ void LCodeGen::DoAddS(LAddS* instr) {
Operand right = ToOperand(instr->right());
if (can_overflow) {
__ Adds(result, left, right);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Add(result, left, right);
}
@@ -1656,7 +1655,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
// adaptor frame below it.
const uint32_t kArgumentsLimit = 1 * KB;
__ Cmp(length, kArgumentsLimit);
- DeoptimizeIf(hi, instr);
+ DeoptimizeIf(hi, instr, "too many arguments");
// Push the receiver and use the register to keep the original
// number of arguments.
@@ -1838,7 +1837,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) {
if (FLAG_debug_code && instr->hydrogen()->skip_check()) {
__ Assert(NegateCondition(cond), kEliminatedBoundsCheckFailed);
} else {
- DeoptimizeIf(cond, instr);
+ DeoptimizeIf(cond, instr, "out of bounds");
}
}
@@ -1917,7 +1916,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
__ JumpIfSmi(value, true_label);
} else if (expected.NeedsMap()) {
// If we need a map later and have a smi, deopt.
- DeoptimizeIfSmi(value, instr);
+ DeoptimizeIfSmi(value, instr, "Smi");
}
Register map = NoReg;
@@ -1978,7 +1977,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.
- Deoptimize(instr);
+ Deoptimize(instr, "unexpected object");
}
}
}
@@ -2163,7 +2162,7 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
instr->pointer_map(), 1, Safepoint::kNoLazyDeopt);
__ StoreToSafepointRegisterSlot(x0, temp);
}
- DeoptimizeIfSmi(temp, instr);
+ DeoptimizeIfSmi(temp, instr, "instance migration failed");
}
@@ -2218,7 +2217,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
if (instr->hydrogen()->HasMigrationTarget()) {
__ B(ne, deferred->entry());
} else {
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "wrong map");
}
__ Bind(&success);
@@ -2227,7 +2226,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
if (!instr->hydrogen()->value()->type().IsHeapObject()) {
- DeoptimizeIfSmi(ToRegister(instr->value()), instr);
+ DeoptimizeIfSmi(ToRegister(instr->value()), instr, "Smi");
}
}
@@ -2235,7 +2234,7 @@ void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
Register value = ToRegister(instr->value());
DCHECK(!instr->result() || ToRegister(instr->result()).Is(value));
- DeoptimizeIfNotSmi(value, instr);
+ DeoptimizeIfNotSmi(value, instr, "not a Smi");
}
@@ -2253,15 +2252,15 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
__ Cmp(scratch, first);
if (first == last) {
// If there is only one type in the interval check for equality.
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "wrong instance type");
} else if (last == LAST_TYPE) {
// We don't need to compare with the higher bound of the interval.
- DeoptimizeIf(lo, instr);
+ DeoptimizeIf(lo, instr, "wrong instance type");
} else {
// If we are below the lower bound, set the C flag and clear the Z flag
// to force a deopt.
__ Ccmp(scratch, last, CFlag, hs);
- DeoptimizeIf(hi, instr);
+ DeoptimizeIf(hi, instr, "wrong instance type");
}
} else {
uint8_t mask;
@@ -2271,9 +2270,11 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
if (base::bits::IsPowerOfTwo32(mask)) {
DCHECK((tag == 0) || (tag == mask));
if (tag == 0) {
- DeoptimizeIfBitSet(scratch, MaskToBit(mask), instr);
+ DeoptimizeIfBitSet(scratch, MaskToBit(mask), instr,
+ "wrong instance type");
} else {
- DeoptimizeIfBitClear(scratch, MaskToBit(mask), instr);
+ DeoptimizeIfBitClear(scratch, MaskToBit(mask), instr,
+ "wrong instance type");
}
} else {
if (tag == 0) {
@@ -2282,7 +2283,7 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
__ And(scratch, scratch, mask);
__ Cmp(scratch, tag);
}
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "wrong instance type");
}
}
}
@@ -2321,7 +2322,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
__ JumpIfHeapNumber(input, &is_heap_number);
// Check for undefined. Undefined is coverted to zero for clamping conversion.
- DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr);
+ DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr,
+ "not a heap number/undefined");
__ Mov(result, 0);
__ B(&done);
@@ -2626,7 +2628,7 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) {
} else {
__ Cmp(reg, Operand(object));
}
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "value mismatch");
}
@@ -2650,9 +2652,9 @@ void LCodeGen::DoDateField(LDateField* instr) {
DCHECK(object.is(result) && object.Is(x0));
DCHECK(instr->IsMarkedAsCall());
- DeoptimizeIfSmi(object, instr);
+ DeoptimizeIfSmi(object, instr, "Smi");
__ CompareObjectType(object, temp1, temp1, JS_DATE_TYPE);
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "not a date object");
if (index->value() == 0) {
__ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
@@ -2688,7 +2690,7 @@ void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
type = Deoptimizer::LAZY;
}
- Deoptimize(instr, &type, instr->hydrogen()->reason());
+ Deoptimize(instr, instr->hydrogen()->reason(), &type);
}
@@ -2702,21 +2704,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) {
- DeoptimizeIfZero(dividend, instr);
+ DeoptimizeIfZero(dividend, instr, "division by zero");
}
// Check for (kMinInt / -1).
if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
// Test dividend for kMinInt by subtracting one (cmp) and checking for
// overflow.
__ Cmp(dividend, 1);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
}
// 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);
__ Tst(dividend, mask);
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "lost precision");
}
if (divisor == -1) { // Nice shortcut, not needed for correctness.
@@ -2744,14 +2746,14 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
DCHECK(!AreAliased(dividend, result));
if (divisor == 0) {
- Deoptimize(instr);
+ Deoptimize(instr, "division by zero");
return;
}
// Check for (0 / -x) that will produce negative zero.
HDiv* hdiv = instr->hydrogen();
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
- DeoptimizeIfZero(dividend, instr);
+ DeoptimizeIfZero(dividend, instr, "minus zero");
}
__ TruncatingDiv(result, dividend, Abs(divisor));
@@ -2763,7 +2765,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
__ Sxtw(dividend.X(), dividend);
__ Mov(temp, divisor);
__ Smsubl(temp.X(), result, temp, dividend.X());
- DeoptimizeIfNotZero(temp, instr);
+ DeoptimizeIfNotZero(temp, instr, "lost precision");
}
}
@@ -2786,7 +2788,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
// Check for x / 0.
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
- DeoptimizeIfZero(divisor, instr);
+ DeoptimizeIfZero(divisor, instr, "division by zero");
}
// Check for (0 / -x) as that will produce negative zero.
@@ -2798,7 +2800,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
// If the divisor >= 0 (pl, the opposite of mi) set the flags to
// condition ne, so we don't deopt, ie. positive divisor doesn't deopt.
__ Ccmp(dividend, 0, NoFlag, mi);
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "minus zero");
}
// Check for (kMinInt / -1).
@@ -2810,13 +2812,13 @@ void LCodeGen::DoDivI(LDivI* instr) {
// -1. If overflow is clear, set the flags for condition ne, as the
// dividend isn't -1, and thus we shouldn't deopt.
__ Ccmp(divisor, -1, NoFlag, vs);
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "overflow");
}
// Compute remainder and deopt if it's not zero.
Register remainder = ToRegister32(instr->temp());
__ Msub(remainder, result, divisor, dividend);
- DeoptimizeIfNotZero(remainder, instr);
+ DeoptimizeIfNotZero(remainder, instr, "lost precision");
}
@@ -2825,11 +2827,11 @@ void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) {
Register result = ToRegister32(instr->result());
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIfMinusZero(input, instr);
+ DeoptimizeIfMinusZero(input, instr, "minus zero");
}
__ TryRepresentDoubleAsInt32(result, input, double_scratch());
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "lost precision or NaN");
if (instr->tag_result()) {
__ SmiTag(result.X());
@@ -2890,7 +2892,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
__ LoadInstanceDescriptors(map, result);
__ Ldr(result, FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
__ Ldr(result, FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
- DeoptimizeIfZero(result, instr);
+ DeoptimizeIfZero(result, instr, "no cache");
__ Bind(&done);
}
@@ -2903,17 +2905,17 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
DCHECK(instr->IsMarkedAsCall());
DCHECK(object.Is(x0));
- DeoptimizeIfRoot(object, Heap::kUndefinedValueRootIndex, instr);
+ DeoptimizeIfRoot(object, Heap::kUndefinedValueRootIndex, instr, "undefined");
__ LoadRoot(null_value, Heap::kNullValueRootIndex);
__ Cmp(object, null_value);
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "null");
- DeoptimizeIfSmi(object, instr);
+ DeoptimizeIfSmi(object, instr, "Smi");
STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
__ CompareObjectType(object, x1, x1, LAST_JS_PROXY_TYPE);
- DeoptimizeIf(le, instr);
+ DeoptimizeIf(le, instr, "not a JavaScript object");
Label use_cache, call_runtime;
__ CheckEnumCache(object, null_value, x1, x2, x3, x4, &call_runtime);
@@ -2927,7 +2929,7 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr);
__ Ldr(x1, FieldMemOperand(object, HeapObject::kMapOffset));
- DeoptimizeIfNotRoot(x1, Heap::kMetaMapRootIndex, instr);
+ DeoptimizeIfNotRoot(x1, Heap::kMetaMapRootIndex, instr, "wrong map");
__ Bind(&use_cache);
}
@@ -3320,7 +3322,7 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
__ Ldr(result, ContextMemOperand(context, instr->slot_index()));
if (instr->hydrogen()->RequiresHoleCheck()) {
if (instr->hydrogen()->DeoptimizesOnHole()) {
- DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr);
+ DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, "hole");
} else {
Label not_the_hole;
__ JumpIfNotRoot(result, Heap::kTheHoleValueRootIndex, &not_the_hole);
@@ -3341,7 +3343,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
JSFunction::kPrototypeOrInitialMapOffset));
// Check that the function has a prototype or an initial map.
- DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr);
+ DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, "hole");
// If the function does not have an initial map, we're done.
Label done;
@@ -3361,7 +3363,7 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
__ Mov(result, Operand(Handle<Object>(instr->hydrogen()->cell().handle())));
__ Ldr(result, FieldMemOperand(result, Cell::kValueOffset));
if (instr->hydrogen()->RequiresHoleCheck()) {
- DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr);
+ DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, "hole");
}
}
@@ -3492,7 +3494,7 @@ void LCodeGen::DoLoadKeyedExternal(LLoadKeyedExternal* instr) {
if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
// Deopt if value > 0x80000000.
__ Tst(result, 0xFFFFFFFF80000000);
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "negative value");
}
break;
case FLOAT32_ELEMENTS:
@@ -3589,7 +3591,7 @@ void LCodeGen::DoLoadKeyedFixedDouble(LLoadKeyedFixedDouble* instr) {
STATIC_ASSERT(kHoleNanInt64 == 0x7fffffffffffffff);
__ Ldr(scratch, mem_op);
__ Cmn(scratch, 1);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "hole");
}
}
@@ -3627,9 +3629,9 @@ void LCodeGen::DoLoadKeyedFixed(LLoadKeyedFixed* instr) {
if (instr->hydrogen()->RequiresHoleCheck()) {
if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
- DeoptimizeIfNotSmi(result, instr);
+ DeoptimizeIfNotSmi(result, instr, "not a Smi");
} else {
- DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr);
+ DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, "hole");
}
}
}
@@ -3731,7 +3733,7 @@ void LCodeGen::DoMathAbs(LMathAbs* instr) {
Register result = r.IsSmi() ? ToRegister(instr->result())
: ToRegister32(instr->result());
__ Abs(result, input);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
}
}
@@ -3883,7 +3885,7 @@ void LCodeGen::DoMathFloorI(LMathFloorI* instr) {
Register result = ToRegister(instr->result());
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIfMinusZero(input, instr);
+ DeoptimizeIfMinusZero(input, instr, "minus zero");
}
__ Fcvtms(result, input);
@@ -3893,7 +3895,7 @@ void LCodeGen::DoMathFloorI(LMathFloorI* instr) {
__ Cmp(result, Operand(result, SXTW));
// - The input was not NaN.
__ Fccmp(input, input, NoFlag, eq);
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "lost precision or NaN");
}
@@ -3919,13 +3921,13 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
// If the divisor is negative, we have to negate and handle edge cases.
__ Negs(result, dividend);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "minus zero");
}
// Dividing by -1 is basically negation, unless we overflow.
if (divisor == -1) {
if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) {
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
}
return;
}
@@ -3948,14 +3950,14 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
DCHECK(!AreAliased(dividend, result));
if (divisor == 0) {
- Deoptimize(instr);
+ Deoptimize(instr, "division by zero");
return;
}
// Check for (0 / -x) that will produce negative zero.
HMathFloorOfDiv* hdiv = instr->hydrogen();
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
- DeoptimizeIfZero(dividend, instr);
+ DeoptimizeIfZero(dividend, instr, "minus zero");
}
// Easy case: We need no dynamic check for the dividend and the flooring
@@ -3998,14 +4000,14 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
__ Sdiv(result, dividend, divisor);
// Check for x / 0.
- DeoptimizeIfZero(divisor, instr);
+ DeoptimizeIfZero(divisor, instr, "division by zero");
// Check for (kMinInt / -1).
if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
// The V flag will be set iff dividend == kMinInt.
__ Cmp(dividend, 1);
__ Ccmp(divisor, -1, NoFlag, vs);
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "overflow");
}
// Check for (0 / -x) that will produce negative zero.
@@ -4015,7 +4017,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
// "divisor" can't be null because the code would have already been
// deoptimized. The Z flag is set only if (divisor < 0) and (dividend == 0).
// In this case we need to deoptimize to produce a -0.
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "minus zero");
}
Label done;
@@ -4174,18 +4176,18 @@ void LCodeGen::DoMathRoundI(LMathRoundI* instr) {
// Deoptimize if the result > 1, as it must be larger than 32 bits.
__ Cmp(result, 1);
- DeoptimizeIf(hi, instr);
+ DeoptimizeIf(hi, instr, "overflow");
// Deoptimize for negative inputs, which at this point are only numbers in
// the range [-0.5, -0.0]
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
__ Fmov(result, input);
- DeoptimizeIfNegative(result, instr);
+ DeoptimizeIfNegative(result, instr, "minus zero");
}
// Deoptimize if the input was NaN.
__ Fcmp(input, dot_five);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "NaN");
// Now, the only unhandled inputs are in the range [0.0, 1.5[ (or [-0.5, 1.5[
// if we didn't generate a -0.0 bailout). If input >= 0.5 then return 1,
@@ -4263,7 +4265,7 @@ void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) {
__ And(dividend, dividend, mask);
__ Negs(dividend, dividend);
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "minus zero");
}
__ B(&done);
}
@@ -4282,7 +4284,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
DCHECK(!AreAliased(dividend, result, temp));
if (divisor == 0) {
- Deoptimize(instr);
+ Deoptimize(instr, "division by zero");
return;
}
@@ -4296,7 +4298,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
Label remainder_not_zero;
__ Cbnz(result, &remainder_not_zero);
- DeoptimizeIfNegative(dividend, instr);
+ DeoptimizeIfNegative(dividend, instr, "minus zero");
__ bind(&remainder_not_zero);
}
}
@@ -4311,12 +4313,12 @@ void LCodeGen::DoModI(LModI* instr) {
// modulo = dividend - quotient * divisor
__ Sdiv(result, dividend, divisor);
if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
- DeoptimizeIfZero(divisor, instr);
+ DeoptimizeIfZero(divisor, instr, "division by zero");
}
__ Msub(result, result, divisor, dividend);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
__ Cbnz(result, &done);
- DeoptimizeIfNegative(dividend, instr);
+ DeoptimizeIfNegative(dividend, instr, "minus zero");
}
__ Bind(&done);
}
@@ -4339,10 +4341,10 @@ void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
if (bailout_on_minus_zero) {
if (right < 0) {
// The result is -0 if right is negative and left is zero.
- DeoptimizeIfZero(left, instr);
+ DeoptimizeIfZero(left, instr, "minus zero");
} else if (right == 0) {
// The result is -0 if the right is zero and the left is negative.
- DeoptimizeIfNegative(left, instr);
+ DeoptimizeIfNegative(left, instr, "minus zero");
}
}
@@ -4352,7 +4354,7 @@ void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
if (can_overflow) {
// Only 0x80000000 can overflow here.
__ Negs(result, left);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Neg(result, left);
}
@@ -4368,7 +4370,7 @@ void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
case 2:
if (can_overflow) {
__ Adds(result, left, left);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Add(result, left, left);
}
@@ -4387,7 +4389,7 @@ void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
DCHECK(!AreAliased(scratch, left));
__ Cls(scratch, left);
__ Cmp(scratch, right_log2);
- DeoptimizeIf(lt, instr);
+ DeoptimizeIf(lt, instr, "overflow");
}
if (right >= 0) {
@@ -4397,7 +4399,7 @@ void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
// result = -left << log2(-right)
if (can_overflow) {
__ Negs(result, Operand(left, LSL, right_log2));
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Neg(result, Operand(left, LSL, right_log2));
}
@@ -4455,13 +4457,13 @@ void LCodeGen::DoMulI(LMulI* instr) {
// - If so (eq), set N (mi) if left + right is negative.
// - Otherwise, clear N.
__ Ccmn(left, right, NoFlag, eq);
- DeoptimizeIf(mi, instr);
+ DeoptimizeIf(mi, instr, "minus zero");
}
if (can_overflow) {
__ Smull(result.X(), left, right);
__ Cmp(result.X(), Operand(result, SXTW));
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "overflow");
} else {
__ Mul(result, left, right);
}
@@ -4485,7 +4487,7 @@ void LCodeGen::DoMulS(LMulS* instr) {
// - If so (eq), set N (mi) if left + right is negative.
// - Otherwise, clear N.
__ Ccmn(left, right, NoFlag, eq);
- DeoptimizeIf(mi, instr);
+ DeoptimizeIf(mi, instr, "minus zero");
}
STATIC_ASSERT((kSmiShift == 32) && (kSmiTag == 0));
@@ -4493,7 +4495,7 @@ void LCodeGen::DoMulS(LMulS* instr) {
__ Smulh(result, left, right);
__ Cmp(result, Operand(result.W(), SXTW));
__ SmiTag(result);
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "overflow");
} else {
if (AreAliased(result, left, right)) {
// All three registers are the same: half untag the input and then
@@ -4669,13 +4671,14 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
// Load heap number.
__ Ldr(result, FieldMemOperand(input, HeapNumber::kValueOffset));
if (instr->hydrogen()->deoptimize_on_minus_zero()) {
- DeoptimizeIfMinusZero(result, instr);
+ DeoptimizeIfMinusZero(result, instr, "minus zero");
}
__ B(&done);
if (can_convert_undefined_to_nan) {
__ Bind(&convert_undefined);
- DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr);
+ DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr,
+ "not a heap number/undefined");
__ LoadRoot(scratch, Heap::kNanValueRootIndex);
__ Ldr(result, FieldMemOperand(scratch, HeapNumber::kValueOffset));
@@ -4868,7 +4871,7 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
Register output = ToRegister(instr->result());
if (hchange->CheckFlag(HValue::kCanOverflow) &&
hchange->value()->CheckFlag(HValue::kUint32)) {
- DeoptimizeIfNegative(input.W(), instr);
+ DeoptimizeIfNegative(input.W(), instr, "overflow");
}
__ SmiTag(output, input);
}
@@ -4880,7 +4883,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
Label done, untag;
if (instr->needs_check()) {
- DeoptimizeIfNotSmi(input, instr);
+ DeoptimizeIfNotSmi(input, instr, "not a Smi");
}
__ Bind(&untag);
@@ -4905,7 +4908,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
if (instr->can_deopt()) {
// If `left >>> right` >= 0x80000000, the result is not representable
// in a signed 32-bit smi.
- DeoptimizeIfNegative(result, instr);
+ DeoptimizeIfNegative(result, instr, "negative value");
}
break;
default: UNREACHABLE();
@@ -4915,7 +4918,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
int shift_count = JSShiftAmountFromLConstant(right_op);
if (shift_count == 0) {
if ((instr->op() == Token::SHR) && instr->can_deopt()) {
- DeoptimizeIfNegative(left, instr);
+ DeoptimizeIfNegative(left, instr, "negative value");
}
__ Mov(result, left, kDiscardForSameWReg);
} else {
@@ -4968,7 +4971,7 @@ void LCodeGen::DoShiftS(LShiftS* instr) {
if (instr->can_deopt()) {
// If `left >>> right` >= 0x80000000, the result is not representable
// in a signed 32-bit smi.
- DeoptimizeIfNegative(result, instr);
+ DeoptimizeIfNegative(result, instr, "negative value");
}
break;
default: UNREACHABLE();
@@ -4978,7 +4981,7 @@ void LCodeGen::DoShiftS(LShiftS* instr) {
int shift_count = JSShiftAmountFromLConstant(right_op);
if (shift_count == 0) {
if ((instr->op() == Token::SHR) && instr->can_deopt()) {
- DeoptimizeIfNegative(left, instr);
+ DeoptimizeIfNegative(left, instr, "negative value");
}
__ Mov(result, left);
} else {
@@ -5107,7 +5110,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
if (instr->hydrogen()->RequiresHoleCheck()) {
__ Ldr(scratch, target);
if (instr->hydrogen()->DeoptimizesOnHole()) {
- DeoptimizeIfRoot(scratch, Heap::kTheHoleValueRootIndex, instr);
+ DeoptimizeIfRoot(scratch, Heap::kTheHoleValueRootIndex, instr, "hole");
} else {
__ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, &skip_assignment);
}
@@ -5145,7 +5148,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
if (instr->hydrogen()->RequiresHoleCheck()) {
Register payload = ToRegister(instr->temp2());
__ Ldr(payload, FieldMemOperand(cell, Cell::kValueOffset));
- DeoptimizeIfRoot(payload, Heap::kTheHoleValueRootIndex, instr);
+ DeoptimizeIfRoot(payload, Heap::kTheHoleValueRootIndex, instr, "hole");
}
// Store the value.
@@ -5562,7 +5565,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
if (can_overflow) {
__ Subs(result, left, right);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Sub(result, left, right);
}
@@ -5576,7 +5579,7 @@ void LCodeGen::DoSubS(LSubS* instr) {
Operand right = ToOperand(instr->right());
if (can_overflow) {
__ Subs(result, left, right);
- DeoptimizeIf(vs, instr);
+ DeoptimizeIf(vs, instr, "overflow");
} else {
__ Sub(result, left, right);
}
@@ -5616,7 +5619,8 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr,
// Output contains zero, undefined is converted to zero for truncating
// conversions.
- DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr);
+ DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr,
+ "not a heap number/undefined/true/false");
} else {
Register output = ToRegister32(instr->result());
DoubleRegister dbl_scratch2 = ToDoubleRegister(temp2);
@@ -5774,7 +5778,7 @@ void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
Label no_memento_found;
__ TestJSArrayForAllocationMemento(object, temp1, temp2, &no_memento_found);
- DeoptimizeIf(eq, instr);
+ DeoptimizeIf(eq, instr, "memento found");
__ Bind(&no_memento_found);
}
@@ -5899,7 +5903,7 @@ void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
Register temp = ToRegister(instr->temp());
__ Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset));
__ Cmp(map, temp);
- DeoptimizeIf(ne, instr);
+ DeoptimizeIf(ne, instr, "wrong map");
}
@@ -5933,10 +5937,10 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
__ JumpIfRoot(receiver, Heap::kUndefinedValueRootIndex, &global_object);
// Deoptimize if the receiver is not a JS object.
- DeoptimizeIfSmi(receiver, instr);
+ DeoptimizeIfSmi(receiver, instr, "Smi");
__ CompareObjectType(receiver, result, result, FIRST_SPEC_OBJECT_TYPE);
__ B(ge, &copy_receiver);
- Deoptimize(instr);
+ Deoptimize(instr, "not a JavaScript object");
__ Bind(&global_object);
__ Ldr(result, FieldMemOperand(function, JSFunction::kContextOffset));
« no previous file with comments | « src/arm64/lithium-codegen-arm64.h ('k') | src/mips/lithium-codegen-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698