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

Unified Diff: runtime/vm/stub_code_x64.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/stub_code_mips.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 36136)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -574,6 +574,15 @@
} else {
__ j(NOT_ZERO, &slow_case);
}
+ __ cmpq(R10, Immediate(0));
+ __ j(LESS, &slow_case);
+
+ // Check for maximum allowed length.
+ const Immediate& max_len =
+ Immediate(reinterpret_cast<int64_t>(Smi::New(Array::kMaxElements)));
+ __ cmpq(R10, max_len);
+ __ j(GREATER, &slow_case);
+
__ movq(R13, FieldAddress(CTX, Context::isolate_offset()));
__ movq(R13, Address(R13, Isolate::heap_offset()));
__ movq(R13, Address(R13, Heap::new_space_offset()));
@@ -588,7 +597,8 @@
__ leaq(R12, Address(R10, TIMES_4, fixed_size)); // R10 is Smi.
ASSERT(kSmiTagShift == 1);
__ andq(R12, Immediate(-kObjectAlignment));
- __ leaq(R12, Address(RAX, R12, TIMES_1, 0));
+ __ addq(R12, RAX);
+ __ j(CARRY, &slow_case);
// Check if the allocation fits into the remaining space.
// RAX: potential new object start.
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698