Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 char str[1000]; | 76 char str[1000]; |
| 77 BufferFormatter f(str, sizeof(str)); | 77 BufferFormatter f(str, sizeof(str)); |
| 78 instr->PrintTo(&f); | 78 instr->PrintTo(&f); |
| 79 if (FLAG_print_environments && (instr->env() != NULL)) { | 79 if (FLAG_print_environments && (instr->env() != NULL)) { |
| 80 instr->env()->PrintTo(&f); | 80 instr->env()->PrintTo(&f); |
| 81 } | 81 } |
| 82 if (print_locations && (instr->locs() != NULL)) { | 82 if (print_locations && (instr->locs() != NULL)) { |
| 83 instr->locs()->PrintTo(&f); | 83 instr->locs()->PrintTo(&f); |
| 84 } | 84 } |
| 85 if (instr->lifetime_position() != -1) { | 85 if (instr->lifetime_position() != -1) { |
| 86 OS::Print("%3"Pd": ", instr->lifetime_position()); | 86 OS::Print("%3" Pd ": ", instr->lifetime_position()); |
| 87 } | 87 } |
| 88 if (!instr->IsBlockEntry()) OS::Print(" "); | 88 if (!instr->IsBlockEntry()) OS::Print(" "); |
| 89 OS::Print("%s", str); | 89 OS::Print("%s", str); |
| 90 } | 90 } |
| 91 | 91 |
| 92 | 92 |
| 93 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, | 93 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, |
| 94 intptr_t token_pos, | 94 intptr_t token_pos, |
| 95 Value* value, | 95 Value* value, |
| 96 const AbstractType& dst_type, | 96 const AbstractType& dst_type, |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 126 | 126 |
| 127 const char* CompileType::ToCString() const { | 127 const char* CompileType::ToCString() const { |
| 128 char buffer[1024]; | 128 char buffer[1024]; |
| 129 BufferFormatter f(buffer, sizeof(buffer)); | 129 BufferFormatter f(buffer, sizeof(buffer)); |
| 130 PrintTo(&f); | 130 PrintTo(&f); |
| 131 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 131 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 132 } | 132 } |
| 133 | 133 |
| 134 | 134 |
| 135 static void PrintICData(BufferFormatter* f, const ICData& ic_data) { | 135 static void PrintICData(BufferFormatter* f, const ICData& ic_data) { |
| 136 f->Print(" IC[%"Pd": ", ic_data.NumberOfChecks()); | 136 f->Print(" IC[%" Pd ": ", ic_data.NumberOfChecks()); |
| 137 Function& target = Function::Handle(); | 137 Function& target = Function::Handle(); |
| 138 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { | 138 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { |
| 139 GrowableArray<intptr_t> class_ids; | 139 GrowableArray<intptr_t> class_ids; |
| 140 ic_data.GetCheckAt(i, &class_ids, &target); | 140 ic_data.GetCheckAt(i, &class_ids, &target); |
| 141 const intptr_t count = ic_data.GetCountAt(i); | 141 const intptr_t count = ic_data.GetCountAt(i); |
| 142 if (i > 0) { | 142 if (i > 0) { |
| 143 f->Print(" | "); | 143 f->Print(" | "); |
| 144 } | 144 } |
| 145 for (intptr_t k = 0; k < class_ids.length(); k++) { | 145 for (intptr_t k = 0; k < class_ids.length(); k++) { |
| 146 if (k > 0) { | 146 if (k > 0) { |
| 147 f->Print(", "); | 147 f->Print(", "); |
| 148 } | 148 } |
| 149 const Class& cls = | 149 const Class& cls = |
| 150 Class::Handle(Isolate::Current()->class_table()->At(class_ids[k])); | 150 Class::Handle(Isolate::Current()->class_table()->At(class_ids[k])); |
| 151 f->Print("%s", String::Handle(cls.Name()).ToCString()); | 151 f->Print("%s", String::Handle(cls.Name()).ToCString()); |
| 152 } | 152 } |
| 153 if (count > 0) { | 153 if (count > 0) { |
| 154 f->Print(" #%"Pd, count); | 154 f->Print(" #%" Pd, count); |
| 155 } | 155 } |
| 156 f->Print(" <%p>", static_cast<void*>(target.raw())); | 156 f->Print(" <%p>", static_cast<void*>(target.raw())); |
| 157 } | 157 } |
| 158 f->Print("]"); | 158 f->Print("]"); |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 static void PrintUse(BufferFormatter* f, const Definition& definition) { | 162 static void PrintUse(BufferFormatter* f, const Definition& definition) { |
| 163 if (definition.is_used()) { | 163 if (definition.is_used()) { |
| 164 if (definition.HasSSATemp()) { | 164 if (definition.HasSSATemp()) { |
| 165 f->Print("v%"Pd, definition.ssa_temp_index()); | 165 f->Print("v%" Pd, definition.ssa_temp_index()); |
| 166 } else if (definition.temp_index() != -1) { | 166 } else if (definition.temp_index() != -1) { |
| 167 f->Print("t%"Pd, definition.temp_index()); | 167 f->Print("t%" Pd, definition.temp_index()); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 | 172 |
| 173 const char* Instruction::ToCString() const { | 173 const char* Instruction::ToCString() const { |
| 174 char buffer[1024]; | 174 char buffer[1024]; |
| 175 BufferFormatter f(buffer, sizeof(buffer)); | 175 BufferFormatter f(buffer, sizeof(buffer)); |
| 176 PrintTo(&f); | 176 PrintTo(&f); |
| 177 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 177 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 178 } | 178 } |
| 179 | 179 |
| 180 | 180 |
| 181 void Instruction::PrintTo(BufferFormatter* f) const { | 181 void Instruction::PrintTo(BufferFormatter* f) const { |
| 182 if (GetDeoptId() != Isolate::kNoDeoptId) { | 182 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 183 f->Print("%s:%"Pd"(", DebugName(), GetDeoptId()); | 183 f->Print("%s:%" Pd "(", DebugName(), GetDeoptId()); |
| 184 } else { | 184 } else { |
| 185 f->Print("%s(", DebugName()); | 185 f->Print("%s(", DebugName()); |
| 186 } | 186 } |
| 187 PrintOperandsTo(f); | 187 PrintOperandsTo(f); |
| 188 f->Print(")"); | 188 f->Print(")"); |
| 189 } | 189 } |
| 190 | 190 |
| 191 | 191 |
| 192 void Instruction::PrintOperandsTo(BufferFormatter* f) const { | 192 void Instruction::PrintOperandsTo(BufferFormatter* f) const { |
| 193 for (int i = 0; i < InputCount(); ++i) { | 193 for (int i = 0; i < InputCount(); ++i) { |
| 194 if (i > 0) f->Print(", "); | 194 if (i > 0) f->Print(", "); |
| 195 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); | 195 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 | 199 |
| 200 void Definition::PrintTo(BufferFormatter* f) const { | 200 void Definition::PrintTo(BufferFormatter* f) const { |
| 201 PrintUse(f, *this); | 201 PrintUse(f, *this); |
| 202 if (is_used()) { | 202 if (is_used()) { |
| 203 if (HasSSATemp() || (temp_index() != -1)) f->Print(" <- "); | 203 if (HasSSATemp() || (temp_index() != -1)) f->Print(" <- "); |
| 204 } | 204 } |
| 205 if (GetDeoptId() != Isolate::kNoDeoptId) { | 205 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 206 f->Print("%s:%"Pd"(", DebugName(), GetDeoptId()); | 206 f->Print("%s:%" Pd "(", DebugName(), GetDeoptId()); |
| 207 } else { | 207 } else { |
| 208 f->Print("%s(", DebugName()); | 208 f->Print("%s(", DebugName()); |
| 209 } | 209 } |
| 210 PrintOperandsTo(f); | 210 PrintOperandsTo(f); |
| 211 f->Print(")"); | 211 f->Print(")"); |
| 212 if (range_ != NULL) { | 212 if (range_ != NULL) { |
| 213 f->Print(" "); | 213 f->Print(" "); |
| 214 range_->PrintTo(f); | 214 range_->PrintTo(f); |
| 215 } | 215 } |
| 216 | 216 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 char buffer[256]; | 276 char buffer[256]; |
| 277 BufferFormatter f(buffer, sizeof(buffer)); | 277 BufferFormatter f(buffer, sizeof(buffer)); |
| 278 range->PrintTo(&f); | 278 range->PrintTo(&f); |
| 279 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 279 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 280 } | 280 } |
| 281 | 281 |
| 282 | 282 |
| 283 void RangeBoundary::PrintTo(BufferFormatter* f) const { | 283 void RangeBoundary::PrintTo(BufferFormatter* f) const { |
| 284 switch (kind_) { | 284 switch (kind_) { |
| 285 case kSymbol: | 285 case kSymbol: |
| 286 f->Print("v%"Pd, reinterpret_cast<Definition*>(value_)->ssa_temp_index()); | 286 f->Print("v%" Pd, reinterpret_cast<Definition*>(value_)->ssa_temp_index()) ; |
|
siva
2013/08/20 19:54:51
f->Print("v%" Pd,
reinterpret_cast<Defini
Jacob
2013/08/20 20:32:15
Done.
| |
| 287 if (offset_ != 0) f->Print("%+"Pd, offset_); | 287 if (offset_ != 0) f->Print("%+" Pd, offset_); |
| 288 break; | 288 break; |
| 289 case kConstant: | 289 case kConstant: |
| 290 if (value_ == kMinusInfinity) { | 290 if (value_ == kMinusInfinity) { |
| 291 f->Print("-inf"); | 291 f->Print("-inf"); |
| 292 } else if (value_ == kPlusInfinity) { | 292 } else if (value_ == kPlusInfinity) { |
| 293 f->Print("+inf"); | 293 f->Print("+inf"); |
| 294 } else { | 294 } else { |
| 295 f->Print("%"Pd, value_); | 295 f->Print("%" Pd, value_); |
| 296 } | 296 } |
| 297 break; | 297 break; |
| 298 case kUnknown: | 298 case kUnknown: |
| 299 f->Print("_|_"); | 299 f->Print("_|_"); |
| 300 break; | 300 break; |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 | 304 |
| 305 const char* RangeBoundary::ToCString() const { | 305 const char* RangeBoundary::ToCString() const { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 | 412 |
| 413 f->Print("%s [%s %s], ", | 413 f->Print("%s [%s %s], ", |
| 414 String::Handle(field().name()).ToCString(), | 414 String::Handle(field().name()).ToCString(), |
| 415 field().is_nullable() ? "nullable" : "non-nullable", | 415 field().is_nullable() ? "nullable" : "non-nullable", |
| 416 expected); | 416 expected); |
| 417 value()->PrintTo(f); | 417 value()->PrintTo(f); |
| 418 } | 418 } |
| 419 | 419 |
| 420 | 420 |
| 421 void StoreInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 421 void StoreInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 422 f->Print("%s {%"Pd"}, ", | 422 f->Print("%s {%" Pd "}, ", |
| 423 String::Handle(field().name()).ToCString(), | 423 String::Handle(field().name()).ToCString(), |
| 424 field().Offset()); | 424 field().Offset()); |
| 425 instance()->PrintTo(f); | 425 instance()->PrintTo(f); |
| 426 f->Print(", "); | 426 f->Print(", "); |
| 427 value()->PrintTo(f); | 427 value()->PrintTo(f); |
| 428 } | 428 } |
| 429 | 429 |
| 430 | 430 |
| 431 void IfThenElseInstr::PrintOperandsTo(BufferFormatter* f) const { | 431 void IfThenElseInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 432 left()->PrintTo(f); | 432 left()->PrintTo(f); |
| 433 f->Print(" %s ", Token::Str(kind_)); | 433 f->Print(" %s ", Token::Str(kind_)); |
| 434 right()->PrintTo(f); | 434 right()->PrintTo(f); |
| 435 f->Print(" ? %"Pd" : %"Pd, | 435 f->Print(" ? %" Pd " : %" Pd, |
| 436 if_true_, | 436 if_true_, |
| 437 if_false_); | 437 if_false_); |
| 438 } | 438 } |
| 439 | 439 |
| 440 | 440 |
| 441 void LoadStaticFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 441 void LoadStaticFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 442 field_value()->PrintTo(f); | 442 field_value()->PrintTo(f); |
| 443 } | 443 } |
| 444 | 444 |
| 445 | 445 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 f->Print("%s", function().ToCString()); | 517 f->Print("%s", function().ToCString()); |
| 518 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 518 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 519 if (i > 0) f->Print(", "); | 519 if (i > 0) f->Print(", "); |
| 520 PushArgumentAt(i)->value()->PrintTo(f); | 520 PushArgumentAt(i)->value()->PrintTo(f); |
| 521 } | 521 } |
| 522 } | 522 } |
| 523 | 523 |
| 524 | 524 |
| 525 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 525 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 526 instance()->PrintTo(f); | 526 instance()->PrintTo(f); |
| 527 f->Print(", %"Pd, offset_in_bytes()); | 527 f->Print(", %" Pd, offset_in_bytes()); |
| 528 | 528 |
| 529 if (field() != NULL) { | 529 if (field() != NULL) { |
| 530 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); | 530 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); |
| 531 const char* expected = "?"; | 531 const char* expected = "?"; |
| 532 if (field()->guarded_cid() != kIllegalCid) { | 532 if (field()->guarded_cid() != kIllegalCid) { |
| 533 const Class& cls = Class::Handle( | 533 const Class& cls = Class::Handle( |
| 534 Isolate::Current()->class_table()->At(field()->guarded_cid())); | 534 Isolate::Current()->class_table()->At(field()->guarded_cid())); |
| 535 expected = String::Handle(cls.Name()).ToCString(); | 535 expected = String::Handle(cls.Name()).ToCString(); |
| 536 } | 536 } |
| 537 | 537 |
| 538 f->Print(" [%s %s]", | 538 f->Print(" [%s %s]", |
| 539 field()->is_nullable() ? "nullable" : "non-nullable", | 539 field()->is_nullable() ? "nullable" : "non-nullable", |
| 540 expected); | 540 expected); |
| 541 } | 541 } |
| 542 | 542 |
| 543 f->Print(", immutable=%d", immutable_); | 543 f->Print(", immutable=%d", immutable_); |
| 544 } | 544 } |
| 545 | 545 |
| 546 | 546 |
| 547 void StoreVMFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 547 void StoreVMFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 548 dest()->PrintTo(f); | 548 dest()->PrintTo(f); |
| 549 f->Print(", %"Pd", ", offset_in_bytes()); | 549 f->Print(", %" Pd ", ", offset_in_bytes()); |
| 550 value()->PrintTo(f); | 550 value()->PrintTo(f); |
| 551 } | 551 } |
| 552 | 552 |
| 553 | 553 |
| 554 void InstantiateTypeInstr::PrintOperandsTo(BufferFormatter* f) const { | 554 void InstantiateTypeInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 555 const String& type_name = String::Handle(type().Name()); | 555 const String& type_name = String::Handle(type().Name()); |
| 556 f->Print("%s, ", type_name.ToCString()); | 556 f->Print("%s, ", type_name.ToCString()); |
| 557 instantiator()->PrintTo(f); | 557 instantiator()->PrintTo(f); |
| 558 } | 558 } |
| 559 | 559 |
| 560 | 560 |
| 561 void InstantiateTypeArgumentsInstr::PrintOperandsTo(BufferFormatter* f) const { | 561 void InstantiateTypeArgumentsInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 562 const String& type_args = String::Handle(type_arguments().Name()); | 562 const String& type_args = String::Handle(type_arguments().Name()); |
| 563 f->Print("%s, ", type_args.ToCString()); | 563 f->Print("%s, ", type_args.ToCString()); |
| 564 instantiator()->PrintTo(f); | 564 instantiator()->PrintTo(f); |
| 565 } | 565 } |
| 566 | 566 |
| 567 | 567 |
| 568 void ExtractConstructorTypeArgumentsInstr::PrintOperandsTo( | 568 void ExtractConstructorTypeArgumentsInstr::PrintOperandsTo( |
| 569 BufferFormatter* f) const { | 569 BufferFormatter* f) const { |
| 570 const String& type_args = String::Handle(type_arguments().Name()); | 570 const String& type_args = String::Handle(type_arguments().Name()); |
| 571 f->Print("%s, ", type_args.ToCString()); | 571 f->Print("%s, ", type_args.ToCString()); |
| 572 instantiator()->PrintTo(f); | 572 instantiator()->PrintTo(f); |
| 573 } | 573 } |
| 574 | 574 |
| 575 | 575 |
| 576 void AllocateContextInstr::PrintOperandsTo(BufferFormatter* f) const { | 576 void AllocateContextInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 577 f->Print("%"Pd"", num_context_variables()); | 577 f->Print("%" Pd "", num_context_variables()); |
| 578 } | 578 } |
| 579 | 579 |
| 580 | 580 |
| 581 void BinarySmiOpInstr::PrintTo(BufferFormatter* f) const { | 581 void BinarySmiOpInstr::PrintTo(BufferFormatter* f) const { |
| 582 Definition::PrintTo(f); | 582 Definition::PrintTo(f); |
| 583 f->Print(" %co", overflow_ ? '+' : '-'); | 583 f->Print(" %co", overflow_ ? '+' : '-'); |
| 584 f->Print(" %ct", is_truncating() ? '+' : '-'); | 584 f->Print(" %ct", is_truncating() ? '+' : '-'); |
| 585 } | 585 } |
| 586 | 586 |
| 587 | 587 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 799 | 799 |
| 800 | 800 |
| 801 void InvokeMathCFunctionInstr::PrintOperandsTo(BufferFormatter* f) const { | 801 void InvokeMathCFunctionInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 802 f->Print("%s, ", MethodRecognizer::KindToCString(recognized_kind_)); | 802 f->Print("%s, ", MethodRecognizer::KindToCString(recognized_kind_)); |
| 803 Definition::PrintOperandsTo(f); | 803 Definition::PrintOperandsTo(f); |
| 804 } | 804 } |
| 805 | 805 |
| 806 | 806 |
| 807 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { | 807 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { |
| 808 const GrowableArray<Definition*>& defns = initial_definitions_; | 808 const GrowableArray<Definition*>& defns = initial_definitions_; |
| 809 f->Print("B%"Pd"[graph]:%"Pd, block_id(), GetDeoptId()); | 809 f->Print("B%" Pd "[graph]:%" Pd, block_id(), GetDeoptId()); |
| 810 if (defns.length() > 0) { | 810 if (defns.length() > 0) { |
| 811 f->Print(" {"); | 811 f->Print(" {"); |
| 812 for (intptr_t i = 0; i < defns.length(); ++i) { | 812 for (intptr_t i = 0; i < defns.length(); ++i) { |
| 813 Definition* def = defns[i]; | 813 Definition* def = defns[i]; |
| 814 f->Print("\n "); | 814 f->Print("\n "); |
| 815 def->PrintTo(f); | 815 def->PrintTo(f); |
| 816 } | 816 } |
| 817 f->Print("\n}"); | 817 f->Print("\n}"); |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 | 820 |
| 821 | 821 |
| 822 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { | 822 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { |
| 823 if (try_index() != CatchClauseNode::kInvalidTryIndex) { | 823 if (try_index() != CatchClauseNode::kInvalidTryIndex) { |
| 824 f->Print("B%"Pd"[join try_idx %"Pd"]:%"Pd" pred(", | 824 f->Print("B%" Pd "[join try_idx %" Pd "]:%" Pd " pred(", |
| 825 block_id(), try_index(), GetDeoptId()); | 825 block_id(), try_index(), GetDeoptId()); |
| 826 } else { | 826 } else { |
| 827 f->Print("B%"Pd"[join]:%"Pd" pred(", block_id(), GetDeoptId()); | 827 f->Print("B%" Pd "[join]:%" Pd " pred(", block_id(), GetDeoptId()); |
| 828 } | 828 } |
| 829 for (intptr_t i = 0; i < predecessors_.length(); ++i) { | 829 for (intptr_t i = 0; i < predecessors_.length(); ++i) { |
| 830 if (i > 0) f->Print(", "); | 830 if (i > 0) f->Print(", "); |
| 831 f->Print("B%"Pd, predecessors_[i]->block_id()); | 831 f->Print("B%" Pd, predecessors_[i]->block_id()); |
| 832 } | 832 } |
| 833 f->Print(")"); | 833 f->Print(")"); |
| 834 if (phis_ != NULL) { | 834 if (phis_ != NULL) { |
| 835 f->Print(" {"); | 835 f->Print(" {"); |
| 836 for (intptr_t i = 0; i < phis_->length(); ++i) { | 836 for (intptr_t i = 0; i < phis_->length(); ++i) { |
| 837 if ((*phis_)[i] == NULL) continue; | 837 if ((*phis_)[i] == NULL) continue; |
| 838 f->Print("\n "); | 838 f->Print("\n "); |
| 839 (*phis_)[i]->PrintTo(f); | 839 (*phis_)[i]->PrintTo(f); |
| 840 } | 840 } |
| 841 f->Print("\n}"); | 841 f->Print("\n}"); |
| 842 } | 842 } |
| 843 if (HasParallelMove()) { | 843 if (HasParallelMove()) { |
| 844 f->Print(" "); | 844 f->Print(" "); |
| 845 parallel_move()->PrintTo(f); | 845 parallel_move()->PrintTo(f); |
| 846 } | 846 } |
| 847 } | 847 } |
| 848 | 848 |
| 849 | 849 |
| 850 void PhiInstr::PrintTo(BufferFormatter* f) const { | 850 void PhiInstr::PrintTo(BufferFormatter* f) const { |
| 851 f->Print("v%"Pd" <- phi(", ssa_temp_index()); | 851 f->Print("v%" Pd " <- phi(", ssa_temp_index()); |
| 852 for (intptr_t i = 0; i < inputs_.length(); ++i) { | 852 for (intptr_t i = 0; i < inputs_.length(); ++i) { |
| 853 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); | 853 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); |
| 854 if (i < inputs_.length() - 1) f->Print(", "); | 854 if (i < inputs_.length() - 1) f->Print(", "); |
| 855 } | 855 } |
| 856 f->Print(")"); | 856 f->Print(")"); |
| 857 if (is_alive()) { | 857 if (is_alive()) { |
| 858 f->Print(" alive"); | 858 f->Print(" alive"); |
| 859 } else { | 859 } else { |
| 860 f->Print(" dead"); | 860 f->Print(" dead"); |
| 861 } | 861 } |
| 862 if (range_ != NULL) { | 862 if (range_ != NULL) { |
| 863 f->Print(" "); | 863 f->Print(" "); |
| 864 range_->PrintTo(f); | 864 range_->PrintTo(f); |
| 865 } | 865 } |
| 866 if (type_ != NULL) { | 866 if (type_ != NULL) { |
| 867 f->Print(" "); | 867 f->Print(" "); |
| 868 type_->PrintTo(f); | 868 type_->PrintTo(f); |
| 869 } | 869 } |
| 870 } | 870 } |
| 871 | 871 |
| 872 | 872 |
| 873 void ParameterInstr::PrintOperandsTo(BufferFormatter* f) const { | 873 void ParameterInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 874 f->Print("%"Pd, index()); | 874 f->Print("%" Pd, index()); |
| 875 } | 875 } |
| 876 | 876 |
| 877 | 877 |
| 878 void CheckStackOverflowInstr::PrintOperandsTo(BufferFormatter* f) const { | 878 void CheckStackOverflowInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 879 if (in_loop()) f->Print("depth %"Pd, loop_depth()); | 879 if (in_loop()) f->Print("depth %" Pd, loop_depth()); |
| 880 } | 880 } |
| 881 | 881 |
| 882 | 882 |
| 883 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { | 883 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { |
| 884 if (try_index() != CatchClauseNode::kInvalidTryIndex) { | 884 if (try_index() != CatchClauseNode::kInvalidTryIndex) { |
| 885 f->Print("B%"Pd"[target try_idx %"Pd"]:%"Pd, | 885 f->Print("B%" Pd "[target try_idx %" Pd "]:%" Pd, |
| 886 block_id(), try_index(), GetDeoptId()); | 886 block_id(), try_index(), GetDeoptId()); |
| 887 } else { | 887 } else { |
| 888 f->Print("B%"Pd"[target]:%"Pd, block_id(), GetDeoptId()); | 888 f->Print("B%" Pd "[target]:%" Pd, block_id(), GetDeoptId()); |
| 889 } | 889 } |
| 890 if (HasParallelMove()) { | 890 if (HasParallelMove()) { |
| 891 f->Print(" "); | 891 f->Print(" "); |
| 892 parallel_move()->PrintTo(f); | 892 parallel_move()->PrintTo(f); |
| 893 } | 893 } |
| 894 } | 894 } |
| 895 | 895 |
| 896 | 896 |
| 897 void CatchBlockEntryInstr::PrintTo(BufferFormatter* f) const { | 897 void CatchBlockEntryInstr::PrintTo(BufferFormatter* f) const { |
| 898 f->Print("B%"Pd"[target catch try_idx %"Pd" catch_try_idx %"Pd"]", | 898 f->Print("B%" Pd "[target catch try_idx %" Pd " catch_try_idx %" Pd "]", |
| 899 block_id(), try_index(), catch_try_index()); | 899 block_id(), try_index(), catch_try_index()); |
| 900 if (HasParallelMove()) { | 900 if (HasParallelMove()) { |
| 901 f->Print("\n"); | 901 f->Print("\n"); |
| 902 parallel_move()->PrintTo(f); | 902 parallel_move()->PrintTo(f); |
| 903 } | 903 } |
| 904 | 904 |
| 905 const GrowableArray<Definition*>& defns = initial_definitions_; | 905 const GrowableArray<Definition*>& defns = initial_definitions_; |
| 906 if (defns.length() > 0) { | 906 if (defns.length() > 0) { |
| 907 f->Print(" {"); | 907 f->Print(" {"); |
| 908 for (intptr_t i = 0; i < defns.length(); ++i) { | 908 for (intptr_t i = 0; i < defns.length(); ++i) { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 919 value()->PrintTo(f); | 919 value()->PrintTo(f); |
| 920 } | 920 } |
| 921 | 921 |
| 922 | 922 |
| 923 void GotoInstr::PrintTo(BufferFormatter* f) const { | 923 void GotoInstr::PrintTo(BufferFormatter* f) const { |
| 924 if (HasParallelMove()) { | 924 if (HasParallelMove()) { |
| 925 parallel_move()->PrintTo(f); | 925 parallel_move()->PrintTo(f); |
| 926 f->Print(" "); | 926 f->Print(" "); |
| 927 } | 927 } |
| 928 if (GetDeoptId() != Isolate::kNoDeoptId) { | 928 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 929 f->Print("goto:%"Pd" %"Pd"", GetDeoptId(), successor()->block_id()); | 929 f->Print("goto:%" Pd " %" Pd "", GetDeoptId(), successor()->block_id()); |
| 930 } else { | 930 } else { |
| 931 f->Print("goto: %"Pd"", successor()->block_id()); | 931 f->Print("goto: %" Pd "", successor()->block_id()); |
| 932 } | 932 } |
| 933 } | 933 } |
| 934 | 934 |
| 935 | 935 |
| 936 void BranchInstr::PrintTo(BufferFormatter* f) const { | 936 void BranchInstr::PrintTo(BufferFormatter* f) const { |
| 937 f->Print("%s ", DebugName()); | 937 f->Print("%s ", DebugName()); |
| 938 f->Print("if "); | 938 f->Print("if "); |
| 939 comparison()->PrintTo(f); | 939 comparison()->PrintTo(f); |
| 940 | 940 |
| 941 f->Print(" goto (%"Pd", %"Pd")", | 941 f->Print(" goto (%" Pd ", %" Pd ")", |
| 942 true_successor()->block_id(), | 942 true_successor()->block_id(), |
| 943 false_successor()->block_id()); | 943 false_successor()->block_id()); |
| 944 } | 944 } |
| 945 | 945 |
| 946 | 946 |
| 947 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const { | 947 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const { |
| 948 f->Print("%s ", DebugName()); | 948 f->Print("%s ", DebugName()); |
| 949 for (intptr_t i = 0; i < moves_.length(); i++) { | 949 for (intptr_t i = 0; i < moves_.length(); i++) { |
| 950 if (i != 0) f->Print(", "); | 950 if (i != 0) f->Print(", "); |
| 951 moves_[i]->dest().PrintTo(f); | 951 moves_[i]->dest().PrintTo(f); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 969 f->Print(" ["); | 969 f->Print(" ["); |
| 970 locations_[i].PrintTo(f); | 970 locations_[i].PrintTo(f); |
| 971 f->Print("]"); | 971 f->Print("]"); |
| 972 } | 972 } |
| 973 } | 973 } |
| 974 f->Print(" }"); | 974 f->Print(" }"); |
| 975 if (outer_ != NULL) outer_->PrintTo(f); | 975 if (outer_ != NULL) outer_->PrintTo(f); |
| 976 } | 976 } |
| 977 | 977 |
| 978 } // namespace dart | 978 } // namespace dart |
| OLD | NEW |