OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 | 1732 |
1733 void Intrinsifier::OneByteString_equality(Assembler* assembler) { | 1733 void Intrinsifier::OneByteString_equality(Assembler* assembler) { |
1734 StringEquality(assembler, kOneByteStringCid); | 1734 StringEquality(assembler, kOneByteStringCid); |
1735 } | 1735 } |
1736 | 1736 |
1737 | 1737 |
1738 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1738 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
1739 StringEquality(assembler, kTwoByteStringCid); | 1739 StringEquality(assembler, kTwoByteStringCid); |
1740 } | 1740 } |
1741 | 1741 |
| 1742 |
| 1743 // On stack: user tag (+1), return-address (+0). |
| 1744 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| 1745 Isolate* isolate = Isolate::Current(); |
| 1746 const Address current_tag_addr = |
| 1747 Address::Absolute(reinterpret_cast<uword>(isolate) + |
| 1748 Isolate::current_tag_offset()); |
| 1749 const Address user_tag_addr = |
| 1750 Address::Absolute(reinterpret_cast<uword>(isolate) + |
| 1751 Isolate::user_tag_offset()); |
| 1752 // EAX: UserTag. |
| 1753 __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
| 1754 // Set Isolate::current_tag_. |
| 1755 __ movl(current_tag_addr, EAX); |
| 1756 // EAX: UserTag's tag. |
| 1757 __ movl(EAX, FieldAddress(EAX, UserTag::tag_offset())); |
| 1758 // Set Isolate::user_tag_. |
| 1759 __ movl(user_tag_addr, EAX); |
| 1760 // Set return value. |
| 1761 const Immediate& raw_null = |
| 1762 Immediate(reinterpret_cast<int32_t>(Object::null())); |
| 1763 __ movl(EAX, raw_null); |
| 1764 __ ret(); |
| 1765 } |
| 1766 |
| 1767 |
| 1768 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 1769 Isolate* isolate = Isolate::Current(); |
| 1770 const Address current_tag_addr = |
| 1771 Address::Absolute(reinterpret_cast<uword>(isolate) + |
| 1772 Isolate::current_tag_offset()); |
| 1773 // Set return value to Isolate::current_tag_. |
| 1774 __ movl(EAX, current_tag_addr); |
| 1775 __ ret(); |
| 1776 } |
| 1777 |
| 1778 |
| 1779 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { |
| 1780 Isolate* isolate = Isolate::Current(); |
| 1781 const Address current_tag_addr = |
| 1782 Address::Absolute(reinterpret_cast<uword>(isolate) + |
| 1783 Isolate::current_tag_offset()); |
| 1784 const Address user_tag_addr = |
| 1785 Address::Absolute(reinterpret_cast<uword>(isolate) + |
| 1786 Isolate::user_tag_offset()); |
| 1787 // Set return value to Isolate::current_tag_. |
| 1788 __ movl(EAX, current_tag_addr); |
| 1789 // Clear Isolate::current_tag_. |
| 1790 const Immediate& raw_null = |
| 1791 Immediate(reinterpret_cast<int32_t>(UserTag::null())); |
| 1792 __ movl(current_tag_addr, raw_null); |
| 1793 // Clear Isolate::user_tag_. |
| 1794 __ movl(user_tag_addr, Immediate(0)); |
| 1795 __ ret(); |
| 1796 } |
| 1797 |
1742 #undef __ | 1798 #undef __ |
1743 } // namespace dart | 1799 } // namespace dart |
1744 | 1800 |
1745 #endif // defined TARGET_ARCH_IA32 | 1801 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |