| 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 | |
| 393 // Do optimizations that depend on the propagated type information. | 388 // Do optimizations that depend on the propagated type information. |
| 394 if (optimizer.Canonicalize()) { | 389 if (optimizer.Canonicalize()) { |
| 395 // Invoke Canonicalize twice in order to fully canonicalize patterns | 390 // Invoke Canonicalize twice in order to fully canonicalize patterns |
| 396 // like "if (a & const == 0) { }". | 391 // like "if (a & const == 0) { }". |
| 397 optimizer.Canonicalize(); | 392 optimizer.Canonicalize(); |
| 398 } | 393 } |
| 399 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 394 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 400 | 395 |
| 401 BranchSimplifier::Simplify(flow_graph); | 396 BranchSimplifier::Simplify(flow_graph); |
| 402 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 397 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 Object::Handle(isolate->object_store()->sticky_error()); | 958 Object::Handle(isolate->object_store()->sticky_error()); |
| 964 isolate->object_store()->clear_sticky_error(); | 959 isolate->object_store()->clear_sticky_error(); |
| 965 isolate->set_long_jump_base(base); | 960 isolate->set_long_jump_base(base); |
| 966 return result.raw(); | 961 return result.raw(); |
| 967 } | 962 } |
| 968 UNREACHABLE(); | 963 UNREACHABLE(); |
| 969 return Object::null(); | 964 return Object::null(); |
| 970 } | 965 } |
| 971 | 966 |
| 972 } // namespace dart | 967 } // namespace dart |
| OLD | NEW |