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 3486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 const AbstractType& type = | 3497 const AbstractType& type = |
3498 AbstractType::ZoneHandle(Z, node->field().type()); | 3498 AbstractType::ZoneHandle(Z, node->field().type()); |
3499 const String& dst_name = String::ZoneHandle(Z, node->field().name()); | 3499 const String& dst_name = String::ZoneHandle(Z, node->field().name()); |
3500 store_value = BuildAssignableValue(node->value()->token_pos(), | 3500 store_value = BuildAssignableValue(node->value()->token_pos(), |
3501 store_value, | 3501 store_value, |
3502 type, | 3502 type, |
3503 dst_name); | 3503 dst_name); |
3504 } | 3504 } |
3505 | 3505 |
3506 if (FLAG_use_field_guards) { | 3506 if (FLAG_use_field_guards) { |
3507 if (node->field().guarded_cid() != kDynamicCid) { | 3507 store_value = Bind(BuildStoreExprTemp(store_value)); |
3508 store_value = Bind(BuildStoreExprTemp(store_value)); | 3508 GuardFieldClassInstr* guard_field_class = |
3509 GuardFieldClassInstr* guard_field_class = | 3509 new(Z) GuardFieldClassInstr(store_value, |
3510 new(Z) GuardFieldClassInstr(store_value, | 3510 node->field(), |
3511 node->field(), | 3511 isolate()->GetNextDeoptId()); |
3512 isolate()->GetNextDeoptId()); | 3512 AddInstruction(guard_field_class); |
3513 AddInstruction(guard_field_class); | 3513 store_value = Bind(BuildLoadExprTemp()); |
3514 store_value = Bind(BuildLoadExprTemp()); | 3514 GuardFieldLengthInstr* guard_field_length = |
3515 if (node->field().guarded_list_length() != Field::kNoFixedLength) { | 3515 new(Z) GuardFieldLengthInstr(store_value, |
3516 GuardFieldLengthInstr* guard_field_length = | 3516 node->field(), |
3517 new(Z) GuardFieldLengthInstr(store_value, | 3517 isolate()->GetNextDeoptId()); |
3518 node->field(), | 3518 AddInstruction(guard_field_length); |
3519 isolate()->GetNextDeoptId()); | 3519 store_value = Bind(BuildLoadExprTemp()); |
3520 AddInstruction(guard_field_length); | |
3521 store_value = Bind(BuildLoadExprTemp()); | |
3522 } else { | |
3523 // Advance deopt-id counter to remain in sync. | |
3524 isolate()->GetNextDeoptId(); | |
3525 } | |
3526 } else { | |
3527 // Advance deopt-id counter to remain in sync. | |
3528 isolate()->GetNextDeoptId(); | |
3529 isolate()->GetNextDeoptId(); | |
3530 } | |
3531 } | 3520 } |
3532 StoreInstanceFieldInstr* store = | 3521 StoreInstanceFieldInstr* store = |
3533 new(Z) StoreInstanceFieldInstr(node->field(), | 3522 new(Z) StoreInstanceFieldInstr(node->field(), |
3534 for_instance.value(), | 3523 for_instance.value(), |
3535 store_value, | 3524 store_value, |
3536 kEmitStoreBarrier, | 3525 kEmitStoreBarrier, |
3537 node->token_pos()); | 3526 node->token_pos()); |
3538 // Maybe initializing unboxed store. | 3527 // Maybe initializing unboxed store. |
3539 store->set_is_potential_unboxed_initialization(true); | 3528 store->set_is_potential_unboxed_initialization(true); |
3540 ReturnDefinition(store); | 3529 ReturnDefinition(store); |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4388 Report::MessageF(Report::kBailout, | 4377 Report::MessageF(Report::kBailout, |
4389 Script::Handle(function.script()), | 4378 Script::Handle(function.script()), |
4390 function.token_pos(), | 4379 function.token_pos(), |
4391 "FlowGraphBuilder Bailout: %s %s", | 4380 "FlowGraphBuilder Bailout: %s %s", |
4392 String::Handle(function.name()).ToCString(), | 4381 String::Handle(function.name()).ToCString(), |
4393 reason); | 4382 reason); |
4394 UNREACHABLE(); | 4383 UNREACHABLE(); |
4395 } | 4384 } |
4396 | 4385 |
4397 } // namespace dart | 4386 } // namespace dart |
OLD | NEW |