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

Side by Side Diff: runtime/vm/intrinsifier_ia32.cc

Issue 10911153: Intrinsify Float32Array_getIndexed on IA32 and X64. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) { 545 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) {
546 return false; 546 return false;
547 } 547 }
548 548
549 549
550 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) { 550 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) {
551 return false; 551 return false;
552 } 552 }
553 553
554 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) {
555 Label fall_through;
556 TestByteArrayIndex(assembler, &fall_through);
557 // After TestByteArrayIndex:
558 // EAX has the base address of the byte array
559 // EBX has the index into the array
560
561 // Load single precision float into XMM7
562 __ movss(XMM7, FieldAddress(EAX, EBX, TIMES_4,
srdjan 2012/09/09 14:26:52 Terminate all comments with a period ('.').
Cutch 2012/09/10 14:44:43 Done.
563 Float32Array::data_offset()));
564 // Convert into a double precision float
565 __ cvtss2sd(XMM6, XMM7);
566 // Allocate a double instance
567 const Class& double_class = Class::Handle(
568 Isolate::Current()->object_store()->double_class());
569 AssemblerMacros::TryAllocate(assembler,
570 double_class,
571 &fall_through,
572 Assembler::kNearJump, EAX);
573 // Store XMM6 into double instance
574 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM6);
575 __ ret();
576 __ Bind(&fall_through);
577 return false;
578 }
579
580 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) {
581 return false;
srdjan 2012/09/09 14:26:52 This one should be quicker as no allocation of dou
582 }
554 583
555 // Tests if two top most arguments are smis, jumps to label not_smi if not. 584 // Tests if two top most arguments are smis, jumps to label not_smi if not.
556 // Topmost argument is in EAX. 585 // Topmost argument is in EAX.
557 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { 586 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) {
558 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 587 __ movl(EAX, Address(ESP, + 1 * kWordSize));
559 __ movl(EBX, Address(ESP, + 2 * kWordSize)); 588 __ movl(EBX, Address(ESP, + 2 * kWordSize));
560 __ orl(EBX, EAX); 589 __ orl(EBX, EAX);
561 __ testl(EBX, Immediate(kSmiTagMask)); 590 __ testl(EBX, Immediate(kSmiTagMask));
562 __ j(NOT_ZERO, not_smi, Assembler::kNearJump); 591 __ j(NOT_ZERO, not_smi, Assembler::kNearJump);
563 } 592 }
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 __ Bind(&is_true); 1436 __ Bind(&is_true);
1408 __ LoadObject(EAX, bool_true); 1437 __ LoadObject(EAX, bool_true);
1409 __ ret(); 1438 __ ret();
1410 return true; 1439 return true;
1411 } 1440 }
1412 1441
1413 #undef __ 1442 #undef __
1414 } // namespace dart 1443 } // namespace dart
1415 1444
1416 #endif // defined TARGET_ARCH_IA32 1445 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698