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

Unified Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2161543002: [turbofan] Add support for eager/soft deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do the ports properly Created 4 years, 5 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/crankshaft/ppc/lithium-codegen-ppc.h ('k') | src/crankshaft/s390/lithium-codegen-s390.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ppc/lithium-codegen-ppc.cc
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc
index b0265a8ee6ced21ee2ef327f0ca26742f3c0fc29..8698f9c3b4e673c9989d11fbcaded096d391ca4d 100644
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc
@@ -713,9 +713,8 @@ void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment,
}
}
-
void LCodeGen::DeoptimizeIf(Condition cond, LInstruction* instr,
- Deoptimizer::DeoptReason deopt_reason,
+ DeoptimizeReason deopt_reason,
Deoptimizer::BailoutType bailout_type,
CRegister cr) {
LEnvironment* environment = instr->environment();
@@ -777,10 +776,8 @@ void LCodeGen::DeoptimizeIf(Condition cond, LInstruction* instr,
}
}
-
void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr,
- Deoptimizer::DeoptReason deopt_reason,
- CRegister cr) {
+ DeoptimizeReason deopt_reason, CRegister cr) {
Deoptimizer::BailoutType bailout_type =
info()->IsStub() ? Deoptimizer::LAZY : Deoptimizer::EAGER;
DeoptimizeIf(condition, instr, deopt_reason, bailout_type, cr);
@@ -902,12 +899,12 @@ void LCodeGen::DoModByPowerOf2I(LModByPowerOf2I* instr) {
__ ExtractBitRange(dividend, dividend, shift - 1, 0);
__ neg(dividend, dividend, LeaveOE, SetRC);
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, cr0);
}
} else if (!hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
__ li(dividend, Operand::Zero());
} else {
- DeoptimizeIf(al, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kMinusZero);
}
__ b(&done);
}
@@ -929,7 +926,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
DCHECK(!dividend.is(result));
if (divisor == 0) {
- DeoptimizeIf(al, instr, Deoptimizer::kDivisionByZero);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kDivisionByZero);
return;
}
@@ -944,7 +941,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
Label remainder_not_zero;
__ bne(&remainder_not_zero, cr0);
__ cmpwi(dividend, Operand::Zero());
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
__ bind(&remainder_not_zero);
}
}
@@ -969,14 +966,14 @@ void LCodeGen::DoModI(LModI* instr) {
// Check for x % 0.
if (hmod->CheckFlag(HValue::kCanBeDivByZero)) {
__ cmpwi(right_reg, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kDivisionByZero);
}
// Check for kMinInt % -1, divw will return undefined, which is not what we
// want. We have to deopt if we care about -0, because we can't return that.
if (can_overflow) {
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero, cr0);
+ DeoptimizeIf(overflow, instr, DeoptimizeReason::kMinusZero, cr0);
} else {
if (CpuFeatures::IsSupported(ISELECT)) {
__ isel(overflow, result_reg, r0, result_reg, cr0);
@@ -998,7 +995,7 @@ void LCodeGen::DoModI(LModI* instr) {
if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) {
__ bne(&done, cr0);
__ cmpwi(left_reg, Operand::Zero());
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
}
__ bind(&done);
@@ -1016,13 +1013,13 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
HDiv* hdiv = instr->hydrogen();
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
__ cmpwi(dividend, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero);
}
// Check for (kMinInt / -1).
if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
__ lis(r0, Operand(SIGN_EXT_IMM16(0x8000)));
__ cmpw(dividend, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kOverflow);
}
int32_t shift = WhichPowerOf2Abs(divisor);
@@ -1030,7 +1027,7 @@ void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
// Deoptimize if remainder will not be 0.
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) && shift) {
__ TestBitRange(dividend, shift - 1, 0, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecision, cr0);
}
if (divisor == -1) { // Nice shortcut, not needed for correctness.
@@ -1060,7 +1057,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
DCHECK(!dividend.is(result));
if (divisor == 0) {
- DeoptimizeIf(al, instr, Deoptimizer::kDivisionByZero);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kDivisionByZero);
return;
}
@@ -1068,7 +1065,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
HDiv* hdiv = instr->hydrogen();
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
__ cmpwi(dividend, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero);
}
__ TruncatingDiv(result, dividend, Abs(divisor));
@@ -1079,7 +1076,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
__ mov(ip, Operand(divisor));
__ mullw(scratch, result, ip);
__ cmpw(scratch, dividend);
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecision);
}
}
@@ -1105,7 +1102,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
// Check for x / 0.
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
__ cmpwi(divisor, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kDivisionByZero);
}
// Check for (0 / -x) that will produce negative zero.
@@ -1114,14 +1111,14 @@ void LCodeGen::DoDivI(LDivI* instr) {
__ cmpwi(dividend, Operand::Zero());
__ bne(&dividend_not_zero);
__ cmpwi(divisor, Operand::Zero());
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
__ bind(&dividend_not_zero);
}
// Check for (kMinInt / -1).
if (can_overflow) {
if (!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) {
- DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow, cr0);
} else {
// When truncating, we want kMinInt / -1 = kMinInt.
if (CpuFeatures::IsSupported(ISELECT)) {
@@ -1144,7 +1141,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
Register scratch = scratch0();
__ mullw(scratch, divisor, result);
__ cmpw(dividend, scratch);
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecision);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecision);
}
}
@@ -1172,7 +1169,7 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
if (divisor == -1 && can_overflow) {
__ lis(r0, Operand(SIGN_EXT_IMM16(0x8000)));
__ cmpw(dividend, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kOverflow);
}
#else
if (can_overflow) {
@@ -1184,7 +1181,7 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
__ neg(result, dividend, oe, SetRC);
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) {
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero, cr0);
}
// If the negation could not overflow, simply shifting is OK.
@@ -1200,7 +1197,7 @@ void LCodeGen::DoFlooringDivByPowerOf2I(LFlooringDivByPowerOf2I* instr) {
// Dividing by -1 is basically negation, unless we overflow.
if (divisor == -1) {
- DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow, cr0);
return;
}
@@ -1222,7 +1219,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
DCHECK(!dividend.is(result));
if (divisor == 0) {
- DeoptimizeIf(al, instr, Deoptimizer::kDivisionByZero);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kDivisionByZero);
return;
}
@@ -1230,7 +1227,7 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
HMathFloorOfDiv* hdiv = instr->hydrogen();
if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
__ cmpwi(dividend, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero);
}
// Easy case: We need no dynamic check for the dividend and the flooring
@@ -1282,7 +1279,7 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
// Check for x / 0.
if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) {
__ cmpwi(divisor, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kDivisionByZero);
}
// Check for (0 / -x) that will produce negative zero.
@@ -1291,14 +1288,14 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
__ cmpwi(dividend, Operand::Zero());
__ bne(&dividend_not_zero);
__ cmpwi(divisor, Operand::Zero());
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
__ bind(&dividend_not_zero);
}
// Check for (kMinInt / -1).
if (can_overflow) {
if (!hdiv->CheckFlag(HValue::kAllUsesTruncatingToInt32)) {
- DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow, cr0);
} else {
// When truncating, we want kMinInt / -1 = kMinInt.
if (CpuFeatures::IsSupported(ISELECT)) {
@@ -1376,7 +1373,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
// The case of a null constant will be handled separately.
// If constant is negative and left is null, the result should be -0.
__ cmpi(left, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero);
}
switch (constant) {
@@ -1388,12 +1385,12 @@ void LCodeGen::DoMulI(LMulI* instr) {
__ li(r0, Operand::Zero()); // clear xer
__ mtxer(r0);
__ neg(result, left, SetOE, SetRC);
- DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow, cr0);
#if V8_TARGET_ARCH_PPC64
} else {
__ neg(result, left);
__ TestIfInt32(result, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow);
}
#endif
} else {
@@ -1413,7 +1410,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
__ cmpwi(left, Operand::Zero());
}
#endif
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
}
__ li(result, Operand::Zero());
break;
@@ -1466,7 +1463,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
__ Mul(result, left, right);
}
__ TestIfInt32(result, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow);
if (instr->hydrogen()->representation().IsSmi()) {
__ SmiTag(result);
}
@@ -1481,7 +1478,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
__ mullw(result, left, right);
}
__ TestIfInt32(scratch, result, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow);
#endif
} else {
if (instr->hydrogen()->representation().IsSmi()) {
@@ -1508,7 +1505,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
#endif
// Bail out if the result is minus zero.
__ cmpi(result, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero);
__ bind(&done);
}
}
@@ -1594,7 +1591,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
#if V8_TARGET_ARCH_PPC64
__ extsw(result, result, SetRC);
#endif
- DeoptimizeIf(lt, instr, Deoptimizer::kNegativeValue, cr0);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kNegativeValue, cr0);
} else {
__ srw(result, left, scratch);
}
@@ -1634,7 +1631,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
} else {
if (instr->can_deopt()) {
__ cmpwi(left, Operand::Zero());
- DeoptimizeIf(lt, instr, Deoptimizer::kNegativeValue);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kNegativeValue);
}
__ Move(result, left);
}
@@ -1653,7 +1650,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
} else {
__ SmiTagCheckOverflow(result, left, scratch);
}
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0);
#endif
} else {
__ slwi(result, left, Operand(shift_count));
@@ -1692,7 +1689,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
#if V8_TARGET_ARCH_PPC64
if (can_overflow) {
__ TestIfInt32(result, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow);
}
#endif
} else {
@@ -1703,7 +1700,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
__ SubAndCheckForOverflow(result, left, EmitLoadRegister(right, ip),
scratch0(), r0);
}
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0);
}
}
@@ -1869,7 +1866,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
#if V8_TARGET_ARCH_PPC64
if (can_overflow) {
__ TestIfInt32(result, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow);
}
#endif
} else {
@@ -1880,7 +1877,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
__ AddAndCheckForOverflow(result, left, EmitLoadRegister(right, ip),
scratch0(), r0);
}
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0);
}
}
@@ -2131,7 +2128,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
} else if (expected.NeedsMap()) {
// If we need a map later and have a Smi -> deopt.
__ TestIfSmi(reg, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0);
}
const Register map = scratch0();
@@ -2195,7 +2192,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
if (!expected.IsGeneric()) {
// We've seen something for the first time -> deopt.
// This can only happen if we are not generic already.
- DeoptimizeIf(al, instr, Deoptimizer::kUnexpectedObject);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kUnexpectedObject);
}
}
}
@@ -2579,10 +2576,10 @@ void LCodeGen::DoHasInPrototypeChainAndBranch(
__ lbz(object_instance_type,
FieldMemOperand(object_map, Map::kBitFieldOffset));
__ TestBit(object_instance_type, Map::kIsAccessCheckNeeded, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kAccessCheck, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kAccessCheck, cr0);
// Deoptimize for proxies.
__ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE);
- DeoptimizeIf(eq, instr, Deoptimizer::kProxy);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kProxy);
__ LoadP(object_prototype,
FieldMemOperand(object_map, Map::kPrototypeOffset));
__ CompareRoot(object_prototype, Heap::kNullValueRootIndex);
@@ -2712,7 +2709,7 @@ void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
__ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
if (instr->hydrogen()->DeoptimizesOnHole()) {
__ cmp(result, ip);
- DeoptimizeIf(eq, instr, Deoptimizer::kHole);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
} else {
if (CpuFeatures::IsSupported(ISELECT)) {
Register scratch = scratch0();
@@ -2744,7 +2741,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
__ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
__ cmp(scratch, ip);
if (instr->hydrogen()->DeoptimizesOnHole()) {
- DeoptimizeIf(eq, instr, Deoptimizer::kHole);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
} else {
__ bne(&skip_assignment);
}
@@ -2831,7 +2828,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
// Check that the function has a prototype or an initial map.
__ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
__ cmp(result, ip);
- DeoptimizeIf(eq, instr, Deoptimizer::kHole);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
// If the function does not have an initial map, we're done.
if (CpuFeatures::IsSupported(ISELECT)) {
@@ -2983,7 +2980,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
__ lis(r0, Operand(SIGN_EXT_IMM16(0x8000)));
__ cmplw(result, r0);
- DeoptimizeIf(ge, instr, Deoptimizer::kNegativeValue);
+ DeoptimizeIf(ge, instr, DeoptimizeReason::kNegativeValue);
}
break;
case FLOAT32_ELEMENTS:
@@ -3048,7 +3045,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
__ lwz(scratch, MemOperand(scratch, Register::kExponentOffset));
}
__ Cmpi(scratch, Operand(kHoleNanUpper32), r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kHole);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
}
}
@@ -3099,11 +3096,11 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
if (requires_hole_check) {
if (IsFastSmiElementsKind(hinstr->elements_kind())) {
__ TestIfSmi(result, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, cr0);
} else {
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
__ cmp(result, scratch);
- DeoptimizeIf(eq, instr, Deoptimizer::kHole);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
@@ -3118,7 +3115,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
__ LoadRoot(result, Heap::kArrayProtectorRootIndex);
__ LoadP(result, FieldMemOperand(result, Cell::kValueOffset));
__ CmpSmiLiteral(result, Smi::FromInt(Isolate::kArrayProtectorValid), r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kHole);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kHole);
}
__ LoadRoot(result, Heap::kUndefinedValueRootIndex);
__ bind(&done);
@@ -3268,9 +3265,9 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
// Deoptimize if the receiver is not a JS object.
__ TestIfSmi(receiver, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0);
__ CompareObjectType(receiver, scratch, scratch, FIRST_JS_RECEIVER_TYPE);
- DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kNotAJavaScriptObject);
__ b(&result_in_receiver);
__ bind(&global_object);
@@ -3304,7 +3301,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
// adaptor frame below it.
const uint32_t kArgumentsLimit = 1 * KB;
__ cmpli(length, Operand(kArgumentsLimit));
- DeoptimizeIf(gt, instr, Deoptimizer::kTooManyArguments);
+ DeoptimizeIf(gt, instr, DeoptimizeReason::kTooManyArguments);
// Push the receiver and use the register to keep the original
// number of arguments.
@@ -3458,7 +3455,7 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
__ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
__ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
__ cmp(scratch, ip);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber);
Label done;
Register exponent = scratch0();
@@ -3528,7 +3525,7 @@ void LCodeGen::EmitMathAbs(LMathAbs* instr) {
__ mtxer(r0);
__ neg(result, result, SetOE, SetRC);
// Deoptimize on overflow.
- DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(overflow, instr, DeoptimizeReason::kOverflow, cr0);
__ bind(&done);
}
@@ -3545,7 +3542,7 @@ void LCodeGen::EmitInteger32MathAbs(LMathAbs* instr) {
// Deoptimize on overflow.
__ lis(r0, Operand(SIGN_EXT_IMM16(0x8000)));
__ cmpw(input, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kOverflow);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kOverflow);
__ neg(result, result);
__ bind(&done);
@@ -3609,7 +3606,7 @@ void LCodeGen::DoMathFloorI(LMathFloorI* instr) {
__ TryInt32Floor(result, input, input_high, scratch, double_scratch0(), &done,
&exact);
- DeoptimizeIf(al, instr, Deoptimizer::kLostPrecisionOrNaN);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kLostPrecisionOrNaN);
__ bind(&exact);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
@@ -3617,7 +3614,7 @@ void LCodeGen::DoMathFloorI(LMathFloorI* instr) {
__ cmpi(result, Operand::Zero());
__ bne(&done);
__ cmpwi(input_high, Operand::Zero());
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
}
__ bind(&done);
}
@@ -3658,7 +3655,7 @@ void LCodeGen::DoMathRoundI(LMathRoundI* instr) {
__ LoadDoubleLiteral(dot_five, 0.5, r0);
__ fabs(double_scratch1, input);
__ fcmpu(double_scratch1, dot_five);
- DeoptimizeIf(unordered, instr, Deoptimizer::kLostPrecisionOrNaN);
+ DeoptimizeIf(unordered, instr, DeoptimizeReason::kLostPrecisionOrNaN);
// If input is in [-0.5, -0], the result is -0.
// If input is in [+0, +0.5[, the result is +0.
// If the input is +0.5, the result is 1.
@@ -3666,7 +3663,7 @@ void LCodeGen::DoMathRoundI(LMathRoundI* instr) {
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
// [-0.5, -0] (negative) yields minus zero.
__ TestDoubleSign(input, scratch1);
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
}
__ fcmpu(input, dot_five);
if (CpuFeatures::IsSupported(ISELECT)) {
@@ -3690,7 +3687,7 @@ void LCodeGen::DoMathRoundI(LMathRoundI* instr) {
// Reuse dot_five (double_scratch0) as we no longer need this value.
__ TryInt32Floor(result, input_plus_dot_five, scratch1, scratch2,
double_scratch0(), &done, &done);
- DeoptimizeIf(al, instr, Deoptimizer::kLostPrecisionOrNaN);
+ DeoptimizeIf(al, instr, DeoptimizeReason::kLostPrecisionOrNaN);
__ bind(&done);
}
@@ -3755,7 +3752,7 @@ void LCodeGen::DoPower(LPower* instr) {
__ LoadP(r10, FieldMemOperand(tagged_exponent, HeapObject::kMapOffset));
__ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
__ cmp(r10, ip);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber);
__ bind(&no_deopt);
MathPowStub stub(isolate(), MathPowStub::TAGGED);
__ CallStub(&stub);
@@ -4139,7 +4136,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
__ stop("eliminated bounds check failed");
__ bind(&done);
} else {
- DeoptimizeIf(cc, instr, Deoptimizer::kOutOfBounds);
+ DeoptimizeIf(cc, instr, DeoptimizeReason::kOutOfBounds);
}
}
@@ -4457,7 +4454,7 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
// Deopt on smi, which means the elements array changed to dictionary mode.
__ TestIfSmi(result, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0);
}
@@ -4503,7 +4500,7 @@ void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
Register temp2 = ToRegister(instr->temp2());
Label no_memento_found;
__ TestJSArrayForAllocationMemento(object, temp1, temp2, &no_memento_found);
- DeoptimizeIf(eq, instr, Deoptimizer::kMementoFound);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMementoFound);
__ bind(&no_memento_found);
}
@@ -4814,13 +4811,13 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
if (hchange->CheckFlag(HValue::kCanOverflow) &&
hchange->value()->CheckFlag(HValue::kUint32)) {
__ TestUnsignedSmiCandidate(input, r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOverflow, cr0);
}
#if !V8_TARGET_ARCH_PPC64
if (hchange->CheckFlag(HValue::kCanOverflow) &&
!hchange->value()->CheckFlag(HValue::kUint32)) {
__ SmiTagCheckOverflow(output, input, r0);
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0);
} else {
#endif
__ SmiTag(output, input);
@@ -4838,7 +4835,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
// If the input is a HeapObject, value of scratch won't be zero.
__ andi(scratch, input, Operand(kHeapObjectTag));
__ SmiUntag(result, input);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, cr0);
} else {
__ SmiUntag(result, input);
}
@@ -4868,13 +4865,13 @@ void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg,
if (can_convert_undefined_to_nan) {
__ bne(&convert);
} else {
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber);
}
// load heap number
__ lfd(result_reg, FieldMemOperand(input_reg, HeapNumber::kValueOffset));
if (deoptimize_on_minus_zero) {
__ TestDoubleIsMinusZero(result_reg, scratch, ip);
- DeoptimizeIf(eq, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kMinusZero);
}
__ b(&done);
if (can_convert_undefined_to_nan) {
@@ -4882,7 +4879,7 @@ void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg,
// Convert undefined (and hole) to NaN.
__ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
__ cmp(input_reg, ip);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefined);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefined);
__ LoadRoot(scratch, Heap::kNanValueRootIndex);
__ lfd(result_reg, FieldMemOperand(scratch, HeapNumber::kValueOffset));
__ b(&done);
@@ -4944,10 +4941,10 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
__ bind(&check_false);
__ LoadRoot(ip, Heap::kFalseValueRootIndex);
__ cmp(input_reg, ip);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefinedBoolean);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefinedBoolean);
__ li(input_reg, Operand::Zero());
} else {
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumber);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber);
__ lfd(double_scratch2,
FieldMemOperand(input_reg, HeapNumber::kValueOffset));
@@ -4957,13 +4954,13 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
}
__ TryDoubleToInt32Exact(input_reg, double_scratch2, scratch1,
double_scratch);
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
__ cmpi(input_reg, Operand::Zero());
__ bne(&done);
__ TestHeapNumberSign(scratch2, scratch1);
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
}
}
__ bind(&done);
@@ -5032,13 +5029,13 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
__ TryDoubleToInt32Exact(result_reg, double_input, scratch1,
double_scratch);
// Deoptimize if the input wasn't a int32 (inside a double).
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
Label done;
__ cmpi(result_reg, Operand::Zero());
__ bne(&done);
__ TestDoubleSign(double_input, scratch1);
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
__ bind(&done);
}
}
@@ -5057,13 +5054,13 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
__ TryDoubleToInt32Exact(result_reg, double_input, scratch1,
double_scratch);
// Deoptimize if the input wasn't a int32 (inside a double).
- DeoptimizeIf(ne, instr, Deoptimizer::kLostPrecisionOrNaN);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kLostPrecisionOrNaN);
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
Label done;
__ cmpi(result_reg, Operand::Zero());
__ bne(&done);
__ TestDoubleSign(double_input, scratch1);
- DeoptimizeIf(lt, instr, Deoptimizer::kMinusZero);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kMinusZero);
__ bind(&done);
}
}
@@ -5071,7 +5068,7 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
__ SmiTag(result_reg);
#else
__ SmiTagCheckOverflow(result_reg, r0);
- DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, cr0);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0);
#endif
}
@@ -5079,7 +5076,7 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
LOperand* input = instr->value();
__ TestIfSmi(ToRegister(input), r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, cr0);
}
@@ -5087,7 +5084,7 @@ void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
if (!instr->hydrogen()->value()->type().IsHeapObject()) {
LOperand* input = instr->value();
__ TestIfSmi(ToRegister(input), r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0);
}
}
@@ -5100,7 +5097,7 @@ void LCodeGen::DoCheckArrayBufferNotNeutered(
__ LoadP(scratch, FieldMemOperand(view, JSArrayBufferView::kBufferOffset));
__ lwz(scratch, FieldMemOperand(scratch, JSArrayBuffer::kBitFieldOffset));
__ andi(r0, scratch, Operand(1 << JSArrayBuffer::WasNeutered::kShift));
- DeoptimizeIf(ne, instr, Deoptimizer::kOutOfBounds, cr0);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kOutOfBounds, cr0);
}
@@ -5120,13 +5117,13 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
// If there is only one type in the interval check for equality.
if (first == last) {
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongInstanceType);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongInstanceType);
} else {
- DeoptimizeIf(lt, instr, Deoptimizer::kWrongInstanceType);
+ DeoptimizeIf(lt, instr, DeoptimizeReason::kWrongInstanceType);
// Omit check for the last type.
if (last != LAST_TYPE) {
__ cmpli(scratch, Operand(last));
- DeoptimizeIf(gt, instr, Deoptimizer::kWrongInstanceType);
+ DeoptimizeIf(gt, instr, DeoptimizeReason::kWrongInstanceType);
}
}
} else {
@@ -5137,12 +5134,12 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
if (base::bits::IsPowerOfTwo32(mask)) {
DCHECK(tag == 0 || base::bits::IsPowerOfTwo32(tag));
__ andi(r0, scratch, Operand(mask));
- DeoptimizeIf(tag == 0 ? ne : eq, instr, Deoptimizer::kWrongInstanceType,
- cr0);
+ DeoptimizeIf(tag == 0 ? ne : eq, instr,
+ DeoptimizeReason::kWrongInstanceType, cr0);
} else {
__ andi(scratch, scratch, Operand(mask));
__ cmpi(scratch, Operand(tag));
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongInstanceType);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongInstanceType);
}
}
}
@@ -5161,7 +5158,7 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) {
} else {
__ Cmpi(reg, Operand(object), r0);
}
- DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kValueMismatch);
}
@@ -5177,7 +5174,7 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
__ StoreToSafepointRegisterSlot(r3, temp);
}
__ TestIfSmi(temp, r0);
- DeoptimizeIf(eq, instr, Deoptimizer::kInstanceMigrationFailed, cr0);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kInstanceMigrationFailed, cr0);
}
@@ -5232,7 +5229,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
if (instr->hydrogen()->HasMigrationTarget()) {
__ bne(deferred->entry());
} else {
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongMap);
}
__ bind(&success);
@@ -5271,7 +5268,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
// Check for undefined. Undefined is converted to zero for clamping
// conversions.
__ Cmpi(input_reg, Operand(factory()->undefined_value()), r0);
- DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefined);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefined);
__ li(result_reg, Operand::Zero());
__ b(&done);
@@ -5702,7 +5699,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
__ LoadP(result, FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
__ LoadP(result, FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
__ cmpi(result, Operand::Zero());
- DeoptimizeIf(eq, instr, Deoptimizer::kNoCache);
+ DeoptimizeIf(eq, instr, DeoptimizeReason::kNoCache);
__ bind(&done);
}
@@ -5713,7 +5710,7 @@ void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
Register map = ToRegister(instr->map());
__ LoadP(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset));
__ cmp(map, scratch0());
- DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kWrongMap);
}
« no previous file with comments | « src/crankshaft/ppc/lithium-codegen-ppc.h ('k') | src/crankshaft/s390/lithium-codegen-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698