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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const ObjectPool& object_pool_; | 99 const ObjectPool& object_pool_; |
100 | 100 |
101 uword end_; | 101 uword end_; |
102 intptr_t native_function_pool_index_; | 102 intptr_t native_function_pool_index_; |
103 intptr_t target_code_pool_index_; | 103 intptr_t target_code_pool_index_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); | 105 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern); |
106 }; | 106 }; |
107 | 107 |
108 | 108 |
109 // Instance call that can switch from an IC call to a megamorphic call | 109 // Instance call that can switch between a direct monomorphic call, an IC call, |
110 // load ICData load MegamorphicCache | 110 // and a megamorphic call. |
111 // call ICLookup stub -> call MegamorphicLookup stub | 111 // load guarded cid load ICData load MegamorphicCache |
112 // call target call target | 112 // load monomorphic target <-> load ICLookup stub -> load MMLookup stub |
| 113 // call target.entry call stub.entry call stub.entry |
113 class SwitchableCallPattern : public ValueObject { | 114 class SwitchableCallPattern : public ValueObject { |
114 public: | 115 public: |
115 SwitchableCallPattern(uword pc, const Code& code); | 116 SwitchableCallPattern(uword pc, const Code& code); |
116 | 117 |
117 RawObject* cache() const; | 118 RawObject* data() const; |
118 void SetCache(const MegamorphicCache& cache) const; | 119 RawCode* target() const; |
119 void SetLookupStub(const Code& stub) const; | 120 void SetData(const Object& data) const; |
| 121 void SetTarget(const Code& target) const; |
120 | 122 |
121 private: | 123 private: |
122 const ObjectPool& object_pool_; | 124 const ObjectPool& object_pool_; |
123 intptr_t cache_pool_index_; | 125 intptr_t data_pool_index_; |
124 intptr_t stub_pool_index_; | 126 intptr_t target_pool_index_; |
125 | 127 |
126 DISALLOW_COPY_AND_ASSIGN(SwitchableCallPattern); | 128 DISALLOW_COPY_AND_ASSIGN(SwitchableCallPattern); |
127 }; | 129 }; |
128 | 130 |
129 | 131 |
130 class ReturnPattern : public ValueObject { | 132 class ReturnPattern : public ValueObject { |
131 public: | 133 public: |
132 explicit ReturnPattern(uword pc); | 134 explicit ReturnPattern(uword pc); |
133 | 135 |
134 // bx_lr = 1. | 136 // bx_lr = 1. |
135 static const int kLengthInBytes = 1 * Instr::kInstrSize; | 137 static const int kLengthInBytes = 1 * Instr::kInstrSize; |
136 | 138 |
137 int pattern_length_in_bytes() const { | 139 int pattern_length_in_bytes() const { |
138 return kLengthInBytes; | 140 return kLengthInBytes; |
139 } | 141 } |
140 | 142 |
141 bool IsValid() const; | 143 bool IsValid() const; |
142 | 144 |
143 private: | 145 private: |
144 const uword pc_; | 146 const uword pc_; |
145 }; | 147 }; |
146 | 148 |
147 } // namespace dart | 149 } // namespace dart |
148 | 150 |
149 #endif // VM_INSTRUCTIONS_ARM64_H_ | 151 #endif // VM_INSTRUCTIONS_ARM64_H_ |
OLD | NEW |