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

Unified Diff: runtime/vm/intrinsifier_arm64.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_arm.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_arm64.cc
===================================================================
--- runtime/vm/intrinsifier_arm64.cc (revision 38478)
+++ runtime/vm/intrinsifier_arm64.cc (working copy)
@@ -400,6 +400,75 @@
}
+void Intrinsifier::Float64Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+ __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index.
+ __ ldr(R1, Address(SP, + 1 * kWordSize)); // Array.
+ __ tsti(R0, 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.
+
+ __ fldrd(V0, element_address);
+
+ const Class& double_class = Class::Handle(
+ Isolate::Current()->object_store()->double_class());
+ __ TryAllocate(double_class,
+ &fall_through,
+ R0, // Result register.
+ kNoPP);
+ __ StoreDFieldToOffset(V0, R0, Double::value_offset(), kNoPP);
+ __ 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.
+ __ tsti(R0, 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.
+ __ tsti(R2, kSmiTagMask);
+ __ b(&fall_through, EQ); // Value is Smi, fall through.
+
+ __ LoadClassId(R3, R2, kNoPP);
+ __ CompareImmediate(R3, kDoubleCid, kNoPP);
+ __ b(&fall_through, NE); // Not a Double, fall through.
+
+ __ LoadDFieldFromOffset(V0, R2, Double::value_offset(), kNoPP);
+
+ Address element_address =
+ __ ElementAddressForRegIndex(false, // Store.
+ false, // Not external.
+ kTypedDataFloat64ArrayCid, // Cid.
+ 8, // Index scale.
+ R1, // Array.
+ R0); // Index.
+ __ fstrd(V0, 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_arm.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698