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

Unified Diff: runtime/vm/intrinsifier_mips.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_ia32.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_mips.cc
===================================================================
--- runtime/vm/intrinsifier_mips.cc (revision 36830)
+++ runtime/vm/intrinsifier_mips.cc (working copy)
@@ -42,7 +42,7 @@
__ bne(CMPRES1, ZR, &fall_through); // Index is not an smi, fall through
__ delay_slot()->lw(T1, Address(SP, + 1 * kWordSize)); // Array
- // range check
+ // Range check.
__ lw(T2, FieldAddress(T1, Array::length_offset()));
__ BranchUnsignedGreaterEqual(T0, T2, &fall_through);
@@ -225,7 +225,7 @@
__ bne(CMPRES1, ZR, &fall_through); // Index is not an smi, fall through
__ delay_slot()->lw(T1, Address(SP, 1 * kWordSize)); // Array
- // range check
+ // Range check.
__ lw(T2, FieldAddress(T1, GrowableObjectArray::length_offset()));
__ BranchUnsignedGreaterEqual(T0, T2, &fall_through);
@@ -437,6 +437,53 @@
}
+void Intrinsifier::Uint8Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+
+ __ lw(T0, Address(SP, + 0 * kWordSize)); // Index.
+
+ __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
+ __ bne(CMPRES1, ZR, &fall_through); // Index is not an smi, fall through.
+ __ delay_slot()->lw(T1, Address(SP, + 1 * kWordSize)); // Array.
+
+ // Range check.
+ __ lw(T2, FieldAddress(T1, TypedData::length_offset()));
+ __ BranchUnsignedGreaterEqual(T0, T2, &fall_through);
+
+ __ SmiUntag(T0);
+ __ addu(T1, T1, T0);
+ __ lbu(V0, FieldAddress(T1, TypedData::data_offset()));
+ __ Ret();
+ __ delay_slot()->SmiTag(V0);
+
+ __ Bind(&fall_through);
+}
+
+
+void Intrinsifier::ExternalUint8Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+
+ __ lw(T0, Address(SP, + 0 * kWordSize)); // Index.
+
+ __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
+ __ bne(CMPRES1, ZR, &fall_through); // Index is not an smi, fall through.
+ __ delay_slot()->lw(T1, Address(SP, + 1 * kWordSize)); // Array.
+
+ // Range check.
+ __ lw(T2, FieldAddress(T1, TypedData::length_offset()));
+ __ BranchUnsignedGreaterEqual(T0, T2, &fall_through);
+
+ __ lw(T1, FieldAddress(T1, ExternalTypedData::data_offset()));
+ __ SmiUntag(T0);
+ __ addu(T1, T1, T0);
+ __ lbu(V0, Address(T1, 0));
+ __ Ret();
+ __ delay_slot()->SmiTag(V0);
+
+ __ Bind(&fall_through);
+}
+
+
static int GetScaleFactor(intptr_t size) {
switch (size) {
case 1: return 0;
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698