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 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 void Intrinsifier::OneByteString_equality(Assembler* assembler) { | 1700 void Intrinsifier::OneByteString_equality(Assembler* assembler) { |
1701 StringEquality(assembler, kOneByteStringCid); | 1701 StringEquality(assembler, kOneByteStringCid); |
1702 } | 1702 } |
1703 | 1703 |
1704 | 1704 |
1705 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1705 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
1706 StringEquality(assembler, kTwoByteStringCid); | 1706 StringEquality(assembler, kTwoByteStringCid); |
1707 } | 1707 } |
1708 | 1708 |
1709 | 1709 |
| 1710 // On stack: user tag (+0). |
| 1711 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| 1712 // R1: Isolate. |
| 1713 Isolate* isolate = Isolate::Current(); |
| 1714 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
| 1715 // R0: UserTag. |
| 1716 __ ldr(R0, Address(SP, + 0 * kWordSize)); |
| 1717 // Set Isolate::current_tag_. |
| 1718 __ str(R0, Address(R1, Isolate::current_tag_offset())); |
| 1719 // R0: UserTag's tag. |
| 1720 __ ldr(R0, FieldAddress(R0, UserTag::tag_offset())); |
| 1721 // Set Isolate::user_tag_. |
| 1722 __ str(R0, Address(R1, Isolate::user_tag_offset())); |
| 1723 // Set return value. |
| 1724 const int32_t raw_null = reinterpret_cast<int32_t>(Object::null()); |
| 1725 __ LoadImmediate(R0, raw_null); |
| 1726 __ Ret(); |
| 1727 } |
| 1728 |
| 1729 |
| 1730 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 1731 // R1: Isolate. |
| 1732 Isolate* isolate = Isolate::Current(); |
| 1733 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
| 1734 // Set return value to Isolate::current_tag_. |
| 1735 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 1736 __ Ret(); |
| 1737 } |
| 1738 |
| 1739 |
| 1740 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { |
| 1741 // R1: Isolate. |
| 1742 Isolate* isolate = Isolate::Current(); |
| 1743 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
| 1744 // Set return value to Isolate::current_tag_. |
| 1745 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 1746 // Clear Isolate::current_tag_. |
| 1747 const int32_t raw_null = reinterpret_cast<int32_t>(UserTag::null()); |
| 1748 __ LoadImmediate(R2, raw_null); |
| 1749 __ str(R2, Address(R1, Isolate::current_tag_offset())); |
| 1750 // Clear Isolate::user_tag_. |
| 1751 __ eor(R2, R2, ShifterOperand(R2)); |
| 1752 __ str(R2, Address(R1, Isolate::user_tag_offset())); |
| 1753 __ Ret(); |
| 1754 } |
| 1755 |
1710 } // namespace dart | 1756 } // namespace dart |
1711 | 1757 |
1712 #endif // defined TARGET_ARCH_ARM | 1758 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |