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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 10870053: Fix Growable array set length intrinsics to check if the incoming value is a Smi, otherwise call na… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
===================================================================
--- runtime/vm/intrinsifier_x64.cc (revision 11330)
+++ runtime/vm/intrinsifier_x64.cc (working copy)
@@ -341,7 +341,7 @@
bool Intrinsifier::GrowableArray_setLength(Assembler* assembler) {
Label fall_through;
__ movq(RAX, Address(RSP, + 2 * kWordSize)); // Growable array.
- __ movq(RCX, Address(RSP, + 1 * kWordSize)); // Length.
+ __ movq(RCX, Address(RSP, + 1 * kWordSize)); // Length value.
__ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset()));
__ cmpq(RCX, FieldAddress(RDX, Array::length_offset()));
__ j(ABOVE, &fall_through, Assembler::kNearJump);
@@ -372,8 +372,6 @@
// call into regular code.
// On stack: growable array (+2), value (+1), return-address (+0).
bool Intrinsifier::GrowableArray_add(Assembler* assembler) {
- // TODO(srdjan): Enable once crash in apidoc.dart is fixed.
- return false;
// In checked mode we need to check the incoming argument.
if (FLAG_enable_type_checks) return false;
Label fall_through;
@@ -383,7 +381,7 @@
__ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset()));
// RDX: data.
// Compare length with capacity.
- __ cmpq(RCX, FieldAddress(RDX, GrowableObjectArray::length_offset()));
+ __ cmpq(RCX, FieldAddress(RDX, Array::length_offset()));
__ j(EQUAL, &fall_through, Assembler::kNearJump); // Must grow data.
const Immediate value_one = Immediate(reinterpret_cast<int64_t>(Smi::New(1)));
// len = len + 1;
@@ -393,6 +391,9 @@
__ StoreIntoObject(RDX,
FieldAddress(RDX, RCX, TIMES_4, sizeof(RawArray)),
RAX);
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<int64_t>(Object::null()));
+ __ movq(RAX, raw_null);
__ ret();
__ Bind(&fall_through);
return false;
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698