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/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/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 472 | 472 |
| 473 // Optimize try-blocks. | 473 // Optimize try-blocks. |
| 474 TryCatchAnalyzer::Optimize(flow_graph); | 474 TryCatchAnalyzer::Optimize(flow_graph); |
| 475 | 475 |
| 476 // Detach environments from the instructions that can't deoptimize. | 476 // Detach environments from the instructions that can't deoptimize. |
| 477 // Do it before we attempt to perform allocation sinking to minimize | 477 // Do it before we attempt to perform allocation sinking to minimize |
| 478 // amount of materializations it has to perform. | 478 // amount of materializations it has to perform. |
| 479 optimizer.EliminateEnvironments(); | 479 optimizer.EliminateEnvironments(); |
| 480 | 480 |
| 481 DeadCodeElimination::EliminateDeadPhis(flow_graph); | 481 DeadCodeElimination::EliminateDeadPhis(flow_graph); |
| 482 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | |
|
Ivan Posva
2014/06/11 15:20:50
What exactly is a DEBUG_ASSERT and why is it being
Florian Schneider
2014/06/11 15:30:31
// DEBUG_ASSERT allows identifiers in condition to
Ivan Posva
2014/06/11 16:25:24
See followup CL, which removes the unnecessary use
| |
| 482 | 483 |
| 483 // Attempt to sink allocations of temporary non-escaping objects to | 484 // Attempt to sink allocations of temporary non-escaping objects to |
| 484 // the deoptimization path. | 485 // the deoptimization path. |
| 485 AllocationSinking* sinking = NULL; | 486 AllocationSinking* sinking = NULL; |
| 486 if (FLAG_allocation_sinking && | 487 if (FLAG_allocation_sinking && |
| 487 (flow_graph->graph_entry()->SuccessorCount() == 1)) { | 488 (flow_graph->graph_entry()->SuccessorCount() == 1)) { |
| 488 // TODO(fschneider): Support allocation sinking with try-catch. | 489 // TODO(fschneider): Support allocation sinking with try-catch. |
| 489 sinking = new AllocationSinking(flow_graph); | 490 sinking = new AllocationSinking(flow_graph); |
| 490 sinking->Optimize(); | 491 sinking->Optimize(); |
| 491 } | 492 } |
| 493 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | |
| 492 | 494 |
| 493 // Ensure that all phis inserted by optimization passes have consistent | 495 // Ensure that all phis inserted by optimization passes have consistent |
| 494 // representations. | 496 // representations. |
| 495 optimizer.SelectRepresentations(); | 497 optimizer.SelectRepresentations(); |
| 496 | 498 |
| 497 if (optimizer.Canonicalize()) { | 499 if (optimizer.Canonicalize()) { |
| 498 // To fully remove redundant boxing (e.g. BoxDouble used only in | 500 // To fully remove redundant boxing (e.g. BoxDouble used only in |
| 499 // environments and UnboxDouble instructions) instruction we | 501 // environments and UnboxDouble instructions) instruction we |
| 500 // first need to replace all their uses and then fold them away. | 502 // first need to replace all their uses and then fold them away. |
| 501 // For now we just repeat Canonicalize twice to do that. | 503 // For now we just repeat Canonicalize twice to do that. |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 975 const Object& result = | 977 const Object& result = |
| 976 Object::Handle(isolate->object_store()->sticky_error()); | 978 Object::Handle(isolate->object_store()->sticky_error()); |
| 977 isolate->object_store()->clear_sticky_error(); | 979 isolate->object_store()->clear_sticky_error(); |
| 978 return result.raw(); | 980 return result.raw(); |
| 979 } | 981 } |
| 980 UNREACHABLE(); | 982 UNREACHABLE(); |
| 981 return Object::null(); | 983 return Object::null(); |
| 982 } | 984 } |
| 983 | 985 |
| 984 } // namespace dart | 986 } // namespace dart |
| OLD | NEW |