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

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
Index: runtime/vm/intrinsifier_mips.cc
===================================================================
--- runtime/vm/intrinsifier_mips.cc (revision 36816)
+++ runtime/vm/intrinsifier_mips.cc (working copy)
@@ -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
zra 2014/05/30 18:11:00 Range check.
srdjan 2014/05/30 19:23:12 Done.
+ __ 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;

Powered by Google App Engine
This is Rietveld 408576698