@babylonjs/v8-android-jit-nointl-nosnapshot 11.110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/include/APIDesign.md +72 -0
  2. package/dist/include/DEPS +10 -0
  3. package/dist/include/DIR_METADATA +11 -0
  4. package/dist/include/OWNERS +23 -0
  5. package/dist/include/cppgc/DEPS +8 -0
  6. package/dist/include/cppgc/OWNERS +2 -0
  7. package/dist/include/cppgc/README.md +135 -0
  8. package/dist/include/cppgc/allocation.h +310 -0
  9. package/dist/include/cppgc/common.h +28 -0
  10. package/dist/include/cppgc/cross-thread-persistent.h +464 -0
  11. package/dist/include/cppgc/custom-space.h +97 -0
  12. package/dist/include/cppgc/default-platform.h +67 -0
  13. package/dist/include/cppgc/ephemeron-pair.h +30 -0
  14. package/dist/include/cppgc/explicit-management.h +100 -0
  15. package/dist/include/cppgc/garbage-collected.h +106 -0
  16. package/dist/include/cppgc/heap-consistency.h +309 -0
  17. package/dist/include/cppgc/heap-handle.h +48 -0
  18. package/dist/include/cppgc/heap-state.h +82 -0
  19. package/dist/include/cppgc/heap-statistics.h +120 -0
  20. package/dist/include/cppgc/heap.h +202 -0
  21. package/dist/include/cppgc/internal/api-constants.h +65 -0
  22. package/dist/include/cppgc/internal/atomic-entry-flag.h +48 -0
  23. package/dist/include/cppgc/internal/base-page-handle.h +45 -0
  24. package/dist/include/cppgc/internal/caged-heap-local-data.h +111 -0
  25. package/dist/include/cppgc/internal/caged-heap.h +61 -0
  26. package/dist/include/cppgc/internal/compiler-specific.h +38 -0
  27. package/dist/include/cppgc/internal/finalizer-trait.h +93 -0
  28. package/dist/include/cppgc/internal/gc-info.h +155 -0
  29. package/dist/include/cppgc/internal/logging.h +50 -0
  30. package/dist/include/cppgc/internal/member-storage.h +236 -0
  31. package/dist/include/cppgc/internal/name-trait.h +137 -0
  32. package/dist/include/cppgc/internal/persistent-node.h +214 -0
  33. package/dist/include/cppgc/internal/pointer-policies.h +207 -0
  34. package/dist/include/cppgc/internal/write-barrier.h +477 -0
  35. package/dist/include/cppgc/liveness-broker.h +78 -0
  36. package/dist/include/cppgc/macros.h +26 -0
  37. package/dist/include/cppgc/member.h +566 -0
  38. package/dist/include/cppgc/name-provider.h +65 -0
  39. package/dist/include/cppgc/object-size-trait.h +58 -0
  40. package/dist/include/cppgc/persistent.h +366 -0
  41. package/dist/include/cppgc/platform.h +158 -0
  42. package/dist/include/cppgc/prefinalizer.h +75 -0
  43. package/dist/include/cppgc/process-heap-statistics.h +36 -0
  44. package/dist/include/cppgc/sentinel-pointer.h +32 -0
  45. package/dist/include/cppgc/source-location.h +92 -0
  46. package/dist/include/cppgc/testing.h +106 -0
  47. package/dist/include/cppgc/trace-trait.h +120 -0
  48. package/dist/include/cppgc/type-traits.h +249 -0
  49. package/dist/include/cppgc/visitor.h +411 -0
  50. package/dist/include/js_protocol-1.2.json +997 -0
  51. package/dist/include/js_protocol-1.3.json +1159 -0
  52. package/dist/include/js_protocol.pdl +1766 -0
  53. package/dist/include/libplatform/DEPS +9 -0
  54. package/dist/include/libplatform/libplatform-export.h +29 -0
  55. package/dist/include/libplatform/libplatform.h +106 -0
  56. package/dist/include/libplatform/v8-tracing.h +333 -0
  57. package/dist/include/v8-array-buffer.h +512 -0
  58. package/dist/include/v8-callbacks.h +412 -0
  59. package/dist/include/v8-container.h +129 -0
  60. package/dist/include/v8-context.h +415 -0
  61. package/dist/include/v8-cppgc.h +231 -0
  62. package/dist/include/v8-data.h +80 -0
  63. package/dist/include/v8-date.h +48 -0
  64. package/dist/include/v8-debug.h +168 -0
  65. package/dist/include/v8-embedder-heap.h +223 -0
  66. package/dist/include/v8-embedder-state-scope.h +51 -0
  67. package/dist/include/v8-exception.h +217 -0
  68. package/dist/include/v8-extension.h +62 -0
  69. package/dist/include/v8-external.h +37 -0
  70. package/dist/include/v8-fast-api-calls.h +957 -0
  71. package/dist/include/v8-forward.h +81 -0
  72. package/dist/include/v8-function-callback.h +475 -0
  73. package/dist/include/v8-function.h +133 -0
  74. package/dist/include/v8-initialization.h +289 -0
  75. package/dist/include/v8-inspector-protocol.h +13 -0
  76. package/dist/include/v8-inspector.h +397 -0
  77. package/dist/include/v8-internal.h +851 -0
  78. package/dist/include/v8-isolate.h +1695 -0
  79. package/dist/include/v8-json.h +47 -0
  80. package/dist/include/v8-local-handle.h +455 -0
  81. package/dist/include/v8-locker.h +138 -0
  82. package/dist/include/v8-maybe.h +160 -0
  83. package/dist/include/v8-memory-span.h +43 -0
  84. package/dist/include/v8-message.h +214 -0
  85. package/dist/include/v8-metrics.h +311 -0
  86. package/dist/include/v8-microtask-queue.h +157 -0
  87. package/dist/include/v8-microtask.h +28 -0
  88. package/dist/include/v8-object.h +768 -0
  89. package/dist/include/v8-persistent-handle.h +588 -0
  90. package/dist/include/v8-platform.h +1130 -0
  91. package/dist/include/v8-primitive-object.h +118 -0
  92. package/dist/include/v8-primitive.h +866 -0
  93. package/dist/include/v8-profiler.h +1277 -0
  94. package/dist/include/v8-promise.h +174 -0
  95. package/dist/include/v8-proxy.h +50 -0
  96. package/dist/include/v8-regexp.h +106 -0
  97. package/dist/include/v8-script.h +803 -0
  98. package/dist/include/v8-snapshot.h +196 -0
  99. package/dist/include/v8-statistics.h +217 -0
  100. package/dist/include/v8-template.h +1018 -0
  101. package/dist/include/v8-traced-handle.h +420 -0
  102. package/dist/include/v8-typed-array.h +282 -0
  103. package/dist/include/v8-unwinder-state.h +31 -0
  104. package/dist/include/v8-unwinder.h +132 -0
  105. package/dist/include/v8-util.h +656 -0
  106. package/dist/include/v8-value-serializer-version.h +24 -0
  107. package/dist/include/v8-value-serializer.h +302 -0
  108. package/dist/include/v8-value.h +531 -0
  109. package/dist/include/v8-version-string.h +38 -0
  110. package/dist/include/v8-version.h +20 -0
  111. package/dist/include/v8-wasm-trap-handler-posix.h +31 -0
  112. package/dist/include/v8-wasm-trap-handler-win.h +28 -0
  113. package/dist/include/v8-wasm.h +200 -0
  114. package/dist/include/v8-weak-callback-info.h +80 -0
  115. package/dist/include/v8.h +88 -0
  116. package/dist/include/v8config.h +904 -0
  117. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.aar +0 -0
  118. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.aar.md5 +1 -0
  119. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.aar.sha1 +1 -0
  120. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.pom +10 -0
  121. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.pom.md5 +1 -0
  122. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.pom.sha1 +1 -0
  123. package/dist/org/chromium/v8-android/maven-metadata.xml +12 -0
  124. package/dist/org/chromium/v8-android/maven-metadata.xml.md5 +1 -0
  125. package/dist/org/chromium/v8-android/maven-metadata.xml.sha1 +1 -0
  126. package/package.json +24 -0
