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

Unified Diff: runtime/vm/intrinsifier_ia32.cc

Issue 11087087: Apply John's change (Issue 11077007: Intrinsify Float64 array access on ia32 and x64.). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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_x64.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 13556)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -627,6 +627,54 @@
}
+bool Intrinsifier::Float64Array_getIndexed(Assembler* assembler) {
+ Label fall_through;
+ TestByteArrayIndex(assembler, &fall_through);
+ // After TestByteArrayIndex:
+ // * EAX has the base address of the byte array.
+ // * EBX has the index into the array.
+ // EBX contains the SMI index which is shifted left by 1.
+ // This shift means we only multiply the index by 4 not 8 (sizeof double).
+ // Load double precision float into XMM7.
+ __ movsd(XMM7, FieldAddress(EAX, EBX, TIMES_4,
+ Float64Array::data_offset()));
+ // Allocate a double instance.
+ const Class& double_class = Class::Handle(
+ Isolate::Current()->object_store()->double_class());
+ AssemblerMacros::TryAllocate(assembler,
+ double_class,
+ &fall_through,
+ Assembler::kNearJump, EAX);
+ // Store XMM7 into double instance.
+ __ movsd(FieldAddress(EAX, Double::value_offset()), XMM7);
+ __ ret();
+ __ Bind(&fall_through);
+ return false;
+}
+
+
+bool Intrinsifier::Float64Array_setIndexed(Assembler* assembler) {
+ Label fall_through;
+ __ movl(EAX, Address(ESP, + 1 * kWordSize)); // Value.
+ // If EAX is not an instance of double, jump to fall through.
+ __ CompareClassId(EAX, kDoubleCid, EDI);
+ __ j(NOT_EQUAL, &fall_through);
+ // Load double value into XMM7.
+ __ movsd(XMM7, FieldAddress(EAX, Double::value_offset()));
+ TestByteArraySetIndex(assembler, &fall_through);
+ // After TestByteArraySetIndex:
+ // * EAX has the base address of the byte array.
+ // * EBX has the index into the array.
+ // EBX contains the SMI index which is shifted by 1.
+ // This shift means we only multiply the index by 4 not 8 (sizeof float).
+ // Store into array.
+ __ movsd(FieldAddress(EAX, EBX, TIMES_4, Float64Array::data_offset()), XMM7);
+ __ ret();
+ __ Bind(&fall_through);
+ return false;
+}
+
+
// Tests if two top most arguments are smis, jumps to label not_smi if not.
// Topmost argument is in EAX.
static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698