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/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 optimizer.ApplyICData(); | 331 optimizer.ApplyICData(); |
| 332 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 332 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 333 | 333 |
| 334 // Optimize (a << b) & c patterns. Must occur before | 334 // Optimize (a << b) & c patterns. Must occur before |
| 335 // 'SelectRepresentations' which inserts conversion nodes. | 335 // 'SelectRepresentations' which inserts conversion nodes. |
| 336 // TODO(srdjan): Moved before inlining until environment use list can | 336 // TODO(srdjan): Moved before inlining until environment use list can |
| 337 // be used to detect when shift-left is outside the scope of bit-and. | 337 // be used to detect when shift-left is outside the scope of bit-and. |
| 338 optimizer.TryOptimizeLeftShiftWithBitAndPattern(); | 338 optimizer.TryOptimizeLeftShiftWithBitAndPattern(); |
| 339 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 339 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 340 | 340 |
| 341 // Propagate types and eliminate more type tests. | |
| 342 if (FLAG_propagate_types) { | |
| 343 FlowGraphTypePropagator propagator(flow_graph); | |
| 344 propagator.Propagate(); | |
|
Kevin Millikin (Google)
2013/08/13 11:47:40
Why?
We compute this five times. The other four
Florian Schneider
2013/08/14 12:30:24
Without this I get some performance regressions wh
| |
| 345 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | |
| 346 } | |
| 347 | |
| 348 // Use propagated class-ids to optimize further. | |
| 349 optimizer.ApplyClassIds(); | |
| 350 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | |
| 351 | |
| 341 // Inlining (mutates the flow graph) | 352 // Inlining (mutates the flow graph) |
| 342 if (FLAG_use_inlining) { | 353 if (FLAG_use_inlining) { |
| 343 TimerScope timer(FLAG_compiler_stats, | 354 TimerScope timer(FLAG_compiler_stats, |
| 344 &CompilerStats::graphinliner_timer); | 355 &CompilerStats::graphinliner_timer); |
| 345 FlowGraphInliner inliner(flow_graph, &guarded_fields); | 356 FlowGraphInliner inliner(flow_graph, &guarded_fields); |
| 346 inliner.Inline(); | 357 inliner.Inline(); |
| 347 // Use lists are maintained and validated by the inliner. | 358 // Use lists are maintained and validated by the inliner. |
| 348 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 359 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 349 } | 360 } |
| 350 | 361 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 908 Object::Handle(isolate->object_store()->sticky_error()); | 919 Object::Handle(isolate->object_store()->sticky_error()); |
| 909 isolate->object_store()->clear_sticky_error(); | 920 isolate->object_store()->clear_sticky_error(); |
| 910 isolate->set_long_jump_base(base); | 921 isolate->set_long_jump_base(base); |
| 911 return result.raw(); | 922 return result.raw(); |
| 912 } | 923 } |
| 913 UNREACHABLE(); | 924 UNREACHABLE(); |
| 914 return Object::null(); | 925 return Object::null(); |
| 915 } | 926 } |
| 916 | 927 |
| 917 } // namespace dart | 928 } // namespace dart |
| OLD | NEW |