| 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 exit()->LinkTo(other_fragment.entry()); | 551 exit()->LinkTo(other_fragment.entry()); |
| 552 } | 552 } |
| 553 exit_ = other_fragment.exit(); | 553 exit_ = other_fragment.exit(); |
| 554 } | 554 } |
| 555 | 555 |
| 556 | 556 |
| 557 Value* EffectGraphVisitor::Bind(Definition* definition) { | 557 Value* EffectGraphVisitor::Bind(Definition* definition) { |
| 558 ASSERT(is_open()); | 558 ASSERT(is_open()); |
| 559 owner()->DeallocateTemps(definition->InputCount()); | 559 owner()->DeallocateTemps(definition->InputCount()); |
| 560 owner()->add_args_pushed(-definition->ArgumentCount()); | 560 owner()->add_args_pushed(-definition->ArgumentCount()); |
| 561 definition->set_use_kind(Definition::kValue); | |
| 562 definition->set_temp_index(owner()->AllocateTemp()); | 561 definition->set_temp_index(owner()->AllocateTemp()); |
| 563 if (is_empty()) { | 562 if (is_empty()) { |
| 564 entry_ = definition; | 563 entry_ = definition; |
| 565 } else { | 564 } else { |
| 566 exit()->LinkTo(definition); | 565 exit()->LinkTo(definition); |
| 567 } | 566 } |
| 568 exit_ = definition; | 567 exit_ = definition; |
| 569 return new Value(definition); | 568 return new Value(definition); |
| 570 } | 569 } |
| 571 | 570 |
| 572 | 571 |
| 573 void EffectGraphVisitor::Do(Definition* definition) { | 572 void EffectGraphVisitor::Do(Definition* definition) { |
| 574 ASSERT(is_open()); | 573 ASSERT(is_open()); |
| 575 owner()->DeallocateTemps(definition->InputCount()); | 574 owner()->DeallocateTemps(definition->InputCount()); |
| 576 owner()->add_args_pushed(-definition->ArgumentCount()); | 575 owner()->add_args_pushed(-definition->ArgumentCount()); |
| 577 definition->set_use_kind(Definition::kEffect); | |
| 578 if (is_empty()) { | 576 if (is_empty()) { |
| 579 entry_ = definition; | 577 entry_ = definition; |
| 580 } else { | 578 } else { |
| 581 exit()->LinkTo(definition); | 579 exit()->LinkTo(definition); |
| 582 } | 580 } |
| 583 exit_ = definition; | 581 exit_ = definition; |
| 584 } | 582 } |
| 585 | 583 |
| 586 | 584 |
| 587 void EffectGraphVisitor::AddInstruction(Instruction* instruction) { | 585 void EffectGraphVisitor::AddInstruction(Instruction* instruction) { |
| (...skipping 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3968 LanguageError::kBailout, | 3966 LanguageError::kBailout, |
| 3969 Heap::kNew, | 3967 Heap::kNew, |
| 3970 "FlowGraphBuilder Bailout: %s %s", | 3968 "FlowGraphBuilder Bailout: %s %s", |
| 3971 String::Handle(function.name()).ToCString(), | 3969 String::Handle(function.name()).ToCString(), |
| 3972 reason)); | 3970 reason)); |
| 3973 Isolate::Current()->long_jump_base()->Jump(1, error); | 3971 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3974 UNREACHABLE(); | 3972 UNREACHABLE(); |
| 3975 } | 3973 } |
| 3976 | 3974 |
| 3977 } // namespace dart | 3975 } // namespace dart |
| OLD | NEW |