| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/redundancy_elimination.h" | 5 #include "vm/redundancy_elimination.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/flow_graph.h" | 8 #include "vm/flow_graph.h" |
| 9 #include "vm/hash_map.h" | 9 #include "vm/hash_map.h" |
| 10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 | 1316 |
| 1317 if (check == NULL) { | 1317 if (check == NULL) { |
| 1318 return; | 1318 return; |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 // Host CheckSmi instruction and make this phi smi one. | 1321 // Host CheckSmi instruction and make this phi smi one. |
| 1322 Hoist(NULL, pre_header, check); | 1322 Hoist(NULL, pre_header, check); |
| 1323 | 1323 |
| 1324 // Replace value we are checking with phi's input. | 1324 // Replace value we are checking with phi's input. |
| 1325 check->value()->BindTo(phi->InputAt(non_smi_input)->definition()); | 1325 check->value()->BindTo(phi->InputAt(non_smi_input)->definition()); |
| 1326 check->value()->SetReachingType(phi->InputAt(non_smi_input)->Type()); |
| 1326 | 1327 |
| 1327 phi->UpdateType(CompileType::FromCid(kSmiCid)); | 1328 phi->UpdateType(CompileType::FromCid(kSmiCid)); |
| 1328 } | 1329 } |
| 1329 | 1330 |
| 1330 void LICM::OptimisticallySpecializeSmiPhis() { | 1331 void LICM::OptimisticallySpecializeSmiPhis() { |
| 1331 if (!flow_graph()->function().allows_hoisting_check_class() || | 1332 if (!flow_graph()->function().allows_hoisting_check_class() || |
| 1332 FLAG_precompiled_mode) { | 1333 FLAG_precompiled_mode) { |
| 1333 // Do not hoist any: Either deoptimized on a hoisted check, | 1334 // Do not hoist any: Either deoptimized on a hoisted check, |
| 1334 // or compiling precompiled code where we can't do optimistic | 1335 // or compiling precompiled code where we can't do optimistic |
| 1335 // hoisting of checks. | 1336 // hoisting of checks. |
| (...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3293 if (to_index == 0) { | 3294 if (to_index == 0) { |
| 3294 join->phis_ = NULL; | 3295 join->phis_ = NULL; |
| 3295 } else { | 3296 } else { |
| 3296 join->phis_->TruncateTo(to_index); | 3297 join->phis_->TruncateTo(to_index); |
| 3297 } | 3298 } |
| 3298 } | 3299 } |
| 3299 } | 3300 } |
| 3300 } | 3301 } |
| 3301 | 3302 |
| 3302 } // namespace dart | 3303 } // namespace dart |
| OLD | NEW |