| 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) {
|
|
|