@kungfu-tech/libnode-win32-x64 0.0.0-bootstrap.0 → 22.22.3-kf.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 (343) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/dist/node/include/acorn_version.h +6 -0
  4. package/dist/node/include/aliased_buffer-inl.h +244 -0
  5. package/dist/node/include/aliased_buffer.h +206 -0
  6. package/dist/node/include/aliased_struct-inl.h +54 -0
  7. package/dist/node/include/aliased_struct.h +63 -0
  8. package/dist/node/include/amaro_version.h +6 -0
  9. package/dist/node/include/async_context_frame.h +33 -0
  10. package/dist/node/include/async_wrap-inl.h +96 -0
  11. package/dist/node/include/async_wrap.h +243 -0
  12. package/dist/node/include/base_object-inl.h +335 -0
  13. package/dist/node/include/base_object.h +342 -0
  14. package/dist/node/include/base_object_types.h +74 -0
  15. package/dist/node/include/blob_serializer_deserializer-inl.h +385 -0
  16. package/dist/node/include/blob_serializer_deserializer.h +132 -0
  17. package/dist/node/include/callback_queue-inl.h +97 -0
  18. package/dist/node/include/callback_queue.h +79 -0
  19. package/dist/node/include/cares_wrap.h +447 -0
  20. package/dist/node/include/cjs_module_lexer_version.h +6 -0
  21. package/dist/node/include/cleanup_queue-inl.h +36 -0
  22. package/dist/node/include/cleanup_queue.h +79 -0
  23. package/dist/node/include/compile_cache.h +104 -0
  24. package/dist/node/include/connect_wrap.h +26 -0
  25. package/dist/node/include/connection_wrap.h +30 -0
  26. package/dist/node/include/cppgc/allocation.h +310 -0
  27. package/dist/node/include/cppgc/common.h +28 -0
  28. package/dist/node/include/cppgc/cross-thread-persistent.h +466 -0
  29. package/dist/node/include/cppgc/custom-space.h +97 -0
  30. package/dist/node/include/cppgc/default-platform.h +67 -0
  31. package/dist/node/include/cppgc/ephemeron-pair.h +30 -0
  32. package/dist/node/include/cppgc/explicit-management.h +100 -0
  33. package/dist/node/include/cppgc/garbage-collected.h +106 -0
  34. package/dist/node/include/cppgc/heap-consistency.h +309 -0
  35. package/dist/node/include/cppgc/heap-handle.h +48 -0
  36. package/dist/node/include/cppgc/heap-state.h +82 -0
  37. package/dist/node/include/cppgc/heap-statistics.h +120 -0
  38. package/dist/node/include/cppgc/heap.h +202 -0
  39. package/dist/node/include/cppgc/internal/api-constants.h +87 -0
  40. package/dist/node/include/cppgc/internal/atomic-entry-flag.h +48 -0
  41. package/dist/node/include/cppgc/internal/base-page-handle.h +45 -0
  42. package/dist/node/include/cppgc/internal/caged-heap-local-data.h +121 -0
  43. package/dist/node/include/cppgc/internal/caged-heap.h +68 -0
  44. package/dist/node/include/cppgc/internal/compiler-specific.h +38 -0
  45. package/dist/node/include/cppgc/internal/finalizer-trait.h +93 -0
  46. package/dist/node/include/cppgc/internal/gc-info.h +148 -0
  47. package/dist/node/include/cppgc/internal/logging.h +50 -0
  48. package/dist/node/include/cppgc/internal/member-storage.h +256 -0
  49. package/dist/node/include/cppgc/internal/name-trait.h +137 -0
  50. package/dist/node/include/cppgc/internal/persistent-node.h +214 -0
  51. package/dist/node/include/cppgc/internal/pointer-policies.h +243 -0
  52. package/dist/node/include/cppgc/internal/write-barrier.h +487 -0
  53. package/dist/node/include/cppgc/liveness-broker.h +78 -0
  54. package/dist/node/include/cppgc/macros.h +35 -0
  55. package/dist/node/include/cppgc/member.h +629 -0
  56. package/dist/node/include/cppgc/name-provider.h +65 -0
  57. package/dist/node/include/cppgc/object-size-trait.h +58 -0
  58. package/dist/node/include/cppgc/persistent.h +377 -0
  59. package/dist/node/include/cppgc/platform.h +163 -0
  60. package/dist/node/include/cppgc/prefinalizer.h +75 -0
  61. package/dist/node/include/cppgc/process-heap-statistics.h +36 -0
  62. package/dist/node/include/cppgc/sentinel-pointer.h +39 -0
  63. package/dist/node/include/cppgc/source-location.h +16 -0
  64. package/dist/node/include/cppgc/testing.h +106 -0
  65. package/dist/node/include/cppgc/trace-trait.h +128 -0
  66. package/dist/node/include/cppgc/type-traits.h +271 -0
  67. package/dist/node/include/cppgc/visitor.h +504 -0
  68. package/dist/node/include/crypto/crypto_aes.h +88 -0
  69. package/dist/node/include/crypto/crypto_bio.h +193 -0
  70. package/dist/node/include/crypto/crypto_cipher.h +293 -0
  71. package/dist/node/include/crypto/crypto_clienthello-inl.h +90 -0
  72. package/dist/node/include/crypto/crypto_clienthello.h +131 -0
  73. package/dist/node/include/crypto/crypto_common.h +64 -0
  74. package/dist/node/include/crypto/crypto_context.h +171 -0
  75. package/dist/node/include/crypto/crypto_dh.h +126 -0
  76. package/dist/node/include/crypto/crypto_dsa.h +52 -0
  77. package/dist/node/include/crypto/crypto_ec.h +164 -0
  78. package/dist/node/include/crypto/crypto_hash.h +91 -0
  79. package/dist/node/include/crypto/crypto_hkdf.h +61 -0
  80. package/dist/node/include/crypto/crypto_hmac.h +92 -0
  81. package/dist/node/include/crypto/crypto_keygen.h +299 -0
  82. package/dist/node/include/crypto/crypto_keys.h +392 -0
  83. package/dist/node/include/crypto/crypto_pbkdf2.h +74 -0
  84. package/dist/node/include/crypto/crypto_random.h +124 -0
  85. package/dist/node/include/crypto/crypto_rsa.h +136 -0
  86. package/dist/node/include/crypto/crypto_scrypt.h +85 -0
  87. package/dist/node/include/crypto/crypto_sig.h +165 -0
  88. package/dist/node/include/crypto/crypto_spkac.h +21 -0
  89. package/dist/node/include/crypto/crypto_timing.h +20 -0
  90. package/dist/node/include/crypto/crypto_tls.h +305 -0
  91. package/dist/node/include/crypto/crypto_util.h +725 -0
  92. package/dist/node/include/crypto/crypto_x509.h +140 -0
  93. package/dist/node/include/dataqueue/queue.h +306 -0
  94. package/dist/node/include/debug_utils-inl.h +278 -0
  95. package/dist/node/include/debug_utils.h +196 -0
  96. package/dist/node/include/diagnosticfilename-inl.h +33 -0
  97. package/dist/node/include/embedded_data.h +17 -0
  98. package/dist/node/include/encoding_binding.h +61 -0
  99. package/dist/node/include/env-inl.h +984 -0
  100. package/dist/node/include/env.h +1287 -0
  101. package/dist/node/include/env_properties.h +540 -0
  102. package/dist/node/include/handle_wrap.h +123 -0
  103. package/dist/node/include/histogram-inl.h +107 -0
  104. package/dist/node/include/histogram.h +279 -0
  105. package/dist/node/include/inspector/io_agent.h +30 -0
  106. package/dist/node/include/inspector/main_thread_interface.h +116 -0
  107. package/dist/node/include/inspector/network_agent.h +94 -0
  108. package/dist/node/include/inspector/network_inspector.h +45 -0
  109. package/dist/node/include/inspector/network_requests_buffer.h +195 -0
  110. package/dist/node/include/inspector/network_resource_manager.h +29 -0
  111. package/dist/node/include/inspector/node_json.h +24 -0
  112. package/dist/node/include/inspector/node_string.h +101 -0
  113. package/dist/node/include/inspector/protocol_helper.h +27 -0
  114. package/dist/node/include/inspector/runtime_agent.h +41 -0
  115. package/dist/node/include/inspector/target_agent.h +75 -0
  116. package/dist/node/include/inspector/tracing_agent.h +43 -0
  117. package/dist/node/include/inspector/worker_agent.h +40 -0
  118. package/dist/node/include/inspector/worker_inspector.h +124 -0
  119. package/dist/node/include/inspector_agent.h +165 -0
  120. package/dist/node/include/inspector_io.h +78 -0
  121. package/dist/node/include/inspector_profiler.h +149 -0
  122. package/dist/node/include/inspector_socket.h +60 -0
  123. package/dist/node/include/inspector_socket_server.h +110 -0
  124. package/dist/node/include/js_native_api.h +607 -0
  125. package/dist/node/include/js_native_api_types.h +226 -0
  126. package/dist/node/include/js_native_api_v8.h +485 -0
  127. package/dist/node/include/js_native_api_v8_internals.h +45 -0
  128. package/dist/node/include/js_stream.h +52 -0
  129. package/dist/node/include/json_utils.h +172 -0
  130. package/dist/node/include/large_pages/node_large_page.h +34 -0
  131. package/dist/node/include/libplatform/libplatform-export.h +29 -0
  132. package/dist/node/include/libplatform/libplatform.h +112 -0
  133. package/dist/node/include/libplatform/v8-tracing.h +333 -0
  134. package/dist/node/include/memory_tracker-inl.h +359 -0
  135. package/dist/node/include/memory_tracker.h +289 -0
  136. package/dist/node/include/module_wrap.h +216 -0
  137. package/dist/node/include/node.h +1593 -0
  138. package/dist/node/include/node_api.h +265 -0
  139. package/dist/node/include/node_api_internals.h +48 -0
  140. package/dist/node/include/node_api_types.h +56 -0
  141. package/dist/node/include/node_binding.h +161 -0
  142. package/dist/node/include/node_blob.h +159 -0
  143. package/dist/node/include/node_bob-inl.h +36 -0
  144. package/dist/node/include/node_bob.h +107 -0
  145. package/dist/node/include/node_buffer.h +92 -0
  146. package/dist/node/include/node_builtins.h +220 -0
  147. package/dist/node/include/node_config_file.h +46 -0
  148. package/dist/node/include/node_constants.h +82 -0
  149. package/dist/node/include/node_context_data.h +168 -0
  150. package/dist/node/include/node_contextify.h +204 -0
  151. package/dist/node/include/node_crypto.h +56 -0
  152. package/dist/node/include/node_debug.h +30 -0
  153. package/dist/node/include/node_dir.h +52 -0
  154. package/dist/node/include/node_dotenv.h +45 -0
  155. package/dist/node/include/node_errors.h +380 -0
  156. package/dist/node/include/node_exit_code.h +54 -0
  157. package/dist/node/include/node_external_reference.h +165 -0
  158. package/dist/node/include/node_file-inl.h +406 -0
  159. package/dist/node/include/node_file.h +537 -0
  160. package/dist/node/include/node_http2.h +1177 -0
  161. package/dist/node/include/node_http2_state.h +159 -0
  162. package/dist/node/include/node_http_common-inl.h +202 -0
  163. package/dist/node/include/node_http_common.h +535 -0
  164. package/dist/node/include/node_i18n.h +132 -0
  165. package/dist/node/include/node_internals.h +483 -0
  166. package/dist/node/include/node_main_instance.h +67 -0
  167. package/dist/node/include/node_mem-inl.h +113 -0
  168. package/dist/node/include/node_mem.h +45 -0
  169. package/dist/node/include/node_messaging.h +389 -0
  170. package/dist/node/include/node_metadata.h +164 -0
  171. package/dist/node/include/node_modules.h +91 -0
  172. package/dist/node/include/node_mutex.h +323 -0
  173. package/dist/node/include/node_object_wrap.h +132 -0
  174. package/dist/node/include/node_options-inl.h +490 -0
  175. package/dist/node/include/node_options.h +615 -0
  176. package/dist/node/include/node_perf.h +166 -0
  177. package/dist/node/include/node_perf_common.h +102 -0
  178. package/dist/node/include/node_platform.h +238 -0
  179. package/dist/node/include/node_process-inl.h +26 -0
  180. package/dist/node/include/node_process.h +112 -0
  181. package/dist/node/include/node_realm-inl.h +151 -0
  182. package/dist/node/include/node_realm.h +183 -0
  183. package/dist/node/include/node_report.h +43 -0
  184. package/dist/node/include/node_revert.h +82 -0
  185. package/dist/node/include/node_root_certs.h +3520 -0
  186. package/dist/node/include/node_sea.h +74 -0
  187. package/dist/node/include/node_shadow_realm.h +46 -0
  188. package/dist/node/include/node_snapshot_builder.h +57 -0
  189. package/dist/node/include/node_snapshotable.h +174 -0
  190. package/dist/node/include/node_sockaddr-inl.h +257 -0
  191. package/dist/node/include/node_sockaddr.h +394 -0
  192. package/dist/node/include/node_sqlite.h +270 -0
  193. package/dist/node/include/node_stat_watcher.h +73 -0
  194. package/dist/node/include/node_task_runner.h +92 -0
  195. package/dist/node/include/node_threadsafe_cow-inl.h +54 -0
  196. package/dist/node/include/node_threadsafe_cow.h +105 -0
  197. package/dist/node/include/node_union_bytes.h +81 -0
  198. package/dist/node/include/node_url.h +96 -0
  199. package/dist/node/include/node_v8.h +77 -0
  200. package/dist/node/include/node_v8_platform-inl.h +185 -0
  201. package/dist/node/include/node_version.h +110 -0
  202. package/dist/node/include/node_wasi.h +184 -0
  203. package/dist/node/include/node_wasm_web_api.h +55 -0
  204. package/dist/node/include/node_watchdog.h +154 -0
  205. package/dist/node/include/node_webstorage.h +60 -0
  206. package/dist/node/include/node_worker.h +158 -0
  207. package/dist/node/include/path.h +33 -0
  208. package/dist/node/include/permission/addon_permission.h +31 -0
  209. package/dist/node/include/permission/child_process_permission.h +31 -0
  210. package/dist/node/include/permission/fs_permission.h +167 -0
  211. package/dist/node/include/permission/inspector_permission.h +31 -0
  212. package/dist/node/include/permission/permission.h +138 -0
  213. package/dist/node/include/permission/permission_base.h +65 -0
  214. package/dist/node/include/permission/wasi_permission.h +31 -0
  215. package/dist/node/include/permission/worker_permission.h +31 -0
  216. package/dist/node/include/pipe_wrap.h +80 -0
  217. package/dist/node/include/quic/application.h +159 -0
  218. package/dist/node/include/quic/bindingdata.h +272 -0
  219. package/dist/node/include/quic/cid.h +127 -0
  220. package/dist/node/include/quic/data.h +148 -0
  221. package/dist/node/include/quic/defs.h +245 -0
  222. package/dist/node/include/quic/endpoint.h +458 -0
  223. package/dist/node/include/quic/http3.h +15 -0
  224. package/dist/node/include/quic/logstream.h +81 -0
  225. package/dist/node/include/quic/packet.h +152 -0
  226. package/dist/node/include/quic/preferredaddress.h +72 -0
  227. package/dist/node/include/quic/session.h +443 -0
  228. package/dist/node/include/quic/sessionticket.h +108 -0
  229. package/dist/node/include/quic/streams.h +232 -0
  230. package/dist/node/include/quic/tlscontext.h +227 -0
  231. package/dist/node/include/quic/tokens.h +256 -0
  232. package/dist/node/include/quic/transportparams.h +165 -0
  233. package/dist/node/include/req_wrap-inl.h +171 -0
  234. package/dist/node/include/req_wrap.h +77 -0
  235. package/dist/node/include/spawn_sync.h +243 -0
  236. package/dist/node/include/stream_base-inl.h +173 -0
  237. package/dist/node/include/stream_base.h +478 -0
  238. package/dist/node/include/stream_pipe.h +76 -0
  239. package/dist/node/include/stream_wrap.h +132 -0
  240. package/dist/node/include/string_bytes.h +113 -0
  241. package/dist/node/include/string_decoder-inl.h +31 -0
  242. package/dist/node/include/string_decoder.h +49 -0
  243. package/dist/node/include/tcp_wrap.h +105 -0
  244. package/dist/node/include/threadpoolwork-inl.h +70 -0
  245. package/dist/node/include/timer_wrap-inl.h +32 -0
  246. package/dist/node/include/timer_wrap.h +85 -0
  247. package/dist/node/include/timers.h +70 -0
  248. package/dist/node/include/tracing/agent.h +195 -0
  249. package/dist/node/include/tracing/node_trace_buffer.h +83 -0
  250. package/dist/node/include/tracing/node_trace_writer.h +75 -0
  251. package/dist/node/include/tracing/trace_event.h +722 -0
  252. package/dist/node/include/tracing/trace_event_common.h +1109 -0
  253. package/dist/node/include/tracing/traced_value.h +129 -0
  254. package/dist/node/include/tty_wrap.h +65 -0
  255. package/dist/node/include/udp_wrap.h +230 -0
  256. package/dist/node/include/undici_version.h +6 -0
  257. package/dist/node/include/util-inl.h +700 -0
  258. package/dist/node/include/util.h +1021 -0
  259. package/dist/node/include/uv/aix.h +32 -0
  260. package/dist/node/include/uv/bsd.h +34 -0
  261. package/dist/node/include/uv/darwin.h +61 -0
  262. package/dist/node/include/uv/errno.h +483 -0
  263. package/dist/node/include/uv/linux.h +34 -0
  264. package/dist/node/include/uv/os390.h +33 -0
  265. package/dist/node/include/uv/posix.h +31 -0
  266. package/dist/node/include/uv/sunos.h +44 -0
  267. package/dist/node/include/uv/threadpool.h +37 -0
  268. package/dist/node/include/uv/tree.h +521 -0
  269. package/dist/node/include/uv/unix.h +512 -0
  270. package/dist/node/include/uv/version.h +43 -0
  271. package/dist/node/include/uv/win.h +698 -0
  272. package/dist/node/include/uv.h +1990 -0
  273. package/dist/node/include/v8-array-buffer.h +525 -0
  274. package/dist/node/include/v8-callbacks.h +462 -0
  275. package/dist/node/include/v8-container.h +183 -0
  276. package/dist/node/include/v8-context.h +485 -0
  277. package/dist/node/include/v8-cppgc.h +245 -0
  278. package/dist/node/include/v8-data.h +80 -0
  279. package/dist/node/include/v8-date.h +48 -0
  280. package/dist/node/include/v8-debug.h +168 -0
  281. package/dist/node/include/v8-embedder-heap.h +82 -0
  282. package/dist/node/include/v8-embedder-state-scope.h +52 -0
  283. package/dist/node/include/v8-exception.h +223 -0
  284. package/dist/node/include/v8-extension.h +62 -0
  285. package/dist/node/include/v8-external.h +37 -0
  286. package/dist/node/include/v8-fast-api-calls.h +984 -0
  287. package/dist/node/include/v8-forward.h +82 -0
  288. package/dist/node/include/v8-function-callback.h +607 -0
  289. package/dist/node/include/v8-function.h +140 -0
  290. package/dist/node/include/v8-handle-base.h +137 -0
  291. package/dist/node/include/v8-initialization.h +289 -0
  292. package/dist/node/include/v8-inspector-protocol.h +13 -0
  293. package/dist/node/include/v8-inspector.h +419 -0
  294. package/dist/node/include/v8-internal.h +1397 -0
  295. package/dist/node/include/v8-isolate.h +1767 -0
  296. package/dist/node/include/v8-json.h +47 -0
  297. package/dist/node/include/v8-local-handle.h +758 -0
  298. package/dist/node/include/v8-locker.h +138 -0
  299. package/dist/node/include/v8-maybe.h +160 -0
  300. package/dist/node/include/v8-memory-span.h +198 -0
  301. package/dist/node/include/v8-message.h +233 -0
  302. package/dist/node/include/v8-metrics.h +264 -0
  303. package/dist/node/include/v8-microtask-queue.h +157 -0
  304. package/dist/node/include/v8-microtask.h +28 -0
  305. package/dist/node/include/v8-object.h +824 -0
  306. package/dist/node/include/v8-persistent-handle.h +582 -0
  307. package/dist/node/include/v8-platform.h +1358 -0
  308. package/dist/node/include/v8-primitive-object.h +118 -0
  309. package/dist/node/include/v8-primitive.h +877 -0
  310. package/dist/node/include/v8-profiler.h +1302 -0
  311. package/dist/node/include/v8-promise.h +174 -0
  312. package/dist/node/include/v8-proxy.h +50 -0
  313. package/dist/node/include/v8-regexp.h +106 -0
  314. package/dist/node/include/v8-script.h +904 -0
  315. package/dist/node/include/v8-snapshot.h +266 -0
  316. package/dist/node/include/v8-source-location.h +92 -0
  317. package/dist/node/include/v8-statistics.h +238 -0
  318. package/dist/node/include/v8-template.h +1297 -0
  319. package/dist/node/include/v8-traced-handle.h +432 -0
  320. package/dist/node/include/v8-typed-array.h +390 -0
  321. package/dist/node/include/v8-unwinder-state.h +31 -0
  322. package/dist/node/include/v8-unwinder.h +132 -0
  323. package/dist/node/include/v8-util.h +665 -0
  324. package/dist/node/include/v8-value-serializer-version.h +24 -0
  325. package/dist/node/include/v8-value-serializer.h +316 -0
  326. package/dist/node/include/v8-value.h +655 -0
  327. package/dist/node/include/v8-version-string.h +38 -0
  328. package/dist/node/include/v8-version.h +20 -0
  329. package/dist/node/include/v8-wasm-trap-handler-posix.h +31 -0
  330. package/dist/node/include/v8-wasm-trap-handler-win.h +28 -0
  331. package/dist/node/include/v8-wasm.h +201 -0
  332. package/dist/node/include/v8-weak-callback-info.h +80 -0
  333. package/dist/node/include/v8.h +88 -0
  334. package/dist/node/include/v8config.h +981 -0
  335. package/dist/node/include/zlib_version.h +6 -0
  336. package/dist/node/libnode.dll +0 -0
  337. package/dist/node/libnode.lib +0 -0
  338. package/dist/node/libnodebuildinfo.json +10 -0
  339. package/dist/node/link_node.lib +0 -0
  340. package/dist/node/link_node.node +0 -0
  341. package/index.js +5 -0
  342. package/libnode.release.json +8 -0
  343. package/package.json +29 -1
@@ -0,0 +1,981 @@
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
+ #include <memory>
17
+ // clang-format off
18
+
19
+ // Platform headers for feature detection below.
20
+ #if defined(__ANDROID__)
21
+ # include <sys/cdefs.h>
22
+ #elif defined(__APPLE__)
23
+ # include <TargetConditionals.h>
24
+ #elif defined(__linux__)
25
+ # include <features.h>
26
+ #endif
27
+
28
+
29
+ // This macro allows to test for the version of the GNU C library (or
30
+ // a compatible C library that masquerades as glibc). It evaluates to
31
+ // 0 if libc is not GNU libc or compatible.
32
+ // Use like:
33
+ // #if V8_GLIBC_PREREQ(2, 3)
34
+ // ...
35
+ // #endif
36
+ #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
37
+ # define V8_GLIBC_PREREQ(major, minor) \
38
+ ((__GLIBC__ * 100 + __GLIBC_MINOR__) >= ((major) * 100 + (minor)))
39
+ #else
40
+ # define V8_GLIBC_PREREQ(major, minor) 0
41
+ #endif
42
+
43
+
44
+ // This macro allows to test for the version of the GNU C++ compiler.
45
+ // Note that this also applies to compilers that masquerade as GCC,
46
+ // for example clang and the Intel C++ compiler for Linux.
47
+ // Use like:
48
+ // #if V8_GNUC_PREREQ(4, 3, 1)
49
+ // ...
50
+ // #endif
51
+ #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
52
+ # define V8_GNUC_PREREQ(major, minor, patchlevel) \
53
+ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
54
+ ((major) * 10000 + (minor) * 100 + (patchlevel)))
55
+ #elif defined(__GNUC__) && defined(__GNUC_MINOR__)
56
+ # define V8_GNUC_PREREQ(major, minor, patchlevel) \
57
+ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= \
58
+ ((major) * 10000 + (minor) * 100 + (patchlevel)))
59
+ #else
60
+ # define V8_GNUC_PREREQ(major, minor, patchlevel) 0
61
+ #endif
62
+
63
+
64
+
65
+ // -----------------------------------------------------------------------------
66
+ // Operating system detection (host)
67
+ //
68
+ // V8_OS_ANDROID - Android
69
+ // V8_OS_BSD - BSDish (macOS, Net/Free/Open/DragonFlyBSD)
70
+ // V8_OS_CYGWIN - Cygwin
71
+ // V8_OS_DRAGONFLYBSD - DragonFlyBSD
72
+ // V8_OS_FREEBSD - FreeBSD
73
+ // V8_OS_FUCHSIA - Fuchsia
74
+ // V8_OS_LINUX - Linux (Android, ChromeOS, Linux, ...)
75
+ // V8_OS_DARWIN - Darwin (macOS, iOS)
76
+ // V8_OS_MACOS - macOS
77
+ // V8_OS_IOS - iOS
78
+ // V8_OS_NETBSD - NetBSD
79
+ // V8_OS_OPENBSD - OpenBSD
80
+ // V8_OS_POSIX - POSIX compatible (mostly everything except Windows)
81
+ // V8_OS_QNX - QNX Neutrino
82
+ // V8_OS_SOLARIS - Sun Solaris and OpenSolaris
83
+ // V8_OS_STARBOARD - Starboard (platform abstraction for Cobalt)
84
+ // V8_OS_AIX - AIX
85
+ // V8_OS_WIN - Microsoft Windows
86
+
87
+ #if defined(__ANDROID__)
88
+ # define V8_OS_ANDROID 1
89
+ # define V8_OS_LINUX 1
90
+ # define V8_OS_POSIX 1
91
+ # define V8_OS_STRING "android"
92
+
93
+ #elif defined(__APPLE__)
94
+ # define V8_OS_POSIX 1
95
+ # define V8_OS_BSD 1
96
+ # define V8_OS_DARWIN 1
97
+ # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
98
+ # define V8_OS_IOS 1
99
+ # define V8_OS_STRING "ios"
100
+ # else
101
+ # define V8_OS_MACOS 1
102
+ # define V8_OS_STRING "macos"
103
+ # endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
104
+
105
+ #elif defined(__CYGWIN__)
106
+ # define V8_OS_CYGWIN 1
107
+ # define V8_OS_POSIX 1
108
+ # define V8_OS_STRING "cygwin"
109
+
110
+ #elif defined(__linux__)
111
+ # define V8_OS_LINUX 1
112
+ # define V8_OS_POSIX 1
113
+ # define V8_OS_STRING "linux"
114
+
115
+ #elif defined(__sun)
116
+ # define V8_OS_POSIX 1
117
+ # define V8_OS_SOLARIS 1
118
+ # define V8_OS_STRING "sun"
119
+
120
+ #elif defined(STARBOARD)
121
+ # define V8_OS_STARBOARD 1
122
+ # define V8_OS_STRING "starboard"
123
+
124
+ #elif defined(_AIX)
125
+ # define V8_OS_POSIX 1
126
+ # define V8_OS_AIX 1
127
+ # define V8_OS_STRING "aix"
128
+
129
+ #elif defined(__FreeBSD__)
130
+ # define V8_OS_BSD 1
131
+ # define V8_OS_FREEBSD 1
132
+ # define V8_OS_POSIX 1
133
+ # define V8_OS_STRING "freebsd"
134
+
135
+ #elif defined(__Fuchsia__)
136
+ # define V8_OS_FUCHSIA 1
137
+ # define V8_OS_POSIX 1
138
+ # define V8_OS_STRING "fuchsia"
139
+
140
+ #elif defined(__DragonFly__)
141
+ # define V8_OS_BSD 1
142
+ # define V8_OS_DRAGONFLYBSD 1
143
+ # define V8_OS_POSIX 1
144
+ # define V8_OS_STRING "dragonflybsd"
145
+
146
+ #elif defined(__NetBSD__)
147
+ # define V8_OS_BSD 1
148
+ # define V8_OS_NETBSD 1
149
+ # define V8_OS_POSIX 1
150
+ # define V8_OS_STRING "netbsd"
151
+
152
+ #elif defined(__OpenBSD__)
153
+ # define V8_OS_BSD 1
154
+ # define V8_OS_OPENBSD 1
155
+ # define V8_OS_POSIX 1
156
+ # define V8_OS_STRING "openbsd"
157
+
158
+ #elif defined(__QNXNTO__)
159
+ # define V8_OS_POSIX 1
160
+ # define V8_OS_QNX 1
161
+ # define V8_OS_STRING "qnx"
162
+
163
+ #elif defined(_WIN32)
164
+ # define V8_OS_WIN 1
165
+ # define V8_OS_STRING "windows"
166
+ #endif
167
+
168
+ // -----------------------------------------------------------------------------
169
+ // Operating system detection (target)
170
+ //
171
+ // V8_TARGET_OS_ANDROID
172
+ // V8_TARGET_OS_FUCHSIA
173
+ // V8_TARGET_OS_IOS
174
+ // V8_TARGET_OS_LINUX
175
+ // V8_TARGET_OS_MACOS
176
+ // V8_TARGET_OS_WIN
177
+ // V8_TARGET_OS_CHROMEOS
178
+ //
179
+ // If not set explicitly, these fall back to corresponding V8_OS_ values.
180
+
181
+ #ifdef V8_HAVE_TARGET_OS
182
+
183
+ // The target OS is provided, just check that at least one known value is set.
184
+ # if !defined(V8_TARGET_OS_ANDROID) \
185
+ && !defined(V8_TARGET_OS_FUCHSIA) \
186
+ && !defined(V8_TARGET_OS_IOS) \
187
+ && !defined(V8_TARGET_OS_LINUX) \
188
+ && !defined(V8_TARGET_OS_MACOS) \
189
+ && !defined(V8_TARGET_OS_WIN) \
190
+ && !defined(V8_TARGET_OS_CHROMEOS)
191
+ # error No known target OS defined.
192
+ # endif
193
+
194
+ #else // V8_HAVE_TARGET_OS
195
+
196
+ # if defined(V8_TARGET_OS_ANDROID) \
197
+ || defined(V8_TARGET_OS_FUCHSIA) \
198
+ || defined(V8_TARGET_OS_IOS) \
199
+ || defined(V8_TARGET_OS_LINUX) \
200
+ || defined(V8_TARGET_OS_MACOS) \
201
+ || defined(V8_TARGET_OS_WIN) \
202
+ || defined(V8_TARGET_OS_CHROMEOS)
203
+ # error A target OS is defined but V8_HAVE_TARGET_OS is unset.
204
+ # endif
205
+
206
+ // Fall back to the detected host OS.
207
+ #ifdef V8_OS_ANDROID
208
+ # define V8_TARGET_OS_ANDROID
209
+ #endif
210
+
211
+ #ifdef V8_OS_FUCHSIA
212
+ # define V8_TARGET_OS_FUCHSIA
213
+ #endif
214
+
215
+ #ifdef V8_OS_IOS
216
+ # define V8_TARGET_OS_IOS
217
+ #endif
218
+
219
+ #ifdef V8_OS_LINUX
220
+ # define V8_TARGET_OS_LINUX
221
+ #endif
222
+
223
+ #ifdef V8_OS_MACOS
224
+ # define V8_TARGET_OS_MACOS
225
+ #endif
226
+
227
+ #ifdef V8_OS_WIN
228
+ # define V8_TARGET_OS_WIN
229
+ #endif
230
+
231
+ #endif // V8_HAVE_TARGET_OS
232
+
233
+ #if defined(V8_TARGET_OS_ANDROID)
234
+ # define V8_TARGET_OS_STRING "android"
235
+ #elif defined(V8_TARGET_OS_FUCHSIA)
236
+ # define V8_TARGET_OS_STRING "fuchsia"
237
+ #elif defined(V8_TARGET_OS_IOS)
238
+ # define V8_TARGET_OS_STRING "ios"
239
+ #elif defined(V8_TARGET_OS_LINUX)
240
+ # define V8_TARGET_OS_STRING "linux"
241
+ #elif defined(V8_TARGET_OS_MACOS)
242
+ # define V8_TARGET_OS_STRING "macos"
243
+ #elif defined(V8_TARGET_OS_WINDOWS)
244
+ # define V8_TARGET_OS_STRING "windows"
245
+ #else
246
+ # define V8_TARGET_OS_STRING "unknown"
247
+ #endif
248
+
249
+ // -----------------------------------------------------------------------------
250
+ // C library detection
251
+ //
252
+ // V8_LIBC_MSVCRT - MSVC libc
253
+ // V8_LIBC_BIONIC - Bionic libc
254
+ // V8_LIBC_BSD - BSD libc derivate
255
+ // V8_LIBC_GLIBC - GNU C library
256
+ // V8_LIBC_UCLIBC - uClibc
257
+ //
258
+ // Note that testing for libc must be done using #if not #ifdef. For example,
259
+ // to test for the GNU C library, use:
260
+ // #if V8_LIBC_GLIBC
261
+ // ...
262
+ // #endif
263
+
264
+ #if defined (_MSC_VER)
265
+ # define V8_LIBC_MSVCRT 1
266
+ #elif defined(__BIONIC__)
267
+ # define V8_LIBC_BIONIC 1
268
+ # define V8_LIBC_BSD 1
269
+ #elif defined(__UCLIBC__)
270
+ // Must test for UCLIBC before GLIBC, as UCLIBC pretends to be GLIBC.
271
+ # define V8_LIBC_UCLIBC 1
272
+ #elif defined(__GLIBC__) || defined(__GNU_LIBRARY__)
273
+ # define V8_LIBC_GLIBC 1
274
+ #else
275
+ # define V8_LIBC_BSD V8_OS_BSD
276
+ #endif
277
+
278
+
279
+ // -----------------------------------------------------------------------------
280
+ // Compiler detection
281
+ //
282
+ // V8_CC_GNU - GCC, or clang in gcc mode
283
+ // V8_CC_INTEL - Intel C++
284
+ // V8_CC_MINGW - Minimalist GNU for Windows
285
+ // V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32)
286
+ // V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64)
287
+ // V8_CC_MSVC - Microsoft Visual C/C++, or clang in cl.exe mode
288
+ //
289
+ // C++11 feature detection
290
+ //
291
+ // Compiler-specific feature detection
292
+ //
293
+ // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline))
294
+ // supported
295
+ // V8_HAS_ATTRIBUTE_CONSTINIT - __attribute__((require_constant_
296
+ // initialization))
297
+ // supported
298
+ // V8_HAS_ATTRIBUTE_NONNULL - __attribute__((nonnull)) supported
299
+ // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported
300
+ // V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported
301
+ // V8_HAS_ATTRIBUTE_USED - __attribute__((used)) supported
302
+ // V8_HAS_ATTRIBUTE_RETAIN - __attribute__((retain)) supported
303
+ // V8_HAS_ATTRIBUTE_VISIBILITY - __attribute__((visibility)) supported
304
+ // V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT - __attribute__((warn_unused_result))
305
+ // supported
306
+ // V8_HAS_CPP_ATTRIBUTE_NODISCARD - [[nodiscard]] supported
307
+ // V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
308
+ // - [[no_unique_address]] supported
309
+ // V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported
310
+ // V8_HAS_BUILTIN_BIT_CAST - __builtin_bit_cast() supported
311
+ // V8_HAS_BUILTIN_BSWAP16 - __builtin_bswap16() supported
312
+ // V8_HAS_BUILTIN_BSWAP32 - __builtin_bswap32() supported
313
+ // V8_HAS_BUILTIN_BSWAP64 - __builtin_bswap64() supported
314
+ // V8_HAS_BUILTIN_CLZ - __builtin_clz() supported
315
+ // V8_HAS_BUILTIN_CTZ - __builtin_ctz() supported
316
+ // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported
317
+ // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported
318
+ // V8_HAS_BUILTIN_MUL_OVERFLOW - __builtin_mul_overflow() supported
319
+ // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported
320
+ // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported
321
+ // V8_HAS_BUILTIN_SMUL_OVERFLOW - __builtin_smul_overflow() supported
322
+ // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported
323
+ // V8_HAS_BUILTIN_SUB_OVERFLOW - __builtin_sub_overflow() supported
324
+ // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported
325
+ // V8_HAS_COMPUTED_GOTO - computed goto/labels as values
326
+ // supported
327
+ // V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported
328
+ // V8_HAS_DECLSPEC_SELECTANY - __declspec(selectany) supported
329
+ // V8_HAS___FORCEINLINE - __forceinline supported
330
+ //
331
+ // Note that testing for compilers and/or features must be done using #if
332
+ // not #ifdef. For example, to test for Intel C++ Compiler, use:
333
+ // #if V8_CC_INTEL
334
+ // ...
335
+ // #endif
336
+
337
+ #if defined(__has_cpp_attribute)
338
+ #define V8_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE)
339
+ #else
340
+ #define V8_HAS_CPP_ATTRIBUTE(FEATURE) 0
341
+ #endif
342
+
343
+ #if defined(__clang__)
344
+
345
+ #if defined(__GNUC__) // Clang in gcc mode.
346
+ # define V8_CC_GNU 1
347
+ #endif
348
+
349
+ # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
350
+ # define V8_HAS_ATTRIBUTE_CONSTINIT \
351
+ (__has_attribute(require_constant_initialization))
352
+ # define V8_HAS_ATTRIBUTE_CONST (__has_attribute(const))
353
+ # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull))
354
+ # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline))
355
+ # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused))
356
+ # define V8_HAS_ATTRIBUTE_USED (__has_attribute(used))
357
+ # define V8_HAS_ATTRIBUTE_RETAIN (__has_attribute(retain))
358
+ // Support for the "preserve_most" attribute is limited:
359
+ // - 32-bit platforms do not implement it,
360
+ // - component builds fail because _dl_runtime_resolve clobbers registers,
361
+ // - we see crashes on arm64 on Windows (https://crbug.com/1409934), which can
362
+ // hopefully be fixed in the future.
363
+ // Additionally, the initial implementation in clang <= 16 overwrote the return
364
+ // register(s) in the epilogue of a preserve_most function, so we only use
365
+ // preserve_most in clang >= 17 (see https://reviews.llvm.org/D143425).
366
+ #if (defined(_M_X64) || defined(__x86_64__) /* x64 (everywhere) */ \
367
+ || ((defined(__AARCH64EL__) || defined(_M_ARM64)) /* arm64, but ... */ \
368
+ && !defined(_WIN32))) /* not on windows */ \
369
+ && !defined(COMPONENT_BUILD) /* no component build */\
370
+ && __clang_major__ >= 17 /* clang >= 17 */
371
+ # define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most))
372
+ #endif
373
+ # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility))
374
+ # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
375
+ (__has_attribute(warn_unused_result))
376
+ # define V8_HAS_ATTRIBUTE_WEAK (__has_attribute(weak))
377
+
378
+ # define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
379
+ # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \
380
+ (V8_HAS_CPP_ATTRIBUTE(no_unique_address))
381
+
382
+ # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow))
383
+ # define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume))
384
+ # define V8_HAS_BUILTIN_ASSUME_ALIGNED (__has_builtin(__builtin_assume_aligned))
385
+ # define V8_HAS_BUILTIN_BIT_CAST (__has_builtin(__builtin_bit_cast))
386
+ # define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16))
387
+ # define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32))
388
+ # define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64))
389
+ # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz))
390
+ # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz))
391
+ # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect))
392
+ # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address))
393
+ # define V8_HAS_BUILTIN_MUL_OVERFLOW (__has_builtin(__builtin_mul_overflow))
394
+ # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount))
395
+ # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow))
396
+ # define V8_HAS_BUILTIN_SMUL_OVERFLOW (__has_builtin(__builtin_smul_overflow))
397
+ # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow))
398
+ # define V8_HAS_BUILTIN_SUB_OVERFLOW (__has_builtin(__builtin_sub_overflow))
399
+ # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow))
400
+ # define V8_HAS_BUILTIN_UNREACHABLE (__has_builtin(__builtin_unreachable))
401
+
402
+ // Clang has no __has_feature for computed gotos.
403
+ // GCC doc: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
404
+ # define V8_HAS_COMPUTED_GOTO 1
405
+
406
+ #elif defined(__GNUC__)
407
+
408
+ # define V8_CC_GNU 1
409
+ # if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0
410
+ # define V8_CC_INTEL 1
411
+ # endif
412
+ # if defined(__MINGW32__)
413
+ # define V8_CC_MINGW32 1
414
+ # endif
415
+ # if defined(__MINGW64__)
416
+ # define V8_CC_MINGW64 1
417
+ # endif
418
+ # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64)
419
+
420
+ // FYI: __has_builtin is only available with GCC 10 and later, so explicitly
421
+ // check GCC version numbers to enable features. TODO(leszeks): Merge feature
422
+ // enabling for GCC 10 and later into the Clang section above, and leave this
423
+ // section for GCC 9 and earlier.
424
+
425
+ // always_inline is available in gcc 4.0 but not very reliable until 4.4.
426
+ // Works around "sorry, unimplemented: inlining failed" build errors with
427
+ // older compilers.
428
+ # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE 1
429
+ # define V8_HAS_ATTRIBUTE_NOINLINE 1
430
+ # define V8_HAS_ATTRIBUTE_UNUSED 1
431
+ # define V8_HAS_ATTRIBUTE_VISIBILITY 1
432
+ # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT (!V8_CC_INTEL)
433
+ # define V8_HAS_ATTRIBUTE_WEAK 1
434
+
435
+ // [[nodiscard]] does not work together with with
436
+ // __attribute__((visibility(""))) on GCC 7.4 which is why there is no define
437
+ // for V8_HAS_CPP_ATTRIBUTE_NODISCARD. See https://crbug.com/v8/11707.
438
+
439
+ # define V8_HAS_BUILTIN_ASSUME_ALIGNED 1
440
+ # if __GNUC__ >= 11
441
+ # define V8_HAS_BUILTIN_BIT_CAST 1
442
+ # endif
443
+ # define V8_HAS_BUILTIN_CLZ 1
444
+ # define V8_HAS_BUILTIN_CTZ 1
445
+ # define V8_HAS_BUILTIN_EXPECT 1
446
+ # define V8_HAS_BUILTIN_FRAME_ADDRESS 1
447
+ # define V8_HAS_BUILTIN_POPCOUNT 1
448
+ # define V8_HAS_BUILTIN_UNREACHABLE 1
449
+
450
+ // GCC doc: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
451
+ #define V8_HAS_COMPUTED_GOTO 1
452
+
453
+ #endif
454
+
455
+ #if defined(_MSC_VER)
456
+ # define V8_CC_MSVC 1
457
+
458
+ # define V8_HAS_DECLSPEC_NOINLINE 1
459
+ # define V8_HAS_DECLSPEC_SELECTANY 1
460
+
461
+ # define V8_HAS___FORCEINLINE 1
462
+
463
+ #endif
464
+
465
+
466
+ // -----------------------------------------------------------------------------
467
+ // Helper macros
468
+
469
+ // A macro used to make better inlining. Don't bother for debug builds.
470
+ // Use like:
471
+ // V8_INLINE int GetZero() { return 0; }
472
+ #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_ALWAYS_INLINE
473
+ # define V8_INLINE inline __attribute__((always_inline))
474
+ #elif !defined(DEBUG) && V8_HAS___FORCEINLINE
475
+ # define V8_INLINE __forceinline
476
+ #else
477
+ # define V8_INLINE inline
478
+ #endif
479
+
480
+ #ifdef DEBUG
481
+ // In debug mode, check assumptions instead of actually adding annotations.
482
+ # define V8_ASSUME DCHECK
483
+ #elif V8_HAS_BUILTIN_ASSUME
484
+ # define V8_ASSUME __builtin_assume
485
+ #elif V8_HAS_BUILTIN_UNREACHABLE
486
+ # define V8_ASSUME(condition) \
487
+ do { \
488
+ if (!(condition)) __builtin_unreachable(); \
489
+ } while (false)
490
+ #else
491
+ # define V8_ASSUME USE
492
+ #endif
493
+
494
+ // Prefer c++20 std::assume_aligned
495
+ #if __cplusplus >= 202002L && defined(__cpp_lib_assume_aligned)
496
+ # define V8_ASSUME_ALIGNED(ptr, alignment) \
497
+ std::assume_aligned<(alignment)>(ptr)
498
+ #elif V8_HAS_BUILTIN_ASSUME_ALIGNED
499
+ # define V8_ASSUME_ALIGNED(ptr, alignment) \
500
+ __builtin_assume_aligned((ptr), (alignment))
501
+ #else
502
+ # define V8_ASSUME_ALIGNED(ptr, alignment) (ptr)
503
+ #endif
504
+
505
+ // A macro to mark functions whose values don't change (e.g. across calls)
506
+ // and thereby compiler is free to hoist and fold multiple calls together.
507
+ // Use like:
508
+ // V8_CONST int foo() { ... }
509
+ #if V8_HAS_ATTRIBUTE_CONST
510
+ # define V8_CONST __attribute__((const))
511
+ #else
512
+ # define V8_CONST
513
+ #endif
514
+
515
+ // A macro to mark a declaration as requiring constant initialization.
516
+ // Use like:
517
+ // int* foo V8_CONSTINIT;
518
+ #if V8_HAS_ATTRIBUTE_CONSTINIT
519
+ # define V8_CONSTINIT __attribute__((require_constant_initialization))
520
+ #else
521
+ # define V8_CONSTINIT
522
+ #endif
523
+
524
+
525
+ // A macro to mark specific arguments as non-null.
526
+ // Use like:
527
+ // int add(int* x, int y, int* z) V8_NONNULL(1, 3) { return *x + y + *z; }
528
+ #if V8_HAS_ATTRIBUTE_NONNULL
529
+ # define V8_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
530
+ #else
531
+ # define V8_NONNULL(...) /* NOT SUPPORTED */
532
+ #endif
533
+
534
+
535
+ // A macro used to tell the compiler to never inline a particular function.
536
+ // Use like:
537
+ // V8_NOINLINE int GetMinusOne() { return -1; }
538
+ #if V8_HAS_ATTRIBUTE_NOINLINE
539
+ # define V8_NOINLINE __attribute__((noinline))
540
+ #elif V8_HAS_DECLSPEC_NOINLINE
541
+ # define V8_NOINLINE __declspec(noinline)
542
+ #else
543
+ # define V8_NOINLINE /* NOT SUPPORTED */
544
+ #endif
545
+
546
+
547
+ // A macro used to change the calling conventions to preserve all registers (no
548
+ // caller-saved registers). Use this for cold functions called from hot
549
+ // functions.
550
+ // Use like:
551
+ // V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
552
+ #if V8_OS_WIN
553
+ # define V8_PRESERVE_MOST
554
+ #else
555
+ #if V8_HAS_ATTRIBUTE_PRESERVE_MOST
556
+ # define V8_PRESERVE_MOST __attribute__((preserve_most))
557
+ #else
558
+ # define V8_PRESERVE_MOST /* NOT SUPPORTED */
559
+ #endif
560
+ #endif
561
+
562
+
563
+ // A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
564
+ #if defined(V8_DEPRECATION_WARNINGS)
565
+ # define V8_DEPRECATED(message) [[deprecated(message)]]
566
+ #else
567
+ # define V8_DEPRECATED(message)
568
+ #endif
569
+
570
+
571
+ // A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated.
572
+ #if defined(V8_IMMINENT_DEPRECATION_WARNINGS)
573
+ # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
574
+ #else
575
+ # define V8_DEPRECATE_SOON(message)
576
+ #endif
577
+
578
+
579
+ #if defined(V8_IMMINENT_DEPRECATION_WARNINGS) || \
580
+ defined(V8_DEPRECATION_WARNINGS)
581
+ #if defined(V8_CC_MSVC)
582
+ # define START_ALLOW_USE_DEPRECATED() \
583
+ __pragma(warning(push)) \
584
+ __pragma(warning(disable : 4996))
585
+ # define END_ALLOW_USE_DEPRECATED() __pragma(warning(pop))
586
+ #else // !defined(V8_CC_MSVC)
587
+ # define START_ALLOW_USE_DEPRECATED() \
588
+ _Pragma("GCC diagnostic push") \
589
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
590
+ #define END_ALLOW_USE_DEPRECATED() _Pragma("GCC diagnostic pop")
591
+ #endif // !defined(V8_CC_MSVC)
592
+ #else // !(defined(V8_IMMINENT_DEPRECATION_WARNINGS) ||
593
+ // defined(V8_DEPRECATION_WARNINGS))
594
+ #define START_ALLOW_USE_DEPRECATED()
595
+ #define END_ALLOW_USE_DEPRECATED()
596
+ #endif // !(defined(V8_IMMINENT_DEPRECATION_WARNINGS) ||
597
+ // defined(V8_DEPRECATION_WARNINGS))
598
+ #define ALLOW_COPY_AND_MOVE_WITH_DEPRECATED_FIELDS(ClassName) \
599
+ START_ALLOW_USE_DEPRECATED() \
600
+ ClassName(const ClassName&) = default; \
601
+ ClassName(ClassName&&) = default; \
602
+ ClassName& operator=(const ClassName&) = default; \
603
+ ClassName& operator=(ClassName&&) = default; \
604
+ END_ALLOW_USE_DEPRECATED()
605
+
606
+
607
+ #if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 6)
608
+ # define V8_ENUM_DEPRECATED(message)
609
+ # define V8_ENUM_DEPRECATE_SOON(message)
610
+ #else
611
+ # define V8_ENUM_DEPRECATED(message) V8_DEPRECATED(message)
612
+ # define V8_ENUM_DEPRECATE_SOON(message) V8_DEPRECATE_SOON(message)
613
+ #endif
614
+
615
+
616
+ // A macro to provide the compiler with branch prediction information.
617
+ #if V8_HAS_BUILTIN_EXPECT
618
+ # define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
619
+ # define V8_LIKELY(condition) (__builtin_expect(!!(condition), 1))
620
+ #else
621
+ # define V8_UNLIKELY(condition) (condition)
622
+ # define V8_LIKELY(condition) (condition)
623
+ #endif
624
+
625
+
626
+ // Annotate a function indicating the caller must examine the return value.
627
+ // Use like:
628
+ // int foo() V8_WARN_UNUSED_RESULT;
629
+ #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
630
+ #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
631
+ #else
632
+ #define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */
633
+ #endif
634
+
635
+
636
+ // Annotate functions/variables as weak to allow overriding the symbol.
637
+ #if V8_HAS_ATTRIBUTE_WEAK
638
+ #define V8_WEAK __attribute__((weak))
639
+ #else
640
+ #define V8_WEAK /* NOT SUPPORTED */
641
+ #endif
642
+
643
+
644
+ // Annotate a class or constructor indicating the caller must assign the
645
+ // constructed instances.
646
+ // Apply to the whole class like:
647
+ // class V8_NODISCARD Foo() { ... };
648
+ // or apply to just one constructor like:
649
+ // V8_NODISCARD Foo() { ... };
650
+ // [[nodiscard]] comes in C++17 but supported in clang with -std >= c++11.
651
+ #if V8_HAS_CPP_ATTRIBUTE_NODISCARD
652
+ #define V8_NODISCARD [[nodiscard]]
653
+ #else
654
+ #define V8_NODISCARD /* NOT SUPPORTED */
655
+ #endif
656
+
657
+ // The no_unique_address attribute allows tail padding in a non-static data
658
+ // member to overlap other members of the enclosing class (and in the special
659
+ // case when the type is empty, permits it to fully overlap other members). The
660
+ // field is laid out as if a base class were encountered at the corresponding
661
+ // point within the class (except that it does not share a vptr with the
662
+ // enclosing object).
663
+ //
664
+ // Apply to a data member like:
665
+ //
666
+ // class Foo {
667
+ // V8_NO_UNIQUE_ADDRESS Bar bar_;
668
+ // };
669
+ //
670
+ // [[no_unique_address]] comes in C++20 but supported in clang with
671
+ // -std >= c++11.
672
+ #if V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
673
+ #define V8_NO_UNIQUE_ADDRESS [[no_unique_address]]
674
+ #else
675
+ #define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */
676
+ #endif
677
+
678
+ // Marks a type as being eligible for the "trivial" ABI despite having a
679
+ // non-trivial destructor or copy/move constructor. Such types can be relocated
680
+ // after construction by simply copying their memory, which makes them eligible
681
+ // to be passed in registers. The canonical example is std::unique_ptr.
682
+ //
683
+ // Use with caution; this has some subtle effects on constructor/destructor
684
+ // ordering and will be very incorrect if the type relies on its address
685
+ // remaining constant. When used as a function argument (by value), the value
686
+ // may be constructed in the caller's stack frame, passed in a register, and
687
+ // then used and destructed in the callee's stack frame. A similar thing can
688
+ // occur when values are returned.
689
+ //
690
+ // TRIVIAL_ABI is not needed for types which have a trivial destructor and
691
+ // copy/move constructors, since those are automatically trivial by the ABI
692
+ // spec.
693
+ //
694
+ // It is also not likely to be effective on types too large to be passed in one
695
+ // or two registers on typical target ABIs.
696
+ //
697
+ // See also:
698
+ // https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
699
+ // https://libcxx.llvm.org/docs/DesignDocs/UniquePtrTrivialAbi.html
700
+ #if defined(__clang__) && defined(__has_attribute)
701
+ #if __has_attribute(trivial_abi)
702
+ #define V8_TRIVIAL_ABI [[clang::trivial_abi]]
703
+ #define V8_HAS_ATTRIBUTE_TRIVIAL_ABI 1
704
+ #endif // __has_attribute(trivial_abi)
705
+ #endif // defined(__clang__) && defined(__has_attribute)
706
+ #if !defined(V8_TRIVIAL_ABI)
707
+ #define V8_TRIVIAL_ABI
708
+ #define V8_HAS_ATTRIBUTE_TRIVIAL_ABI 0
709
+ #endif //!defined(V8_TRIVIAL_ABI)
710
+
711
+ // Helper macro to define no_sanitize attributes only with clang.
712
+ #if defined(__clang__) && defined(__has_attribute)
713
+ #if __has_attribute(no_sanitize)
714
+ #define V8_CLANG_NO_SANITIZE(what) __attribute__((no_sanitize(what)))
715
+ #endif
716
+ #endif
717
+ #if !defined(V8_CLANG_NO_SANITIZE)
718
+ #define V8_CLANG_NO_SANITIZE(what)
719
+ #endif
720
+
721
+ // Exposing private symbols requires exposing public symbols too.
722
+ #ifdef BUILDING_V8_SHARED_PRIVATE
723
+ #define BUILDING_V8_SHARED
724
+ #endif
725
+
726
+ #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
727
+ #error Inconsistent build configuration: To build the V8 shared library \
728
+ set BUILDING_V8_SHARED, to include its headers for linking against the \
729
+ V8 shared library set USING_V8_SHARED.
730
+ #endif
731
+
732
+ #ifdef V8_OS_WIN
733
+
734
+ // Setup for Windows DLL export/import. When building the V8 DLL the
735
+ // BUILDING_V8_SHARED needs to be defined. When building a program which uses
736
+ // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
737
+ // static library or building a program which uses the V8 static library neither
738
+ // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
739
+ #ifdef BUILDING_V8_SHARED
740
+ # define V8_EXPORT __declspec(dllexport)
741
+ #elif USING_V8_SHARED
742
+ # define V8_EXPORT __declspec(dllimport)
743
+ #else
744
+ # define V8_EXPORT
745
+ #endif // BUILDING_V8_SHARED
746
+
747
+ #else // V8_OS_WIN
748
+
749
+ // Setup for Linux shared library export.
750
+ #if V8_HAS_ATTRIBUTE_VISIBILITY
751
+ # ifdef BUILDING_V8_SHARED
752
+ # define V8_EXPORT __attribute__ ((visibility("default")))
753
+ # else
754
+ # define V8_EXPORT
755
+ # endif
756
+ #else
757
+ # define V8_EXPORT
758
+ #endif
759
+
760
+ #endif // V8_OS_WIN
761
+
762
+ // clang-format on
763
+
764
+ // Processor architecture detection. For more info on what's defined, see:
765
+ // http://msdn.microsoft.com/en-us/library/b0084kay.aspx
766
+ // http://www.agner.org/optimize/calling_conventions.pdf
767
+ // or with gcc, run: "echo | gcc -E -dM -"
768
+ // The V8_HOST_ARCH_* macros correspond to the architecture on which V8, as a
769
+ // virtual machine and compiler, runs. Don't confuse this with the architecture
770
+ // on which V8 is built.
771
+ #if defined(_M_X64) || defined(__x86_64__)
772
+ #define V8_HOST_ARCH_X64 1
773
+ #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32.
774
+ #define V8_HOST_ARCH_32_BIT 1
775
+ #else
776
+ #define V8_HOST_ARCH_64_BIT 1
777
+ #endif
778
+ #elif defined(_M_IX86) || defined(__i386__)
779
+ #define V8_HOST_ARCH_IA32 1
780
+ #define V8_HOST_ARCH_32_BIT 1
781
+ #elif defined(__AARCH64EL__) || defined(_M_ARM64)
782
+ #define V8_HOST_ARCH_ARM64 1
783
+ #define V8_HOST_ARCH_64_BIT 1
784
+ #elif defined(__ARMEL__)
785
+ #define V8_HOST_ARCH_ARM 1
786
+ #define V8_HOST_ARCH_32_BIT 1
787
+ #elif defined(__mips64)
788
+ #define V8_HOST_ARCH_MIPS64 1
789
+ #define V8_HOST_ARCH_64_BIT 1
790
+ #elif defined(__loongarch_lp64)
791
+ #define V8_HOST_ARCH_LOONG64 1
792
+ #define V8_HOST_ARCH_64_BIT 1
793
+ #elif defined(__PPC64__) || defined(_ARCH_PPC64)
794
+ #define V8_HOST_ARCH_PPC64 1
795
+ #define V8_HOST_ARCH_64_BIT 1
796
+ #elif defined(__PPC__) || defined(_ARCH_PPC)
797
+ #define V8_HOST_ARCH_PPC 1
798
+ #define V8_HOST_ARCH_32_BIT 1
799
+ #elif defined(__s390__) || defined(__s390x__)
800
+ #define V8_HOST_ARCH_S390 1
801
+ #if defined(__s390x__)
802
+ #define V8_HOST_ARCH_64_BIT 1
803
+ #else
804
+ #define V8_HOST_ARCH_32_BIT 1
805
+ #endif
806
+ #elif defined(__riscv) || defined(__riscv__)
807
+ #if __riscv_xlen == 64
808
+ #define V8_HOST_ARCH_RISCV64 1
809
+ #define V8_HOST_ARCH_64_BIT 1
810
+ #elif __riscv_xlen == 32
811
+ #define V8_HOST_ARCH_RISCV32 1
812
+ #define V8_HOST_ARCH_32_BIT 1
813
+ #else
814
+ #error "Cannot detect Riscv's bitwidth"
815
+ #endif
816
+ #else
817
+ #error "Host architecture was not detected as supported by v8"
818
+ #endif
819
+
820
+ // Target architecture detection. This corresponds to the architecture for which
821
+ // V8's JIT will generate code (the last stage of the canadian cross-compiler).
822
+ // The macros may be set externally. If not, detect in the same way as the host
823
+ // architecture, that is, target the native environment as presented by the
824
+ // compiler.
825
+ #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \
826
+ !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_PPC && \
827
+ !V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \
828
+ !V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \
829
+ !V8_TARGET_ARCH_RISCV32
830
+ #if defined(_M_X64) || defined(__x86_64__)
831
+ #define V8_TARGET_ARCH_X64 1
832
+ #elif defined(_M_IX86) || defined(__i386__)
833
+ #define V8_TARGET_ARCH_IA32 1
834
+ #elif defined(__AARCH64EL__) || defined(_M_ARM64)
835
+ #define V8_TARGET_ARCH_ARM64 1
836
+ #elif defined(__ARMEL__)
837
+ #define V8_TARGET_ARCH_ARM 1
838
+ #elif defined(__mips64)
839
+ #define V8_TARGET_ARCH_MIPS64 1
840
+ #elif defined(__loongarch_lp64)
841
+ #define V8_TARGET_ARCH_LOONG64 1
842
+ #elif defined(_ARCH_PPC64)
843
+ #define V8_TARGET_ARCH_PPC64 1
844
+ #elif defined(_ARCH_PPC)
845
+ #define V8_TARGET_ARCH_PPC 1
846
+ #elif defined(__s390__)
847
+ #define V8_TARGET_ARCH_S390 1
848
+ #if defined(__s390x__)
849
+ #define V8_TARGET_ARCH_S390X 1
850
+ #endif
851
+ #elif defined(__riscv) || defined(__riscv__)
852
+ #if __riscv_xlen == 64
853
+ #define V8_TARGET_ARCH_RISCV64 1
854
+ #elif __riscv_xlen == 32
855
+ #define V8_TARGET_ARCH_RISCV32 1
856
+ #endif
857
+ #else
858
+ #error Target architecture was not detected as supported by v8
859
+ #endif
860
+ #endif
861
+
862
+ // Determine architecture pointer size.
863
+ #if V8_TARGET_ARCH_IA32
864
+ #define V8_TARGET_ARCH_32_BIT 1
865
+ #elif V8_TARGET_ARCH_X64
866
+ #if !V8_TARGET_ARCH_32_BIT && !V8_TARGET_ARCH_64_BIT
867
+ #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32.
868
+ #define V8_TARGET_ARCH_32_BIT 1
869
+ #else
870
+ #define V8_TARGET_ARCH_64_BIT 1
871
+ #endif
872
+ #endif
873
+ #elif V8_TARGET_ARCH_ARM
874
+ #define V8_TARGET_ARCH_32_BIT 1
875
+ #elif V8_TARGET_ARCH_ARM64
876
+ #define V8_TARGET_ARCH_64_BIT 1
877
+ #elif V8_TARGET_ARCH_MIPS
878
+ #define V8_TARGET_ARCH_32_BIT 1
879
+ #elif V8_TARGET_ARCH_MIPS64
880
+ #define V8_TARGET_ARCH_64_BIT 1
881
+ #elif V8_TARGET_ARCH_LOONG64
882
+ #define V8_TARGET_ARCH_64_BIT 1
883
+ #elif V8_TARGET_ARCH_PPC
884
+ #define V8_TARGET_ARCH_32_BIT 1
885
+ #elif V8_TARGET_ARCH_PPC64
886
+ #define V8_TARGET_ARCH_64_BIT 1
887
+ #elif V8_TARGET_ARCH_S390
888
+ #if V8_TARGET_ARCH_S390X
889
+ #define V8_TARGET_ARCH_64_BIT 1
890
+ #else
891
+ #define V8_TARGET_ARCH_32_BIT 1
892
+ #endif
893
+ #elif V8_TARGET_ARCH_RISCV64
894
+ #define V8_TARGET_ARCH_64_BIT 1
895
+ #elif V8_TARGET_ARCH_RISCV32
896
+ #define V8_TARGET_ARCH_32_BIT 1
897
+ #else
898
+ #error Unknown target architecture pointer size
899
+ #endif
900
+
901
+ // Check for supported combinations of host and target architectures.
902
+ #if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32
903
+ #error Target architecture ia32 is only supported on ia32 host
904
+ #endif
905
+ #if (V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT && \
906
+ !((V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64) && V8_HOST_ARCH_64_BIT))
907
+ #error Target architecture x64 is only supported on x64 and arm64 host
908
+ #endif
909
+ #if (V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT && \
910
+ !(V8_HOST_ARCH_X64 && V8_HOST_ARCH_32_BIT))
911
+ #error Target architecture x32 is only supported on x64 host with x32 support
912
+ #endif
913
+ #if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM))
914
+ #error Target architecture arm is only supported on arm and ia32 host
915
+ #endif
916
+ #if (V8_TARGET_ARCH_ARM64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64))
917
+ #error Target architecture arm64 is only supported on arm64 and x64 host
918
+ #endif
919
+ #if (V8_TARGET_ARCH_MIPS64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_MIPS64))
920
+ #error Target architecture mips64 is only supported on mips64 and x64 host
921
+ #endif
922
+ #if (V8_TARGET_ARCH_RISCV64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_RISCV64))
923
+ #error Target architecture riscv64 is only supported on riscv64 and x64 host
924
+ #endif
925
+ #if (V8_TARGET_ARCH_RISCV32 && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_RISCV32))
926
+ #error Target architecture riscv32 is only supported on riscv32 and ia32 host
927
+ #endif
928
+ #if (V8_TARGET_ARCH_LOONG64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_LOONG64))
929
+ #error Target architecture loong64 is only supported on loong64 and x64 host
930
+ #endif
931
+
932
+ // Determine architecture endianness.
933
+ #if V8_TARGET_ARCH_IA32
934
+ #define V8_TARGET_LITTLE_ENDIAN 1
935
+ #elif V8_TARGET_ARCH_X64
936
+ #define V8_TARGET_LITTLE_ENDIAN 1
937
+ #elif V8_TARGET_ARCH_ARM
938
+ #define V8_TARGET_LITTLE_ENDIAN 1
939
+ #elif V8_TARGET_ARCH_ARM64
940
+ #define V8_TARGET_LITTLE_ENDIAN 1
941
+ #elif V8_TARGET_ARCH_LOONG64
942
+ #define V8_TARGET_LITTLE_ENDIAN 1
943
+ #elif V8_TARGET_ARCH_MIPS64
944
+ #if defined(__MIPSEB__) || defined(V8_TARGET_ARCH_MIPS64_BE)
945
+ #define V8_TARGET_BIG_ENDIAN 1
946
+ #else
947
+ #define V8_TARGET_LITTLE_ENDIAN 1
948
+ #endif
949
+ #elif defined(__BIG_ENDIAN__) // FOR PPCGR on AIX
950
+ #define V8_TARGET_BIG_ENDIAN 1
951
+ #elif V8_TARGET_ARCH_PPC_LE
952
+ #define V8_TARGET_LITTLE_ENDIAN 1
953
+ #elif V8_TARGET_ARCH_PPC_BE
954
+ #define V8_TARGET_BIG_ENDIAN 1
955
+ #elif V8_TARGET_ARCH_S390
956
+ #if V8_TARGET_ARCH_S390_LE_SIM
957
+ #define V8_TARGET_LITTLE_ENDIAN 1
958
+ #else
959
+ #define V8_TARGET_BIG_ENDIAN 1
960
+ #endif
961
+ #elif V8_TARGET_ARCH_RISCV32 || V8_TARGET_ARCH_RISCV64
962
+ #define V8_TARGET_LITTLE_ENDIAN 1
963
+ #elif defined(__BYTE_ORDER__)
964
+ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
965
+ #define V8_TARGET_BIG_ENDIAN 1
966
+ #else
967
+ #define V8_TARGET_LITTLE_ENDIAN 1
968
+ #endif
969
+ #else
970
+ #error Unknown target architecture endianness
971
+ #endif
972
+
973
+ #undef V8_HAS_CPP_ATTRIBUTE
974
+
975
+ #if !defined(V8_STATIC_ROOTS)
976
+ #define V8_STATIC_ROOTS_BOOL false
977
+ #else
978
+ #define V8_STATIC_ROOTS_BOOL true
979
+ #endif
980
+
981
+ #endif // V8CONFIG_H_