| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 UNIMPLEMENTED(); | 107 UNIMPLEMENTED(); |
| 108 return 0; | 108 return 0; |
| 109 } | 109 } |
| 110 | 110 |
| 111 | 111 |
| 112 static bool HasLoadFromPool(Instr instr) { | 112 static bool HasLoadFromPool(Instr instr) { |
| 113 switch (Bytecode::DecodeOpcode(instr)) { | 113 switch (Bytecode::DecodeOpcode(instr)) { |
| 114 case Bytecode::kLoadConstant: | 114 case Bytecode::kLoadConstant: |
| 115 case Bytecode::kPushConstant: | 115 case Bytecode::kPushConstant: |
| 116 case Bytecode::kStaticCall: | 116 case Bytecode::kStaticCall: |
| 117 case Bytecode::kInstanceCall: | 117 case Bytecode::kInstanceCall1: |
| 118 case Bytecode::kInstanceCall2: | 118 case Bytecode::kInstanceCall2: |
| 119 case Bytecode::kInstanceCall3: | 119 case Bytecode::kInstanceCall1Opt: |
| 120 case Bytecode::kInstanceCall2Opt: |
| 120 case Bytecode::kStoreStaticTOS: | 121 case Bytecode::kStoreStaticTOS: |
| 121 case Bytecode::kPushStatic: | 122 case Bytecode::kPushStatic: |
| 122 case Bytecode::kAllocate: | 123 case Bytecode::kAllocate: |
| 123 case Bytecode::kInstantiateType: | 124 case Bytecode::kInstantiateType: |
| 124 case Bytecode::kInstantiateTypeArgumentsTOS: | 125 case Bytecode::kInstantiateTypeArgumentsTOS: |
| 125 case Bytecode::kAssertAssignable: | 126 case Bytecode::kAssertAssignable: |
| 126 return true; | 127 return true; |
| 127 default: | 128 default: |
| 128 return false; | 129 return false; |
| 129 } | 130 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 158 object_pool_.ObjectAt(target_code_pool_index_)); | 159 object_pool_.ObjectAt(target_code_pool_index_)); |
| 159 } | 160 } |
| 160 | 161 |
| 161 | 162 |
| 162 void CallPattern::SetTargetCode(const Code& target_code) const { | 163 void CallPattern::SetTargetCode(const Code& target_code) const { |
| 163 object_pool_.SetObjectAt(target_code_pool_index_, target_code); | 164 object_pool_.SetObjectAt(target_code_pool_index_, target_code); |
| 164 } | 165 } |
| 165 | 166 |
| 166 | 167 |
| 167 void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) { | 168 void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) { |
| 168 UNIMPLEMENTED(); | 169 const uint8_t argc = Bytecode::IsCallOpcode(Bytecode::At(pc)) ? |
| 170 Bytecode::DecodeArgc(Bytecode::At(pc)) : 0; |
| 171 *reinterpret_cast<Instr*>(pc) = Bytecode::Encode(Bytecode::kDeopt, argc, 0); |
| 169 } | 172 } |
| 170 | 173 |
| 171 | 174 |
| 172 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) | 175 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) |
| 173 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), | 176 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
| 174 cache_pool_index_(-1), | 177 cache_pool_index_(-1), |
| 175 stub_pool_index_(-1) { | 178 stub_pool_index_(-1) { |
| 176 UNIMPLEMENTED(); | 179 UNIMPLEMENTED(); |
| 177 } | 180 } |
| 178 | 181 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 201 | 204 |
| 202 | 205 |
| 203 bool ReturnPattern::IsValid() const { | 206 bool ReturnPattern::IsValid() const { |
| 204 UNIMPLEMENTED(); | 207 UNIMPLEMENTED(); |
| 205 return false; | 208 return false; |
| 206 } | 209 } |
| 207 | 210 |
| 208 } // namespace dart | 211 } // namespace dart |
| 209 | 212 |
| 210 #endif // defined TARGET_ARCH_DBC | 213 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |