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 #ifndef VM_ASSEMBLER_X64_H_ | 5 #ifndef VM_ASSEMBLER_X64_H_ |
6 #define VM_ASSEMBLER_X64_H_ | 6 #define VM_ASSEMBLER_X64_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_x64.h directly; use assembler.h instead. | 9 #error Do not include assembler_x64.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
11 | 11 |
12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
13 #include "platform/utils.h" | 13 #include "platform/utils.h" |
14 #include "vm/constants_x64.h" | 14 #include "vm/constants_x64.h" |
15 #include "vm/hash_map.h" | 15 #include "vm/hash_map.h" |
16 #include "vm/object.h" | 16 #include "vm/object.h" |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
20 // Forward declarations. | 20 // Forward declarations. |
21 class RuntimeEntry; | 21 class RuntimeEntry; |
| 22 class StubEntry; |
22 | 23 |
23 class Immediate : public ValueObject { | 24 class Immediate : public ValueObject { |
24 public: | 25 public: |
25 explicit Immediate(int64_t value) : value_(value) { } | 26 explicit Immediate(int64_t value) : value_(value) { } |
26 | 27 |
27 Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { } | 28 Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { } |
28 | 29 |
29 int64_t value() const { return value_; } | 30 int64_t value() const { return value_; } |
30 | 31 |
31 bool is_int8() const { return Utils::IsInt(8, value_); } | 32 bool is_int8() const { return Utils::IsInt(8, value_); } |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 | 686 |
686 // Note: verified_mem mode forces far jumps. | 687 // Note: verified_mem mode forces far jumps. |
687 void j(Condition condition, Label* label, bool near = kFarJump); | 688 void j(Condition condition, Label* label, bool near = kFarJump); |
688 void j(Condition condition, const ExternalLabel* label); | 689 void j(Condition condition, const ExternalLabel* label); |
689 | 690 |
690 void jmp(Register reg); | 691 void jmp(Register reg); |
691 void jmp(const Address& address); | 692 void jmp(const Address& address); |
692 // Note: verified_mem mode forces far jumps. | 693 // Note: verified_mem mode forces far jumps. |
693 void jmp(Label* label, bool near = kFarJump); | 694 void jmp(Label* label, bool near = kFarJump); |
694 void jmp(const ExternalLabel* label); | 695 void jmp(const ExternalLabel* label); |
| 696 void jmp(const StubEntry& stub_entry); |
695 | 697 |
696 void lock(); | 698 void lock(); |
697 void cmpxchgl(const Address& address, Register reg); | 699 void cmpxchgl(const Address& address, Register reg); |
698 void lock_cmpxchgl(const Address& address, Register reg) { | 700 void lock_cmpxchgl(const Address& address, Register reg) { |
699 lock(); | 701 lock(); |
700 cmpxchgl(address, reg); | 702 cmpxchgl(address, reg); |
701 } | 703 } |
702 | 704 |
703 void cmpxchgq(const Address& address, Register reg); | 705 void cmpxchgq(const Address& address, Register reg); |
704 void lock_cmpxchgq(const Address& address, Register reg) { | 706 void lock_cmpxchgq(const Address& address, Register reg) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 void LoadIsolate(Register dst); | 761 void LoadIsolate(Register dst); |
760 void LoadObject(Register dst, const Object& obj); | 762 void LoadObject(Register dst, const Object& obj); |
761 void LoadUniqueObject(Register dst, const Object& obj); | 763 void LoadUniqueObject(Register dst, const Object& obj); |
762 void LoadExternalLabel(Register dst, | 764 void LoadExternalLabel(Register dst, |
763 const ExternalLabel* label, | 765 const ExternalLabel* label, |
764 Patchability patchable); | 766 Patchability patchable); |
765 void LoadFunctionFromCalleePool(Register dst, | 767 void LoadFunctionFromCalleePool(Register dst, |
766 const Function& function, | 768 const Function& function, |
767 Register new_pp); | 769 Register new_pp); |
768 void JmpPatchable(const ExternalLabel* label, Register pp); | 770 void JmpPatchable(const ExternalLabel* label, Register pp); |
| 771 void JmpPatchable(const StubEntry& stub_entry, Register pp); |
769 void Jmp(const ExternalLabel* label, Register pp); | 772 void Jmp(const ExternalLabel* label, Register pp); |
| 773 void Jmp(const StubEntry& stub_entry, Register pp); |
770 void J(Condition condition, const ExternalLabel* label, Register pp); | 774 void J(Condition condition, const ExternalLabel* label, Register pp); |
| 775 void J(Condition condition, const StubEntry& stub_entry, Register pp); |
771 void CallPatchable(const ExternalLabel* label); | 776 void CallPatchable(const ExternalLabel* label); |
| 777 void CallPatchable(const StubEntry& stub_entry); |
772 void Call(const ExternalLabel* label); | 778 void Call(const ExternalLabel* label); |
| 779 void Call(const StubEntry& stub_entry); |
773 // Unaware of write barrier (use StoreInto* methods for storing to objects). | 780 // Unaware of write barrier (use StoreInto* methods for storing to objects). |
774 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse. | 781 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse. |
775 void StoreObject(const Address& dst, const Object& obj); | 782 void StoreObject(const Address& dst, const Object& obj); |
776 void PushObject(const Object& object); | 783 void PushObject(const Object& object); |
777 void CompareObject(Register reg, const Object& object); | 784 void CompareObject(Register reg, const Object& object); |
778 | 785 |
779 // When storing into a heap object field, knowledge of the previous content | 786 // When storing into a heap object field, knowledge of the previous content |
780 // is expressed through these constants. | 787 // is expressed through these constants. |
781 enum FieldContent { | 788 enum FieldContent { |
782 kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode. | 789 kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode. |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 } | 1213 } |
1207 | 1214 |
1208 | 1215 |
1209 inline void Assembler::EmitOperandSizeOverride() { | 1216 inline void Assembler::EmitOperandSizeOverride() { |
1210 EmitUint8(0x66); | 1217 EmitUint8(0x66); |
1211 } | 1218 } |
1212 | 1219 |
1213 } // namespace dart | 1220 } // namespace dart |
1214 | 1221 |
1215 #endif // VM_ASSEMBLER_X64_H_ | 1222 #endif // VM_ASSEMBLER_X64_H_ |
OLD | NEW |