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 const Immediate& raw_null = | |
1668 Immediate(reinterpret_cast<int64_t>(Object::null())); | |
zra
2014/04/14 15:31:29
__ LoadObject(RAX, Object::null_object(), PP);
Cutch
2014/04/15 14:36:43
Done.
| |
1669 __ movq(RAX, raw_null); | |
1670 __ ret(); | |
1671 } | |
1672 | |
1673 | |
1674 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | |
1675 // RBX: Isolate. | |
1676 Isolate* isolate = Isolate::Current(); | |
1677 const Immediate& isolate_address = | |
1678 Immediate(reinterpret_cast<int64_t>(isolate)); | |
1679 __ movq(RBX, isolate_address); | |
1680 // Set return value to Isolate::current_tag_. | |
1681 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | |
1682 __ ret(); | |
1683 } | |
1684 | |
1685 | |
1686 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) { | |
1687 // RBX: Isolate. | |
1688 Isolate* isolate = Isolate::Current(); | |
1689 const Immediate& isolate_address = | |
1690 Immediate(reinterpret_cast<int64_t>(isolate)); | |
1691 __ movq(RBX, isolate_address); | |
1692 // Set return value to Isolate::current_tag_. | |
1693 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | |
1694 // Clear Isolate::current_tag_. | |
1695 const Immediate& raw_null = | |
1696 Immediate(reinterpret_cast<int64_t>(UserTag::null())); | |
zra
2014/04/14 15:31:29
Use LoadObject here, too.
Cutch
2014/04/15 14:36:43
Done.
| |
1697 __ movq(Address(RBX, Isolate::current_tag_offset()), raw_null); | |
1698 // Clear Isolate::user_tag_. | |
1699 __ movq(Address(RBX, Isolate::user_tag_offset()), Immediate(0)); | |
1700 __ ret(); | |
1701 } | |
1702 | |
1650 #undef __ | 1703 #undef __ |
1651 | 1704 |
1652 } // namespace dart | 1705 } // namespace dart |
1653 | 1706 |
1654 #endif // defined TARGET_ARCH_X64 | 1707 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |