OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Classes that describe assembly patterns as used by inline caches. | 4 // Classes that describe assembly patterns as used by inline caches. |
5 | 5 |
6 #ifndef VM_INSTRUCTIONS_ARM64_H_ | 6 #ifndef VM_INSTRUCTIONS_ARM64_H_ |
7 #define VM_INSTRUCTIONS_ARM64_H_ | 7 #define VM_INSTRUCTIONS_ARM64_H_ |
8 | 8 |
9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
10 #error Do not include instructions_arm64.h directly; use instructions.h instead. | 10 #error Do not include instructions_arm64.h directly; use instructions.h instead. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 static intptr_t OffsetFromPPIndex(intptr_t index); | 54 static intptr_t OffsetFromPPIndex(intptr_t index); |
55 }; | 55 }; |
56 | 56 |
57 | 57 |
58 class CallPattern : public ValueObject { | 58 class CallPattern : public ValueObject { |
59 public: | 59 public: |
60 CallPattern(uword pc, const Code& code); | 60 CallPattern(uword pc, const Code& code); |
61 | 61 |
62 RawICData* IcData(); | 62 RawICData* IcData(); |
63 | 63 |
64 RawCode* TargetCode() const; | 64 uword TargetAddress() const; |
65 void SetTargetCode(const Code& target) const; | 65 void SetTargetAddress(uword target_address) const; |
66 | 66 |
67 // This constant length is only valid for inserted call patterns used for | 67 // This constant length is only valid for inserted call patterns used for |
68 // lazy deoptimization. Regular call pattern may vary in length. | 68 // lazy deoptimization. Regular call pattern may vary in length. |
69 static const int kDeoptCallLengthInBytes = 5 * Instr::kInstrSize; | 69 static const int kLengthInBytes = 5 * Instr::kInstrSize; |
70 | 70 |
71 static void InsertDeoptCallAt(uword pc, uword target_address); | 71 static void InsertAt(uword pc, uword target_address); |
72 | 72 |
73 private: | 73 private: |
74 const ObjectPool& object_pool_; | 74 const ObjectPool& object_pool_; |
75 | 75 |
76 uword end_; | 76 uword end_; |
77 uword ic_data_load_end_; | 77 uword ic_data_load_end_; |
78 | 78 |
79 intptr_t target_code_pool_index_; | 79 intptr_t target_address_pool_index_; |
80 ICData& ic_data_; | 80 ICData& ic_data_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 82 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
83 }; | 83 }; |
84 | 84 |
85 | 85 |
86 class NativeCallPattern : public ValueObject { | 86 class NativeCallPattern : public ValueObject { |
87 public: | 87 public: |
88 NativeCallPattern(uword pc, const Code& code); | 88 NativeCallPattern(uword pc, const Code& code); |
89 | 89 |
90 RawCode* target() const; | 90 uword target() const; |
91 void set_target(const Code& target) const; | 91 void set_target(uword target_address) const; |
92 | 92 |
93 NativeFunction native_function() const; | 93 NativeFunction native_function() const; |
94 void set_native_function(NativeFunction target) const; | 94 void set_native_function(NativeFunction target) const; |
95 | 95 |
96 private: | 96 private: |
97 const ObjectPool& object_pool_; | 97 const ObjectPool& object_pool_; |
98 | 98 |
99 uword end_; | 99 uword end_; |
100 intptr_t native_function_pool_index_; | 100 intptr_t native_function_pool_index_; |
101 intptr_t target_code_pool_index_; | 101 intptr_t target_address_pool_index_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); | 103 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
104 }; | 104 }; |
105 | 105 |
106 | 106 |
| 107 class JumpPattern : public ValueObject { |
| 108 public: |
| 109 JumpPattern(uword pc, const Code& code); |
| 110 |
| 111 static const int kLengthInBytes = 5 * Instr::kInstrSize; |
| 112 |
| 113 int pattern_length_in_bytes() const { |
| 114 return kLengthInBytes; |
| 115 } |
| 116 |
| 117 bool IsValid() const; |
| 118 uword TargetAddress() const; |
| 119 void SetTargetAddress(uword target_address) const; |
| 120 |
| 121 private: |
| 122 const uword pc_; |
| 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(JumpPattern); |
| 125 }; |
| 126 |
| 127 |
107 class ReturnPattern : public ValueObject { | 128 class ReturnPattern : public ValueObject { |
108 public: | 129 public: |
109 explicit ReturnPattern(uword pc); | 130 explicit ReturnPattern(uword pc); |
110 | 131 |
111 // bx_lr = 1. | 132 // bx_lr = 1. |
112 static const int kLengthInBytes = 1 * Instr::kInstrSize; | 133 static const int kLengthInBytes = 1 * Instr::kInstrSize; |
113 | 134 |
114 int pattern_length_in_bytes() const { | 135 int pattern_length_in_bytes() const { |
115 return kLengthInBytes; | 136 return kLengthInBytes; |
116 } | 137 } |
117 | 138 |
118 bool IsValid() const; | 139 bool IsValid() const; |
119 | 140 |
120 private: | 141 private: |
121 const uword pc_; | 142 const uword pc_; |
122 }; | 143 }; |
123 | 144 |
124 } // namespace dart | 145 } // namespace dart |
125 | 146 |
126 #endif // VM_INSTRUCTIONS_ARM64_H_ | 147 #endif // VM_INSTRUCTIONS_ARM64_H_ |
OLD | NEW |