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

Unified Diff: runtime/vm/intrinsifier_ia32.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.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 11330)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -399,8 +399,8 @@
// On stack: growable array (+2), length (+1), return-address (+0).
bool Intrinsifier::GrowableArray_setLength(Assembler* assembler) {
Label fall_through;
- __ movl(EAX, Address(ESP, + 2 * kWordSize));
- __ movl(EBX, Address(ESP, + 1 * kWordSize));
+ __ movl(EAX, Address(ESP, + 2 * kWordSize)); // Growable array.
+ __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Length value.
__ movl(EDI, FieldAddress(EAX, GrowableObjectArray::data_offset()));
__ cmpl(EBX, FieldAddress(EDI, Array::length_offset()));
__ j(ABOVE, &fall_through, Assembler::kNearJump);
@@ -431,9 +431,7 @@
// 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.
+ // In checked mode we need to type-check the incoming argument.
if (FLAG_enable_type_checks) return false;
Label fall_through;
__ movl(EAX, Address(ESP, + 2 * kWordSize)); // Array.
@@ -442,7 +440,7 @@
__ movl(EDI, FieldAddress(EAX, GrowableObjectArray::data_offset()));
// EDI: data.
// Compare length with capacity.
- __ cmpl(EBX, FieldAddress(EDI, GrowableObjectArray::length_offset()));
+ __ cmpl(EBX, FieldAddress(EDI, Array::length_offset()));
__ j(EQUAL, &fall_through, Assembler::kNearJump); // Must grow data.
const Immediate value_one = Immediate(reinterpret_cast<int32_t>(Smi::New(1)));
// len = len + 1;
@@ -452,6 +450,9 @@
__ StoreIntoObject(EDI,
FieldAddress(EDI, EBX, TIMES_2, sizeof(RawArray)),
EAX);
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<int32_t>(Object::null()));
+ __ movl(EAX, raw_null);
__ ret();
__ Bind(&fall_through);
return false;
« no previous file with comments | « runtime/vm/intrinsifier.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698