| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3513 ASSERT(InputCount() > 1); | 3513 ASSERT(InputCount() > 1); |
| 3514 Definition* first = InputAt(0)->definition(); | 3514 Definition* first = InputAt(0)->definition(); |
| 3515 for (intptr_t i = 1; i < InputCount(); ++i) { | 3515 for (intptr_t i = 1; i < InputCount(); ++i) { |
| 3516 Definition* def = InputAt(i)->definition(); | 3516 Definition* def = InputAt(i)->definition(); |
| 3517 if (def != first) return false; | 3517 if (def != first) return false; |
| 3518 } | 3518 } |
| 3519 return true; | 3519 return true; |
| 3520 } | 3520 } |
| 3521 | 3521 |
| 3522 | 3522 |
| 3523 bool PhiInstr::HasReplacement(Definition** replacement) const { |
| 3524 ASSERT(InputCount() > 1); |
| 3525 ASSERT(!IsRedundant()); |
| 3526 // At least >=1 inputs are different from 'this': Check for |
| 3527 // v <- phi (v, v, ..., r, v, ..., v) |
| 3528 // where r is the replacement. |
| 3529 intptr_t i = 0; |
| 3530 while (InputAt(i)->definition() == this) ++i; |
| 3531 *replacement = InputAt(i)->definition(); |
| 3532 while (++i < InputCount()) { |
| 3533 if (InputAt(i)->definition() != this) return false; |
| 3534 } |
| 3535 return true; |
| 3536 } |
| 3537 |
| 3538 |
| 3523 bool CheckArrayBoundInstr::IsFixedLengthArrayType(intptr_t cid) { | 3539 bool CheckArrayBoundInstr::IsFixedLengthArrayType(intptr_t cid) { |
| 3524 return LoadFieldInstr::IsFixedLengthArrayCid(cid); | 3540 return LoadFieldInstr::IsFixedLengthArrayCid(cid); |
| 3525 } | 3541 } |
| 3526 | 3542 |
| 3527 | 3543 |
| 3528 Instruction* CheckArrayBoundInstr::Canonicalize(FlowGraph* flow_graph) { | 3544 Instruction* CheckArrayBoundInstr::Canonicalize(FlowGraph* flow_graph) { |
| 3529 return IsRedundant(RangeBoundary::FromDefinition(length()->definition())) ? | 3545 return IsRedundant(RangeBoundary::FromDefinition(length()->definition())) ? |
| 3530 NULL : this; | 3546 NULL : this; |
| 3531 } | 3547 } |
| 3532 | 3548 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3870 set_native_c_function(native_function); | 3886 set_native_c_function(native_function); |
| 3871 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3887 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3872 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3888 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3873 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3889 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3874 set_is_bootstrap_native(is_bootstrap_native); | 3890 set_is_bootstrap_native(is_bootstrap_native); |
| 3875 } | 3891 } |
| 3876 | 3892 |
| 3877 #undef __ | 3893 #undef __ |
| 3878 | 3894 |
| 3879 } // namespace dart | 3895 } // namespace dart |
| OLD | NEW |