@@ -0,0 +1,904 @@
1
+ // Copyright 2013 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef V8CONFIG_H_
6
+ #define V8CONFIG_H_
7
+
8
+ #ifdef V8_GN_HEADER
9
+ #if __cplusplus >= 201703L && !__has_include("v8-gn.h")
10
+ #error Missing v8-gn.h. The configuration for v8 is missing from the include \
11
+ path. Add it with -I<path> to the command line
12
+ #endif
13
+ #include "v8-gn.h" // NOLINT(build/include_directory)
14
+ #endif
15
+
16
+ // clang-format off
17
+
18
+ // Platform headers for feature detection below.
19
+ #if defined(__ANDROID__)
20
+ # include <sys/cdefs.h>
21
+ #elif defined(__APPLE__)
22
+ # include <TargetConditionals.h>
23
+ #elif defined(__linux__)
24
+ # include <features.h>
25
+ #endif
26
+
27
+
28
+ // This macro allows to test for the version of the GNU C library (or
29
+ // a compatible C library that masquerades as glibc). It evaluates to
30
+ // 0 if libc is not GNU libc or compatible.
31
+ // Use like:
32
+ // #if V8_GLIBC_PREREQ(2, 3)
33
+ // ...
34
+ // #endif
35
+ #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
36
+ # define V8_GLIBC_PREREQ(major, minor) \
37
+ ((__GLIBC__ * 100 + __GLIBC_MINOR__) >= ((major) * 100 + (minor)))
38
+ #else
39
+ # define V8_GLIBC_PREREQ(major, minor) 0
40
+ #endif
41
+
42
+
43
+ // This macro allows to test for the version of the GNU C++ compiler.
44
+ // Note that this also applies to compilers that masquerade as GCC,
45
+ // for example clang and the Intel C++ compiler for Linux.
46
+ // Use like:
47
+ // #if V8_GNUC_PREREQ(4, 3, 1)
48
+ // ...
49
+ // #endif
50
+ #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
51
+ # define V8_GNUC_PREREQ(major, minor, patchlevel) \
52
+ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
53
+ ((major) * 10000 + (minor) * 100 + (patchlevel)))
54
+ #elif defined(__GNUC__) && defined(__GNUC_MINOR__)
55
+ # define V8_GNUC_PREREQ(major, minor, patchlevel) \
56
+ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= \
57
+ ((major) * 10000 + (minor) * 100 + (patchlevel)))
58
+ #else
59
+ # define V8_GNUC_PREREQ(major, minor, patchlevel) 0
60
+ #endif
61
+
62
+
63
+
64
+ // -----------------------------------------------------------------------------
65
+ // Operating system detection (host)
66
+ //
67
+ // V8_OS_ANDROID - Android
68
+ // V8_OS_BSD - BSDish (macOS, Net/Free/Open/DragonFlyBSD)
69
+ // V8_OS_CYGWIN - Cygwin
70
+ // V8_OS_DRAGONFLYBSD - DragonFlyBSD
71
+ // V8_OS_FREEBSD - FreeBSD
72
+ // V8_OS_FUCHSIA - Fuchsia
73
+ // V8_OS_LINUX - Linux (Android, ChromeOS, Linux, ...)
74
+ // V8_OS_DARWIN - Darwin (macOS, iOS)
75
+ // V8_OS_MACOS - macOS
76
+ // V8_OS_IOS - iOS
77
+ // V8_OS_NETBSD - NetBSD
78
+ // V8_OS_OPENBSD - OpenBSD
79
+ // V8_OS_POSIX - POSIX compatible (mostly everything except Windows)
80
+ // V8_OS_QNX - QNX Neutrino
81
+ // V8_OS_SOLARIS - Sun Solaris and OpenSolaris
82
+ // V8_OS_STARBOARD - Starboard (platform abstraction for Cobalt)
83
+ // V8_OS_AIX - AIX
84
+ // V8_OS_WIN - Microsoft Windows
85
+
86
+ #if defined(__ANDROID__)
87
+ # define V8_OS_ANDROID 1
88
+ # define V8_OS_LINUX 1
89
+ # define V8_OS_POSIX 1
90
+ # define V8_OS_STRING "android"
91
+
92
+ #elif defined(__APPLE__)
93
+ # define V8_OS_POSIX 1
94
+ # define V8_OS_BSD 1
95
+ # define V8_OS_DARWIN 1
96
+ # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
97
+ # define V8_OS_IOS 1
98
+ # define V8_OS_STRING "ios"
99
+ # else
100
+ # define V8_OS_MACOS 1
101
+ # define V8_OS_STRING "macos"
102
+ # endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
103
+
104
+ #elif defined(__CYGWIN__)
105
+ # define V8_OS_CYGWIN 1
106
+ # define V8_OS_POSIX 1
107
+ # define V8_OS_STRING "cygwin"
108
+
109
+ #elif defined(__linux__)
110
+ # define V8_OS_LINUX 1
111
+ # define V8_OS_POSIX 1
112
+ # define V8_OS_STRING "linux"
113
+
114
+ #elif defined(__sun)
115
+ # define V8_OS_POSIX 1
116
+ # define V8_OS_SOLARIS 1
117
+ # define V8_OS_STRING "sun"
118
+
119
+ #elif defined(STARBOARD)
120
+ # define V8_OS_STARBOARD 1
121
+ # define V8_OS_STRING "starboard"
122
+
123
+ #elif defined(_AIX)
124
+ # define V8_OS_POSIX 1
125
+ # define V8_OS_AIX 1
126
+ # define V8_OS_STRING "aix"
127
+
128
+ #elif defined(__FreeBSD__)
129
+ # define V8_OS_BSD 1
130
+ # define V8_OS_FREEBSD 1
131
+ # define V8_OS_POSIX 1
132
+ # define V8_OS_STRING "freebsd"
133
+
134
+ #elif defined(__Fuchsia__)
135
+ # define V8_OS_FUCHSIA 1
136
+ # define V8_OS_POSIX 1
137
+ # define V8_OS_STRING "fuchsia"
138
+
139
+ #elif defined(__DragonFly__)
140
+ # define V8_OS_BSD 1
141
+ # define V8_OS_DRAGONFLYBSD 1
142
+ # define V8_OS_POSIX 1
143
+ # define V8_OS_STRING "dragonflybsd"
144
+
145
+ #elif defined(__NetBSD__)
146
+ # define V8_OS_BSD 1
147
+ # define V8_OS_NETBSD 1
148
+ # define V8_OS_POSIX 1
149
+ # define V8_OS_STRING "netbsd"
150
+
151
+ #elif defined(__OpenBSD__)
152
+ # define V8_OS_BSD 1
153
+ # define V8_OS_OPENBSD 1
154
+ # define V8_OS_POSIX 1
155
+ # define V8_OS_STRING "openbsd"
156
+
157
+ #elif defined(__QNXNTO__)
158
+ # define V8_OS_POSIX 1
159
+ # define V8_OS_QNX 1
160
+ # define V8_OS_STRING "qnx"
161
+
162
+ #elif defined(_WIN32)
163
+ # define V8_OS_WIN 1
164
+ # define V8_OS_STRING "windows"
165
+ #endif
166
+
167
+ // -----------------------------------------------------------------------------
168
+ // Operating system detection (target)
169
+ //
170
+ // V8_TARGET_OS_ANDROID
171
+ // V8_TARGET_OS_FUCHSIA
172
+ // V8_TARGET_OS_IOS
173
+ // V8_TARGET_OS_LINUX
174
+ // V8_TARGET_OS_MACOS
175
+ // V8_TARGET_OS_WIN
176
+ //
177
+ // If not set explicitly, these fall back to corresponding V8_OS_ values.
178
+
179
+ #ifdef V8_HAVE_TARGET_OS
180
+
181
+ // The target OS is provided, just check that at least one known value is set.
182
+ # if !defined(V8_TARGET_OS_ANDROID) \
183
+ && !defined(V8_TARGET_OS_FUCHSIA) \
184
+ && !defined(V8_TARGET_OS_IOS) \
185
+ && !defined(V8_TARGET_OS_LINUX) \
186
+ && !defined(V8_TARGET_OS_MACOS) \
187
+ && !defined(V8_TARGET_OS_WIN)
188
+ # error No known target OS defined.
189
+ # endif
190
+
191
+ #else // V8_HAVE_TARGET_OS
192
+
193
+ # if defined(V8_TARGET_OS_ANDROID) \
194
+ || defined(V8_TARGET_OS_FUCHSIA) \
195
+ || defined(V8_TARGET_OS_IOS) \
196
+ || defined(V8_TARGET_OS_LINUX) \
197
+ || defined(V8_TARGET_OS_MACOS) \
198
+ || defined(V8_TARGET_OS_WIN)
199
+ # error A target OS is defined but V8_HAVE_TARGET_OS is unset.
200
+ # endif
201
+
202
+ // Fall back to the detected host OS.
203
+ #ifdef V8_OS_ANDROID
204
+ # define V8_TARGET_OS_ANDROID
205
+ #endif
206
+
207
+ #ifdef V8_OS_FUCHSIA
208
+ # define V8_TARGET_OS_FUCHSIA
209
+ #endif
210
+
211
+ #ifdef V8_OS_IOS
212
+ # define V8_TARGET_OS_IOS
213
+ #endif
214
+
215
+ #ifdef V8_OS_LINUX
216
+ # define V8_TARGET_OS_LINUX
217
+ #endif
218
+
219
+ #ifdef V8_OS_MACOS
220
+ # define V8_TARGET_OS_MACOS
221
+ #endif
222
+
223
+ #ifdef V8_OS_WIN
224
+ # define V8_TARGET_OS_WIN
225
+ #endif
226
+
227
+ #endif // V8_HAVE_TARGET_OS
228
+
229
+ #if defined(V8_TARGET_OS_ANDROID)
230
+ # define V8_TARGET_OS_STRING "android"
231
+ #elif defined(V8_TARGET_OS_FUCHSIA)
232
+ # define V8_TARGET_OS_STRING "fuchsia"
233
+ #elif defined(V8_TARGET_OS_IOS)
234
+ # define V8_TARGET_OS_STRING "ios"
235
+ #elif defined(V8_TARGET_OS_LINUX)
236
+ # define V8_TARGET_OS_STRING "linux"
237
+ #elif defined(V8_TARGET_OS_MACOS)
238
+ # define V8_TARGET_OS_STRING "macos"
239
+ #elif defined(V8_TARGET_OS_WINDOWS)
240
+ # define V8_TARGET_OS_STRING "windows"
241
+ #else
242
+ # define V8_TARGET_OS_STRING "unknown"
243
+ #endif
244
+
245
+ // -----------------------------------------------------------------------------
246
+ // C library detection
247
+ //
248
+ // V8_LIBC_MSVCRT - MSVC libc
249
+ // V8_LIBC_BIONIC - Bionic libc
250
+ // V8_LIBC_BSD - BSD libc derivate
251
+ // V8_LIBC_GLIBC - GNU C library
252
+ // V8_LIBC_UCLIBC - uClibc
253
+ //
254
+ // Note that testing for libc must be done using #if not #ifdef. For example,
255
+ // to test for the GNU C library, use:
256
+ // #if V8_LIBC_GLIBC
257
+ // ...
258
+ // #endif
259
+
260
+ #if defined (_MSC_VER)
261
+ # define V8_LIBC_MSVCRT 1
262
+ #elif defined(__BIONIC__)
263
+ # define V8_LIBC_BIONIC 1
264
+ # define V8_LIBC_BSD 1
265
+ #elif defined(__UCLIBC__)
266
+ // Must test for UCLIBC before GLIBC, as UCLIBC pretends to be GLIBC.
267
+ # define V8_LIBC_UCLIBC 1
268
+ #elif defined(__GLIBC__) || defined(__GNU_LIBRARY__)
269
+ # define V8_LIBC_GLIBC 1
270
+ #else
271
+ # define V8_LIBC_BSD V8_OS_BSD
272
+ #endif
273
+
274
+
275
+ // -----------------------------------------------------------------------------
276
+ // Compiler detection
277
+ //
278
+ // V8_CC_GNU - GCC, or clang in gcc mode
279
+ // V8_CC_INTEL - Intel C++
280
+ // V8_CC_MINGW - Minimalist GNU for Windows
281
+ // V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32)
282
+ // V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64)
283
+ // V8_CC_MSVC - Microsoft Visual C/C++, or clang in cl.exe mode
284
+ //
285
+ // C++11 feature detection
286
+ //
287
+ // Compiler-specific feature detection
288
+ //
289
+ // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline))
290
+ // supported
291
+ // V8_HAS_ATTRIBUTE_CONSTINIT - __attribute__((require_constant_
292
+ // initialization))
293
+ // supported
294
+ // V8_HAS_ATTRIBUTE_NONNULL - __attribute__((nonnull)) supported
295
+ // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported
296
+ // V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported
297
+ // V8_HAS_ATTRIBUTE_VISIBILITY - __attribute__((visibility)) supported
298
+ // V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT - __attribute__((warn_unused_result))
299
+ // supported
300
+ // V8_HAS_CPP_ATTRIBUTE_NODISCARD - [[nodiscard]] supported
301
+ // V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
302
+ // - [[no_unique_address]] supported
303
+ // V8_HAS_BUILTIN_BSWAP16 - __builtin_bswap16() supported
304
+ // V8_HAS_BUILTIN_BSWAP32 - __builtin_bswap32() supported
305
+ // V8_HAS_BUILTIN_BSWAP64 - __builtin_bswap64() supported
306
+ // V8_HAS_BUILTIN_CLZ - __builtin_clz() supported
307
+ // V8_HAS_BUILTIN_CTZ - __builtin_ctz() supported
308
+ // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported
309
+ // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported
310
+ // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported
311
+ // V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported
312
+ // V8_HAS_BUILTIN_SUB_OVERFLOW - __builtin_sub_overflow() supported
313
+ // V8_HAS_BUILTIN_MUL_OVERFLOW - __builtin_mul_overflow() supported
314
+ // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported
315
+ // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported
316
+ // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported
317
+ // V8_HAS_BUILTIN_SMUL_OVERFLOW - __builtin_smul_overflow() supported
318
+ // V8_HAS_COMPUTED_GOTO - computed goto/labels as values
319
+ // supported
320
+ // V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported
321
+ // V8_HAS_DECLSPEC_SELECTANY - __declspec(selectany) supported
322
+ // V8_HAS___FORCEINLINE - __forceinline supported
323
+ //
324
+ // Note that testing for compilers and/or features must be done using #if
325
+ // not #ifdef. For example, to test for Intel C++ Compiler, use:
326
+ // #if V8_CC_INTEL
327
+ // ...
328
+ // #endif
329
+
330
+ #if defined(__has_cpp_attribute)
331
+ #define V8_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE)
332
+ #else
333
+ #define V8_HAS_CPP_ATTRIBUTE(FEATURE) 0
334
+ #endif
335
+
336
+ #if defined(__clang__)
337
+
338
+ #if defined(__GNUC__) // Clang in gcc mode.
339
+ # define V8_CC_GNU 1
340
+ #endif
341
+
342
+ # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
343
+ # define V8_HAS_ATTRIBUTE_CONSTINIT \
344
+ (__has_attribute(require_constant_initialization))
345
+ # define V8_HAS_ATTRIBUTE_CONST (__has_attribute(const))
346
+ # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull))
347
+ # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline))
348
+ # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused))
349
+ # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility))
350
+ # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
351
+ (__has_attribute(warn_unused_result))
352
+
353
+ # define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
354
+ # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \
355
+ (V8_HAS_CPP_ATTRIBUTE(no_unique_address))
356
+
357
+ # define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume))
358
+ # define V8_HAS_BUILTIN_ASSUME_ALIGNED (__has_builtin(__builtin_assume_aligned))
359
+ # define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16))
360
+ # define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32))
361
+ # define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64))
362
+ # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz))
363
+ # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz))
364
+ # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect))
365
+ # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address))
366
+ # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount))
367
+ # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow))
368
+ # define V8_HAS_BUILTIN_SUB_OVERFLOW (__has_builtin(__builtin_sub_overflow))
369
+ # define V8_HAS_BUILTIN_MUL_OVERFLOW (__has_builtin(__builtin_mul_overflow))
370
+ # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow))
371
+ # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow))
372
+ # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow))
373
+ # define V8_HAS_BUILTIN_SMUL_OVERFLOW (__has_builtin(__builtin_smul_overflow))
374
+ # define V8_HAS_BUILTIN_UNREACHABLE (__has_builtin(__builtin_unreachable))
375
+
376
+ // Clang has no __has_feature for computed gotos.
377
+ // GCC doc: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
378
+ # define V8_HAS_COMPUTED_GOTO 1
379
+
380
+ #elif defined(__GNUC__)
381
+
382
+ # define V8_CC_GNU 1
383
+ # if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0
384
+ # define V8_CC_INTEL 1
385
+ # endif
386
+ # if defined(__MINGW32__)
387
+ # define V8_CC_MINGW32 1
388
+ # endif
389
+ # if defined(__MINGW64__)
390
+ # define V8_CC_MINGW64 1
391
+ # endif
392
+ # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64)
393
+
394
+ // always_inline is available in gcc 4.0 but not very reliable until 4.4.
395
+ // Works around "sorry, unimplemented: inlining failed" build errors with
396
+ // older compilers.
397
+ # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE 1
398
+ # define V8_HAS_ATTRIBUTE_NOINLINE 1
399
+ # define V8_HAS_ATTRIBUTE_UNUSED 1
400
+ # define V8_HAS_ATTRIBUTE_VISIBILITY 1
401
+ # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT (!V8_CC_INTEL)
402
+
403
+ // [[nodiscard]] does not work together with with
404
+ // __attribute__((visibility(""))) on GCC 7.4 which is why there is no define
405
+ // for V8_HAS_CPP_ATTRIBUTE_NODISCARD. See https://crbug.com/v8/11707.
406
+
407
+ # define V8_HAS_BUILTIN_ASSUME_ALIGNED 1
408
+ # define V8_HAS_BUILTIN_CLZ 1
409
+ # define V8_HAS_BUILTIN_CTZ 1
410
+ # define V8_HAS_BUILTIN_EXPECT 1
411
+ # define V8_HAS_BUILTIN_FRAME_ADDRESS 1
412
+ # define V8_HAS_BUILTIN_POPCOUNT 1
413
+ # define V8_HAS_BUILTIN_UNREACHABLE 1
414
+
415
+ // GCC doc: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
416
+ #define V8_HAS_COMPUTED_GOTO 1
417
+
418
+ #endif
419
+
420
+ #if defined(_MSC_VER)
421
+ # define V8_CC_MSVC 1
422
+
423
+ # define V8_HAS_DECLSPEC_NOINLINE 1
424
+ # define V8_HAS_DECLSPEC_SELECTANY 1
425
+
426
+ # define V8_HAS___FORCEINLINE 1
427
+
428
+ #endif
429
+
430
+
431
+ // -----------------------------------------------------------------------------
432
+ // Helper macros
433
+
434
+ // A macro used to make better inlining. Don't bother for debug builds.
435
+ // Use like:
436
+ // V8_INLINE int GetZero() { return 0; }
437
+ #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_ALWAYS_INLINE
438
+ # define V8_INLINE inline __attribute__((always_inline))
439
+ #elif !defined(DEBUG) && V8_HAS___FORCEINLINE
440
+ # define V8_INLINE __forceinline
441
+ #else
442
+ # define V8_INLINE inline
443
+ #endif
444
+
445
+ #ifdef DEBUG
446
+ // In debug mode, check assumptions instead of actually adding annotations.
447
+ # define V8_ASSUME(condition) DCHECK(condition)
448
+ #elif V8_HAS_BUILTIN_ASSUME
449
+ # define V8_ASSUME(condition) __builtin_assume(condition)
450
+ #elif V8_HAS_BUILTIN_UNREACHABLE
451
+ # define V8_ASSUME(condition) \
452
+ do { if (!(condition)) __builtin_unreachable(); } while (false)
453
+ #else
454
+ # define V8_ASSUME(condition)
455
+ #endif
456
+
457
+ #if V8_HAS_BUILTIN_ASSUME_ALIGNED
458
+ # define V8_ASSUME_ALIGNED(ptr, alignment) \
459
+ __builtin_assume_aligned((ptr), (alignment))
460
+ #else
461
+ # define V8_ASSUME_ALIGNED(ptr, alignment) (ptr)
462
+ #endif
463
+
464
+
465
+ // A macro to mark functions whose values don't change (e.g. across calls)
466
+ // and thereby compiler is free to hoist and fold multiple calls together.
467
+ // Use like:
468
+ // V8_CONST int foo() { ... }
469
+ #if V8_HAS_ATTRIBUTE_CONST
470
+ # define V8_CONST __attribute__((const))
471
+ #else
472
+ # define V8_CONST
473
+ #endif
474
+
475
+ // A macro to mark a declaration as requiring constant initialization.
476
+ // Use like:
477
+ // int* foo V8_CONSTINIT;
478
+ #if V8_HAS_ATTRIBUTE_CONSTINIT
479
+ # define V8_CONSTINIT __attribute__((require_constant_initialization))
480
+ #else
481
+ # define V8_CONSTINIT
482
+ #endif
483
+
484
+
485
+ // A macro to mark specific arguments as non-null.
486
+ // Use like:
487
+ // int add(int* x, int y, int* z) V8_NONNULL(1, 3) { return *x + y + *z; }
488
+ #if V8_HAS_ATTRIBUTE_NONNULL
489
+ # define V8_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
490
+ #else
491
+ # define V8_NONNULL(...) /* NOT SUPPORTED */
492
+ #endif
493
+
494
+
495
+ // A macro used to tell the compiler to never inline a particular function.
496
+ // Use like:
497
+ // V8_NOINLINE int GetMinusOne() { return -1; }
498
+ #if V8_HAS_ATTRIBUTE_NOINLINE
499
+ # define V8_NOINLINE __attribute__((noinline))
500
+ #elif V8_HAS_DECLSPEC_NOINLINE
501
+ # define V8_NOINLINE __declspec(noinline)
502
+ #else
503
+ # define V8_NOINLINE /* NOT SUPPORTED */
504
+ #endif
505
+
506
+
507
+ // A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
508
+ #if defined(V8_DEPRECATION_WARNINGS)
509
+ # define V8_DEPRECATED(message) [[deprecated(message)]]
510
+ #else
511
+ # define V8_DEPRECATED(message)
512
+ #endif
513
+
514
+
515
+ // A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated.
516
+ #if defined(V8_IMMINENT_DEPRECATION_WARNINGS)
517
+ # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
518
+ #else
519
+ # define V8_DEPRECATE_SOON(message)
520
+ #endif
521
+
522
+
523
+ #if defined(V8_IMMINENT_DEPRECATION_WARNINGS) || \
524
+ defined(V8_DEPRECATION_WARNINGS)
525
+ #if defined(V8_CC_MSVC)
526
+ # define START_ALLOW_USE_DEPRECATED() \
527
+ __pragma(warning(push)) \
528
+ __pragma(warning(disable : 4996))
529
+ # define END_ALLOW_USE_DEPRECATED() __pragma(warning(pop))
530
+ #else // !defined(V8_CC_MSVC)
531
+ # define START_ALLOW_USE_DEPRECATED() \
532
+ _Pragma("GCC diagnostic push") \
533
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
534
+ #define END_ALLOW_USE_DEPRECATED() _Pragma("GCC diagnostic pop")
535
+ #endif // !defined(V8_CC_MSVC)
536
+ #else // !(defined(V8_IMMINENT_DEPRECATION_WARNINGS) ||
537
+ // defined(V8_DEPRECATION_WARNINGS))
538
+ #define START_ALLOW_USE_DEPRECATED()
539
+ #define END_ALLOW_USE_DEPRECATED()
540
+ #endif // !(defined(V8_IMMINENT_DEPRECATION_WARNINGS) ||
541
+ // defined(V8_DEPRECATION_WARNINGS))
542
+ #define ALLOW_COPY_AND_MOVE_WITH_DEPRECATED_FIELDS(ClassName) \
543
+ START_ALLOW_USE_DEPRECATED() \
544
+ ClassName(const ClassName&) = default; \
545
+ ClassName(ClassName&&) = default; \
546
+ ClassName& operator=(const ClassName&) = default; \
547
+ ClassName& operator=(ClassName&&) = default; \
548
+ END_ALLOW_USE_DEPRECATED()
549
+
550
+
551
+ #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 6)
552
+ # define V8_ENUM_DEPRECATED(message)
553
+ # define V8_ENUM_DEPRECATE_SOON(message)
554
+ #else
555
+ # define V8_ENUM_DEPRECATED(message) V8_DEPRECATED(message)
556
+ # define V8_ENUM_DEPRECATE_SOON(message) V8_DEPRECATE_SOON(message)
557
+ #endif
558
+
559
+
560
+ // A macro to provide the compiler with branch prediction information.
561
+ #if V8_HAS_BUILTIN_EXPECT
562
+ # define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
563
+ # define V8_LIKELY(condition) (__builtin_expect(!!(condition), 1))
564
+ #else
565
+ # define V8_UNLIKELY(condition) (condition)
566
+ # define V8_LIKELY(condition) (condition)
567
+ #endif
568
+
569
+
570
+ // Annotate a function indicating the caller must examine the return value.
571
+ // Use like:
572
+ // int foo() V8_WARN_UNUSED_RESULT;
573
+ #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
574
+ #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
575
+ #else
576
+ #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */
577
+ #endif
578
+
579
+
580
+ // Annotate a class or constructor indicating the caller must assign the
581
+ // constructed instances.
582
+ // Apply to the whole class like:
583
+ // class V8_NODISCARD Foo() { ... };
584
+ // or apply to just one constructor like:
585
+ // V8_NODISCARD Foo() { ... };
586
+ // [[nodiscard]] comes in C++17 but supported in clang with -std >= c++11.
587
+ #if V8_HAS_CPP_ATTRIBUTE_NODISCARD
588
+ #define V8_NODISCARD [[nodiscard]]
589
+ #else
590
+ #define V8_NODISCARD /* NOT SUPPORTED */
591
+ #endif
592
+
593
+ // The no_unique_address attribute allows tail padding in a non-static data
594
+ // member to overlap other members of the enclosing class (and in the special
595
+ // case when the type is empty, permits it to fully overlap other members). The
596
+ // field is laid out as if a base class were encountered at the corresponding
597
+ // point within the class (except that it does not share a vptr with the
598
+ // enclosing object).
599
+ //
600
+ // Apply to a data member like:
601
+ //
602
+ // class Foo {
603
+ // V8_NO_UNIQUE_ADDRESS Bar bar_;
604
+ // };
605
+ //
606
+ // [[no_unique_address]] comes in C++20 but supported in clang with
607
+ // -std >= c++11.
608
+ #if V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
609
+ #define V8_NO_UNIQUE_ADDRESS [[no_unique_address]]
610
+ #else
611
+ #define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */
612
+ #endif
613
+
614
+ // Marks a type as being eligible for the "trivial" ABI despite having a
615
+ // non-trivial destructor or copy/move constructor. Such types can be relocated
616
+ // after construction by simply copying their memory, which makes them eligible
617
+ // to be passed in registers. The canonical example is std::unique_ptr.
618
+ //
619
+ // Use with caution; this has some subtle effects on constructor/destructor
620
+ // ordering and will be very incorrect if the type relies on its address
621
+ // remaining constant. When used as a function argument (by value), the value
622
+ // may be constructed in the caller's stack frame, passed in a register, and
623
+ // then used and destructed in the callee's stack frame. A similar thing can
624
+ // occur when values are returned.
625
+ //
626
+ // TRIVIAL_ABI is not needed for types which have a trivial destructor and
627
+ // copy/move constructors, since those are automatically trivial by the ABI
628
+ // spec.
629
+ //
630
+ // It is also not likely to be effective on types too large to be passed in one
631
+ // or two registers on typical target ABIs.
632
+ //
633
+ // See also:
634
+ // https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
635
+ // https://libcxx.llvm.org/docs/DesignDocs/UniquePtrTrivialAbi.html
636
+ #if defined(__clang__) && defined(__has_attribute)
637
+ #if __has_attribute(trivial_abi)
638
+ #define V8_TRIVIAL_ABI [[clang::trivial_abi]]
639
+ #endif // __has_attribute(trivial_abi)
640
+ #endif // defined(__clang__) && defined(__has_attribute)
641
+ #if !defined(V8_TRIVIAL_ABI)
642
+ #define V8_TRIVIAL_ABI
643
+ #endif //!defined(V8_TRIVIAL_ABI)
644
+
645
+ // Helper macro to define no_sanitize attributes only with clang.
646
+ #if defined(__clang__) && defined(__has_attribute)
647
+ #if __has_attribute(no_sanitize)
648
+ #define V8_CLANG_NO_SANITIZE(what) __attribute__((no_sanitize(what)))
649
+ #endif
650
+ #endif
651
+ #if !defined(V8_CLANG_NO_SANITIZE)
652
+ #define V8_CLANG_NO_SANITIZE(what)
653
+ #endif
654
+
655
+ #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
656
+ #error Inconsistent build configuration: To build the V8 shared library \
657
+ set BUILDING_V8_SHARED, to include its headers for linking against the \
658
+ V8 shared library set USING_V8_SHARED.
659
+ #endif
660
+
661
+ #ifdef V8_OS_WIN
662
+
663
+ // Setup for Windows DLL export/import. When building the V8 DLL the
664
+ // BUILDING_V8_SHARED needs to be defined. When building a program which uses
665
+ // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
666
+ // static library or building a program which uses the V8 static library neither
667
+ // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
668
+ #ifdef BUILDING_V8_SHARED
669
+ # define V8_EXPORT __declspec(dllexport)
670
+ #elif USING_V8_SHARED
671
+ # define V8_EXPORT __declspec(dllimport)
672
+ #else
673
+ # define V8_EXPORT
674
+ #endif // BUILDING_V8_SHARED
675
+
676
+ #else // V8_OS_WIN
677
+
678
+ // Setup for Linux shared library export.
679
+ #if V8_HAS_ATTRIBUTE_VISIBILITY
680
+ # ifdef BUILDING_V8_SHARED
681
+ # define V8_EXPORT __attribute__ ((visibility("default")))
682
+ # else
683
+ # define V8_EXPORT
684
+ # endif
685
+ #else
686
+ # define V8_EXPORT
687
+ #endif
688
+
689
+ #endif // V8_OS_WIN
690
+
691
+ // clang-format on
692
+
693
+ // Processor architecture detection. For more info on what's defined, see:
694
+ // http://msdn.microsoft.com/en-us/library/b0084kay.aspx
695
+ // http://www.agner.org/optimize/calling_conventions.pdf
696
+ // or with gcc, run: "echo | gcc -E -dM -"
697
+ // The V8_HOST_ARCH_* macros correspond to the architecture on which V8, as a
698
+ // virtual machine and compiler, runs. Don't confuse this with the architecture
699
+ // on which V8 is built.
700
+ #if defined(_M_X64) || defined(__x86_64__)
701
+ #define V8_HOST_ARCH_X64 1
702
+ #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32.
703
+ #define V8_HOST_ARCH_32_BIT 1
704
+ #else
705
+ #define V8_HOST_ARCH_64_BIT 1
706
+ #endif
707
+ #elif defined(_M_IX86) || defined(__i386__)
708
+ #define V8_HOST_ARCH_IA32 1
709
+ #define V8_HOST_ARCH_32_BIT 1
710
+ #elif defined(__AARCH64EL__) || defined(_M_ARM64)
711
+ #define V8_HOST_ARCH_ARM64 1
712
+ #define V8_HOST_ARCH_64_BIT 1
713
+ #elif defined(__ARMEL__)
714
+ #define V8_HOST_ARCH_ARM 1
715
+ #define V8_HOST_ARCH_32_BIT 1
716
+ #elif defined(__mips64)
717
+ #define V8_HOST_ARCH_MIPS64 1
718
+ #define V8_HOST_ARCH_64_BIT 1
719
+ #elif defined(__loongarch64)
720
+ #define V8_HOST_ARCH_LOONG64 1
721
+ #define V8_HOST_ARCH_64_BIT 1
722
+ #elif defined(__PPC64__) || defined(_ARCH_PPC64)
723
+ #define V8_HOST_ARCH_PPC64 1
724
+ #define V8_HOST_ARCH_64_BIT 1
725
+ #elif defined(__PPC__) || defined(_ARCH_PPC)
726
+ #define V8_HOST_ARCH_PPC 1
727
+ #define V8_HOST_ARCH_32_BIT 1
728
+ #elif defined(__s390__) || defined(__s390x__)
729
+ #define V8_HOST_ARCH_S390 1
730
+ #if defined(__s390x__)
731
+ #define V8_HOST_ARCH_64_BIT 1
732
+ #else
733
+ #define V8_HOST_ARCH_32_BIT 1
734
+ #endif
735
+ #elif defined(__riscv) || defined(__riscv__)
736
+ #if __riscv_xlen == 64
737
+ #define V8_HOST_ARCH_RISCV64 1
738
+ #define V8_HOST_ARCH_64_BIT 1
739
+ #elif __riscv_xlen == 32
740
+ #define V8_HOST_ARCH_RISCV32 1
741
+ #define V8_HOST_ARCH_32_BIT 1
742
+ #else
743
+ #error "Cannot detect Riscv's bitwidth"
744
+ #endif
745
+ #else
746
+ #error "Host architecture was not detected as supported by v8"
747
+ #endif
748
+
749
+ // Target architecture detection. This corresponds to the architecture for which
750
+ // V8's JIT will generate code (the last stage of the canadian cross-compiler).
751
+ // The macros may be set externally. If not, detect in the same way as the host
752
+ // architecture, that is, target the native environment as presented by the
753
+ // compiler.
754
+ #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \
755
+ !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_PPC && \
756
+ !V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \
757
+ !V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \
758
+ !V8_TARGET_ARCH_RISCV32
759
+ #if defined(_M_X64) || defined(__x86_64__)
760
+ #define V8_TARGET_ARCH_X64 1
761
+ #elif defined(_M_IX86) || defined(__i386__)
762
+ #define V8_TARGET_ARCH_IA32 1
763
+ #elif defined(__AARCH64EL__) || defined(_M_ARM64)
764
+ #define V8_TARGET_ARCH_ARM64 1
765
+ #elif defined(__ARMEL__)
766
+ #define V8_TARGET_ARCH_ARM 1
767
+ #elif defined(__mips64)
768
+ #define V8_TARGET_ARCH_MIPS64 1
769
+ #elif defined(__loongarch64)
770
+ #define V8_TARGET_ARCH_LOONG64 1
771
+ #elif defined(_ARCH_PPC64)
772
+ #define V8_TARGET_ARCH_PPC64 1
773
+ #elif defined(_ARCH_PPC)
774
+ #define V8_TARGET_ARCH_PPC 1
775
+ #elif defined(__s390__)
776
+ #define V8_TARGET_ARCH_S390 1
777
+ #if defined(__s390x__)
778
+ #define V8_TARGET_ARCH_S390X 1
779
+ #endif
780
+ #elif defined(__riscv) || defined(__riscv__)
781
+ #if __riscv_xlen == 64
782
+ #define V8_TARGET_ARCH_RISCV64 1
783
+ #elif __riscv_xlen == 32
784
+ #define V8_TARGET_ARCH_RISCV32 1
785
+ #endif
786
+ #else
787
+ #error Target architecture was not detected as supported by v8
788
+ #endif
789
+ #endif
790
+
791
+ // Determine architecture pointer size.
792
+ #if V8_TARGET_ARCH_IA32
793
+ #define V8_TARGET_ARCH_32_BIT 1
794
+ #elif V8_TARGET_ARCH_X64
795
+ #if !V8_TARGET_ARCH_32_BIT && !V8_TARGET_ARCH_64_BIT
796
+ #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32.
797
+ #define V8_TARGET_ARCH_32_BIT 1
798
+ #else
799
+ #define V8_TARGET_ARCH_64_BIT 1
800
+ #endif
801
+ #endif
802
+ #elif V8_TARGET_ARCH_ARM
803
+ #define V8_TARGET_ARCH_32_BIT 1
804
+ #elif V8_TARGET_ARCH_ARM64
805
+ #define V8_TARGET_ARCH_64_BIT 1
806
+ #elif V8_TARGET_ARCH_MIPS
807
+ #define V8_TARGET_ARCH_32_BIT 1
808
+ #elif V8_TARGET_ARCH_MIPS64
809
+ #define V8_TARGET_ARCH_64_BIT 1
810
+ #elif V8_TARGET_ARCH_LOONG64
811
+ #define V8_TARGET_ARCH_64_BIT 1
812
+ #elif V8_TARGET_ARCH_PPC
813
+ #define V8_TARGET_ARCH_32_BIT 1
814
+ #elif V8_TARGET_ARCH_PPC64
815
+ #define V8_TARGET_ARCH_64_BIT 1
816
+ #elif V8_TARGET_ARCH_S390
817
+ #if V8_TARGET_ARCH_S390X
818
+ #define V8_TARGET_ARCH_64_BIT 1
819
+ #else
820
+ #define V8_TARGET_ARCH_32_BIT 1
821
+ #endif
822
+ #elif V8_TARGET_ARCH_RISCV64
823
+ #define V8_TARGET_ARCH_64_BIT 1
824
+ #elif V8_TARGET_ARCH_RISCV32
825
+ #define V8_TARGET_ARCH_32_BIT 1
826
+ #else
827
+ #error Unknown target architecture pointer size
828
+ #endif
829
+
830
+ // Check for supported combinations of host and target architectures.
831
+ #if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32
832
+ #error Target architecture ia32 is only supported on ia32 host
833
+ #endif
834
+ #if (V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT && \
835
+ !((V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64) && V8_HOST_ARCH_64_BIT))
836
+ #error Target architecture x64 is only supported on x64 and arm64 host
837
+ #endif
838
+ #if (V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT && \
839
+ !(V8_HOST_ARCH_X64 && V8_HOST_ARCH_32_BIT))
840
+ #error Target architecture x32 is only supported on x64 host with x32 support
841
+ #endif
842
+ #if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM))
843
+ #error Target architecture arm is only supported on arm and ia32 host
844
+ #endif
845
+ #if (V8_TARGET_ARCH_ARM64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64))
846
+ #error Target architecture arm64 is only supported on arm64 and x64 host
847
+ #endif
848
+ #if (V8_TARGET_ARCH_MIPS64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_MIPS64))
849
+ #error Target architecture mips64 is only supported on mips64 and x64 host
850
+ #endif
851
+ #if (V8_TARGET_ARCH_RISCV64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_RISCV64))
852
+ #error Target architecture riscv64 is only supported on riscv64 and x64 host
853
+ #endif
854
+ #if (V8_TARGET_ARCH_RISCV32 && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_RISCV32))
855
+ #error Target architecture riscv32 is only supported on riscv32 and ia32 host
856
+ #endif
857
+ #if (V8_TARGET_ARCH_LOONG64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_LOONG64))
858
+ #error Target architecture loong64 is only supported on loong64 and x64 host
859
+ #endif
860
+
861
+ // Determine architecture endianness.
862
+ #if V8_TARGET_ARCH_IA32
863
+ #define V8_TARGET_LITTLE_ENDIAN 1
864
+ #elif V8_TARGET_ARCH_X64
865
+ #define V8_TARGET_LITTLE_ENDIAN 1
866
+ #elif V8_TARGET_ARCH_ARM
867
+ #define V8_TARGET_LITTLE_ENDIAN 1
868
+ #elif V8_TARGET_ARCH_ARM64
869
+ #define V8_TARGET_LITTLE_ENDIAN 1
870
+ #elif V8_TARGET_ARCH_LOONG64
871
+ #define V8_TARGET_LITTLE_ENDIAN 1
872
+ #elif V8_TARGET_ARCH_MIPS64
873
+ #if defined(__MIPSEB__) || defined(V8_TARGET_ARCH_MIPS64_BE)
874
+ #define V8_TARGET_BIG_ENDIAN 1
875
+ #else
876
+ #define V8_TARGET_LITTLE_ENDIAN 1
877
+ #endif
878
+ #elif defined(__BIG_ENDIAN__) // FOR PPCGR on AIX
879
+ #define V8_TARGET_BIG_ENDIAN 1
880
+ #elif V8_TARGET_ARCH_PPC_LE
881
+ #define V8_TARGET_LITTLE_ENDIAN 1
882
+ #elif V8_TARGET_ARCH_PPC_BE
883
+ #define V8_TARGET_BIG_ENDIAN 1
884
+ #elif V8_TARGET_ARCH_S390
885
+ #if V8_TARGET_ARCH_S390_LE_SIM
886
+ #define V8_TARGET_LITTLE_ENDIAN 1
887
+ #else
888
+ #define V8_TARGET_BIG_ENDIAN 1
889
+ #endif
890
+ #elif V8_TARGET_ARCH_RISCV32 || V8_TARGET_ARCH_RISCV64
891
+ #define V8_TARGET_LITTLE_ENDIAN 1
892
+ #elif defined(__BYTE_ORDER__)
893
+ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
894
+ #define V8_TARGET_BIG_ENDIAN 1
895
+ #else
896
+ #define V8_TARGET_LITTLE_ENDIAN 1
897
+ #endif
898
+ #else
899
+ #error Unknown target architecture endianness
900
+ #endif
901
+
902
+ #undef V8_HAS_CPP_ATTRIBUTE
903
+
904
+ #endif // V8CONFIG_H_