OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 PositionsRecorder* positions_recorder_; | 809 PositionsRecorder* positions_recorder_; |
810 const PositionState saved_state_; | 810 const PositionState saved_state_; |
811 | 811 |
812 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope); | 812 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope); |
813 }; | 813 }; |
814 | 814 |
815 | 815 |
816 // ----------------------------------------------------------------------------- | 816 // ----------------------------------------------------------------------------- |
817 // Utility functions | 817 // Utility functions |
818 | 818 |
819 static inline bool is_intn(int x, int n) { | 819 inline bool is_intn(int x, int n) { |
820 return -(1 << (n-1)) <= x && x < (1 << (n-1)); | 820 return -(1 << (n-1)) <= x && x < (1 << (n-1)); |
821 } | 821 } |
822 | 822 |
823 static inline bool is_int8(int x) { return is_intn(x, 8); } | 823 inline bool is_int8(int x) { return is_intn(x, 8); } |
824 static inline bool is_int16(int x) { return is_intn(x, 16); } | 824 inline bool is_int16(int x) { return is_intn(x, 16); } |
825 static inline bool is_int18(int x) { return is_intn(x, 18); } | 825 inline bool is_int18(int x) { return is_intn(x, 18); } |
826 static inline bool is_int24(int x) { return is_intn(x, 24); } | 826 inline bool is_int24(int x) { return is_intn(x, 24); } |
827 | 827 |
828 static inline bool is_uintn(int x, int n) { | 828 inline bool is_uintn(int x, int n) { |
829 return (x & -(1 << n)) == 0; | 829 return (x & -(1 << n)) == 0; |
830 } | 830 } |
831 | 831 |
832 static inline bool is_uint2(int x) { return is_uintn(x, 2); } | 832 inline bool is_uint2(int x) { return is_uintn(x, 2); } |
833 static inline bool is_uint3(int x) { return is_uintn(x, 3); } | 833 inline bool is_uint3(int x) { return is_uintn(x, 3); } |
834 static inline bool is_uint4(int x) { return is_uintn(x, 4); } | 834 inline bool is_uint4(int x) { return is_uintn(x, 4); } |
835 static inline bool is_uint5(int x) { return is_uintn(x, 5); } | 835 inline bool is_uint5(int x) { return is_uintn(x, 5); } |
836 static inline bool is_uint6(int x) { return is_uintn(x, 6); } | 836 inline bool is_uint6(int x) { return is_uintn(x, 6); } |
837 static inline bool is_uint8(int x) { return is_uintn(x, 8); } | 837 inline bool is_uint8(int x) { return is_uintn(x, 8); } |
838 static inline bool is_uint10(int x) { return is_uintn(x, 10); } | 838 inline bool is_uint10(int x) { return is_uintn(x, 10); } |
839 static inline bool is_uint12(int x) { return is_uintn(x, 12); } | 839 inline bool is_uint12(int x) { return is_uintn(x, 12); } |
840 static inline bool is_uint16(int x) { return is_uintn(x, 16); } | 840 inline bool is_uint16(int x) { return is_uintn(x, 16); } |
841 static inline bool is_uint24(int x) { return is_uintn(x, 24); } | 841 inline bool is_uint24(int x) { return is_uintn(x, 24); } |
842 static inline bool is_uint26(int x) { return is_uintn(x, 26); } | 842 inline bool is_uint26(int x) { return is_uintn(x, 26); } |
843 static inline bool is_uint28(int x) { return is_uintn(x, 28); } | 843 inline bool is_uint28(int x) { return is_uintn(x, 28); } |
844 | 844 |
845 static inline int NumberOfBitsSet(uint32_t x) { | 845 inline int NumberOfBitsSet(uint32_t x) { |
846 unsigned int num_bits_set; | 846 unsigned int num_bits_set; |
847 for (num_bits_set = 0; x; x >>= 1) { | 847 for (num_bits_set = 0; x; x >>= 1) { |
848 num_bits_set += x & 1; | 848 num_bits_set += x & 1; |
849 } | 849 } |
850 return num_bits_set; | 850 return num_bits_set; |
851 } | 851 } |
852 | 852 |
853 bool EvalComparison(Token::Value op, double op1, double op2); | 853 bool EvalComparison(Token::Value op, double op1, double op2); |
854 | 854 |
855 // Computes pow(x, y) with the special cases in the spec for Math.pow. | 855 // Computes pow(x, y) with the special cases in the spec for Math.pow. |
(...skipping 18 matching lines...) Expand all Loading... |
874 public: | 874 public: |
875 NullCallWrapper() { } | 875 NullCallWrapper() { } |
876 virtual ~NullCallWrapper() { } | 876 virtual ~NullCallWrapper() { } |
877 virtual void BeforeCall(int call_size) const { } | 877 virtual void BeforeCall(int call_size) const { } |
878 virtual void AfterCall() const { } | 878 virtual void AfterCall() const { } |
879 }; | 879 }; |
880 | 880 |
881 } } // namespace v8::internal | 881 } } // namespace v8::internal |
882 | 882 |
883 #endif // V8_ASSEMBLER_H_ | 883 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |