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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 ic_data_(ICData::Handle()) { | 60 ic_data_(ICData::Handle()) { |
61 ASSERT(code.ContainsInstructionAt(end_)); | 61 ASSERT(code.ContainsInstructionAt(end_)); |
62 const uword call_pc = end_ - sizeof(Instr); | 62 const uword call_pc = end_ - sizeof(Instr); |
63 Instr call_instr = Bytecode::At(call_pc); | 63 Instr call_instr = Bytecode::At(call_pc); |
64 ASSERT(Bytecode::IsCallOpcode(call_instr)); | 64 ASSERT(Bytecode::IsCallOpcode(call_instr)); |
65 ic_data_load_end_ = call_pc; | 65 ic_data_load_end_ = call_pc; |
66 target_code_pool_index_ = Bytecode::DecodeD(call_instr); | 66 target_code_pool_index_ = Bytecode::DecodeD(call_instr); |
67 } | 67 } |
68 | 68 |
69 | 69 |
| 70 int CallPattern::DeoptCallPatternLengthInInstructions() { |
| 71 UNIMPLEMENTED(); |
| 72 return 0; |
| 73 } |
| 74 |
| 75 |
| 76 int CallPattern::DeoptCallPatternLengthInBytes() { |
| 77 UNIMPLEMENTED(); |
| 78 return 0; |
| 79 } |
| 80 |
| 81 |
70 NativeCallPattern::NativeCallPattern(uword pc, const Code& code) | 82 NativeCallPattern::NativeCallPattern(uword pc, const Code& code) |
71 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), | 83 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
72 end_(pc), | 84 end_(pc), |
73 native_function_pool_index_(-1), | 85 native_function_pool_index_(-1), |
74 target_code_pool_index_(-1) { | 86 target_code_pool_index_(-1) { |
75 UNIMPLEMENTED(); | 87 UNIMPLEMENTED(); |
76 } | 88 } |
77 | 89 |
78 | 90 |
79 RawCode* NativeCallPattern::target() const { | 91 RawCode* NativeCallPattern::target() const { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return reinterpret_cast<RawCode*>( | 174 return reinterpret_cast<RawCode*>( |
163 object_pool_.ObjectAt(target_code_pool_index_)); | 175 object_pool_.ObjectAt(target_code_pool_index_)); |
164 } | 176 } |
165 | 177 |
166 | 178 |
167 void CallPattern::SetTargetCode(const Code& target_code) const { | 179 void CallPattern::SetTargetCode(const Code& target_code) const { |
168 object_pool_.SetObjectAt(target_code_pool_index_, target_code); | 180 object_pool_.SetObjectAt(target_code_pool_index_, target_code); |
169 } | 181 } |
170 | 182 |
171 | 183 |
172 void CallPattern::InsertDeoptCallAt(uword pc) { | 184 void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) { |
173 const uint8_t argc = Bytecode::IsCallOpcode(Bytecode::At(pc)) ? | 185 const uint8_t argc = Bytecode::IsCallOpcode(Bytecode::At(pc)) ? |
174 Bytecode::DecodeArgc(Bytecode::At(pc)) : 0; | 186 Bytecode::DecodeArgc(Bytecode::At(pc)) : 0; |
175 *reinterpret_cast<Instr*>(pc) = Bytecode::Encode(Bytecode::kDeopt, argc, 0); | 187 *reinterpret_cast<Instr*>(pc) = Bytecode::Encode(Bytecode::kDeopt, argc, 0); |
176 } | 188 } |
177 | 189 |
178 | 190 |
179 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) | 191 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) |
180 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), | 192 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
181 data_pool_index_(-1), | 193 data_pool_index_(-1), |
182 target_pool_index_(-1) { | 194 target_pool_index_(-1) { |
(...skipping 30 matching lines...) Expand all Loading... |
213 | 225 |
214 | 226 |
215 bool ReturnPattern::IsValid() const { | 227 bool ReturnPattern::IsValid() const { |
216 UNIMPLEMENTED(); | 228 UNIMPLEMENTED(); |
217 return false; | 229 return false; |
218 } | 230 } |
219 | 231 |
220 } // namespace dart | 232 } // namespace dart |
221 | 233 |
222 #endif // defined TARGET_ARCH_DBC | 234 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |