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_GLOBALS_H_ | 5 #ifndef V8_GLOBALS_H_ |
6 #define V8_GLOBALS_H_ | 6 #define V8_GLOBALS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 DCHECK(IsValidFunctionKind(kind)); | 1036 DCHECK(IsValidFunctionKind(kind)); |
1037 return kind & FunctionKind::kInObjectLiteral; | 1037 return kind & FunctionKind::kInObjectLiteral; |
1038 } | 1038 } |
1039 | 1039 |
1040 | 1040 |
1041 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) { | 1041 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) { |
1042 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); | 1042 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); |
1043 DCHECK(IsValidFunctionKind(kind)); | 1043 DCHECK(IsValidFunctionKind(kind)); |
1044 return kind; | 1044 return kind; |
1045 } | 1045 } |
1046 | |
1047 inline uint32_t ObjectHash(Address address) { | |
1048 // All objects are at least pointer aligned, so we can remove the trailing | |
1049 // zeros. | |
1050 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> | |
1051 kPointerSizeLog2); | |
1052 } | |
1053 | |
1054 } // namespace internal | 1046 } // namespace internal |
1055 } // namespace v8 | 1047 } // namespace v8 |
1056 | 1048 |
1057 namespace i = v8::internal; | 1049 namespace i = v8::internal; |
1058 | 1050 |
1059 #endif // V8_GLOBALS_H_ | 1051 #endif // V8_GLOBALS_H_ |
OLD | NEW |