| 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 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2412 ReturnDefinition(new(Z) ConstantInstr(closure)); | 2412 ReturnDefinition(new(Z) ConstantInstr(closure)); |
| 2413 return; | 2413 return; |
| 2414 } | 2414 } |
| 2415 | 2415 |
| 2416 const bool is_implicit = function.IsImplicitInstanceClosureFunction(); | 2416 const bool is_implicit = function.IsImplicitInstanceClosureFunction(); |
| 2417 ASSERT(is_implicit || function.IsNonImplicitClosureFunction()); | 2417 ASSERT(is_implicit || function.IsNonImplicitClosureFunction()); |
| 2418 // The context scope may have already been set by the non-optimizing | 2418 // The context scope may have already been set by the non-optimizing |
| 2419 // compiler. If it was not, set it here. | 2419 // compiler. If it was not, set it here. |
| 2420 if (function.context_scope() == ContextScope::null()) { | 2420 if (function.context_scope() == ContextScope::null()) { |
| 2421 ASSERT(!is_implicit); | 2421 ASSERT(!is_implicit); |
| 2422 ASSERT(node->scope() != NULL); | |
| 2423 const ContextScope& context_scope = ContextScope::ZoneHandle( | 2422 const ContextScope& context_scope = ContextScope::ZoneHandle( |
| 2424 Z, node->scope()->PreserveOuterScope(owner()->context_level())); | 2423 Z, node->scope()->PreserveOuterScope(owner()->context_level())); |
| 2425 ASSERT(!function.HasCode()); | 2424 ASSERT(!function.HasCode()); |
| 2426 ASSERT(function.context_scope() == ContextScope::null()); | 2425 ASSERT(function.context_scope() == ContextScope::null()); |
| 2427 function.set_context_scope(context_scope); | 2426 function.set_context_scope(context_scope); |
| 2428 | 2427 |
| 2429 // The closure is now properly setup, add it to the lookup table. | 2428 // The closure is now properly setup, add it to the lookup table. |
| 2430 // It is possible that the compiler creates more than one function | 2429 // It is possible that the compiler creates more than one function |
| 2431 // object for the same closure, e.g. when inlining nodes from | 2430 // object for the same closure, e.g. when inlining nodes from |
| 2432 // finally clauses. If we already have a function object for the | 2431 // finally clauses. If we already have a function object for the |
| (...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4611 Script::Handle(function.script()), | 4610 Script::Handle(function.script()), |
| 4612 function.token_pos(), | 4611 function.token_pos(), |
| 4613 Report::AtLocation, | 4612 Report::AtLocation, |
| 4614 "FlowGraphBuilder Bailout: %s %s", | 4613 "FlowGraphBuilder Bailout: %s %s", |
| 4615 String::Handle(function.name()).ToCString(), | 4614 String::Handle(function.name()).ToCString(), |
| 4616 reason); | 4615 reason); |
| 4617 UNREACHABLE(); | 4616 UNREACHABLE(); |
| 4618 } | 4617 } |
| 4619 | 4618 |
| 4620 } // namespace dart | 4619 } // namespace dart |
| OLD | NEW |