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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // and the index in the pool being read from in the output parameters 'reg' | 102 // and the index in the pool being read from in the output parameters 'reg' |
103 // and 'index' respectively. | 103 // and 'index' respectively. |
104 uword InstructionPattern::DecodeLoadWordFromPool(uword end, | 104 uword InstructionPattern::DecodeLoadWordFromPool(uword end, |
105 Register* reg, | 105 Register* reg, |
106 intptr_t* index) { | 106 intptr_t* index) { |
107 UNIMPLEMENTED(); | 107 UNIMPLEMENTED(); |
108 return 0; | 108 return 0; |
109 } | 109 } |
110 | 110 |
111 | 111 |
| 112 static bool HasLoadFromPool(Instr instr) { |
| 113 switch (Bytecode::DecodeOpcode(instr)) { |
| 114 case Bytecode::kLoadConstant: |
| 115 case Bytecode::kPushConstant: |
| 116 case Bytecode::kStaticCall: |
| 117 case Bytecode::kInstanceCall: |
| 118 case Bytecode::kInstanceCall2: |
| 119 case Bytecode::kInstanceCall3: |
| 120 case Bytecode::kStoreStaticTOS: |
| 121 case Bytecode::kPushStatic: |
| 122 case Bytecode::kAllocate: |
| 123 case Bytecode::kInstantiateType: |
| 124 case Bytecode::kInstantiateTypeArgumentsTOS: |
| 125 case Bytecode::kAssertAssignable: |
| 126 return true; |
| 127 default: |
| 128 return false; |
| 129 } |
| 130 } |
| 131 |
| 132 |
112 bool DecodeLoadObjectFromPoolOrThread(uword pc, | 133 bool DecodeLoadObjectFromPoolOrThread(uword pc, |
113 const Code& code, | 134 const Code& code, |
114 Object* obj) { | 135 Object* obj) { |
115 UNIMPLEMENTED(); | 136 ASSERT(code.ContainsInstructionAt(pc)); |
| 137 Instr instr = Bytecode::At(pc); |
| 138 if (HasLoadFromPool(instr)) { |
| 139 uint16_t index = Bytecode::DecodeD(instr); |
| 140 const ObjectPool& pool = ObjectPool::Handle(code.object_pool()); |
| 141 if (pool.InfoAt(index) == ObjectPool::kTaggedObject) { |
| 142 *obj = pool.ObjectAt(index); |
| 143 return true; |
| 144 } |
| 145 } |
116 return false; | 146 return false; |
117 } | 147 } |
118 | 148 |
119 | 149 |
120 RawICData* CallPattern::IcData() { | 150 RawICData* CallPattern::IcData() { |
121 UNIMPLEMENTED(); | 151 UNIMPLEMENTED(); |
122 return ICData::null(); | 152 return ICData::null(); |
123 } | 153 } |
124 | 154 |
125 | 155 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 201 |
172 | 202 |
173 bool ReturnPattern::IsValid() const { | 203 bool ReturnPattern::IsValid() const { |
174 UNIMPLEMENTED(); | 204 UNIMPLEMENTED(); |
175 return false; | 205 return false; |
176 } | 206 } |
177 | 207 |
178 } // namespace dart | 208 } // namespace dart |
179 | 209 |
180 #endif // defined TARGET_ARCH_DBC | 210 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |