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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 11195007: Add value tests to intrinisics GrowableArray _setData and setLength. Thos are private native method… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 13693)
+++ runtime/vm/intrinsifier_x64.cc (working copy)
@@ -345,6 +345,8 @@
Label fall_through;
__ movq(RAX, Address(RSP, + 2 * kWordSize)); // Growable array.
__ movq(RCX, Address(RSP, + 1 * kWordSize)); // Length value.
+ __ testq(RCX, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi length.
__ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset()));
__ cmpq(RCX, FieldAddress(RDX, Array::length_offset()));
__ j(ABOVE, &fall_through, Assembler::kNearJump);
@@ -361,13 +363,19 @@
if (FLAG_enable_type_checks) {
return false;
}
- __ movq(RAX, Address(RSP, + 2 * kWordSize));
- __ movq(RBX, Address(RSP, + 1 * kWordSize));
+ Label fall_through;
+ __ movq(RBX, Address(RSP, + 1 * kWordSize)); /// Data.
+ __ testq(RBX, Immediate(kSmiTagMask));
+ __ j(ZERO, &fall_through, Assembler::kNearJump); // Data is Smi.
+ __ CompareClassId(RBX, kArrayCid);
+ __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+ __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Growable array.
__ StoreIntoObject(RAX,
FieldAddress(RAX, GrowableObjectArray::data_offset()),
RBX);
__ ret();
- return true;
+ __ 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