| OLD | NEW |
| 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) { | 552 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) { |
| 553 return false; | 553 return false; |
| 554 } | 554 } |
| 555 | 555 |
| 556 | 556 |
| 557 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) { | 557 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) { |
| 558 return false; | 558 return false; |
| 559 } | 559 } |
| 560 | 560 |
| 561 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { | 561 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { |
| 562 Label fall_through; | 562 // Temporary fix until cvtss2sd is implemented on x64. |
| 563 /* Label fall_through; |
| 563 TestByteArrayIndex(assembler, &fall_through); | 564 TestByteArrayIndex(assembler, &fall_through); |
| 564 // After TestByteArrayIndex: | 565 // After TestByteArrayIndex: |
| 565 // * EAX has the base address of the byte array. | 566 // * EAX has the base address of the byte array. |
| 566 // * EBX has the index into the array. | 567 // * EBX has the index into the array. |
| 567 // EBX contains the SMI index which is shifted left by 1. | 568 // EBX contains the SMI index which is shifted left by 1. |
| 568 // This shift means we only multiply the index by 2 not 4 (sizeof float). | 569 // This shift means we only multiply the index by 2 not 4 (sizeof float). |
| 569 // Load single precision float into XMM7. | 570 // Load single precision float into XMM7. |
| 570 __ movss(XMM7, FieldAddress(EAX, EBX, TIMES_2, | 571 __ movss(XMM7, FieldAddress(EAX, EBX, TIMES_2, |
| 571 Float32Array::data_offset())); | 572 Float32Array::data_offset())); |
| 572 // Convert into a double precision float. | 573 // Convert into a double precision float. |
| 573 __ cvtss2sd(XMM7, XMM7); | 574 __ cvtss2sd(XMM7, XMM7); |
| 574 // Allocate a double instance. | 575 // Allocate a double instance. |
| 575 const Class& double_class = Class::Handle( | 576 const Class& double_class = Class::Handle( |
| 576 Isolate::Current()->object_store()->double_class()); | 577 Isolate::Current()->object_store()->double_class()); |
| 577 AssemblerMacros::TryAllocate(assembler, | 578 AssemblerMacros::TryAllocate(assembler, |
| 578 double_class, | 579 double_class, |
| 579 &fall_through, | 580 &fall_through, |
| 580 Assembler::kNearJump, EAX); | 581 Assembler::kNearJump, EAX); |
| 581 // Store XMM7 into double instance. | 582 // Store XMM7 into double instance. |
| 582 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM7); | 583 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM7); |
| 583 __ ret(); | 584 __ ret(); |
| 584 __ Bind(&fall_through); | 585 __ Bind(&fall_through); */ |
| 586 |
| 585 return false; | 587 return false; |
| 586 } | 588 } |
| 587 | 589 |
| 588 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { | 590 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { |
| 589 return false; | 591 return false; |
| 590 } | 592 } |
| 591 | 593 |
| 592 // Tests if two top most arguments are smis, jumps to label not_smi if not. | 594 // Tests if two top most arguments are smis, jumps to label not_smi if not. |
| 593 // Topmost argument is in EAX. | 595 // Topmost argument is in EAX. |
| 594 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { | 596 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 __ Bind(&is_true); | 1462 __ Bind(&is_true); |
| 1461 __ LoadObject(EAX, bool_true); | 1463 __ LoadObject(EAX, bool_true); |
| 1462 __ ret(); | 1464 __ ret(); |
| 1463 return true; | 1465 return true; |
| 1464 } | 1466 } |
| 1465 | 1467 |
| 1466 #undef __ | 1468 #undef __ |
| 1467 } // namespace dart | 1469 } // namespace dart |
| 1468 | 1470 |
| 1469 #endif // defined TARGET_ARCH_IA32 | 1471 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |