Index: runtime/vm/intermediate_language_arm64.cc |
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc |
index b4d4752fd6d86f063cfdc7075e578782a2e48b99..b4647a95975886c3d6cf3d2302a1681273e7691b 100644 |
--- a/runtime/vm/intermediate_language_arm64.cc |
+++ b/runtime/vm/intermediate_language_arm64.cc |
@@ -4906,10 +4906,10 @@ LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate, |
void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? |
- ICData::kDeoptHoistedCheckClass : ICData::kDeoptCheckClass; |
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), |
+ ICData::kDeoptCheckClass, |
+ licm_hoisted_ ? ICData::kHoisted : 0); |
if (IsNullCheck()) { |
- Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
__ CompareObject(locs()->in(0).reg(), Object::null_object(), PP); |
__ b(deopt, EQ); |
return; |
@@ -4919,7 +4919,6 @@ void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(unary_checks().NumberOfChecks() > 1)); |
const Register value = locs()->in(0).reg(); |
const Register temp = locs()->temp(0).reg(); |
- Label* deopt = compiler->AddDeoptStub(deopt_id(), deopt_reason); |
Label is_ok; |
intptr_t cix = 0; |
if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) { |
@@ -5016,8 +5015,10 @@ LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate, |
void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- Label* deopt = compiler->AddDeoptStub(deopt_id(), |
- ICData::kDeoptCheckArrayBound); |
+ Label* deopt = compiler->AddDeoptStub( |
+ deopt_id(), |
+ ICData::kDeoptCheckArrayBound, |
+ generalized_ ? ICData::kGeneralized : 0); |
Location length_loc = locs()->in(kLengthPos); |
Location index_loc = locs()->in(kIndexPos); |
@@ -5047,8 +5048,13 @@ void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} else if (length_loc.IsConstant()) { |
const Smi& length = Smi::Cast(length_loc.constant()); |
const Register index = index_loc.reg(); |
- __ CompareImmediate(index, reinterpret_cast<int64_t>(length.raw()), PP); |
- __ b(deopt, CS); |
+ if (length.Value() == Smi::kMaxValue) { |
+ __ tst(index, Operand(index)); |
+ __ b(deopt, MI); |
+ } else { |
+ __ CompareImmediate(index, reinterpret_cast<int64_t>(length.raw()), PP); |
+ __ b(deopt, CS); |
+ } |
} else { |
const Register length = length_loc.reg(); |
const Register index = index_loc.reg(); |