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

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

Issue 2704623003: VM: [Kernel] Ensure we record [FieldLoadInstr]s in the ParsedFunction when using field guards (Closed)
Patch Set: Moved the AddToGuardedFields call to the LoadFieldInstr constructor Created 3 years, 10 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/aot_optimizer.cc ('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 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3407 BuildStoreLocal(node->local(), store_value, node->token_pos()); 3407 BuildStoreLocal(node->local(), store_value, node->token_pos());
3408 ReturnDefinition(store); 3408 ReturnDefinition(store);
3409 } 3409 }
3410 3410
3411 3411
3412 void EffectGraphVisitor::VisitLoadInstanceFieldNode( 3412 void EffectGraphVisitor::VisitLoadInstanceFieldNode(
3413 LoadInstanceFieldNode* node) { 3413 LoadInstanceFieldNode* node) {
3414 ValueGraphVisitor for_instance(owner()); 3414 ValueGraphVisitor for_instance(owner());
3415 node->instance()->Visit(&for_instance); 3415 node->instance()->Visit(&for_instance);
3416 Append(for_instance); 3416 Append(for_instance);
3417 LoadFieldInstr* load = new (Z) LoadFieldInstr( 3417 LoadFieldInstr* load =
3418 for_instance.value(), &node->field(), 3418 new (Z) LoadFieldInstr(for_instance.value(), &node->field(),
3419 AbstractType::ZoneHandle(Z, node->field().type()), node->token_pos()); 3419 AbstractType::ZoneHandle(Z, node->field().type()),
3420 if (node->field().guarded_cid() != kIllegalCid) { 3420 node->token_pos(), &owner()->parsed_function());
3421 if (!node->field().is_nullable() ||
3422 (node->field().guarded_cid() == kNullCid)) {
3423 load->set_result_cid(node->field().guarded_cid());
3424 }
3425 owner()->parsed_function().AddToGuardedFields(&node->field());
3426 }
3427 ReturnDefinition(load); 3421 ReturnDefinition(load);
3428 } 3422 }
3429 3423
3430 3424
3431 void EffectGraphVisitor::VisitStoreInstanceFieldNode( 3425 void EffectGraphVisitor::VisitStoreInstanceFieldNode(
3432 StoreInstanceFieldNode* node) { 3426 StoreInstanceFieldNode* node) {
3433 const TokenPosition token_pos = node->token_pos(); 3427 const TokenPosition token_pos = node->token_pos();
3434 ValueGraphVisitor for_instance(owner()); 3428 ValueGraphVisitor for_instance(owner());
3435 node->instance()->Visit(&for_instance); 3429 node->instance()->Visit(&for_instance);
3436 Append(for_instance); 3430 Append(for_instance);
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
4384 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); 4378 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks);
4385 ASSERT(found); 4379 ASSERT(found);
4386 } 4380 }
4387 4381
4388 4382
4389 void FlowGraphBuilder::Bailout(const char* reason) const { 4383 void FlowGraphBuilder::Bailout(const char* reason) const {
4390 parsed_function_.Bailout("FlowGraphBuilder", reason); 4384 parsed_function_.Bailout("FlowGraphBuilder", reason);
4391 } 4385 }
4392 4386
4393 } // namespace dart 4387 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698