| 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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 PositionsRecorder* positions_recorder_; | 995 PositionsRecorder* positions_recorder_; |
| 996 const PositionState saved_state_; | 996 const PositionState saved_state_; |
| 997 | 997 |
| 998 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope); | 998 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope); |
| 999 }; | 999 }; |
| 1000 | 1000 |
| 1001 | 1001 |
| 1002 // ----------------------------------------------------------------------------- | 1002 // ----------------------------------------------------------------------------- |
| 1003 // Utility functions | 1003 // Utility functions |
| 1004 | 1004 |
| 1005 inline bool is_intn(int x, int n) { | |
| 1006 return -(1 << (n-1)) <= x && x < (1 << (n-1)); | |
| 1007 } | |
| 1008 | |
| 1009 inline bool is_int8(int x) { return is_intn(x, 8); } | |
| 1010 inline bool is_int16(int x) { return is_intn(x, 16); } | |
| 1011 inline bool is_int18(int x) { return is_intn(x, 18); } | |
| 1012 inline bool is_int24(int x) { return is_intn(x, 24); } | |
| 1013 | |
| 1014 inline bool is_uintn(int x, int n) { | |
| 1015 return (x & -(1 << n)) == 0; | |
| 1016 } | |
| 1017 | |
| 1018 inline bool is_uint2(int x) { return is_uintn(x, 2); } | |
| 1019 inline bool is_uint3(int x) { return is_uintn(x, 3); } | |
| 1020 inline bool is_uint4(int x) { return is_uintn(x, 4); } | |
| 1021 inline bool is_uint5(int x) { return is_uintn(x, 5); } | |
| 1022 inline bool is_uint6(int x) { return is_uintn(x, 6); } | |
| 1023 inline bool is_uint8(int x) { return is_uintn(x, 8); } | |
| 1024 inline bool is_uint10(int x) { return is_uintn(x, 10); } | |
| 1025 inline bool is_uint12(int x) { return is_uintn(x, 12); } | |
| 1026 inline bool is_uint16(int x) { return is_uintn(x, 16); } | |
| 1027 inline bool is_uint24(int x) { return is_uintn(x, 24); } | |
| 1028 inline bool is_uint26(int x) { return is_uintn(x, 26); } | |
| 1029 inline bool is_uint28(int x) { return is_uintn(x, 28); } | |
| 1030 | |
| 1031 inline int NumberOfBitsSet(uint32_t x) { | 1005 inline int NumberOfBitsSet(uint32_t x) { |
| 1032 unsigned int num_bits_set; | 1006 unsigned int num_bits_set; |
| 1033 for (num_bits_set = 0; x; x >>= 1) { | 1007 for (num_bits_set = 0; x; x >>= 1) { |
| 1034 num_bits_set += x & 1; | 1008 num_bits_set += x & 1; |
| 1035 } | 1009 } |
| 1036 return num_bits_set; | 1010 return num_bits_set; |
| 1037 } | 1011 } |
| 1038 | 1012 |
| 1039 bool EvalComparison(Token::Value op, double op1, double op2); | 1013 bool EvalComparison(Token::Value op, double op1, double op2); |
| 1040 | 1014 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1061 public: | 1035 public: |
| 1062 NullCallWrapper() { } | 1036 NullCallWrapper() { } |
| 1063 virtual ~NullCallWrapper() { } | 1037 virtual ~NullCallWrapper() { } |
| 1064 virtual void BeforeCall(int call_size) const { } | 1038 virtual void BeforeCall(int call_size) const { } |
| 1065 virtual void AfterCall() const { } | 1039 virtual void AfterCall() const { } |
| 1066 }; | 1040 }; |
| 1067 | 1041 |
| 1068 } } // namespace v8::internal | 1042 } } // namespace v8::internal |
| 1069 | 1043 |
| 1070 #endif // V8_ASSEMBLER_H_ | 1044 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |