| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 | 1640 |
| 1641 void Intrinsifier::OneByteString_equality(Assembler* assembler) { | 1641 void Intrinsifier::OneByteString_equality(Assembler* assembler) { |
| 1642 StringEquality(assembler, kOneByteStringCid); | 1642 StringEquality(assembler, kOneByteStringCid); |
| 1643 } | 1643 } |
| 1644 | 1644 |
| 1645 | 1645 |
| 1646 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1646 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
| 1647 StringEquality(assembler, kTwoByteStringCid); | 1647 StringEquality(assembler, kTwoByteStringCid); |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 |
| 1651 // On stack: user tag (+1), return-address (+0). |
| 1652 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| 1653 // RBX: Isolate. |
| 1654 Isolate* isolate = Isolate::Current(); |
| 1655 const Immediate& isolate_address = |
| 1656 Immediate(reinterpret_cast<int64_t>(isolate)); |
| 1657 __ movq(RBX, isolate_address); |
| 1658 // RAX: UserTag. |
| 1659 __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
| 1660 // Set Isolate::current_tag_. |
| 1661 __ movq(Address(RBX, Isolate::current_tag_offset()), RAX); |
| 1662 // RAX: UserTag's tag. |
| 1663 __ movq(RAX, FieldAddress(RAX, UserTag::tag_offset())); |
| 1664 // Set Isolate::user_tag_. |
| 1665 __ movq(Address(RBX, Isolate::user_tag_offset()), RAX); |
| 1666 // Set return value. |
| 1667 __ LoadObject(RAX, Object::null_object(), PP); |
| 1668 __ ret(); |
| 1669 } |
| 1670 |
| 1671 |
| 1672 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 1673 // RBX: Isolate. |
| 1674 Isolate* isolate = Isolate::Current(); |
| 1675 const Immediate& isolate_address = |
| 1676 Immediate(reinterpret_cast<int64_t>(isolate)); |
| 1677 __ movq(RBX, isolate_address); |
| 1678 // Set return value to Isolate::current_tag_. |
| 1679 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1680 __ ret(); |
| 1681 } |
| 1682 |
| 1683 |
| 1684 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { |
| 1685 // RBX: Isolate. |
| 1686 Isolate* isolate = Isolate::Current(); |
| 1687 const Immediate& isolate_address = |
| 1688 Immediate(reinterpret_cast<int64_t>(isolate)); |
| 1689 __ movq(RBX, isolate_address); |
| 1690 // Set return value to Isolate::current_tag_. |
| 1691 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1692 // Clear Isolate::current_tag_. |
| 1693 __ LoadObject(RCX, Object::null_object(), PP); |
| 1694 __ movq(Address(RBX, Isolate::current_tag_offset()), RCX); |
| 1695 // Clear Isolate::user_tag_. |
| 1696 __ movq(Address(RBX, Isolate::user_tag_offset()), Immediate(0)); |
| 1697 __ ret(); |
| 1698 } |
| 1699 |
| 1650 #undef __ | 1700 #undef __ |
| 1651 | 1701 |
| 1652 } // namespace dart | 1702 } // namespace dart |
| 1653 | 1703 |
| 1654 #endif // defined TARGET_ARCH_X64 | 1704 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |