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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 // EBX contains the SMI index which is shifted by 1. | 785 // EBX contains the SMI index which is shifted by 1. |
786 // This shift means we only multiply the index by 4 not 8 (sizeof float). | 786 // This shift means we only multiply the index by 4 not 8 (sizeof float). |
787 // Store into array. | 787 // Store into array. |
788 __ movsd(FieldAddress(EAX, EBX, TIMES_4, Float64Array::data_offset()), XMM7); | 788 __ movsd(FieldAddress(EAX, EBX, TIMES_4, Float64Array::data_offset()), XMM7); |
789 __ ret(); | 789 __ ret(); |
790 __ Bind(&fall_through); | 790 __ Bind(&fall_through); |
791 return false; | 791 return false; |
792 } | 792 } |
793 | 793 |
794 | 794 |
| 795 bool Intrinsifier::ExternalUint8Array_getIndexed(Assembler* assembler) { |
| 796 Label fall_through; |
| 797 TestByteArrayIndex(assembler, &fall_through); |
| 798 __ SmiUntag(EBX); |
| 799 __ movl(EAX, FieldAddress(EAX, ExternalUint8Array::external_data_offset())); |
| 800 __ movl(EAX, Address(EAX, ExternalByteArrayData<uint8_t>::data_offset())); |
| 801 __ movzxb(EAX, Address(EAX, EBX, TIMES_1, 0)); |
| 802 __ SmiTag(EAX); |
| 803 __ ret(); |
| 804 __ Bind(&fall_through); |
| 805 return false; |
| 806 } |
| 807 |
| 808 |
795 // Tests if two top most arguments are smis, jumps to label not_smi if not. | 809 // Tests if two top most arguments are smis, jumps to label not_smi if not. |
796 // Topmost argument is in EAX. | 810 // Topmost argument is in EAX. |
797 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { | 811 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { |
798 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | 812 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
799 __ movl(EBX, Address(ESP, + 2 * kWordSize)); | 813 __ movl(EBX, Address(ESP, + 2 * kWordSize)); |
800 __ orl(EBX, EAX); | 814 __ orl(EBX, EAX); |
801 __ testl(EBX, Immediate(kSmiTagMask)); | 815 __ testl(EBX, Immediate(kSmiTagMask)); |
802 __ j(NOT_ZERO, not_smi, Assembler::kNearJump); | 816 __ j(NOT_ZERO, not_smi, Assembler::kNearJump); |
803 } | 817 } |
804 | 818 |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 __ Bind(&is_true); | 1739 __ Bind(&is_true); |
1726 __ LoadObject(EAX, bool_true); | 1740 __ LoadObject(EAX, bool_true); |
1727 __ ret(); | 1741 __ ret(); |
1728 return true; | 1742 return true; |
1729 } | 1743 } |
1730 | 1744 |
1731 #undef __ | 1745 #undef __ |
1732 } // namespace dart | 1746 } // namespace dart |
1733 | 1747 |
1734 #endif // defined TARGET_ARCH_IA32 | 1748 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |