| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 | 211 |
| 212 // FUNCTION_CAST<F>(addr) casts an address into a function | 212 // FUNCTION_CAST<F>(addr) casts an address into a function |
| 213 // of type F. Used to invoke generated code from within C. | 213 // of type F. Used to invoke generated code from within C. |
| 214 template <typename F> | 214 template <typename F> |
| 215 F FUNCTION_CAST(Address addr) { | 215 F FUNCTION_CAST(Address addr) { |
| 216 return reinterpret_cast<F>(reinterpret_cast<intptr_t>(addr)); | 216 return reinterpret_cast<F>(reinterpret_cast<intptr_t>(addr)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 | 219 |
| 220 // Determine whether the architecture uses function descriptors |
| 221 // which provide a level of indirection between the function pointer |
| 222 // and the function entrypoint. |
| 223 #if V8_HOST_ARCH_PPC && \ |
| 224 (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN)) |
| 225 #define USES_FUNCTION_DESCRIPTORS 1 |
| 226 #define FUNCTION_ENTRYPOINT_ADDRESS(f) \ |
| 227 (reinterpret_cast<v8::internal::Address*>( \ |
| 228 &(reinterpret_cast<intptr_t*>(f)[0]))) |
| 229 #else |
| 230 #define USES_FUNCTION_DESCRIPTORS 0 |
| 231 #endif |
| 232 |
| 233 |
| 220 // ----------------------------------------------------------------------------- | 234 // ----------------------------------------------------------------------------- |
| 221 // Forward declarations for frequently used classes | 235 // Forward declarations for frequently used classes |
| 222 // (sorted alphabetically) | 236 // (sorted alphabetically) |
| 223 | 237 |
| 224 class FreeStoreAllocationPolicy; | 238 class FreeStoreAllocationPolicy; |
| 225 template <typename T, class P = FreeStoreAllocationPolicy> class List; | 239 template <typename T, class P = FreeStoreAllocationPolicy> class List; |
| 226 | 240 |
| 227 // ----------------------------------------------------------------------------- | 241 // ----------------------------------------------------------------------------- |
| 228 // Declarations for use in both the preparser and the rest of V8. | 242 // Declarations for use in both the preparser and the rest of V8. |
| 229 | 243 |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); | 1033 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); |
| 1020 DCHECK(IsValidFunctionKind(kind)); | 1034 DCHECK(IsValidFunctionKind(kind)); |
| 1021 return kind; | 1035 return kind; |
| 1022 } | 1036 } |
| 1023 } // namespace internal | 1037 } // namespace internal |
| 1024 } // namespace v8 | 1038 } // namespace v8 |
| 1025 | 1039 |
| 1026 namespace i = v8::internal; | 1040 namespace i = v8::internal; |
| 1027 | 1041 |
| 1028 #endif // V8_GLOBALS_H_ | 1042 #endif // V8_GLOBALS_H_ |
| OLD | NEW |