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 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3428 void EffectGraphVisitor::VisitStoreInstanceFieldNode( | 3428 void EffectGraphVisitor::VisitStoreInstanceFieldNode( |
3429 StoreInstanceFieldNode* node) { | 3429 StoreInstanceFieldNode* node) { |
3430 const TokenPosition token_pos = node->token_pos(); | 3430 const TokenPosition token_pos = node->token_pos(); |
3431 ValueGraphVisitor for_instance(owner()); | 3431 ValueGraphVisitor for_instance(owner()); |
3432 node->instance()->Visit(&for_instance); | 3432 node->instance()->Visit(&for_instance); |
3433 Append(for_instance); | 3433 Append(for_instance); |
3434 ValueGraphVisitor for_value(owner()); | 3434 ValueGraphVisitor for_value(owner()); |
3435 node->value()->Visit(&for_value); | 3435 node->value()->Visit(&for_value); |
3436 Append(for_value); | 3436 Append(for_value); |
3437 Value* store_value = for_value.value(); | 3437 Value* store_value = for_value.value(); |
3438 if (Isolate::Current()->type_checks()) { | 3438 if (isolate()->type_checks()) { |
3439 const AbstractType& type = | 3439 const AbstractType& type = |
3440 AbstractType::ZoneHandle(Z, node->field().type()); | 3440 AbstractType::ZoneHandle(Z, node->field().type()); |
3441 const String& dst_name = String::ZoneHandle(Z, node->field().name()); | 3441 const String& dst_name = String::ZoneHandle(Z, node->field().name()); |
3442 store_value = BuildAssignableValue(node->value()->token_pos(), store_value, | 3442 store_value = BuildAssignableValue(node->value()->token_pos(), store_value, |
3443 type, dst_name); | 3443 type, dst_name); |
3444 } | 3444 } |
3445 | 3445 |
3446 if (FLAG_use_field_guards) { | 3446 if (isolate()->use_field_guards()) { |
3447 store_value = Bind(BuildStoreExprTemp(store_value, token_pos)); | 3447 store_value = Bind(BuildStoreExprTemp(store_value, token_pos)); |
3448 GuardFieldClassInstr* guard_field_class = new (Z) GuardFieldClassInstr( | 3448 GuardFieldClassInstr* guard_field_class = new (Z) GuardFieldClassInstr( |
3449 store_value, node->field(), thread()->GetNextDeoptId()); | 3449 store_value, node->field(), thread()->GetNextDeoptId()); |
3450 AddInstruction(guard_field_class); | 3450 AddInstruction(guard_field_class); |
3451 store_value = Bind(BuildLoadExprTemp(token_pos)); | 3451 store_value = Bind(BuildLoadExprTemp(token_pos)); |
3452 GuardFieldLengthInstr* guard_field_length = new (Z) GuardFieldLengthInstr( | 3452 GuardFieldLengthInstr* guard_field_length = new (Z) GuardFieldLengthInstr( |
3453 store_value, node->field(), thread()->GetNextDeoptId()); | 3453 store_value, node->field(), thread()->GetNextDeoptId()); |
3454 AddInstruction(guard_field_length); | 3454 AddInstruction(guard_field_length); |
3455 store_value = Bind(BuildLoadExprTemp(token_pos)); | 3455 store_value = Bind(BuildLoadExprTemp(token_pos)); |
3456 } | 3456 } |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4390 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); | 4390 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); |
4391 ASSERT(found); | 4391 ASSERT(found); |
4392 } | 4392 } |
4393 | 4393 |
4394 | 4394 |
4395 void FlowGraphBuilder::Bailout(const char* reason) const { | 4395 void FlowGraphBuilder::Bailout(const char* reason) const { |
4396 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4396 parsed_function_.Bailout("FlowGraphBuilder", reason); |
4397 } | 4397 } |
4398 | 4398 |
4399 } // namespace dart | 4399 } // namespace dart |
OLD | NEW |