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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 #endif | 82 #endif |
83 | 83 |
84 | 84 |
85 // Determine whether double field unboxing feature is enabled. | 85 // Determine whether double field unboxing feature is enabled. |
86 #if (V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64) | 86 #if (V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64) |
87 #define V8_DOUBLE_FIELDS_UNBOXING 1 | 87 #define V8_DOUBLE_FIELDS_UNBOXING 1 |
88 #else | 88 #else |
89 #define V8_DOUBLE_FIELDS_UNBOXING 0 | 89 #define V8_DOUBLE_FIELDS_UNBOXING 0 |
90 #endif | 90 #endif |
91 | 91 |
92 // Support for alternative bool type. This is only enabled if the code is | |
93 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. | |
94 // For instance, 'bool b = "false";' results in b == true! This is a hidden | |
95 // source of bugs. | |
96 // However, redefining the bool type does have some negative impact on some | |
97 // platforms. It gives rise to compiler warnings (i.e. with | |
98 // MSVC) in the API header files when mixing code that uses the standard | |
99 // bool with code that uses the redefined version. | |
100 // This does not actually belong in the platform code, but needs to be | |
101 // defined here because the platform code uses bool, and platform.h is | |
102 // include very early in the main include file. | |
103 | |
104 #ifdef USE_MYBOOL | |
105 typedef unsigned int __my_bool__; | |
106 #define bool __my_bool__ // use 'indirection' to avoid name clashes | |
107 #endif | |
108 | 92 |
109 typedef uint8_t byte; | 93 typedef uint8_t byte; |
110 typedef byte* Address; | 94 typedef byte* Address; |
111 | 95 |
112 // ----------------------------------------------------------------------------- | 96 // ----------------------------------------------------------------------------- |
113 // Constants | 97 // Constants |
114 | 98 |
115 const int KB = 1024; | 99 const int KB = 1024; |
116 const int MB = KB * KB; | 100 const int MB = KB * KB; |
117 const int GB = KB * KB * KB; | 101 const int GB = KB * KB * KB; |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 DCHECK(IsValidFunctionKind(kind)); | 806 DCHECK(IsValidFunctionKind(kind)); |
823 return kind & FunctionKind::kDefaultConstructor; | 807 return kind & FunctionKind::kDefaultConstructor; |
824 } | 808 } |
825 | 809 |
826 | 810 |
827 } } // namespace v8::internal | 811 } } // namespace v8::internal |
828 | 812 |
829 namespace i = v8::internal; | 813 namespace i = v8::internal; |
830 | 814 |
831 #endif // V8_GLOBALS_H_ | 815 #endif // V8_GLOBALS_H_ |
OLD | NEW |