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 // EBX: Isolate. | |
1746 Isolate* isolate = Isolate::Current(); | |
1747 __ leal(EBX, Address::Absolute(reinterpret_cast<uword>(isolate))); | |
srdjan
2014/04/14 15:08:27
Couldn't you get the address of current_tag here d
zra
2014/04/14 15:31:29
At least on ARM and MIPS, I don't think it would s
Cutch
2014/04/15 14:36:43
Done on IA32.
| |
1748 // EAX: UserTag. | |
1749 __ movl(EAX, Address(ESP, + 1 * kWordSize)); | |
1750 // Set Isolate::current_tag_. | |
1751 __ movl(Address(EBX, Isolate::current_tag_offset()), EAX); | |
1752 // EAX: UserTag's tag. | |
1753 __ movl(EAX, FieldAddress(EAX, UserTag::tag_offset())); | |
1754 // Set Isolate::user_tag_. | |
1755 __ movl(Address(EBX, Isolate::user_tag_offset()), EAX); | |
1756 // Set return value. | |
1757 const Immediate& raw_null = | |
1758 Immediate(reinterpret_cast<int32_t>(Object::null())); | |
1759 __ movl(EAX, raw_null); | |
1760 __ ret(); | |
1761 } | |
1762 | |
1763 | |
1764 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | |
1765 // EBX: Isolate. | |
1766 Isolate* isolate = Isolate::Current(); | |
1767 __ leal(EBX, Address::Absolute(reinterpret_cast<uword>(isolate))); | |
1768 // Set return value to Isolate::current_tag_. | |
1769 __ movl(EAX, Address(EBX, Isolate::current_tag_offset())); | |
1770 __ ret(); | |
1771 } | |
1772 | |
1773 | |
1774 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { | |
1775 // EBX: Isolate. | |
1776 Isolate* isolate = Isolate::Current(); | |
1777 __ leal(EBX, Address::Absolute(reinterpret_cast<uword>(isolate))); | |
1778 // Set return value to Isolate::current_tag_. | |
1779 __ movl(EAX, Address(EBX, Isolate::current_tag_offset())); | |
1780 // Clear Isolate::current_tag_. | |
1781 const Immediate& raw_null = | |
1782 Immediate(reinterpret_cast<int32_t>(UserTag::null())); | |
1783 __ movl(Address(EBX, Isolate::current_tag_offset()), raw_null); | |
1784 // Clear Isolate::user_tag_. | |
1785 __ movl(Address(EBX, Isolate::user_tag_offset()), Immediate(0)); | |
1786 __ ret(); | |
1787 } | |
1788 | |
1742 #undef __ | 1789 #undef __ |
1743 } // namespace dart | 1790 } // namespace dart |
1744 | 1791 |
1745 #endif // defined TARGET_ARCH_IA32 | 1792 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |