| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 } | 378 } |
| 379 | 379 |
| 380 // Propagate types and eliminate more type tests. | 380 // Propagate types and eliminate more type tests. |
| 381 FlowGraphTypePropagator::Propagate(flow_graph); | 381 FlowGraphTypePropagator::Propagate(flow_graph); |
| 382 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 382 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 383 | 383 |
| 384 // Use propagated class-ids to optimize further. | 384 // Use propagated class-ids to optimize further. |
| 385 optimizer.ApplyClassIds(); | 385 optimizer.ApplyClassIds(); |
| 386 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 386 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 387 | 387 |
| 388 // Propagate types for potentially newly added instructions by |
| 389 // ApplyClassIds(). Must occur before canonicalization. |
| 390 FlowGraphTypePropagator::Propagate(flow_graph); |
| 391 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 392 |
| 388 // Do optimizations that depend on the propagated type information. | 393 // Do optimizations that depend on the propagated type information. |
| 389 if (optimizer.Canonicalize()) { | 394 if (optimizer.Canonicalize()) { |
| 390 // Invoke Canonicalize twice in order to fully canonicalize patterns | 395 // Invoke Canonicalize twice in order to fully canonicalize patterns |
| 391 // like "if (a & const == 0) { }". | 396 // like "if (a & const == 0) { }". |
| 392 optimizer.Canonicalize(); | 397 optimizer.Canonicalize(); |
| 393 } | 398 } |
| 394 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 399 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 395 | 400 |
| 396 BranchSimplifier::Simplify(flow_graph); | 401 BranchSimplifier::Simplify(flow_graph); |
| 397 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 402 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 Object::Handle(isolate->object_store()->sticky_error()); | 963 Object::Handle(isolate->object_store()->sticky_error()); |
| 959 isolate->object_store()->clear_sticky_error(); | 964 isolate->object_store()->clear_sticky_error(); |
| 960 isolate->set_long_jump_base(base); | 965 isolate->set_long_jump_base(base); |
| 961 return result.raw(); | 966 return result.raw(); |
| 962 } | 967 } |
| 963 UNREACHABLE(); | 968 UNREACHABLE(); |
| 964 return Object::null(); | 969 return Object::null(); |
| 965 } | 970 } |
| 966 | 971 |
| 967 } // namespace dart | 972 } // namespace dart |
| OLD | NEW |