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/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2763 BuildClosureCall(node, false); | 2763 BuildClosureCall(node, false); |
2764 } | 2764 } |
2765 | 2765 |
2766 | 2766 |
2767 void ValueGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) { | 2767 void ValueGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) { |
2768 BuildClosureCall(node, true); | 2768 BuildClosureCall(node, true); |
2769 } | 2769 } |
2770 | 2770 |
2771 | 2771 |
2772 void EffectGraphVisitor::VisitInitStaticFieldNode(InitStaticFieldNode* node) { | 2772 void EffectGraphVisitor::VisitInitStaticFieldNode(InitStaticFieldNode* node) { |
2773 Value* field = Bind(new(Z) ConstantInstr(node->field())); | 2773 Value* field = Bind(new(Z) ConstantInstr( |
| 2774 Field::ZoneHandle(Z, node->field().Original()))); |
2774 AddInstruction(new(Z) InitStaticFieldInstr(field, node->field())); | 2775 AddInstruction(new(Z) InitStaticFieldInstr(field, node->field())); |
2775 } | 2776 } |
2776 | 2777 |
2777 | 2778 |
2778 void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) { | 2779 void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) { |
2779 Value* context = Bind(BuildCurrentContext(node->token_pos())); | 2780 Value* context = Bind(BuildCurrentContext(node->token_pos())); |
2780 Value* clone = Bind(new(Z) CloneContextInstr(node->token_pos(), context)); | 2781 Value* clone = Bind(new(Z) CloneContextInstr(node->token_pos(), context)); |
2781 Do(BuildStoreContext(clone, node->token_pos())); | 2782 Do(BuildStoreContext(clone, node->token_pos())); |
2782 } | 2783 } |
2783 | 2784 |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3726 void EffectGraphVisitor::VisitLoadStaticFieldNode(LoadStaticFieldNode* node) { | 3727 void EffectGraphVisitor::VisitLoadStaticFieldNode(LoadStaticFieldNode* node) { |
3727 const TokenPosition token_pos = node->token_pos(); | 3728 const TokenPosition token_pos = node->token_pos(); |
3728 if (node->field().is_const()) { | 3729 if (node->field().is_const()) { |
3729 ASSERT(node->field().StaticValue() != Object::sentinel().raw()); | 3730 ASSERT(node->field().StaticValue() != Object::sentinel().raw()); |
3730 ASSERT(node->field().StaticValue() != | 3731 ASSERT(node->field().StaticValue() != |
3731 Object::transition_sentinel().raw()); | 3732 Object::transition_sentinel().raw()); |
3732 Definition* result = new(Z) ConstantInstr( | 3733 Definition* result = new(Z) ConstantInstr( |
3733 Instance::ZoneHandle(Z, node->field().StaticValue()), token_pos); | 3734 Instance::ZoneHandle(Z, node->field().StaticValue()), token_pos); |
3734 return ReturnDefinition(result); | 3735 return ReturnDefinition(result); |
3735 } | 3736 } |
3736 Value* field_value = Bind(new(Z) ConstantInstr(node->field(), token_pos)); | 3737 Value* field_value = Bind(new(Z) ConstantInstr( |
| 3738 Field::ZoneHandle(Z, node->field().Original()), token_pos)); |
3737 LoadStaticFieldInstr* load = | 3739 LoadStaticFieldInstr* load = |
3738 new(Z) LoadStaticFieldInstr(field_value, token_pos); | 3740 new(Z) LoadStaticFieldInstr(field_value, token_pos); |
3739 ReturnDefinition(load); | 3741 ReturnDefinition(load); |
3740 } | 3742 } |
3741 | 3743 |
3742 | 3744 |
3743 Definition* EffectGraphVisitor::BuildStoreStaticField( | 3745 Definition* EffectGraphVisitor::BuildStoreStaticField( |
3744 StoreStaticFieldNode* node, | 3746 StoreStaticFieldNode* node, |
3745 bool result_is_needed, | 3747 bool result_is_needed, |
3746 TokenPosition token_pos) { | 3748 TokenPosition token_pos) { |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4649 Script::Handle(function.script()), | 4651 Script::Handle(function.script()), |
4650 function.token_pos(), | 4652 function.token_pos(), |
4651 Report::AtLocation, | 4653 Report::AtLocation, |
4652 "FlowGraphBuilder Bailout: %s %s", | 4654 "FlowGraphBuilder Bailout: %s %s", |
4653 String::Handle(function.name()).ToCString(), | 4655 String::Handle(function.name()).ToCString(), |
4654 reason); | 4656 reason); |
4655 UNREACHABLE(); | 4657 UNREACHABLE(); |
4656 } | 4658 } |
4657 | 4659 |
4658 } // namespace dart | 4660 } // namespace dart |
OLD | NEW |