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

Unified Diff: runtime/vm/intrinsifier_ia32.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_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 43193)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -145,93 +145,6 @@
}
-// Access growable object array at specified index.
-// On stack: growable array (+2), index (+1), return-address (+0).
-void Intrinsifier::GrowableArrayGetIndexed(Assembler* assembler) {
- Label fall_through;
- __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Index.
- __ movl(EAX, Address(ESP, + 2 * kWordSize)); // GrowableArray.
- __ testl(EBX, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi index.
- // Range check using _length field.
- __ cmpl(EBX, FieldAddress(EAX, GrowableObjectArray::length_offset()));
- // Runtime throws exception.
- __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
- __ movl(EAX, FieldAddress(EAX, GrowableObjectArray::data_offset())); // data.
-
- // Note that EBX is Smi, i.e, times 2.
- ASSERT(kSmiTagShift == 1);
- __ movl(EAX, FieldAddress(EAX, EBX, TIMES_2, Array::data_offset()));
- __ ret();
- __ Bind(&fall_through);
-}
-
-
-// Set value into growable object array at specified index.
-// On stack: growable array (+3), index (+2), value (+1), return-address (+0).
-void Intrinsifier::GrowableArraySetIndexed(Assembler* assembler) {
- if (FLAG_enable_type_checks) {
- return;
- }
- Label fall_through;
- __ movl(EBX, Address(ESP, + 2 * kWordSize)); // Index.
- __ movl(EAX, Address(ESP, + 3 * kWordSize)); // GrowableArray.
- __ testl(EBX, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &fall_through); // Non-smi index.
- // Range check using _length field.
- __ cmpl(EBX, FieldAddress(EAX, GrowableObjectArray::length_offset()));
- // Runtime throws exception.
- __ j(ABOVE_EQUAL, &fall_through);
- __ movl(EAX, FieldAddress(EAX, GrowableObjectArray::data_offset())); // data.
- __ movl(EDI, Address(ESP, + 1 * kWordSize)); // Value.
- // Note that EBX is Smi, i.e, times 2.
- ASSERT(kSmiTagShift == 1);
- __ StoreIntoObject(EAX,
- FieldAddress(EAX, EBX, TIMES_2, Array::data_offset()),
- EDI);
- __ 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 (+2), length (+1), return-address (+0).
-void Intrinsifier::GrowableArraySetLength(Assembler* assembler) {
- Label fall_through;
- __ movl(EAX, Address(ESP, + 2 * kWordSize)); // Growable array.
- __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Length value.
- __ testl(EBX, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi length.
- FieldAddress length_field(EAX, GrowableObjectArray::length_offset());
- __ StoreIntoSmiField(length_field, EBX);
- __ ret();
- __ Bind(&fall_through);
-}
-
-
-// Set data of growable object array.
-// On stack: growable array (+2), data (+1), return-address (+0).
-void Intrinsifier::GrowableArraySetData(Assembler* assembler) {
- if (FLAG_enable_type_checks) {
- return;
- }
- Label fall_through;
- __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Data.
- // Check that data is an ObjectArray.
- __ testl(EBX, Immediate(kSmiTagMask));
- __ j(ZERO, &fall_through); // Data is Smi.
- __ CompareClassId(EBX, kArrayCid, EAX);
- __ j(NOT_EQUAL, &fall_through);
- __ movl(EAX, Address(ESP, + 2 * kWordSize)); // Growable array.
- __ StoreIntoObject(EAX,
- FieldAddress(EAX, GrowableObjectArray::data_offset()),
- EBX);
- __ 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 (+2), value (+1), return-address (+0).
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698