| 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 |
| 171 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) | 179 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) |
| 172 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), | 180 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
| 173 data_pool_index_(-1), | 181 data_pool_index_(-1), |
| 174 target_pool_index_(-1) { | 182 target_pool_index_(-1) { |
| 175 UNIMPLEMENTED(); | 183 UNIMPLEMENTED(); |
| 176 } | 184 } |
| 177 | 185 |
| 178 | 186 |
| 179 RawObject* SwitchableCallPattern::data() const { | 187 RawObject* SwitchableCallPattern::data() const { |
| 180 return object_pool_.ObjectAt(data_pool_index_); | 188 return object_pool_.ObjectAt(data_pool_index_); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 204 | 212 |
| 205 | 213 |
| 206 bool ReturnPattern::IsValid() const { | 214 bool ReturnPattern::IsValid() const { |
| 207 UNIMPLEMENTED(); | 215 UNIMPLEMENTED(); |
| 208 return false; | 216 return false; |
| 209 } | 217 } |
| 210 | 218 |
| 211 } // namespace dart | 219 } // namespace dart |
| 212 | 220 |
| 213 #endif // defined TARGET_ARCH_DBC | 221 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |