| OLD | NEW |
| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 saved_arguments_descriptor()->PrintTo(f); | 299 saved_arguments_descriptor()->PrintTo(f); |
| 300 f->Print(", ?%s @%"Pd"", | 300 f->Print(", ?%s @%"Pd"", |
| 301 formal_parameter_name().ToCString(), | 301 formal_parameter_name().ToCString(), |
| 302 formal_parameter_index()); | 302 formal_parameter_index()); |
| 303 } | 303 } |
| 304 | 304 |
| 305 | 305 |
| 306 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 306 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 307 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 307 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 308 if (i > 0) f->Print(", "); | 308 if (i > 0) f->Print(", "); |
| 309 ArgumentAt(i)->value()->PrintTo(f); | 309 PushArgumentAt(i)->value()->PrintTo(f); |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 | 312 |
| 313 | 313 |
| 314 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 314 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 315 f->Print("%s", function_name().ToCString()); | 315 f->Print("%s", function_name().ToCString()); |
| 316 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 316 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 317 f->Print(", "); | 317 f->Print(", "); |
| 318 ArgumentAt(i)->value()->PrintTo(f); | 318 PushArgumentAt(i)->value()->PrintTo(f); |
| 319 } | 319 } |
| 320 if (HasICData()) { | 320 if (HasICData()) { |
| 321 PrintICData(f, *ic_data()); | 321 PrintICData(f, *ic_data()); |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 | 325 |
| 326 void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 326 void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 327 f->Print("%s", instance_call()->function_name().ToCString()); | 327 f->Print("%s", instance_call()->function_name().ToCString()); |
| 328 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 328 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 329 f->Print(", "); | 329 f->Print(", "); |
| 330 ArgumentAt(i)->value()->PrintTo(f); | 330 PushArgumentAt(i)->value()->PrintTo(f); |
| 331 } | 331 } |
| 332 PrintICData(f, ic_data()); | 332 PrintICData(f, ic_data()); |
| 333 } | 333 } |
| 334 | 334 |
| 335 | 335 |
| 336 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const { | 336 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 337 f->Print("%s, ", Token::Str(kind())); | 337 f->Print("%s, ", Token::Str(kind())); |
| 338 left()->PrintTo(f); | 338 left()->PrintTo(f); |
| 339 f->Print(", "); | 339 f->Print(", "); |
| 340 right()->PrintTo(f); | 340 right()->PrintTo(f); |
| 341 } | 341 } |
| 342 | 342 |
| 343 | 343 |
| 344 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const { | 344 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 345 left()->PrintTo(f); | 345 left()->PrintTo(f); |
| 346 f->Print(" %s ", Token::Str(kind())); | 346 f->Print(" %s ", Token::Str(kind())); |
| 347 right()->PrintTo(f); | 347 right()->PrintTo(f); |
| 348 if (HasICData()) { | 348 if (HasICData()) { |
| 349 PrintICData(f, *ic_data()); | 349 PrintICData(f, *ic_data()); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 | 352 |
| 353 | 353 |
| 354 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 354 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 355 f->Print("%s ", String::Handle(function().name()).ToCString()); | 355 f->Print("%s ", String::Handle(function().name()).ToCString()); |
| 356 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 356 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 357 if (i > 0) f->Print(", "); | 357 if (i > 0) f->Print(", "); |
| 358 ArgumentAt(i)->value()->PrintTo(f); | 358 PushArgumentAt(i)->value()->PrintTo(f); |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 | 361 |
| 362 | 362 |
| 363 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const { | 363 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 364 f->Print("%s lvl:%"Pd"", local().name().ToCString(), context_level()); | 364 f->Print("%s lvl:%"Pd"", local().name().ToCString(), context_level()); |
| 365 } | 365 } |
| 366 | 366 |
| 367 | 367 |
| 368 void StoreLocalInstr::PrintOperandsTo(BufferFormatter* f) const { | 368 void StoreLocalInstr::PrintOperandsTo(BufferFormatter* f) const { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 if (HasICData()) { | 420 if (HasICData()) { |
| 421 PrintICData(f, *ic_data()); | 421 PrintICData(f, *ic_data()); |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const { | 426 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 427 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); | 427 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); |
| 428 for (intptr_t i = 0; i < ArgumentCount(); i++) { | 428 for (intptr_t i = 0; i < ArgumentCount(); i++) { |
| 429 f->Print(", "); | 429 f->Print(", "); |
| 430 ArgumentAt(i)->value()->PrintTo(f); | 430 PushArgumentAt(i)->value()->PrintTo(f); |
| 431 } | 431 } |
| 432 } | 432 } |
| 433 | 433 |
| 434 | 434 |
| 435 void AllocateObjectWithBoundsCheckInstr::PrintOperandsTo( | 435 void AllocateObjectWithBoundsCheckInstr::PrintOperandsTo( |
| 436 BufferFormatter* f) const { | 436 BufferFormatter* f) const { |
| 437 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); | 437 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); |
| 438 for (intptr_t i = 0; i < InputCount(); i++) { | 438 for (intptr_t i = 0; i < InputCount(); i++) { |
| 439 f->Print(", "); | 439 f->Print(", "); |
| 440 InputAt(i)->PrintTo(f); | 440 InputAt(i)->PrintTo(f); |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 | 444 |
| 445 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { | 445 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 446 for (int i = 0; i < ArgumentCount(); ++i) { | 446 for (int i = 0; i < ArgumentCount(); ++i) { |
| 447 if (i != 0) f->Print(", "); | 447 if (i != 0) f->Print(", "); |
| 448 ArgumentAt(i)->value()->PrintTo(f); | 448 PushArgumentAt(i)->value()->PrintTo(f); |
| 449 } | 449 } |
| 450 if (ArgumentCount() > 0) f->Print(", "); | 450 if (ArgumentCount() > 0) f->Print(", "); |
| 451 element_type()->PrintTo(f); | 451 element_type()->PrintTo(f); |
| 452 } | 452 } |
| 453 | 453 |
| 454 | 454 |
| 455 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const { | 455 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 456 f->Print("%s", function().ToCString()); | 456 f->Print("%s", function().ToCString()); |
| 457 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 457 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 458 if (i > 0) f->Print(", "); | 458 if (i > 0) f->Print(", "); |
| 459 ArgumentAt(i)->value()->PrintTo(f); | 459 PushArgumentAt(i)->value()->PrintTo(f); |
| 460 } | 460 } |
| 461 } | 461 } |
| 462 | 462 |
| 463 | 463 |
| 464 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 464 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 465 value()->PrintTo(f); | 465 value()->PrintTo(f); |
| 466 f->Print(", %"Pd", immutable=%d", offset_in_bytes(), immutable_); | 466 f->Print(", %"Pd", immutable=%d", offset_in_bytes(), immutable_); |
| 467 } | 467 } |
| 468 | 468 |
| 469 | 469 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 f->Print(" ["); | 689 f->Print(" ["); |
| 690 locations_[i].PrintTo(f); | 690 locations_[i].PrintTo(f); |
| 691 f->Print("]"); | 691 f->Print("]"); |
| 692 } | 692 } |
| 693 } | 693 } |
| 694 f->Print(" }"); | 694 f->Print(" }"); |
| 695 if (outer_ != NULL) outer_->PrintTo(f); | 695 if (outer_ != NULL) outer_->PrintTo(f); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace dart | 698 } // namespace dart |
| OLD | NEW |