| 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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 | 1009 |
| 1010 // Call to stub that checks whether the debugger is in single | 1010 // Call to stub that checks whether the debugger is in single |
| 1011 // step mode. This call must happen before the contexts are | 1011 // step mode. This call must happen before the contexts are |
| 1012 // unchained so that captured variables can be inspected. | 1012 // unchained so that captured variables can be inspected. |
| 1013 // No debugger check is done in native functions or for return | 1013 // No debugger check is done in native functions or for return |
| 1014 // statements for which there is no associated source position. | 1014 // statements for which there is no associated source position. |
| 1015 const Function& function = owner()->parsed_function()->function(); | 1015 const Function& function = owner()->parsed_function()->function(); |
| 1016 if ((node->token_pos() != Scanner::kNoSourcePos) && | 1016 if ((node->token_pos() != Scanner::kNoSourcePos) && |
| 1017 !function.is_native() && FLAG_enable_debugger) { | 1017 !function.is_native() && FLAG_enable_debugger) { |
| 1018 AddInstruction(new(I) DebugStepCheckInstr(node->token_pos(), | 1018 AddInstruction(new(I) DebugStepCheckInstr(node->token_pos(), |
| 1019 PcDescriptors::kRuntimeCall)); | 1019 RawPcDescriptors::kRuntimeCall)); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 if (FLAG_enable_type_checks) { | 1022 if (FLAG_enable_type_checks) { |
| 1023 const bool is_implicit_dynamic_getter = | 1023 const bool is_implicit_dynamic_getter = |
| 1024 (!function.is_static() && | 1024 (!function.is_static() && |
| 1025 ((function.kind() == RawFunction::kImplicitGetter) || | 1025 ((function.kind() == RawFunction::kImplicitGetter) || |
| 1026 (function.kind() == RawFunction::kImplicitStaticFinalGetter))); | 1026 (function.kind() == RawFunction::kImplicitStaticFinalGetter))); |
| 1027 // Implicit getters do not need a type check at return, unless they compute | 1027 // Implicit getters do not need a type check at return, unless they compute |
| 1028 // the initial value of a static field. | 1028 // the initial value of a static field. |
| 1029 // The body of a constructor cannot modify the type of the | 1029 // The body of a constructor cannot modify the type of the |
| (...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3112 | 3112 |
| 3113 // <Expression> ::= StoreLocal { local: LocalVariable | 3113 // <Expression> ::= StoreLocal { local: LocalVariable |
| 3114 // value: <Expression> } | 3114 // value: <Expression> } |
| 3115 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { | 3115 void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) { |
| 3116 // If the right hand side is an expression that does not contain | 3116 // If the right hand side is an expression that does not contain |
| 3117 // a safe point for the debugger to stop, add an explicit stub | 3117 // a safe point for the debugger to stop, add an explicit stub |
| 3118 // call. | 3118 // call. |
| 3119 if (node->value()->IsLiteralNode() || | 3119 if (node->value()->IsLiteralNode() || |
| 3120 node->value()->IsLoadLocalNode()) { | 3120 node->value()->IsLoadLocalNode()) { |
| 3121 if (FLAG_enable_debugger) { | 3121 if (FLAG_enable_debugger) { |
| 3122 AddInstruction(new(I) DebugStepCheckInstr(node->token_pos(), | 3122 AddInstruction(new(I) DebugStepCheckInstr( |
| 3123 PcDescriptors::kRuntimeCall)); | 3123 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| 3124 } | 3124 } |
| 3125 } | 3125 } |
| 3126 | 3126 |
| 3127 ValueGraphVisitor for_value(owner()); | 3127 ValueGraphVisitor for_value(owner()); |
| 3128 node->value()->Visit(&for_value); | 3128 node->value()->Visit(&for_value); |
| 3129 Append(for_value); | 3129 Append(for_value); |
| 3130 Value* store_value = for_value.value(); | 3130 Value* store_value = for_value.value(); |
| 3131 if (FLAG_enable_type_checks) { | 3131 if (FLAG_enable_type_checks) { |
| 3132 store_value = BuildAssignableValue(node->value()->token_pos(), | 3132 store_value = BuildAssignableValue(node->value()->token_pos(), |
| 3133 store_value, | 3133 store_value, |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3961 Report::MessageF(Report::kBailout, | 3961 Report::MessageF(Report::kBailout, |
| 3962 Script::Handle(function.script()), | 3962 Script::Handle(function.script()), |
| 3963 function.token_pos(), | 3963 function.token_pos(), |
| 3964 "FlowGraphBuilder Bailout: %s %s", | 3964 "FlowGraphBuilder Bailout: %s %s", |
| 3965 String::Handle(function.name()).ToCString(), | 3965 String::Handle(function.name()).ToCString(), |
| 3966 reason); | 3966 reason); |
| 3967 UNREACHABLE(); | 3967 UNREACHABLE(); |
| 3968 } | 3968 } |
| 3969 | 3969 |
| 3970 } // namespace dart | 3970 } // namespace dart |
| OLD | NEW |