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

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

Issue 2686263002: [crankshaft] Fix Smi overflow in {HMaybeGrowElements}. (Closed)
Patch Set: Created 3 years, 10 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/code-stubs-hydrogen.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/arm/lithium-codegen-arm.cc
diff --git a/src/crankshaft/arm/lithium-codegen-arm.cc b/src/crankshaft/arm/lithium-codegen-arm.cc
index 5d32e1c9aed87fae4c78fbb947b52b55902a0adb..89d5e5d466a3e05410f7beeed9bcbb3d51ebc403 100644
--- a/src/crankshaft/arm/lithium-codegen-arm.cc
+++ b/src/crankshaft/arm/lithium-codegen-arm.cc
@@ -4045,13 +4045,17 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
if (Smi::IsValid(int_key)) {
__ mov(r3, Operand(Smi::FromInt(int_key)));
} else {
- // We should never get here at runtime because there is a smi check on
- // the key before this point.
- __ stop("expected smi");
+ Abort(kArrayIndexConstantValueTooBig);
}
} else {
- __ Move(r3, ToRegister(key));
- __ SmiTag(r3);
+ Label is_smi;
+ __ SmiTag(r3, ToRegister(key), SetCC);
+ // Deopt if the key is outside Smi range. The stub expects Smi and would
+ // bump the elements into dictionary mode (and trigger a deopt) anyways.
+ __ b(vc, &is_smi);
+ __ PopSafepointRegisters();
+ DeoptimizeIf(al, instr, DeoptimizeReason::kOverflow);
+ __ bind(&is_smi);
}
GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind());
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698