| 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 3568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3579 | 3579 |
| 3580 | 3580 |
| 3581 // <Expression> ::= StoreLocal { local: LocalVariable | 3581 // <Expression> ::= StoreLocal { local: LocalVariable |
| 3582 // value: <Expression> } | 3582 // value: <Expression> } |
| 3583 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { | 3583 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { |
| 3584 // If the right hand side is an expression that does not contain | 3584 // If the right hand side is an expression that does not contain |
| 3585 // a safe point for the debugger to stop, add an explicit stub | 3585 // a safe point for the debugger to stop, add an explicit stub |
| 3586 // call. Exception: don't do this when assigning to or from internal | 3586 // call. Exception: don't do this when assigning to or from internal |
| 3587 // variables, or for generated code that has no source position. | 3587 // variables, or for generated code that has no source position. |
| 3588 if (FLAG_support_debugger) { | 3588 if (FLAG_support_debugger) { |
| 3589 if ((node->value()->IsLiteralNode() || | 3589 AstNode* rhs = node->value(); |
| 3590 (node->value()->IsLoadLocalNode() && | 3590 if (rhs->IsAssignableNode()) { |
| 3591 !node->value()->AsLoadLocalNode()->local().IsInternal()) || | 3591 rhs = rhs->AsAssignableNode()->expr(); |
| 3592 node->value()->IsClosureNode()) && | 3592 } |
| 3593 if ((rhs->IsLiteralNode() || |
| 3594 (rhs->IsLoadLocalNode() && |
| 3595 !rhs->AsLoadLocalNode()->local().IsInternal()) || |
| 3596 rhs->IsClosureNode()) && |
| 3593 !node->local().IsInternal() && | 3597 !node->local().IsInternal() && |
| 3594 node->token_pos().IsDebugPause()) { | 3598 node->token_pos().IsDebugPause()) { |
| 3595 AddInstruction(new(Z) DebugStepCheckInstr( | 3599 AddInstruction(new(Z) DebugStepCheckInstr( |
| 3596 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 3600 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| 3597 } | 3601 } |
| 3598 } | 3602 } |
| 3599 | 3603 |
| 3600 ValueGraphVisitor for_value(owner()); | 3604 ValueGraphVisitor for_value(owner()); |
| 3601 node->value()->Visit(&for_value); | 3605 node->value()->Visit(&for_value); |
| 3602 Append(for_value); | 3606 Append(for_value); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3701 | 3705 |
| 3702 | 3706 |
| 3703 Definition* EffectGraphVisitor::BuildStoreStaticField( | 3707 Definition* EffectGraphVisitor::BuildStoreStaticField( |
| 3704 StoreStaticFieldNode* node, | 3708 StoreStaticFieldNode* node, |
| 3705 bool result_is_needed, | 3709 bool result_is_needed, |
| 3706 TokenPosition token_pos) { | 3710 TokenPosition token_pos) { |
| 3707 if (FLAG_support_debugger) { | 3711 if (FLAG_support_debugger) { |
| 3708 // If the right hand side is an expression that does not contain | 3712 // If the right hand side is an expression that does not contain |
| 3709 // a safe point for the debugger to stop, add an explicit stub | 3713 // a safe point for the debugger to stop, add an explicit stub |
| 3710 // call. | 3714 // call. |
| 3711 AstNode* val = node->value(); | 3715 AstNode* rhs = node->value(); |
| 3712 if (val->IsAssignableNode()) { | 3716 if (rhs->IsAssignableNode()) { |
| 3713 val = val->AsAssignableNode()->expr(); | 3717 rhs = rhs->AsAssignableNode()->expr(); |
| 3714 } | 3718 } |
| 3715 if ((val->IsLiteralNode() || | 3719 if ((rhs->IsLiteralNode() || |
| 3716 val->IsLoadLocalNode() || | 3720 rhs->IsLoadLocalNode() || |
| 3717 val->IsClosureNode()) && | 3721 rhs->IsClosureNode()) && |
| 3718 node->token_pos().IsDebugPause()) { | 3722 node->token_pos().IsDebugPause()) { |
| 3719 AddInstruction(new(Z) DebugStepCheckInstr( | 3723 AddInstruction(new(Z) DebugStepCheckInstr( |
| 3720 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 3724 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| 3721 } | 3725 } |
| 3722 } | 3726 } |
| 3723 | 3727 |
| 3724 ValueGraphVisitor for_value(owner()); | 3728 ValueGraphVisitor for_value(owner()); |
| 3725 node->value()->Visit(&for_value); | 3729 node->value()->Visit(&for_value); |
| 3726 Append(for_value); | 3730 Append(for_value); |
| 3727 Value* store_value = NULL; | 3731 Value* store_value = NULL; |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4630 block_marks); | 4634 block_marks); |
| 4631 ASSERT(found); | 4635 ASSERT(found); |
| 4632 } | 4636 } |
| 4633 | 4637 |
| 4634 | 4638 |
| 4635 void FlowGraphBuilder::Bailout(const char* reason) const { | 4639 void FlowGraphBuilder::Bailout(const char* reason) const { |
| 4636 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4640 parsed_function_.Bailout("FlowGraphBuilder", reason); |
| 4637 } | 4641 } |
| 4638 | 4642 |
| 4639 } // namespace dart | 4643 } // namespace dart |
| OLD | NEW |