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

Unified Diff: runtime/vm/intrinsifier_arm.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.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 36830)
+++ runtime/vm/intrinsifier_arm.cc (working copy)
@@ -43,7 +43,7 @@
__ tst(R0, Operand(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));
@@ -228,7 +228,7 @@
__ tst(R0, Operand(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));
@@ -431,6 +431,50 @@
}
+void Intrinsifier::Uint8Array_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);
+
+ __ SmiUntag(R0);
+ __ AddImmediate(R1, TypedData::data_offset() - kHeapObjectTag);
+ __ ldrb(R0, Address(R1, R0));
+ __ 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.
+ __ 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);
+
+ __ LoadFromOffset(kWord, R1, R1,
+ ExternalTypedData::data_offset() - kHeapObjectTag);
+ __ SmiUntag(R0);
+ __ ldrb(R0, Address(R1, R0));
+ __ 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.h ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698