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

Unified Diff: runtime/vm/intrinsifier_mips.cc

Issue 876603003: VM: Refactor more intrinsics of GrowableList to use IR builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 43193)
+++ runtime/vm/intrinsifier_mips.cc (working copy)
@@ -134,98 +134,6 @@
}
-void Intrinsifier::GrowableArrayGetIndexed(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, GrowableObjectArray::length_offset()));
- __ BranchUnsignedGreaterEqual(T0, T2, &fall_through);
-
- __ lw(T2, FieldAddress(T1, GrowableObjectArray::data_offset())); // data
-
- ASSERT(kSmiTagShift == 1);
- // array element at T2 + T0 * 2 + Array::data_offset - 1
- __ sll(T3, T0, 1);
- __ addu(T2, T2, T3);
- __ Ret();
- __ delay_slot()->lw(V0, FieldAddress(T2, Array::data_offset()));
- __ Bind(&fall_through);
-}
-
-
-// Set value into growable object array at specified index.
-// On stack: growable array (+2), index (+1), value (+0).
-void Intrinsifier::GrowableArraySetIndexed(Assembler* assembler) {
- if (FLAG_enable_type_checks) {
- return;
- }
- Label fall_through;
- __ lw(T1, Address(SP, 1 * kWordSize)); // Index.
- __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
- __ bne(CMPRES1, ZR, &fall_through); // Non-smi index.
- __ delay_slot()->lw(T0, Address(SP, 2 * kWordSize)); // GrowableArray.
- // Range check using _length field.
- __ lw(T2, FieldAddress(T0, GrowableObjectArray::length_offset()));
- // Runtime throws exception.
- __ BranchUnsignedGreaterEqual(T1, T2, &fall_through);
- __ lw(T0, FieldAddress(T0, GrowableObjectArray::data_offset())); // data.
- __ lw(T2, Address(SP, 0 * kWordSize)); // Value.
- // Note that T1 is Smi, i.e, times 2.
- ASSERT(kSmiTagShift == 1);
- __ sll(T1, T1, 1);
- __ addu(T1, T0, T1);
- __ StoreIntoObject(T0,
- FieldAddress(T1, Array::data_offset()),
- T2);
- __ Ret();
- __ Bind(&fall_through);
-}
-
-
-// Set length of growable object array. The length cannot
-// be greater than the length of the data container.
-// On stack: growable array (+1), length (+0).
-void Intrinsifier::GrowableArraySetLength(Assembler* assembler) {
- Label fall_through;
- __ lw(T1, Address(SP, 0 * kWordSize)); // Length value.
- __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
- __ bne(CMPRES1, ZR, &fall_through); // Non-smi length.
- __ delay_slot()->lw(T0, Address(SP, 1 * kWordSize)); // Growable array.
- __ Ret();
- __ delay_slot()->sw(T1,
- FieldAddress(T0, GrowableObjectArray::length_offset()));
- __ Bind(&fall_through);
-}
-
-
-// Set data of growable object array.
-// On stack: growable array (+1), data (+0).
-void Intrinsifier::GrowableArraySetData(Assembler* assembler) {
- if (FLAG_enable_type_checks) {
- return;
- }
- Label fall_through;
- __ lw(T1, Address(SP, 0 * kWordSize)); // Data.
- // Check that data is an ObjectArray.
- __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
- __ beq(CMPRES1, ZR, &fall_through); // Data is Smi.
- __ LoadClassId(CMPRES1, T1);
- __ BranchNotEqual(CMPRES1, Immediate(kArrayCid), &fall_through);
- __ lw(T0, Address(SP, 1 * kWordSize)); // Growable array.
- __ StoreIntoObject(T0,
- FieldAddress(T0, GrowableObjectArray::data_offset()),
- T1);
- __ Ret();
- __ Bind(&fall_through);
-}
-
-
// Add an element to growable array if it doesn't need to grow, otherwise
// call into regular code.
// On stack: growable array (+1), value (+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