Chromium Code Reviews| 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 4180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4191 LocalScope* scope = node->scope(); | 4191 LocalScope* scope = node->scope(); |
| 4192 const Function& function = owner()->function(); | 4192 const Function& function = owner()->function(); |
| 4193 const intptr_t num_context_variables = | 4193 const intptr_t num_context_variables = |
| 4194 (scope != NULL) ? scope->num_context_variables() : 0; | 4194 (scope != NULL) ? scope->num_context_variables() : 0; |
| 4195 const bool is_top_level_sequence = | 4195 const bool is_top_level_sequence = |
| 4196 node == owner()->parsed_function().node_sequence(); | 4196 node == owner()->parsed_function().node_sequence(); |
| 4197 // The outermost function sequence cannot contain a label. | 4197 // The outermost function sequence cannot contain a label. |
| 4198 ASSERT((node->label() == NULL) || !is_top_level_sequence); | 4198 ASSERT((node->label() == NULL) || !is_top_level_sequence); |
| 4199 NestedBlock nested_block(owner(), node); | 4199 NestedBlock nested_block(owner(), node); |
| 4200 | 4200 |
| 4201 if (FLAG_support_debugger && is_top_level_sequence) { | |
| 4202 AddInstruction(new(Z) DebugStepCheckInstr(function.token_pos(), | |
|
Cutch
2015/07/14 19:54:36
I wonder if you could insert this after the Graphc
rmacnak
2015/07/14 22:28:29
We don't seem to have the right things in scope to
| |
| 4203 RawPcDescriptors::kRuntimeCall)); | |
| 4204 } | |
| 4205 | |
| 4201 if (num_context_variables > 0) { | 4206 if (num_context_variables > 0) { |
| 4202 // The local scope declares variables that are captured. | 4207 // The local scope declares variables that are captured. |
| 4203 // Allocate and chain a new context (Except don't chain when at the function | 4208 // Allocate and chain a new context (Except don't chain when at the function |
| 4204 // entry if the function does not capture any variables from outer scopes). | 4209 // entry if the function does not capture any variables from outer scopes). |
| 4205 Value* allocated_context = | 4210 Value* allocated_context = |
| 4206 Bind(new(Z) AllocateContextInstr(node->token_pos(), | 4211 Bind(new(Z) AllocateContextInstr(node->token_pos(), |
| 4207 num_context_variables)); | 4212 num_context_variables)); |
| 4208 { LocalVariable* tmp_var = EnterTempLocalScope(allocated_context); | 4213 { LocalVariable* tmp_var = EnterTempLocalScope(allocated_context); |
| 4209 if (!is_top_level_sequence || HasContextScope()) { | 4214 if (!is_top_level_sequence || HasContextScope()) { |
| 4210 ASSERT(is_top_level_sequence || | 4215 ASSERT(is_top_level_sequence || |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4802 Report::MessageF(Report::kBailout, | 4807 Report::MessageF(Report::kBailout, |
| 4803 Script::Handle(function.script()), | 4808 Script::Handle(function.script()), |
| 4804 function.token_pos(), | 4809 function.token_pos(), |
| 4805 "FlowGraphBuilder Bailout: %s %s", | 4810 "FlowGraphBuilder Bailout: %s %s", |
| 4806 String::Handle(function.name()).ToCString(), | 4811 String::Handle(function.name()).ToCString(), |
| 4807 reason); | 4812 reason); |
| 4808 UNREACHABLE(); | 4813 UNREACHABLE(); |
| 4809 } | 4814 } |
| 4810 | 4815 |
| 4811 } // namespace dart | 4816 } // namespace dart |
| OLD | NEW |