OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2593 switch (op_) { | 2593 switch (op_) { |
2594 case kMathFloor: | 2594 case kMathFloor: |
2595 case kMathRound: | 2595 case kMathRound: |
2596 case kMathSqrt: | 2596 case kMathSqrt: |
2597 case kMathPowHalf: | 2597 case kMathPowHalf: |
2598 case kMathLog: | 2598 case kMathLog: |
2599 case kMathExp: | 2599 case kMathExp: |
2600 return Representation::Double(); | 2600 return Representation::Double(); |
2601 case kMathAbs: | 2601 case kMathAbs: |
2602 return representation(); | 2602 return representation(); |
| 2603 case kMathClz32: |
| 2604 return Representation::Integer32(); |
2603 default: | 2605 default: |
2604 UNREACHABLE(); | 2606 UNREACHABLE(); |
2605 return Representation::None(); | 2607 return Representation::None(); |
2606 } | 2608 } |
2607 } | 2609 } |
2608 } | 2610 } |
2609 | 2611 |
2610 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; | 2612 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; |
2611 | 2613 |
2612 virtual HValue* Canonicalize() V8_OVERRIDE; | 2614 virtual HValue* Canonicalize() V8_OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
2624 } | 2626 } |
2625 | 2627 |
2626 private: | 2628 private: |
2627 HUnaryMathOperation(HValue* context, HValue* value, BuiltinFunctionId op) | 2629 HUnaryMathOperation(HValue* context, HValue* value, BuiltinFunctionId op) |
2628 : HTemplateInstruction<2>(HType::TaggedNumber()), op_(op) { | 2630 : HTemplateInstruction<2>(HType::TaggedNumber()), op_(op) { |
2629 SetOperandAt(0, context); | 2631 SetOperandAt(0, context); |
2630 SetOperandAt(1, value); | 2632 SetOperandAt(1, value); |
2631 switch (op) { | 2633 switch (op) { |
2632 case kMathFloor: | 2634 case kMathFloor: |
2633 case kMathRound: | 2635 case kMathRound: |
| 2636 case kMathClz32: |
2634 set_representation(Representation::Integer32()); | 2637 set_representation(Representation::Integer32()); |
2635 break; | 2638 break; |
2636 case kMathAbs: | 2639 case kMathAbs: |
2637 // Not setting representation here: it is None intentionally. | 2640 // Not setting representation here: it is None intentionally. |
2638 SetFlag(kFlexibleRepresentation); | 2641 SetFlag(kFlexibleRepresentation); |
2639 // TODO(svenpanne) This flag is actually only needed if representation() | 2642 // TODO(svenpanne) This flag is actually only needed if representation() |
2640 // is tagged, and not when it is an unboxed double or unboxed integer. | 2643 // is tagged, and not when it is an unboxed double or unboxed integer. |
2641 SetChangesFlag(kNewSpacePromotion); | 2644 SetChangesFlag(kNewSpacePromotion); |
2642 break; | 2645 break; |
2643 case kMathLog: | 2646 case kMathLog: |
(...skipping 4872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7516 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7519 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7517 }; | 7520 }; |
7518 | 7521 |
7519 | 7522 |
7520 #undef DECLARE_INSTRUCTION | 7523 #undef DECLARE_INSTRUCTION |
7521 #undef DECLARE_CONCRETE_INSTRUCTION | 7524 #undef DECLARE_CONCRETE_INSTRUCTION |
7522 | 7525 |
7523 } } // namespace v8::internal | 7526 } } // namespace v8::internal |
7524 | 7527 |
7525 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |