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

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

Issue 646103005: Fix Function::Clone() and Field::Clone() to adjust the class owner of type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object.h » ('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/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 function.set_context_scope(context_scope); 2447 function.set_context_scope(context_scope);
2448 const Class& cls = Class::Handle( 2448 const Class& cls = Class::Handle(
2449 I, owner()->parsed_function()->function().Owner()); 2449 I, owner()->parsed_function()->function().Owner());
2450 // The closure is now properly setup, add it to the lookup table. 2450 // The closure is now properly setup, add it to the lookup table.
2451 // It is possible that the compiler creates more than one function 2451 // It is possible that the compiler creates more than one function
2452 // object for the same closure, e.g. when inlining nodes from 2452 // object for the same closure, e.g. when inlining nodes from
2453 // finally clauses. If we already have a function object for the 2453 // finally clauses. If we already have a function object for the
2454 // same closure, do not add a second one. We compare the origin 2454 // same closure, do not add a second one. We compare the origin
2455 // class, token position, and parent function to detect duplicates. 2455 // class, token position, and parent function to detect duplicates.
2456 // Note that we can have two different closure object for the same 2456 // Note that we can have two different closure object for the same
2457 // source text represntation of the closure: one with a non-closurized 2457 // source text representation of the closure: one with a non-closurized
2458 // parent, and one with a closurized parent function. 2458 // parent, and one with a closurized parent function.
2459 2459
2460 const Function& found_func = Function::Handle( 2460 const Function& found_func = Function::Handle(
2461 I, cls.LookupClosureFunction(function.token_pos())); 2461 I, cls.LookupClosureFunction(function.token_pos()));
2462 2462
2463 if (found_func.IsNull() || 2463 if (found_func.IsNull() ||
2464 (found_func.token_pos() != function.token_pos()) || 2464 (found_func.token_pos() != function.token_pos()) ||
2465 (found_func.script() != function.script()) || 2465 (found_func.script() != function.script()) ||
2466 (found_func.parent_function() != function.parent_function())) { 2466 (found_func.parent_function() != function.parent_function())) {
2467 cls.AddClosureFunction(function); 2467 cls.AddClosureFunction(function);
(...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 Report::MessageF(Report::kBailout, 4282 Report::MessageF(Report::kBailout,
4283 Script::Handle(function.script()), 4283 Script::Handle(function.script()),
4284 function.token_pos(), 4284 function.token_pos(),
4285 "FlowGraphBuilder Bailout: %s %s", 4285 "FlowGraphBuilder Bailout: %s %s",
4286 String::Handle(function.name()).ToCString(), 4286 String::Handle(function.name()).ToCString(),
4287 reason); 4287 reason);
4288 UNREACHABLE(); 4288 UNREACHABLE();
4289 } 4289 }
4290 4290
4291 } // namespace dart 4291 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698