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

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

Issue 10917085: Revert "Remove classes Computation and BindInstr." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.h ('k') | runtime/vm/intermediate_language.h » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/il_printer.h" 5 #include "vm/il_printer.h"
6 6
7 #include "vm/intermediate_language.h" 7 #include "vm/intermediate_language.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/parser.h" 9 #include "vm/parser.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (print_locations_ && (instr->locs() != NULL)) { 68 if (print_locations_ && (instr->locs() != NULL)) {
69 instr->locs()->PrintTo(&f); 69 instr->locs()->PrintTo(&f);
70 } 70 }
71 if (instr->lifetime_position() != -1) { 71 if (instr->lifetime_position() != -1) {
72 OS::Print("%3d: ", instr->lifetime_position()); 72 OS::Print("%3d: ", instr->lifetime_position());
73 } 73 }
74 OS::Print("%s", str); 74 OS::Print("%s", str);
75 } 75 }
76 76
77 77
78 void FlowGraphPrinter::PrintComputation(Computation* comp) {
79 char str[1000];
80 BufferFormatter f(str, sizeof(str));
81 comp->PrintTo(&f);
82 OS::Print("%s", str);
83 }
84
85
78 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, 86 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function,
79 intptr_t token_pos, 87 intptr_t token_pos,
80 Value* value, 88 Value* value,
81 const AbstractType& dst_type, 89 const AbstractType& dst_type,
82 const String& dst_name, 90 const String& dst_name,
83 bool eliminated) { 91 bool eliminated) {
84 const Script& script = Script::Handle(parsed_function.function().script()); 92 const Script& script = Script::Handle(parsed_function.function().script());
85 const char* compile_type_name = "unknown"; 93 const char* compile_type_name = "unknown";
86 if (value != NULL) { 94 if (value != NULL) {
87 const AbstractType& type = AbstractType::Handle(value->CompileType()); 95 const AbstractType& type = AbstractType::Handle(value->CompileType());
(...skipping 27 matching lines...) Expand all
115 } 123 }
116 const Class& cls = 124 const Class& cls =
117 Class::Handle(Isolate::Current()->class_table()->At(class_ids[k])); 125 Class::Handle(Isolate::Current()->class_table()->At(class_ids[k]));
118 f->Print("%s", String::Handle(cls.Name()).ToCString()); 126 f->Print("%s", String::Handle(cls.Name()).ToCString());
119 } 127 }
120 } 128 }
121 f->Print("]"); 129 f->Print("]");
122 } 130 }
123 131
124 132
125 void Definition::PrintTo(BufferFormatter* f) const { 133 void Computation::PrintTo(BufferFormatter* f) const {
126 // Do not access 'deopt_id()' as it asserts that the computation can 134 // Do not access 'deopt_id()' as it asserts that the computation can
127 // deoptimize. 135 // deoptimize.
128 f->Print("%s:%d(", DebugName(), deopt_id_); 136 f->Print("%s:%d(", DebugName(), deopt_id_);
129 PrintOperandsTo(f); 137 PrintOperandsTo(f);
130 f->Print(")"); 138 f->Print(")");
131 } 139 }
132 140
133 141
134 void Definition::PrintOperandsTo(BufferFormatter* f) const { 142 void Computation::PrintOperandsTo(BufferFormatter* f) const {
135 for (int i = 0; i < InputCount(); ++i) { 143 for (int i = 0; i < InputCount(); ++i) {
136 if (i > 0) f->Print(", "); 144 if (i > 0) f->Print(", ");
137 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); 145 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f);
138 } 146 }
139 } 147 }
140 148
141 149
142 void Definition::PrintToVisualizer(BufferFormatter* f) const {
143 PrintTo(f);
144 }
145
146
147 void Value::PrintTo(BufferFormatter* f) const { 150 void Value::PrintTo(BufferFormatter* f) const {
148 if (definition()->HasSSATemp()) { 151 if (definition()->HasSSATemp()) {
149 f->Print("v%d", definition()->ssa_temp_index()); 152 f->Print("v%d", definition()->ssa_temp_index());
150 } else { 153 } else {
151 f->Print("t%d", definition()->temp_index()); 154 f->Print("t%d", definition()->temp_index());
152 } 155 }
153 } 156 }
154 157
155 158
156 void ConstantInstr::PrintOperandsTo(BufferFormatter* f) const { 159 void ConstantComp::PrintOperandsTo(BufferFormatter* f) const {
157 f->Print("#%s", value().ToCString()); 160 f->Print("#%s", value().ToCString());
158 } 161 }
159 162
160 163
161 void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const { 164 void AssertAssignableComp::PrintOperandsTo(BufferFormatter* f) const {
162 value()->PrintTo(f); 165 value()->PrintTo(f);
163 f->Print(", %s, '%s'%s", 166 f->Print(", %s, '%s'%s",
164 String::Handle(dst_type().Name()).ToCString(), 167 String::Handle(dst_type().Name()).ToCString(),
165 dst_name().ToCString(), 168 dst_name().ToCString(),
166 is_eliminated() ? " eliminated" : ""); 169 is_eliminated() ? " eliminated" : "");
167 f->Print(" instantiator("); 170 f->Print(" instantiator(");
168 instantiator()->PrintTo(f); 171 instantiator()->PrintTo(f);
169 f->Print(")"); 172 f->Print(")");
170 f->Print(" instantiator_type_arguments("); 173 f->Print(" instantiator_type_arguments(");
171 instantiator_type_arguments()->PrintTo(f); 174 instantiator_type_arguments()->PrintTo(f);
172 f->Print(")"); 175 f->Print(")");
173 } 176 }
174 177
175 178
176 void AssertBooleanInstr::PrintOperandsTo(BufferFormatter* f) const { 179 void AssertBooleanComp::PrintOperandsTo(BufferFormatter* f) const {
177 value()->PrintTo(f); 180 value()->PrintTo(f);
178 f->Print("%s", is_eliminated() ? " eliminated" : ""); 181 f->Print("%s", is_eliminated() ? " eliminated" : "");
179 } 182 }
180 183
181 184
182 void ArgumentDefinitionTestInstr::PrintOperandsTo(BufferFormatter* f) const { 185 void ArgumentDefinitionTestComp::PrintOperandsTo(BufferFormatter* f) const {
183 saved_arguments_descriptor()->PrintTo(f); 186 saved_arguments_descriptor()->PrintTo(f);
184 f->Print(", ?%s @%d", 187 f->Print(", ?%s @%d",
185 formal_parameter_name().ToCString(), 188 formal_parameter_name().ToCString(),
186 formal_parameter_index()); 189 formal_parameter_index());
187 } 190 }
188 191
189 192
190 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const { 193 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const {
191 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 194 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
192 if (i > 0) f->Print(", "); 195 if (i > 0) f->Print(", ");
193 ArgumentAt(i)->value()->PrintTo(f); 196 ArgumentAt(i)->value()->PrintTo(f);
194 } 197 }
195 } 198 }
196 199
197 200
198 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { 201 void InstanceCallComp::PrintOperandsTo(BufferFormatter* f) const {
199 f->Print("%s", function_name().ToCString()); 202 f->Print("%s", function_name().ToCString());
200 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 203 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
201 f->Print(", "); 204 f->Print(", ");
202 ArgumentAt(i)->value()->PrintTo(f); 205 ArgumentAt(i)->value()->PrintTo(f);
203 } 206 }
204 if (HasICData()) { 207 if (HasICData()) {
205 PrintICData(f, *ic_data()); 208 PrintICData(f, *ic_data());
206 } 209 }
207 } 210 }
208 211
209 212
210 void PolymorphicInstanceCallInstr::PrintTo(BufferFormatter* f) const { 213 void PolymorphicInstanceCallComp::PrintTo(BufferFormatter* f) const {
211 f->Print("%s(", DebugName()); 214 f->Print("%s(", DebugName());
212 instance_call()->PrintOperandsTo(f); 215 instance_call()->PrintOperandsTo(f);
213 f->Print(") "); 216 f->Print(") ");
214 PrintICData(f, ic_data()); 217 PrintICData(f, ic_data());
215 } 218 }
216 219
217 220
218 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const { 221 void StrictCompareComp::PrintOperandsTo(BufferFormatter* f) const {
219 f->Print("%s, ", Token::Str(kind())); 222 f->Print("%s, ", Token::Str(kind()));
220 left()->PrintTo(f); 223 left()->PrintTo(f);
221 f->Print(", "); 224 f->Print(", ");
222 right()->PrintTo(f); 225 right()->PrintTo(f);
223 } 226 }
224 227
225 228
226 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const { 229 void EqualityCompareComp::PrintOperandsTo(BufferFormatter* f) const {
227 left()->PrintTo(f); 230 left()->PrintTo(f);
228 f->Print(" %s ", Token::Str(kind())); 231 f->Print(" %s ", Token::Str(kind()));
229 right()->PrintTo(f); 232 right()->PrintTo(f);
230 if (HasICData()) { 233 if (HasICData()) {
231 PrintICData(f, *ic_data()); 234 PrintICData(f, *ic_data());
232 } 235 }
233 } 236 }
234 237
235 238
236 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const { 239 void StaticCallComp::PrintOperandsTo(BufferFormatter* f) const {
237 f->Print("%s ", String::Handle(function().name()).ToCString()); 240 f->Print("%s ", String::Handle(function().name()).ToCString());
238 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 241 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
239 if (i > 0) f->Print(", "); 242 if (i > 0) f->Print(", ");
240 ArgumentAt(i)->value()->PrintTo(f); 243 ArgumentAt(i)->value()->PrintTo(f);
241 } 244 }
242 } 245 }
243 246
244 247
245 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const { 248 void LoadLocalComp::PrintOperandsTo(BufferFormatter* f) const {
246 f->Print("%s lvl:%d", local().name().ToCString(), context_level()); 249 f->Print("%s lvl:%d", local().name().ToCString(), context_level());
247 } 250 }
248 251
249 252
250 void StoreLocalInstr::PrintOperandsTo(BufferFormatter* f) const { 253 void StoreLocalComp::PrintOperandsTo(BufferFormatter* f) const {
251 f->Print("%s, ", local().name().ToCString()); 254 f->Print("%s, ", local().name().ToCString());
252 value()->PrintTo(f); 255 value()->PrintTo(f);
253 f->Print(", lvl: %d", context_level()); 256 f->Print(", lvl: %d", context_level());
254 } 257 }
255 258
256 259
257 void NativeCallInstr::PrintOperandsTo(BufferFormatter* f) const { 260 void NativeCallComp::PrintOperandsTo(BufferFormatter* f) const {
258 f->Print("%s", native_name().ToCString()); 261 f->Print("%s", native_name().ToCString());
259 } 262 }
260 263
261 264
262 void LoadInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 265 void LoadInstanceFieldComp::PrintOperandsTo(BufferFormatter* f) const {
263 f->Print("%s, ", String::Handle(field().name()).ToCString()); 266 f->Print("%s, ", String::Handle(field().name()).ToCString());
264 instance()->PrintTo(f); 267 instance()->PrintTo(f);
265 } 268 }
266 269
267 270
268 void StoreInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 271 void StoreInstanceFieldComp::PrintOperandsTo(BufferFormatter* f) const {
269 f->Print("%s, ", String::Handle(field().name()).ToCString()); 272 f->Print("%s, ", String::Handle(field().name()).ToCString());
270 instance()->PrintTo(f); 273 instance()->PrintTo(f);
271 f->Print(", "); 274 f->Print(", ");
272 value()->PrintTo(f); 275 value()->PrintTo(f);
273 } 276 }
274 277
275 278
276 void LoadStaticFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 279 void LoadStaticFieldComp::PrintOperandsTo(BufferFormatter* f) const {
277 f->Print("%s", String::Handle(field().name()).ToCString()); 280 f->Print("%s", String::Handle(field().name()).ToCString());
278 } 281 }
279 282
280 283
281 void StoreStaticFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 284 void StoreStaticFieldComp::PrintOperandsTo(BufferFormatter* f) const {
282 f->Print("%s, ", String::Handle(field().name()).ToCString()); 285 f->Print("%s, ", String::Handle(field().name()).ToCString());
283 value()->PrintTo(f); 286 value()->PrintTo(f);
284 } 287 }
285 288
286 289
287 void InstanceOfInstr::PrintOperandsTo(BufferFormatter* f) const { 290 void InstanceOfComp::PrintOperandsTo(BufferFormatter* f) const {
288 value()->PrintTo(f); 291 value()->PrintTo(f);
289 f->Print(" %s %s", 292 f->Print(" %s %s",
290 negate_result() ? "ISNOT" : "IS", 293 negate_result() ? "ISNOT" : "IS",
291 String::Handle(type().Name()).ToCString()); 294 String::Handle(type().Name()).ToCString());
292 f->Print(" instantiator("); 295 f->Print(" instantiator(");
293 instantiator()->PrintTo(f); 296 instantiator()->PrintTo(f);
294 f->Print(")"); 297 f->Print(")");
295 f->Print(" type-arg("); 298 f->Print(" type-arg(");
296 instantiator_type_arguments()->PrintTo(f); 299 instantiator_type_arguments()->PrintTo(f);
297 f->Print(")"); 300 f->Print(")");
298 } 301 }
299 302
300 303
301 void RelationalOpInstr::PrintOperandsTo(BufferFormatter* f) const { 304 void RelationalOpComp::PrintOperandsTo(BufferFormatter* f) const {
302 f->Print("%s, ", Token::Str(kind())); 305 f->Print("%s, ", Token::Str(kind()));
303 left()->PrintTo(f); 306 left()->PrintTo(f);
304 f->Print(", "); 307 f->Print(", ");
305 right()->PrintTo(f); 308 right()->PrintTo(f);
306 if (HasICData()) { 309 if (HasICData()) {
307 PrintICData(f, *ic_data()); 310 PrintICData(f, *ic_data());
308 } 311 }
309 } 312 }
310 313
311 314
312 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 315 void AllocateObjectComp::PrintOperandsTo(BufferFormatter* f) const {
313 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); 316 f->Print("%s", Class::Handle(constructor().Owner()).ToCString());
314 for (intptr_t i = 0; i < ArgumentCount(); i++) { 317 for (intptr_t i = 0; i < ArgumentCount(); i++) {
315 f->Print(", "); 318 f->Print(", ");
316 ArgumentAt(i)->value()->PrintTo(f); 319 ArgumentAt(i)->value()->PrintTo(f);
317 } 320 }
318 } 321 }
319 322
320 323
321 void AllocateObjectWithBoundsCheckInstr::PrintOperandsTo( 324 void AllocateObjectWithBoundsCheckComp::PrintOperandsTo(
322 BufferFormatter* f) const { 325 BufferFormatter* f) const {
323 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); 326 f->Print("%s", Class::Handle(constructor().Owner()).ToCString());
324 for (intptr_t i = 0; i < InputCount(); i++) { 327 for (intptr_t i = 0; i < InputCount(); i++) {
325 f->Print(", "); 328 f->Print(", ");
326 InputAt(i)->PrintTo(f); 329 InputAt(i)->PrintTo(f);
327 } 330 }
328 } 331 }
329 332
330 333
331 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { 334 void CreateArrayComp::PrintOperandsTo(BufferFormatter* f) const {
332 for (int i = 0; i < ArgumentCount(); ++i) { 335 for (int i = 0; i < ArgumentCount(); ++i) {
333 if (i != 0) f->Print(", "); 336 if (i != 0) f->Print(", ");
334 ArgumentAt(i)->value()->PrintTo(f); 337 ArgumentAt(i)->value()->PrintTo(f);
335 } 338 }
336 if (ArgumentCount() > 0) f->Print(", "); 339 if (ArgumentCount() > 0) f->Print(", ");
337 element_type()->PrintTo(f); 340 element_type()->PrintTo(f);
338 } 341 }
339 342
340 343
341 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const { 344 void CreateClosureComp::PrintOperandsTo(BufferFormatter* f) const {
342 f->Print("%s", function().ToCString()); 345 f->Print("%s", function().ToCString());
343 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 346 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
344 if (i > 0) f->Print(", "); 347 if (i > 0) f->Print(", ");
345 ArgumentAt(i)->value()->PrintTo(f); 348 ArgumentAt(i)->value()->PrintTo(f);
346 } 349 }
347 } 350 }
348 351
349 352
350 void LoadVMFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 353 void LoadVMFieldComp::PrintOperandsTo(BufferFormatter* f) const {
351 value()->PrintTo(f); 354 value()->PrintTo(f);
352 f->Print(", %d", offset_in_bytes()); 355 f->Print(", %d", offset_in_bytes());
353 } 356 }
354 357
355 358
356 void StoreVMFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 359 void StoreVMFieldComp::PrintOperandsTo(BufferFormatter* f) const {
357 dest()->PrintTo(f); 360 dest()->PrintTo(f);
358 f->Print(", %d, ", offset_in_bytes()); 361 f->Print(", %d, ", offset_in_bytes());
359 value()->PrintTo(f); 362 value()->PrintTo(f);
360 } 363 }
361 364
362 365
363 void InstantiateTypeArgumentsInstr::PrintOperandsTo(BufferFormatter* f) const { 366 void InstantiateTypeArgumentsComp::PrintOperandsTo(BufferFormatter* f) const {
364 const String& type_args = String::Handle(type_arguments().Name()); 367 const String& type_args = String::Handle(type_arguments().Name());
365 f->Print("%s, ", type_args.ToCString()); 368 f->Print("%s, ", type_args.ToCString());
366 instantiator()->PrintTo(f); 369 instantiator()->PrintTo(f);
367 } 370 }
368 371
369 372
370 void ExtractConstructorTypeArgumentsInstr::PrintOperandsTo( 373 void ExtractConstructorTypeArgumentsComp::PrintOperandsTo(
371 BufferFormatter* f) const { 374 BufferFormatter* f) const {
372 const String& type_args = String::Handle(type_arguments().Name()); 375 const String& type_args = String::Handle(type_arguments().Name());
373 f->Print("%s, ", type_args.ToCString()); 376 f->Print("%s, ", type_args.ToCString());
374 instantiator()->PrintTo(f); 377 instantiator()->PrintTo(f);
375 } 378 }
376 379
377 380
378 void AllocateContextInstr::PrintOperandsTo(BufferFormatter* f) const { 381 void AllocateContextComp::PrintOperandsTo(BufferFormatter* f) const {
379 f->Print("%d", num_context_variables()); 382 f->Print("%d", num_context_variables());
380 } 383 }
381 384
382 385
383 void CatchEntryInstr::PrintOperandsTo(BufferFormatter* f) const { 386 void CatchEntryComp::PrintOperandsTo(BufferFormatter* f) const {
384 f->Print("%s, %s", 387 f->Print("%s, %s",
385 exception_var().name().ToCString(), 388 exception_var().name().ToCString(),
386 stacktrace_var().name().ToCString()); 389 stacktrace_var().name().ToCString());
387 } 390 }
388 391
389 392
390 void BinarySmiOpInstr::PrintOperandsTo(BufferFormatter* f) const { 393 void BinarySmiOpComp::PrintOperandsTo(BufferFormatter* f) const {
391 f->Print("%s, ", Token::Str(op_kind())); 394 f->Print("%s, ", Token::Str(op_kind()));
392 left()->PrintTo(f); 395 left()->PrintTo(f);
393 f->Print(", "); 396 f->Print(", ");
394 right()->PrintTo(f); 397 right()->PrintTo(f);
395 } 398 }
396 399
397 400
398 void BinaryMintOpInstr::PrintOperandsTo(BufferFormatter* f) const { 401 void BinaryMintOpComp::PrintOperandsTo(BufferFormatter* f) const {
399 f->Print("%s, ", Token::Str(op_kind())); 402 f->Print("%s, ", Token::Str(op_kind()));
400 left()->PrintTo(f); 403 left()->PrintTo(f);
401 f->Print(", "); 404 f->Print(", ");
402 right()->PrintTo(f); 405 right()->PrintTo(f);
403 } 406 }
404 407
405 408
406 void UnboxedDoubleBinaryOpInstr::PrintOperandsTo(BufferFormatter* f) const { 409 void UnboxedDoubleBinaryOpComp::PrintOperandsTo(BufferFormatter* f) const {
407 f->Print("%s, ", Token::Str(op_kind())); 410 f->Print("%s, ", Token::Str(op_kind()));
408 left()->PrintTo(f); 411 left()->PrintTo(f);
409 f->Print(", "); 412 f->Print(", ");
410 right()->PrintTo(f); 413 right()->PrintTo(f);
411 } 414 }
412 415
413 416
414 void UnarySmiOpInstr::PrintOperandsTo(BufferFormatter* f) const { 417 void UnarySmiOpComp::PrintOperandsTo(BufferFormatter* f) const {
415 f->Print("%s, ", Token::Str(op_kind())); 418 f->Print("%s, ", Token::Str(op_kind()));
416 value()->PrintTo(f); 419 value()->PrintTo(f);
417 } 420 }
418 421
419 422
420 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const { 423 void CheckClassComp::PrintOperandsTo(BufferFormatter* f) const {
421 value()->PrintTo(f); 424 value()->PrintTo(f);
422 PrintICData(f, unary_checks()); 425 PrintICData(f, unary_checks());
423 } 426 }
424 427
425 428
426 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { 429 void GraphEntryInstr::PrintTo(BufferFormatter* f) const {
427 f->Print("%2d: [graph]", block_id()); 430 f->Print("%2d: [graph]", block_id());
428 if (start_env_ != NULL) { 431 if (start_env_ != NULL) {
429 f->Print("\n{\n"); 432 f->Print("\n{\n");
430 const GrowableArray<Value*>& values = start_env_->values(); 433 const GrowableArray<Value*>& values = start_env_->values();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 } else { 499 } else {
497 f->Print("]"); 500 f->Print("]");
498 } 501 }
499 if (HasParallelMove()) { 502 if (HasParallelMove()) {
500 f->Print("\n"); 503 f->Print("\n");
501 parallel_move()->PrintTo(f); 504 parallel_move()->PrintTo(f);
502 } 505 }
503 } 506 }
504 507
505 508
509 void BindInstr::PrintTo(BufferFormatter* f) const {
510 if (!is_used()) {
511 f->Print(" ");
512 } else if (HasSSATemp()) {
513 f->Print(" v%d <- ", ssa_temp_index());
514 } else {
515 f->Print(" t%d <- ", temp_index());
516 }
517 computation()->PrintTo(f);
518 PrintPropagatedType(f, *this);
519 }
520
521
506 void PushArgumentInstr::PrintTo(BufferFormatter* f) const { 522 void PushArgumentInstr::PrintTo(BufferFormatter* f) const {
507 f->Print(" %s ", DebugName()); 523 f->Print(" %s ", DebugName());
508 value()->PrintTo(f); 524 value()->PrintTo(f);
509 } 525 }
510 526
511 527
512 void ReturnInstr::PrintTo(BufferFormatter* f) const { 528 void ReturnInstr::PrintTo(BufferFormatter* f) const {
513 f->Print(" %s:%d ", DebugName(), deopt_id()); 529 f->Print(" %s:%d ", DebugName(), deopt_id());
514 value()->PrintTo(f); 530 value()->PrintTo(f);
515 } 531 }
(...skipping 15 matching lines...) Expand all
531 } else { 547 } else {
532 f->Print(" "); 548 f->Print(" ");
533 } 549 }
534 f->Print(" goto %d", successor()->block_id()); 550 f->Print(" goto %d", successor()->block_id());
535 } 551 }
536 552
537 553
538 void BranchInstr::PrintTo(BufferFormatter* f) const { 554 void BranchInstr::PrintTo(BufferFormatter* f) const {
539 f->Print(" %s ", DebugName()); 555 f->Print(" %s ", DebugName());
540 f->Print("if "); 556 f->Print("if ");
541 comparison()->PrintTo(f); 557 computation()->PrintTo(f);
542 558
543 f->Print(" goto (%d, %d)", 559 f->Print(" goto (%d, %d)",
544 true_successor()->block_id(), 560 true_successor()->block_id(),
545 false_successor()->block_id()); 561 false_successor()->block_id());
546 } 562 }
547 563
548 564
549 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const { 565 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const {
550 f->Print(" %s ", DebugName()); 566 f->Print(" %s ", DebugName());
551 for (intptr_t i = 0; i < moves_.length(); i++) { 567 for (intptr_t i = 0; i < moves_.length(); i++) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 void TargetEntryInstr::PrintToVisualizer(BufferFormatter* f) const { 742 void TargetEntryInstr::PrintToVisualizer(BufferFormatter* f) const {
727 f->Print("_ [target"); 743 f->Print("_ [target");
728 if (IsCatchEntry()) { 744 if (IsCatchEntry()) {
729 f->Print(" catch %d]", catch_try_index()); 745 f->Print(" catch %d]", catch_try_index());
730 } else { 746 } else {
731 f->Print("]"); 747 f->Print("]");
732 } 748 }
733 } 749 }
734 750
735 751
752 void BindInstr::PrintToVisualizer(BufferFormatter* f) const {
753 if (!is_used()) {
754 f->Print("_ ");
755 } else if (HasSSATemp()) {
756 f->Print("v%d ", ssa_temp_index());
757 } else {
758 f->Print("t%d ", temp_index());
759 }
760 computation()->PrintTo(f);
761 }
762
763
736 void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const { 764 void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const {
737 f->Print("_ %s ", DebugName()); 765 f->Print("_ %s ", DebugName());
738 value()->PrintTo(f); 766 value()->PrintTo(f);
739 } 767 }
740 768
741 769
742 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const { 770 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const {
743 f->Print("_ %s:%d ", DebugName(), deopt_id()); 771 f->Print("_ %s:%d ", DebugName(), deopt_id());
744 value()->PrintTo(f); 772 value()->PrintTo(f);
745 } 773 }
(...skipping 10 matching lines...) Expand all
756 784
757 785
758 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { 786 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const {
759 f->Print("_ goto B%d", successor()->block_id()); 787 f->Print("_ goto B%d", successor()->block_id());
760 } 788 }
761 789
762 790
763 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { 791 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const {
764 f->Print("_ %s ", DebugName()); 792 f->Print("_ %s ", DebugName());
765 f->Print("if "); 793 f->Print("if ");
766 comparison()->PrintTo(f); 794 computation()->PrintTo(f);
767 f->Print(" goto (B%d, B%d)", 795 f->Print(" goto (B%d, B%d)",
768 true_successor()->block_id(), 796 true_successor()->block_id(),
769 false_successor()->block_id()); 797 false_successor()->block_id());
770 } 798 }
771 799
772 800
773 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { 801 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const {
774 UNIMPLEMENTED(); 802 UNIMPLEMENTED();
775 } 803 }
776 804
777 805
778 void Environment::PrintTo(BufferFormatter* f) const { 806 void Environment::PrintTo(BufferFormatter* f) const {
779 f->Print(" env={ "); 807 f->Print(" env={ ");
780 for (intptr_t i = 0; i < values_.length(); ++i) { 808 for (intptr_t i = 0; i < values_.length(); ++i) {
781 if (i > 0) f->Print(", "); 809 if (i > 0) f->Print(", ");
782 values_[i]->PrintTo(f); 810 values_[i]->PrintTo(f);
783 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { 811 if ((locations_ != NULL) && !locations_[i].IsInvalid()) {
784 f->Print(" ["); 812 f->Print(" [");
785 locations_[i].PrintTo(f); 813 locations_[i].PrintTo(f);
786 f->Print("]"); 814 f->Print("]");
787 } 815 }
788 } 816 }
789 f->Print(" }"); 817 f->Print(" }");
790 } 818 }
791 819
792 } // namespace dart 820 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698