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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1716 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
1717 StringEquality(assembler, kTwoByteStringCid); | 1717 StringEquality(assembler, kTwoByteStringCid); |
1718 } | 1718 } |
1719 | 1719 |
1720 | 1720 |
1721 // On stack: user tag (+0). | 1721 // On stack: user tag (+0). |
1722 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { | 1722 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
1723 // R1: Isolate. | 1723 // R1: Isolate. |
1724 Isolate* isolate = Isolate::Current(); | 1724 Isolate* isolate = Isolate::Current(); |
1725 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 1725 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
1726 // R0: UserTag. | 1726 // R0: Current user tag. |
1727 __ ldr(R0, Address(SP, + 0 * kWordSize)); | 1727 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 1728 // R2: UserTag. |
| 1729 __ ldr(R2, Address(SP, + 0 * kWordSize)); |
1728 // Set Isolate::current_tag_. | 1730 // Set Isolate::current_tag_. |
1729 __ str(R0, Address(R1, Isolate::current_tag_offset())); | 1731 __ str(R2, Address(R1, Isolate::current_tag_offset())); |
1730 // R0: UserTag's tag. | 1732 // R2: UserTag's tag. |
1731 __ ldr(R0, FieldAddress(R0, UserTag::tag_offset())); | 1733 __ ldr(R2, FieldAddress(R2, UserTag::tag_offset())); |
1732 // Set Isolate::user_tag_. | 1734 // Set Isolate::user_tag_. |
1733 __ str(R0, Address(R1, Isolate::user_tag_offset())); | 1735 __ str(R2, Address(R1, Isolate::user_tag_offset())); |
1734 // Set return value. | 1736 __ Ret(); |
1735 const int32_t raw_null = reinterpret_cast<int32_t>(Object::null()); | 1737 } |
1736 __ LoadImmediate(R0, raw_null); | 1738 |
| 1739 |
| 1740 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { |
| 1741 Isolate* isolate = Isolate::Current(); |
| 1742 // Set return value to default tag address. |
| 1743 __ LoadImmediate(R0, |
| 1744 reinterpret_cast<uword>(isolate->object_store()) + |
| 1745 ObjectStore::default_tag_offset()); |
| 1746 __ ldr(R0, Address(R0, 0)); |
1737 __ Ret(); | 1747 __ Ret(); |
1738 } | 1748 } |
1739 | 1749 |
1740 | 1750 |
1741 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 1751 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
1742 // R1: Isolate. | 1752 // R1: Default tag address. |
1743 Isolate* isolate = Isolate::Current(); | 1753 Isolate* isolate = Isolate::Current(); |
1744 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 1754 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
1745 // Set return value to Isolate::current_tag_. | 1755 // Set return value to Isolate::current_tag_. |
1746 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 1756 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
1747 __ Ret(); | 1757 __ Ret(); |
1748 } | 1758 } |
1749 | 1759 |
1750 | |
1751 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { | |
1752 // R1: Isolate. | |
1753 Isolate* isolate = Isolate::Current(); | |
1754 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | |
1755 // Set return value to Isolate::current_tag_. | |
1756 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | |
1757 // Clear Isolate::current_tag_. | |
1758 const int32_t raw_null = reinterpret_cast<int32_t>(UserTag::null()); | |
1759 __ LoadImmediate(R2, raw_null); | |
1760 __ str(R2, Address(R1, Isolate::current_tag_offset())); | |
1761 // Clear Isolate::user_tag_. | |
1762 __ eor(R2, R2, ShifterOperand(R2)); | |
1763 __ str(R2, Address(R1, Isolate::user_tag_offset())); | |
1764 __ Ret(); | |
1765 } | |
1766 | |
1767 } // namespace dart | 1760 } // namespace dart |
1768 | 1761 |
1769 #endif // defined TARGET_ARCH_ARM | 1762 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |