OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| 11 #include "src/base/bits.h" |
11 #include "src/code-stubs.h" | 12 #include "src/code-stubs.h" |
12 #include "src/conversions.h" | 13 #include "src/conversions.h" |
13 #include "src/data-flow.h" | 14 #include "src/data-flow.h" |
14 #include "src/deoptimizer.h" | 15 #include "src/deoptimizer.h" |
15 #include "src/feedback-slots.h" | 16 #include "src/feedback-slots.h" |
16 #include "src/hydrogen-types.h" | 17 #include "src/hydrogen-types.h" |
17 #include "src/small-pointer-list.h" | 18 #include "src/small-pointer-list.h" |
18 #include "src/unique.h" | 19 #include "src/unique.h" |
19 #include "src/utils.h" | 20 #include "src/utils.h" |
20 #include "src/zone.h" | 21 #include "src/zone.h" |
(...skipping 3817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3838 void SetOperandPositions(Zone* zone, | 3839 void SetOperandPositions(Zone* zone, |
3839 HSourcePosition left_pos, | 3840 HSourcePosition left_pos, |
3840 HSourcePosition right_pos) { | 3841 HSourcePosition right_pos) { |
3841 set_operand_position(zone, 1, left_pos); | 3842 set_operand_position(zone, 1, left_pos); |
3842 set_operand_position(zone, 2, right_pos); | 3843 set_operand_position(zone, 2, right_pos); |
3843 } | 3844 } |
3844 | 3845 |
3845 bool RightIsPowerOf2() { | 3846 bool RightIsPowerOf2() { |
3846 if (!right()->IsInteger32Constant()) return false; | 3847 if (!right()->IsInteger32Constant()) return false; |
3847 int32_t value = right()->GetInteger32Constant(); | 3848 int32_t value = right()->GetInteger32Constant(); |
3848 return IsPowerOf2(value) || IsPowerOf2(-value); | 3849 if (value < 0) { |
| 3850 return base::bits::IsPowerOfTwo32(static_cast<uint32_t>(-value)); |
| 3851 } |
| 3852 return base::bits::IsPowerOfTwo32(static_cast<uint32_t>(value)); |
3849 } | 3853 } |
3850 | 3854 |
3851 DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) | 3855 DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) |
3852 | 3856 |
3853 private: | 3857 private: |
3854 bool IgnoreObservedOutputRepresentation(Representation current_rep); | 3858 bool IgnoreObservedOutputRepresentation(Representation current_rep); |
3855 | 3859 |
3856 Representation observed_input_representation_[2]; | 3860 Representation observed_input_representation_[2]; |
3857 Representation observed_output_representation_; | 3861 Representation observed_output_representation_; |
3858 }; | 3862 }; |
(...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7849 }; | 7853 }; |
7850 | 7854 |
7851 | 7855 |
7852 | 7856 |
7853 #undef DECLARE_INSTRUCTION | 7857 #undef DECLARE_INSTRUCTION |
7854 #undef DECLARE_CONCRETE_INSTRUCTION | 7858 #undef DECLARE_CONCRETE_INSTRUCTION |
7855 | 7859 |
7856 } } // namespace v8::internal | 7860 } } // namespace v8::internal |
7857 | 7861 |
7858 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7862 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |