OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/instructions.h" | 8 #include "vm/instructions.h" |
9 #include "vm/instructions_dbc.h" | 9 #include "vm/instructions_dbc.h" |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return reinterpret_cast<RawCode*>( | 161 return reinterpret_cast<RawCode*>( |
162 object_pool_.ObjectAt(target_code_pool_index_)); | 162 object_pool_.ObjectAt(target_code_pool_index_)); |
163 } | 163 } |
164 | 164 |
165 | 165 |
166 void CallPattern::SetTargetCode(const Code& target_code) const { | 166 void CallPattern::SetTargetCode(const Code& target_code) const { |
167 object_pool_.SetObjectAt(target_code_pool_index_, target_code); | 167 object_pool_.SetObjectAt(target_code_pool_index_, target_code); |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 void CallPattern::InsertDeoptCallAt(uword pc) { | |
172 const uint8_t argc = Bytecode::IsCallOpcode(Bytecode::At(pc)) | |
173 ? Bytecode::DecodeArgc(Bytecode::At(pc)) | |
174 : 0; | |
175 *reinterpret_cast<Instr*>(pc) = Bytecode::Encode(Bytecode::kDeopt, argc, 0); | |
176 } | |
177 | |
178 | |
179 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) | 171 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) |
180 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), | 172 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
181 data_pool_index_(-1), | 173 data_pool_index_(-1), |
182 target_pool_index_(-1) { | 174 target_pool_index_(-1) { |
183 UNIMPLEMENTED(); | 175 UNIMPLEMENTED(); |
184 } | 176 } |
185 | 177 |
186 | 178 |
187 RawObject* SwitchableCallPattern::data() const { | 179 RawObject* SwitchableCallPattern::data() const { |
188 return object_pool_.ObjectAt(data_pool_index_); | 180 return object_pool_.ObjectAt(data_pool_index_); |
(...skipping 23 matching lines...) Expand all Loading... |
212 | 204 |
213 | 205 |
214 bool ReturnPattern::IsValid() const { | 206 bool ReturnPattern::IsValid() const { |
215 UNIMPLEMENTED(); | 207 UNIMPLEMENTED(); |
216 return false; | 208 return false; |
217 } | 209 } |
218 | 210 |
219 } // namespace dart | 211 } // namespace dart |
220 | 212 |
221 #endif // defined TARGET_ARCH_DBC | 213 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |