Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 1980193002: Fix capturing variables in optimized compilations (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
2422 const ContextScope& context_scope = ContextScope::ZoneHandle( 2423 const ContextScope& context_scope = ContextScope::ZoneHandle(
2423 Z, node->scope()->PreserveOuterScope(owner()->context_level())); 2424 Z, node->scope()->PreserveOuterScope(owner()->context_level()));
2424 ASSERT(!function.HasCode()); 2425 ASSERT(!function.HasCode());
2425 ASSERT(function.context_scope() == ContextScope::null()); 2426 ASSERT(function.context_scope() == ContextScope::null());
2426 function.set_context_scope(context_scope); 2427 function.set_context_scope(context_scope);
2427 2428
2428 // The closure is now properly setup, add it to the lookup table. 2429 // The closure is now properly setup, add it to the lookup table.
2429 // It is possible that the compiler creates more than one function 2430 // It is possible that the compiler creates more than one function
2430 // object for the same closure, e.g. when inlining nodes from 2431 // object for the same closure, e.g. when inlining nodes from
2431 // finally clauses. If we already have a function object for the 2432 // finally clauses. If we already have a function object for the
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
4610 Script::Handle(function.script()), 4611 Script::Handle(function.script()),
4611 function.token_pos(), 4612 function.token_pos(),
4612 Report::AtLocation, 4613 Report::AtLocation,
4613 "FlowGraphBuilder Bailout: %s %s", 4614 "FlowGraphBuilder Bailout: %s %s",
4614 String::Handle(function.name()).ToCString(), 4615 String::Handle(function.name()).ToCString(),
4615 reason); 4616 reason);
4616 UNREACHABLE(); 4617 UNREACHABLE();
4617 } 4618 }
4618 4619
4619 } // namespace dart 4620 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698