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

Unified Diff: runtime/vm/stub_code_arm.cc

Issue 285543002: Recognize List constructor and turn it into CreateArray ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm.cc
===================================================================
--- runtime/vm/stub_code_arm.cc (revision 36136)
+++ runtime/vm/stub_code_arm.cc (working copy)
@@ -613,6 +613,15 @@
} else {
__ b(&slow_case, NE);
}
+ __ cmp(R2, ShifterOperand(0));
+ __ b(&slow_case, LT);
+
+ // Check for maximum allowed length.
+ const intptr_t max_len =
+ reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements));
+ __ CompareImmediate(R2, max_len);
+ __ b(&slow_case, GT);
+
__ ldr(R8, FieldAddress(CTX, Context::isolate_offset()));
__ LoadFromOffset(kWord, R8, R8, Isolate::heap_offset());
__ LoadFromOffset(kWord, R8, R8, Heap::new_space_offset());
@@ -628,7 +637,8 @@
__ add(R3, R3, ShifterOperand(R2, LSL, 1)); // R2 is Smi.
ASSERT(kSmiTagShift == 1);
__ bic(R3, R3, ShifterOperand(kObjectAlignment - 1));
- __ add(R7, R3, ShifterOperand(R0));
+ __ adds(R7, R3, ShifterOperand(R0));
+ __ b(&slow_case, VS);
// Check if the allocation fits into the remaining space.
// R0: potential new object start.
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698