| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 } | 1140 } |
| 1141 cursor = NULL; | 1141 cursor = NULL; |
| 1142 } else { | 1142 } else { |
| 1143 // For all variants except the last, use a branch on the loaded class | 1143 // For all variants except the last, use a branch on the loaded class |
| 1144 // id. | 1144 // id. |
| 1145 const Smi& cid = Smi::ZoneHandle(Smi::New(inlined_variants_[i].cid)); | 1145 const Smi& cid = Smi::ZoneHandle(Smi::New(inlined_variants_[i].cid)); |
| 1146 ConstantInstr* cid_constant = new ConstantInstr(cid); | 1146 ConstantInstr* cid_constant = new ConstantInstr(cid); |
| 1147 cid_constant->set_ssa_temp_index( | 1147 cid_constant->set_ssa_temp_index( |
| 1148 owner_->caller_graph()->alloc_ssa_temp_index()); | 1148 owner_->caller_graph()->alloc_ssa_temp_index()); |
| 1149 StrictCompareInstr* compare = | 1149 StrictCompareInstr* compare = |
| 1150 new StrictCompareInstr(Token::kEQ_STRICT, | 1150 new StrictCompareInstr(call_->instance_call()->token_pos(), |
| 1151 Token::kEQ_STRICT, |
| 1151 new Value(load_cid), | 1152 new Value(load_cid), |
| 1152 new Value(cid_constant)); | 1153 new Value(cid_constant)); |
| 1153 BranchInstr* branch = new BranchInstr(compare); | 1154 BranchInstr* branch = new BranchInstr(compare); |
| 1154 branch->InheritDeoptTarget(call_); | 1155 branch->InheritDeoptTarget(call_); |
| 1155 AppendInstruction(AppendInstruction(cursor, cid_constant), branch); | 1156 AppendInstruction(AppendInstruction(cursor, cid_constant), branch); |
| 1156 current_block->set_last_instruction(branch); | 1157 current_block->set_last_instruction(branch); |
| 1157 cursor = NULL; | 1158 cursor = NULL; |
| 1158 | 1159 |
| 1159 // 2. Handle a match by linking to the inlined body. There are three | 1160 // 2. Handle a match by linking to the inlined body. There are three |
| 1160 // cases (unshared, shared first predecessor, and shared subsequent | 1161 // cases (unshared, shared first predecessor, and shared subsequent |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 OS::Print("After Inlining of %s\n", flow_graph_-> | 1335 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1335 parsed_function().function().ToFullyQualifiedCString()); | 1336 parsed_function().function().ToFullyQualifiedCString()); |
| 1336 FlowGraphPrinter printer(*flow_graph_); | 1337 FlowGraphPrinter printer(*flow_graph_); |
| 1337 printer.PrintBlocks(); | 1338 printer.PrintBlocks(); |
| 1338 } | 1339 } |
| 1339 } | 1340 } |
| 1340 } | 1341 } |
| 1341 } | 1342 } |
| 1342 | 1343 |
| 1343 } // namespace dart | 1344 } // namespace dart |
| OLD | NEW |