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

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

Issue 19462004: Disable allocation sinking in the presence of try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/try_catch_optimized2_test.dart » ('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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 TryCatchAnalyzer::Optimize(flow_graph); 443 TryCatchAnalyzer::Optimize(flow_graph);
444 444
445 // Detach environments from the instructions that can't deoptimize. 445 // Detach environments from the instructions that can't deoptimize.
446 // Do it before we attempt to perform allocation sinking to minimize 446 // Do it before we attempt to perform allocation sinking to minimize
447 // amount of materializations it has to perform. 447 // amount of materializations it has to perform.
448 optimizer.EliminateEnvironments(); 448 optimizer.EliminateEnvironments();
449 449
450 // Attempt to sink allocations of temporary non-escaping objects to 450 // Attempt to sink allocations of temporary non-escaping objects to
451 // the deoptimization path. 451 // the deoptimization path.
452 AllocationSinking* sinking = NULL; 452 AllocationSinking* sinking = NULL;
453 if (FLAG_allocation_sinking) { 453 if (FLAG_allocation_sinking &&
454 (flow_graph->graph_entry()->SuccessorCount() == 1)) {
455 // TODO(fschneider): Support allocation sinking with try-catch.
454 sinking = new AllocationSinking(flow_graph); 456 sinking = new AllocationSinking(flow_graph);
455 sinking->Optimize(); 457 sinking->Optimize();
456 } 458 }
457 459
458 // Ensure that all phis inserted by optimization passes have consistent 460 // Ensure that all phis inserted by optimization passes have consistent
459 // representations. 461 // representations.
460 optimizer.SelectRepresentations(); 462 optimizer.SelectRepresentations();
461 463
462 if (optimizer.Canonicalize()) { 464 if (optimizer.Canonicalize()) {
463 // To fully remove redundant boxing (e.g. BoxDouble used only in 465 // To fully remove redundant boxing (e.g. BoxDouble used only in
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 Object::Handle(isolate->object_store()->sticky_error()); 881 Object::Handle(isolate->object_store()->sticky_error());
880 isolate->object_store()->clear_sticky_error(); 882 isolate->object_store()->clear_sticky_error();
881 isolate->set_long_jump_base(base); 883 isolate->set_long_jump_base(base);
882 return result.raw(); 884 return result.raw();
883 } 885 }
884 UNREACHABLE(); 886 UNREACHABLE();
885 return Object::null(); 887 return Object::null();
886 } 888 }
887 889
888 } // namespace dart 890 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/try_catch_optimized2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698