| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { | 1007 void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { |
| 1008 if (instr->HasICData() && (instr->ic_data()->NumberOfChecks() > 0)) { | 1008 if (instr->HasICData() && (instr->ic_data()->NumberOfChecks() > 0)) { |
| 1009 const Token::Kind op_kind = instr->token_kind(); | 1009 const Token::Kind op_kind = instr->token_kind(); |
| 1010 if ((op_kind == Token::kASSIGN_INDEX) && | 1010 if ((op_kind == Token::kASSIGN_INDEX) && |
| 1011 TryReplaceWithStoreIndexed(instr)) { | 1011 TryReplaceWithStoreIndexed(instr)) { |
| 1012 return; | 1012 return; |
| 1013 } | 1013 } |
| 1014 if ((op_kind == Token::kINDEX) && TryReplaceWithLoadIndexed(instr)) { | 1014 if ((op_kind == Token::kINDEX) && TryReplaceWithLoadIndexed(instr)) { |
| 1015 return; | 1015 return; |
| 1016 } | 1016 } |
| 1017 if (Token::IsBinaryToken(op_kind) && | 1017 if (Token::IsBinaryOperator(op_kind) && |
| 1018 TryReplaceWithBinaryOp(instr, op_kind)) { | 1018 TryReplaceWithBinaryOp(instr, op_kind)) { |
| 1019 return; | 1019 return; |
| 1020 } | 1020 } |
| 1021 if (Token::IsUnaryToken(op_kind) && | 1021 if (Token::IsPrefixOperator(op_kind) && |
| 1022 TryReplaceWithUnaryOp(instr, op_kind)) { | 1022 TryReplaceWithUnaryOp(instr, op_kind)) { |
| 1023 return; | 1023 return; |
| 1024 } | 1024 } |
| 1025 if ((op_kind == Token::kGET) && TryInlineInstanceGetter(instr)) { | 1025 if ((op_kind == Token::kGET) && TryInlineInstanceGetter(instr)) { |
| 1026 return; | 1026 return; |
| 1027 } | 1027 } |
| 1028 if ((op_kind == Token::kSET) && TryInlineInstanceSetter(instr)) { | 1028 if ((op_kind == Token::kSET) && TryInlineInstanceSetter(instr)) { |
| 1029 return; | 1029 return; |
| 1030 } | 1030 } |
| 1031 if (TryInlineInstanceMethod(instr)) { | 1031 if (TryInlineInstanceMethod(instr)) { |
| (...skipping 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3335 | 3335 |
| 3336 if (FLAG_trace_constant_propagation) { | 3336 if (FLAG_trace_constant_propagation) { |
| 3337 OS::Print("\n==== After constant propagation ====\n"); | 3337 OS::Print("\n==== After constant propagation ====\n"); |
| 3338 FlowGraphPrinter printer(*graph_); | 3338 FlowGraphPrinter printer(*graph_); |
| 3339 printer.PrintBlocks(); | 3339 printer.PrintBlocks(); |
| 3340 } | 3340 } |
| 3341 } | 3341 } |
| 3342 | 3342 |
| 3343 | 3343 |
| 3344 } // namespace dart | 3344 } // namespace dart |
| OLD | NEW |