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

Unified Diff: runtime/vm/stub_code_mips.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_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 36136)
+++ runtime/vm/stub_code_mips.cc (working copy)
@@ -700,6 +700,12 @@
} else {
__ bne(CMPRES1, ZR, &slow_case);
}
+ __ bltz(A1, &slow_case);
+ // Check for maximum allowed length.
+ const intptr_t max_len =
+ reinterpret_cast<int32_t>(Smi::New(Array::kMaxElements));
+ __ BranchUnsignedGreater(A1, max_len, &slow_case);
+
__ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
__ lw(T0, Address(T0, Isolate::heap_offset()));
__ lw(T0, Address(T0, Heap::new_space_offset()));
@@ -717,8 +723,10 @@
ASSERT(kSmiTagShift == 1);
__ LoadImmediate(TMP, ~(kObjectAlignment - 1));
__ and_(T3, T3, TMP);
- __ addu(T2, T3, V0);
+ __ AdduDetectOverflow(T2, T3, V0, CMPRES1);
+ __ bltz(CMPRES1, &slow_case); // CMPRES1 < 0 on overflow.
+
// Check if the allocation fits into the remaining space.
// V0: potential new object start.
// A0: array element type.
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698