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

Unified Diff: runtime/vm/intrinsifier_arm64.cc

Issue 308513005: Intrinsify [] for ExternalUint8 and Uint8 typed data. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 36830)
+++ runtime/vm/intrinsifier_arm64.cc (working copy)
@@ -41,7 +41,7 @@
__ tsti(R0, kSmiTagMask);
__ b(&fall_through, NE); // Index is not an smi, fall through.
- // range check
+ // Range check.
__ ldr(R6, FieldAddress(R1, Array::length_offset()));
__ cmp(R0, Operand(R6));
__ b(&fall_through, CS);
@@ -228,7 +228,7 @@
__ tsti(R0, kSmiTagMask);
__ b(&fall_through, NE); // Index is not an smi, fall through.
- // range check
+ // Range check.
__ ldr(R6, FieldAddress(R1, GrowableObjectArray::length_offset()));
__ cmp(R0, Operand(R6));
__ b(&fall_through, CS);
@@ -354,6 +354,52 @@
}
+void Intrinsifier::Uint8Array_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);
+
+ // Array element at R1 + R0 + TypedData::data_offset - 1.
+ // Untag R0.
+ __ add(R1, R1, Operand(R0, LSR, 1));
+ __ ldr(R0, FieldAddress(R1, TypedData::data_offset()), kUnsignedByte);
+ __ SmiTag(R0);
+ __ ret();
+ __ Bind(&fall_through);
+}
+
+
+void Intrinsifier::ExternalUint8Array_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);
+
+ __ ldr(R1, FieldAddress(R1, ExternalTypedData::data_offset()));
+
+ // Untag R0.
+ __ add(R1, R1, Operand(R0, LSR, 1));
+ __ ldr(R0, Address(R1, 0), kUnsignedByte);
+ __ SmiTag(R0);
+ __ 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