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

Unified Diff: runtime/vm/intrinsifier_arm.cc

Issue 408373002: Adds intrinsics for Float64Array [] and []=. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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.h ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_arm.cc
===================================================================
--- runtime/vm/intrinsifier_arm.cc (revision 38478)
+++ runtime/vm/intrinsifier_arm.cc (working copy)
@@ -475,6 +475,76 @@
}
+void Intrinsifier::Float64Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+ __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index.
+ __ ldr(R1, Address(SP, + 1 * kWordSize)); // Array.
+ __ tst(R0, Operand(kSmiTagMask));
+ __ b(&fall_through, NE); // Index is not a smi, fall through.
+
+ // Range check.
+ __ ldr(R6, FieldAddress(R1, TypedData::length_offset()));
+ __ cmp(R0, Operand(R6));
+ __ b(&fall_through, CS);
+
+
+ Address element_address =
+ __ ElementAddressForRegIndex(true, // Load.
+ false, // Not external.
+ kTypedDataFloat64ArrayCid, // Cid.
+ 8, // Index scale.
+ R1, // Array.
+ R0); // Index.
+
+ __ vldrd(D0, element_address);
+
+ const Class& double_class = Class::Handle(
+ Isolate::Current()->object_store()->double_class());
+ __ TryAllocate(double_class,
+ &fall_through,
+ R0, // Result register.
+ R1);
+ __ StoreDToOffset(D0, R0, Double::value_offset() - kHeapObjectTag);
+ __ Ret();
+ __ Bind(&fall_through);
+}
+
+
+void Intrinsifier::Float64Array_setIndexed(Assembler* assembler) {
+ Label fall_through;
+ __ ldr(R0, Address(SP, + 1 * kWordSize)); // Index.
+ __ ldr(R1, Address(SP, + 2 * kWordSize)); // Array.
+ __ tst(R0, Operand(kSmiTagMask));
+ __ b(&fall_through, NE); // Index is not a smi, fall through.
+
+ // Range check.
+ __ ldr(R6, FieldAddress(R1, TypedData::length_offset()));
+ __ cmp(R0, Operand(R6));
+ __ b(&fall_through, CS);
+
+ __ ldr(R2, Address(SP, + 0 * kWordSize)); // Value.
+ __ tst(R2, Operand(kSmiTagMask));
+ __ b(&fall_through, EQ); // Value is Smi, fall through.
+
+ __ LoadClassId(R3, R2);
+ __ CompareImmediate(R3, kDoubleCid);
+ __ b(&fall_through, NE); // Not a Double, fall through.
+
+ __ LoadDFromOffset(D0, R2, Double::value_offset() - kHeapObjectTag);
+
+ Address element_address =
+ __ ElementAddressForRegIndex(false, // Store.
+ false, // Not external.
+ kTypedDataFloat64ArrayCid, // Cid.
+ 8, // Index scale.
+ R1, // Array.
+ R0); // Index.
+ __ vstrd(D0, element_address);
+ __ Ret();
+ __ Bind(&fall_through);
+}
+
+
static int GetScaleFactor(intptr_t size) {
switch (size) {
case 1: return 0;
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698