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

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

Issue 1568713002: Add token position to StoreStaticFieldInstr (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « runtime/vm/flow_graph_builder.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/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 3693 matching lines...) Expand 10 before | Expand all | Expand 10 after
3704 return ReturnDefinition(result); 3704 return ReturnDefinition(result);
3705 } 3705 }
3706 Value* field_value = Bind(new(Z) ConstantInstr(node->field(), token_pos)); 3706 Value* field_value = Bind(new(Z) ConstantInstr(node->field(), token_pos));
3707 LoadStaticFieldInstr* load = 3707 LoadStaticFieldInstr* load =
3708 new(Z) LoadStaticFieldInstr(field_value, token_pos); 3708 new(Z) LoadStaticFieldInstr(field_value, token_pos);
3709 ReturnDefinition(load); 3709 ReturnDefinition(load);
3710 } 3710 }
3711 3711
3712 3712
3713 Definition* EffectGraphVisitor::BuildStoreStaticField( 3713 Definition* EffectGraphVisitor::BuildStoreStaticField(
3714 StoreStaticFieldNode* node, bool result_is_needed) { 3714 StoreStaticFieldNode* node,
3715 bool result_is_needed,
3716 intptr_t token_pos) {
3715 ValueGraphVisitor for_value(owner()); 3717 ValueGraphVisitor for_value(owner());
3716 node->value()->Visit(&for_value); 3718 node->value()->Visit(&for_value);
3717 Append(for_value); 3719 Append(for_value);
3718 Value* store_value = NULL; 3720 Value* store_value = NULL;
3719 if (result_is_needed) { 3721 if (result_is_needed) {
3720 store_value = Bind(BuildStoreExprTemp(for_value.value())); 3722 store_value = Bind(BuildStoreExprTemp(for_value.value()));
3721 } else { 3723 } else {
3722 store_value = for_value.value(); 3724 store_value = for_value.value();
3723 } 3725 }
3724 StoreStaticFieldInstr* store = 3726 StoreStaticFieldInstr* store =
3725 new(Z) StoreStaticFieldInstr(node->field(), store_value); 3727 new(Z) StoreStaticFieldInstr(node->field(), store_value, token_pos);
3726 3728
3727 if (result_is_needed) { 3729 if (result_is_needed) {
3728 Do(store); 3730 Do(store);
3729 return BuildLoadExprTemp(); 3731 return BuildLoadExprTemp();
3730 } else { 3732 } else {
3731 return store; 3733 return store;
3732 } 3734 }
3733 } 3735 }
3734 3736
3735 3737
3736 void EffectGraphVisitor::VisitStoreStaticFieldNode(StoreStaticFieldNode* node) { 3738 void EffectGraphVisitor::VisitStoreStaticFieldNode(StoreStaticFieldNode* node) {
3737 ReturnDefinition(BuildStoreStaticField(node, kResultNotNeeded)); 3739 ReturnDefinition(
3740 BuildStoreStaticField(node, kResultNotNeeded, node->token_pos()));
3738 } 3741 }
3739 3742
3740 3743
3741 void ValueGraphVisitor::VisitStoreStaticFieldNode(StoreStaticFieldNode* node) { 3744 void ValueGraphVisitor::VisitStoreStaticFieldNode(StoreStaticFieldNode* node) {
3742 ReturnDefinition(BuildStoreStaticField(node, kResultNeeded)); 3745 ReturnDefinition(
3746 BuildStoreStaticField(node, kResultNeeded, node->token_pos()));
3743 } 3747 }
3744 3748
3745 3749
3746 void EffectGraphVisitor::VisitLoadIndexedNode(LoadIndexedNode* node) { 3750 void EffectGraphVisitor::VisitLoadIndexedNode(LoadIndexedNode* node) {
3747 Function* super_function = NULL; 3751 Function* super_function = NULL;
3748 if (node->IsSuperLoad()) { 3752 if (node->IsSuperLoad()) {
3749 // Resolve the load indexed operator in the super class. 3753 // Resolve the load indexed operator in the super class.
3750 super_function = &Function::ZoneHandle( 3754 super_function = &Function::ZoneHandle(
3751 Z, Resolver::ResolveDynamicAnyArgs(node->super_class(), 3755 Z, Resolver::ResolveDynamicAnyArgs(node->super_class(),
3752 Symbols::IndexToken())); 3756 Symbols::IndexToken()));
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
4588 Report::MessageF(Report::kBailout, 4592 Report::MessageF(Report::kBailout,
4589 Script::Handle(function.script()), 4593 Script::Handle(function.script()),
4590 function.token_pos(), 4594 function.token_pos(),
4591 "FlowGraphBuilder Bailout: %s %s", 4595 "FlowGraphBuilder Bailout: %s %s",
4592 String::Handle(function.name()).ToCString(), 4596 String::Handle(function.name()).ToCString(),
4593 reason); 4597 reason);
4594 UNREACHABLE(); 4598 UNREACHABLE();
4595 } 4599 }
4596 4600
4597 } // namespace dart 4601 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698