Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: runtime/vm/instructions_dbc.cc

Issue 1961953003: DBC: Adds DecodeLoadObjectFromPoolOrThread, enables tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Decode more instructions Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698