@triniwiz/nativescript-masonkit 1.0.0-alpha.12 → 1.0.0-alpha.14

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 (323) hide show
  1. package/common.js.map +1 -1
  2. package/helpers.d.ts +5 -5
  3. package/helpers.js +0 -3
  4. package/helpers.js.map +1 -1
  5. package/index.android.js +2 -2
  6. package/index.android.js.map +1 -1
  7. package/index.ios.js +2 -2
  8. package/index.ios.js.map +1 -1
  9. package/package.json +2 -2
  10. package/platforms/android/masonkit-release.aar +0 -0
  11. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  12. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +4559 -1456
  13. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  14. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +1932 -1932
  15. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  16. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +4559 -1456
  17. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +4559 -1456
  18. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  19. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +1932 -1932
  20. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +1883 -1883
  21. package/style.d.ts +1 -1
  22. package/style.js +0 -1
  23. package/style.js.map +1 -1
  24. package/node.d.ts +0 -2
  25. package/node.js +0 -3
  26. package/node.js.map +0 -1
  27. package/platforms/ios/Podfile +0 -1
  28. package/platforms/ios/build.xcconfig +0 -5
  29. package/platforms/ios/prebuild.sh +0 -101
  30. package/platforms/new_native_src/cpp/Caches.cpp +0 -36
  31. package/platforms/new_native_src/cpp/Caches.h +0 -42
  32. package/platforms/new_native_src/cpp/Common.h +0 -34
  33. package/platforms/new_native_src/cpp/ConcurrentMap.h +0 -57
  34. package/platforms/new_native_src/cpp/Helpers.cpp +0 -101
  35. package/platforms/new_native_src/cpp/Helpers.h +0 -364
  36. package/platforms/new_native_src/cpp/MasonImpl.cpp +0 -68
  37. package/platforms/new_native_src/cpp/MasonImpl.h +0 -40
  38. package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +0 -89
  39. package/platforms/new_native_src/cpp/MasonNodeImpl.h +0 -47
  40. package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +0 -2181
  41. package/platforms/new_native_src/cpp/MasonStyleImpl.h +0 -420
  42. package/platforms/new_native_src/cpp/include/mason_native.h +0 -972
  43. package/platforms/new_native_src/cpp/include/robin_hood.h +0 -2544
  44. package/src-native/pods/Headers/include/APIDesign.md +0 -72
  45. package/src-native/pods/Headers/include/DEPS +0 -10
  46. package/src-native/pods/Headers/include/DIR_METADATA +0 -11
  47. package/src-native/pods/Headers/include/OWNERS +0 -23
  48. package/src-native/pods/Headers/include/cppgc/DEPS +0 -8
  49. package/src-native/pods/Headers/include/cppgc/OWNERS +0 -2
  50. package/src-native/pods/Headers/include/cppgc/README.md +0 -133
  51. package/src-native/pods/Headers/include/cppgc/allocation.h +0 -310
  52. package/src-native/pods/Headers/include/cppgc/common.h +0 -29
  53. package/src-native/pods/Headers/include/cppgc/cross-thread-persistent.h +0 -465
  54. package/src-native/pods/Headers/include/cppgc/custom-space.h +0 -97
  55. package/src-native/pods/Headers/include/cppgc/default-platform.h +0 -67
  56. package/src-native/pods/Headers/include/cppgc/ephemeron-pair.h +0 -30
  57. package/src-native/pods/Headers/include/cppgc/explicit-management.h +0 -100
  58. package/src-native/pods/Headers/include/cppgc/garbage-collected.h +0 -106
  59. package/src-native/pods/Headers/include/cppgc/heap-consistency.h +0 -266
  60. package/src-native/pods/Headers/include/cppgc/heap-state.h +0 -82
  61. package/src-native/pods/Headers/include/cppgc/heap-statistics.h +0 -120
  62. package/src-native/pods/Headers/include/cppgc/heap.h +0 -206
  63. package/src-native/pods/Headers/include/cppgc/internal/api-constants.h +0 -55
  64. package/src-native/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +0 -48
  65. package/src-native/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +0 -79
  66. package/src-native/pods/Headers/include/cppgc/internal/compiler-specific.h +0 -38
  67. package/src-native/pods/Headers/include/cppgc/internal/finalizer-trait.h +0 -93
  68. package/src-native/pods/Headers/include/cppgc/internal/gc-info.h +0 -156
  69. package/src-native/pods/Headers/include/cppgc/internal/logging.h +0 -50
  70. package/src-native/pods/Headers/include/cppgc/internal/name-trait.h +0 -122
  71. package/src-native/pods/Headers/include/cppgc/internal/persistent-node.h +0 -216
  72. package/src-native/pods/Headers/include/cppgc/internal/pointer-policies.h +0 -186
  73. package/src-native/pods/Headers/include/cppgc/internal/write-barrier.h +0 -435
  74. package/src-native/pods/Headers/include/cppgc/liveness-broker.h +0 -77
  75. package/src-native/pods/Headers/include/cppgc/macros.h +0 -26
  76. package/src-native/pods/Headers/include/cppgc/member.h +0 -291
  77. package/src-native/pods/Headers/include/cppgc/name-provider.h +0 -65
  78. package/src-native/pods/Headers/include/cppgc/object-size-trait.h +0 -58
  79. package/src-native/pods/Headers/include/cppgc/persistent.h +0 -370
  80. package/src-native/pods/Headers/include/cppgc/platform.h +0 -156
  81. package/src-native/pods/Headers/include/cppgc/prefinalizer.h +0 -75
  82. package/src-native/pods/Headers/include/cppgc/process-heap-statistics.h +0 -36
  83. package/src-native/pods/Headers/include/cppgc/sentinel-pointer.h +0 -32
  84. package/src-native/pods/Headers/include/cppgc/source-location.h +0 -92
  85. package/src-native/pods/Headers/include/cppgc/testing.h +0 -106
  86. package/src-native/pods/Headers/include/cppgc/trace-trait.h +0 -116
  87. package/src-native/pods/Headers/include/cppgc/type-traits.h +0 -240
  88. package/src-native/pods/Headers/include/cppgc/visitor.h +0 -379
  89. package/src-native/pods/Headers/include/js_protocol-1.2.json +0 -936
  90. package/src-native/pods/Headers/include/js_protocol-1.3.json +0 -1112
  91. package/src-native/pods/Headers/include/js_protocol.pdl +0 -1709
  92. package/src-native/pods/Headers/include/libffi/arm64/ffi.h +0 -524
  93. package/src-native/pods/Headers/include/libffi/arm64/ffitarget.h +0 -92
  94. package/src-native/pods/Headers/include/libffi/x86_64/ffi.h +0 -524
  95. package/src-native/pods/Headers/include/libffi/x86_64/ffitarget.h +0 -147
  96. package/src-native/pods/Headers/include/libffi.h +0 -12
  97. package/src-native/pods/Headers/include/libplatform/DEPS +0 -9
  98. package/src-native/pods/Headers/include/libplatform/libplatform-export.h +0 -29
  99. package/src-native/pods/Headers/include/libplatform/libplatform.h +0 -106
  100. package/src-native/pods/Headers/include/libplatform/v8-tracing.h +0 -333
  101. package/src-native/pods/Headers/include/v8-array-buffer.h +0 -433
  102. package/src-native/pods/Headers/include/v8-callbacks.h +0 -397
  103. package/src-native/pods/Headers/include/v8-container.h +0 -129
  104. package/src-native/pods/Headers/include/v8-context.h +0 -407
  105. package/src-native/pods/Headers/include/v8-cppgc.h +0 -215
  106. package/src-native/pods/Headers/include/v8-data.h +0 -80
  107. package/src-native/pods/Headers/include/v8-date.h +0 -43
  108. package/src-native/pods/Headers/include/v8-debug.h +0 -168
  109. package/src-native/pods/Headers/include/v8-embedder-heap.h +0 -218
  110. package/src-native/pods/Headers/include/v8-embedder-state-scope.h +0 -51
  111. package/src-native/pods/Headers/include/v8-exception.h +0 -217
  112. package/src-native/pods/Headers/include/v8-extension.h +0 -62
  113. package/src-native/pods/Headers/include/v8-external.h +0 -37
  114. package/src-native/pods/Headers/include/v8-fast-api-calls.h +0 -939
  115. package/src-native/pods/Headers/include/v8-forward.h +0 -81
  116. package/src-native/pods/Headers/include/v8-function-callback.h +0 -475
  117. package/src-native/pods/Headers/include/v8-function.h +0 -125
  118. package/src-native/pods/Headers/include/v8-initialization.h +0 -315
  119. package/src-native/pods/Headers/include/v8-inspector-protocol.h +0 -13
  120. package/src-native/pods/Headers/include/v8-inspector.h +0 -376
  121. package/src-native/pods/Headers/include/v8-internal.h +0 -661
  122. package/src-native/pods/Headers/include/v8-isolate.h +0 -1709
  123. package/src-native/pods/Headers/include/v8-json.h +0 -47
  124. package/src-native/pods/Headers/include/v8-local-handle.h +0 -455
  125. package/src-native/pods/Headers/include/v8-locker.h +0 -149
  126. package/src-native/pods/Headers/include/v8-maybe.h +0 -137
  127. package/src-native/pods/Headers/include/v8-memory-span.h +0 -43
  128. package/src-native/pods/Headers/include/v8-message.h +0 -216
  129. package/src-native/pods/Headers/include/v8-metrics.h +0 -255
  130. package/src-native/pods/Headers/include/v8-microtask-queue.h +0 -152
  131. package/src-native/pods/Headers/include/v8-microtask.h +0 -28
  132. package/src-native/pods/Headers/include/v8-object.h +0 -775
  133. package/src-native/pods/Headers/include/v8-persistent-handle.h +0 -590
  134. package/src-native/pods/Headers/include/v8-platform.h +0 -1092
  135. package/src-native/pods/Headers/include/v8-primitive-object.h +0 -118
  136. package/src-native/pods/Headers/include/v8-primitive.h +0 -866
  137. package/src-native/pods/Headers/include/v8-profiler.h +0 -1198
  138. package/src-native/pods/Headers/include/v8-promise.h +0 -174
  139. package/src-native/pods/Headers/include/v8-proxy.h +0 -50
  140. package/src-native/pods/Headers/include/v8-regexp.h +0 -105
  141. package/src-native/pods/Headers/include/v8-script.h +0 -748
  142. package/src-native/pods/Headers/include/v8-snapshot.h +0 -196
  143. package/src-native/pods/Headers/include/v8-statistics.h +0 -217
  144. package/src-native/pods/Headers/include/v8-template.h +0 -1079
  145. package/src-native/pods/Headers/include/v8-traced-handle.h +0 -420
  146. package/src-native/pods/Headers/include/v8-typed-array.h +0 -282
  147. package/src-native/pods/Headers/include/v8-unwinder-state.h +0 -31
  148. package/src-native/pods/Headers/include/v8-unwinder.h +0 -132
  149. package/src-native/pods/Headers/include/v8-util.h +0 -658
  150. package/src-native/pods/Headers/include/v8-value-serializer-version.h +0 -24
  151. package/src-native/pods/Headers/include/v8-value-serializer.h +0 -279
  152. package/src-native/pods/Headers/include/v8-value.h +0 -526
  153. package/src-native/pods/Headers/include/v8-version-string.h +0 -38
  154. package/src-native/pods/Headers/include/v8-version.h +0 -20
  155. package/src-native/pods/Headers/include/v8-wasm-trap-handler-posix.h +0 -31
  156. package/src-native/pods/Headers/include/v8-wasm-trap-handler-win.h +0 -28
  157. package/src-native/pods/Headers/include/v8-wasm.h +0 -257
  158. package/src-native/pods/Headers/include/v8-weak-callback-info.h +0 -86
  159. package/src-native/pods/Headers/include/v8.h +0 -88
  160. package/src-native/pods/Headers/include/v8config.h +0 -605
  161. package/src-native/pods/Headers/inspector/InspectorServer.h +0 -20
  162. package/src-native/pods/Headers/inspector/JsV8InspectorClient.h +0 -66
  163. package/src-native/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +0 -1123
  164. package/src-native/pods/Headers/inspector/base64.h +0 -9
  165. package/src-native/pods/Headers/inspector/src/base/address-region.h +0 -95
  166. package/src-native/pods/Headers/inspector/src/base/atomic-utils.h +0 -219
  167. package/src-native/pods/Headers/inspector/src/base/atomicops.h +0 -332
  168. package/src-native/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +0 -89
  169. package/src-native/pods/Headers/inspector/src/base/base-export.h +0 -31
  170. package/src-native/pods/Headers/inspector/src/base/bits.h +0 -343
  171. package/src-native/pods/Headers/inspector/src/base/build_config.h +0 -234
  172. package/src-native/pods/Headers/inspector/src/base/compiler-specific.h +0 -136
  173. package/src-native/pods/Headers/inspector/src/base/export-template.h +0 -163
  174. package/src-native/pods/Headers/inspector/src/base/flags.h +0 -130
  175. package/src-native/pods/Headers/inspector/src/base/immediate-crash.h +0 -162
  176. package/src-native/pods/Headers/inspector/src/base/lazy-instance.h +0 -258
  177. package/src-native/pods/Headers/inspector/src/base/logging.h +0 -417
  178. package/src-native/pods/Headers/inspector/src/base/macros.h +0 -423
  179. package/src-native/pods/Headers/inspector/src/base/memory.h +0 -89
  180. package/src-native/pods/Headers/inspector/src/base/once.h +0 -108
  181. package/src-native/pods/Headers/inspector/src/base/optional.h +0 -882
  182. package/src-native/pods/Headers/inspector/src/base/platform/mutex.h +0 -370
  183. package/src-native/pods/Headers/inspector/src/base/platform/platform.h +0 -476
  184. package/src-native/pods/Headers/inspector/src/base/platform/semaphore.h +0 -108
  185. package/src-native/pods/Headers/inspector/src/base/platform/v8-time.h +0 -513
  186. package/src-native/pods/Headers/inspector/src/base/platform/wrappers.h +0 -73
  187. package/src-native/pods/Headers/inspector/src/base/safe_conversions.h +0 -389
  188. package/src-native/pods/Headers/inspector/src/base/safe_conversions_impl.h +0 -822
  189. package/src-native/pods/Headers/inspector/src/base/template-utils.h +0 -113
  190. package/src-native/pods/Headers/inspector/src/base/v8-fallthrough.h +0 -21
  191. package/src-native/pods/Headers/inspector/src/common/checks.h +0 -38
  192. package/src-native/pods/Headers/inspector/src/common/globals.h +0 -1842
  193. package/src-native/pods/Headers/inspector/src/debug/debug-interface.h +0 -667
  194. package/src-native/pods/Headers/inspector/src/debug/interface-types.h +0 -175
  195. package/src-native/pods/Headers/inspector/src/init/v8.h +0 -52
  196. package/src-native/pods/Headers/inspector/src/inspector/custom-preview.h +0 -24
  197. package/src-native/pods/Headers/inspector/src/inspector/injected-script.h +0 -251
  198. package/src-native/pods/Headers/inspector/src/inspector/inspected-context.h +0 -79
  199. package/src-native/pods/Headers/inspector/src/inspector/protocol/CSS.h +0 -2148
  200. package/src-native/pods/Headers/inspector/src/inspector/protocol/Console.h +0 -211
  201. package/src-native/pods/Headers/inspector/src/inspector/protocol/DOM.h +0 -1008
  202. package/src-native/pods/Headers/inspector/src/inspector/protocol/Debugger.h +0 -892
  203. package/src-native/pods/Headers/inspector/src/inspector/protocol/Forward.h +0 -75
  204. package/src-native/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +0 -346
  205. package/src-native/pods/Headers/inspector/src/inspector/protocol/Log.h +0 -342
  206. package/src-native/pods/Headers/inspector/src/inspector/protocol/Network.h +0 -2528
  207. package/src-native/pods/Headers/inspector/src/inspector/protocol/Overlay.h +0 -281
  208. package/src-native/pods/Headers/inspector/src/inspector/protocol/Page.h +0 -1189
  209. package/src-native/pods/Headers/inspector/src/inspector/protocol/Profiler.h +0 -1001
  210. package/src-native/pods/Headers/inspector/src/inspector/protocol/Protocol.h +0 -617
  211. package/src-native/pods/Headers/inspector/src/inspector/protocol/Runtime.h +0 -1696
  212. package/src-native/pods/Headers/inspector/src/inspector/protocol/Schema.h +0 -146
  213. package/src-native/pods/Headers/inspector/src/inspector/protocol/Security.h +0 -793
  214. package/src-native/pods/Headers/inspector/src/inspector/remote-object-id.h +0 -54
  215. package/src-native/pods/Headers/inspector/src/inspector/search-util.h +0 -26
  216. package/src-native/pods/Headers/inspector/src/inspector/string-16.h +0 -180
  217. package/src-native/pods/Headers/inspector/src/inspector/string-util.h +0 -128
  218. package/src-native/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +0 -48
  219. package/src-native/pods/Headers/inspector/src/inspector/v8-console-message.h +0 -147
  220. package/src-native/pods/Headers/inspector/src/inspector/v8-console.h +0 -173
  221. package/src-native/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +0 -62
  222. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +0 -248
  223. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-id.h +0 -44
  224. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-script.h +0 -123
  225. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger.h +0 -257
  226. package/src-native/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +0 -91
  227. package/src-native/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +0 -80
  228. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +0 -191
  229. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +0 -156
  230. package/src-native/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +0 -34
  231. package/src-native/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +0 -71
  232. package/src-native/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +0 -24
  233. package/src-native/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +0 -70
  234. package/src-native/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +0 -88
  235. package/src-native/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +0 -104
  236. package/src-native/pods/Headers/inspector/src/inspector/v8-regex.h +0 -38
  237. package/src-native/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +0 -157
  238. package/src-native/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +0 -38
  239. package/src-native/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +0 -164
  240. package/src-native/pods/Headers/inspector/src/inspector/v8-string-conversions.h +0 -17
  241. package/src-native/pods/Headers/inspector/src/inspector/v8-value-utils.h +0 -23
  242. package/src-native/pods/Headers/inspector/src/inspector/value-mirror.h +0 -87
  243. package/src-native/pods/Headers/inspector/src/libplatform/default-platform.h +0 -92
  244. package/src-native/pods/Headers/inspector/src/logging/tracing-flags.h +0 -50
  245. package/src-native/pods/Headers/inspector/src/numbers/conversions.h +0 -183
  246. package/src-native/pods/Headers/inspector/src/tracing/trace-event.h +0 -664
  247. package/src-native/pods/Headers/inspector/src/utils/allocation.h +0 -367
  248. package/src-native/pods/Headers/inspector/src/utils/vector.h +0 -324
  249. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +0 -305
  250. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +0 -314
  251. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +0 -62
  252. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +0 -6
  253. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +0 -58
  254. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +0 -47
  255. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +0 -80
  256. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +0 -52
  257. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +0 -26
  258. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +0 -104
  259. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +0 -39
  260. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +0 -406
  261. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +0 -32
  262. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +0 -158
  263. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +0 -99
  264. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +0 -139
  265. package/src-native/pods/Headers/inspector/utils.h +0 -32
  266. package/src-native/pods/Headers/inspector/v8-inspector-platform.h +0 -44
  267. package/src-native/pods/Headers/jsi/decorator.h +0 -762
  268. package/src-native/pods/Headers/jsi/instrumentation.h +0 -117
  269. package/src-native/pods/Headers/jsi/jsi-inl.h +0 -322
  270. package/src-native/pods/Headers/jsi/jsi.h +0 -1387
  271. package/src-native/pods/Headers/jsi/jsilib.h +0 -59
  272. package/src-native/pods/Headers/jsi/threadsafe.h +0 -79
  273. package/src-native/pods/Headers/runtime/ArgConverter.h +0 -61
  274. package/src-native/pods/Headers/runtime/ArrayAdapter.h +0 -13
  275. package/src-native/pods/Headers/runtime/Caches.h +0 -98
  276. package/src-native/pods/Headers/runtime/ClassBuilder.h +0 -61
  277. package/src-native/pods/Headers/runtime/Common.h +0 -9
  278. package/src-native/pods/Headers/runtime/ConcurrentMap.h +0 -55
  279. package/src-native/pods/Headers/runtime/ConcurrentQueue.h +0 -28
  280. package/src-native/pods/Headers/runtime/Console.h +0 -27
  281. package/src-native/pods/Headers/runtime/Constants.h +0 -15
  282. package/src-native/pods/Headers/runtime/DataWrapper.h +0 -671
  283. package/src-native/pods/Headers/runtime/DictionaryAdapter.h +0 -13
  284. package/src-native/pods/Headers/runtime/ExtVector.h +0 -21
  285. package/src-native/pods/Headers/runtime/FFICall.h +0 -105
  286. package/src-native/pods/Headers/runtime/FastEnumerationAdapter.h +0 -13
  287. package/src-native/pods/Headers/runtime/FunctionReference.h +0 -18
  288. package/src-native/pods/Headers/runtime/Helpers.h +0 -84
  289. package/src-native/pods/Headers/runtime/InlineFunctions.h +0 -16
  290. package/src-native/pods/Headers/runtime/Interop.h +0 -202
  291. package/src-native/pods/Headers/runtime/KnownUnknownClassPair.h +0 -35
  292. package/src-native/pods/Headers/runtime/Metadata.h +0 -981
  293. package/src-native/pods/Headers/runtime/MetadataBuilder.h +0 -72
  294. package/src-native/pods/Headers/runtime/MetadataInlines.h +0 -157
  295. package/src-native/pods/Headers/runtime/ModuleInternal.h +0 -59
  296. package/src-native/pods/Headers/runtime/NSDataAdapter.h +0 -13
  297. package/src-native/pods/Headers/runtime/NativeScriptException.h +0 -27
  298. package/src-native/pods/Headers/runtime/ObjectManager.h +0 -31
  299. package/src-native/pods/Headers/runtime/OneByteStringResource.h +0 -21
  300. package/src-native/pods/Headers/runtime/Pointer.h +0 -26
  301. package/src-native/pods/Headers/runtime/PromiseProxy.h +0 -15
  302. package/src-native/pods/Headers/runtime/Reference.h +0 -38
  303. package/src-native/pods/Headers/runtime/Runtime.h +0 -67
  304. package/src-native/pods/Headers/runtime/RuntimeConfig.h +0 -17
  305. package/src-native/pods/Headers/runtime/SetTimeout.h +0 -34
  306. package/src-native/pods/Headers/runtime/SimpleAllocator.h +0 -23
  307. package/src-native/pods/Headers/runtime/StringHasher.h +0 -315
  308. package/src-native/pods/Headers/runtime/SymbolIterator.h +0 -18
  309. package/src-native/pods/Headers/runtime/SymbolLoader.h +0 -27
  310. package/src-native/pods/Headers/runtime/TNSDerivedClass.h +0 -8
  311. package/src-native/pods/Headers/runtime/TSHelpers.h +0 -15
  312. package/src-native/pods/Headers/runtime/Tasks.h +0 -19
  313. package/src-native/pods/Headers/runtime/UnmanagedType.h +0 -21
  314. package/src-native/pods/Headers/runtime/WeakRef.h +0 -15
  315. package/src-native/pods/Headers/runtime/Worker.h +0 -26
  316. package/src-native/pods/Headers/runtime/robin_hood.h +0 -2184
  317. package/src-native/pods/Headers/v8runtime/HostProxy.h +0 -71
  318. package/src-native/pods/Headers/v8runtime/JSIV8ValueConverter.h +0 -70
  319. package/src-native/pods/Headers/v8runtime/V8PointerValue.h +0 -44
  320. package/src-native/pods/Headers/v8runtime/V8Runtime.h +0 -215
  321. package/src-native/pods/Headers/v8runtime/V8RuntimeConfig.h +0 -26
  322. package/src-native/pods/Headers/v8runtime/V8RuntimeFactory.h +0 -21
  323. package/src-native/pods/NativeScript.podspec +0 -68
@@ -1,1842 +0,0 @@
1
- // Copyright 2012 the V8 project authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- #ifndef V8_COMMON_GLOBALS_H_
6
- #define V8_COMMON_GLOBALS_H_
7
-
8
- #include <stddef.h>
9
- #include <stdint.h>
10
-
11
- #include <limits>
12
- #include <ostream>
13
-
14
- #include "include/v8-internal.h"
15
- #include "src/base/atomic-utils.h"
16
- #include "src/base/build_config.h"
17
- #include "src/base/flags.h"
18
- #include "src/base/logging.h"
19
- #include "src/base/macros.h"
20
-
21
- #define V8_INFINITY std::numeric_limits<double>::infinity()
22
-
23
- namespace v8 {
24
-
25
- namespace base {
26
- class Mutex;
27
- class RecursiveMutex;
28
- } // namespace base
29
-
30
- namespace internal {
31
-
32
- constexpr int KB = 1024;
33
- constexpr int MB = KB * 1024;
34
- constexpr int GB = MB * 1024;
35
-
36
- // Determine whether we are running in a simulated environment.
37
- // Setting USE_SIMULATOR explicitly from the build script will force
38
- // the use of a simulated environment.
39
- #if !defined(USE_SIMULATOR)
40
- #if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64)
41
- #define USE_SIMULATOR 1
42
- #endif
43
- #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM)
44
- #define USE_SIMULATOR 1
45
- #endif
46
- #if (V8_TARGET_ARCH_PPC && !V8_HOST_ARCH_PPC)
47
- #define USE_SIMULATOR 1
48
- #endif
49
- #if (V8_TARGET_ARCH_PPC64 && !V8_HOST_ARCH_PPC64)
50
- #define USE_SIMULATOR 1
51
- #endif
52
- #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS)
53
- #define USE_SIMULATOR 1
54
- #endif
55
- #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64)
56
- #define USE_SIMULATOR 1
57
- #endif
58
- #if (V8_TARGET_ARCH_S390 && !V8_HOST_ARCH_S390)
59
- #define USE_SIMULATOR 1
60
- #endif
61
- #if (V8_TARGET_ARCH_RISCV64 && !V8_HOST_ARCH_RISCV64)
62
- #define USE_SIMULATOR 1
63
- #endif
64
- #endif
65
-
66
- // Determine whether the architecture uses an embedded constant pool
67
- // (contiguous constant pool embedded in code object).
68
- #if V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64
69
- #define V8_EMBEDDED_CONSTANT_POOL true
70
- #else
71
- #define V8_EMBEDDED_CONSTANT_POOL false
72
- #endif
73
-
74
- #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64
75
- // Set stack limit lower for ARM and ARM64 than for other architectures because:
76
- // - on Arm stack allocating MacroAssembler takes 120K bytes.
77
- // See issue crbug.com/405338
78
- // - on Arm64 when running in single-process mode for Android WebView, when
79
- // initializing V8 we already have a large stack and so have to set the
80
- // limit lower. See issue crbug.com/v8/10575
81
- #define V8_DEFAULT_STACK_SIZE_KB 864
82
- #else
83
- // Slightly less than 1MB, since Windows' default stack size for
84
- // the main execution thread is 1MB for both 32 and 64-bit.
85
- #define V8_DEFAULT_STACK_SIZE_KB 984
86
- #endif
87
-
88
- // Minimum stack size in KB required by compilers.
89
- constexpr int kStackSpaceRequiredForCompilation = 40;
90
-
91
- // In order to emit more efficient stack checks in optimized code,
92
- // deoptimization may implicitly exceed the V8 stack limit by this many bytes.
93
- // Stack checks in functions with `difference between optimized and unoptimized
94
- // stack frame sizes <= slack` can simply emit the simple stack check.
95
- constexpr int kStackLimitSlackForDeoptimizationInBytes = 256;
96
-
97
- // Sanity-check, assuming that we aim for a real OS stack size of at least 1MB.
98
- STATIC_ASSERT(V8_DEFAULT_STACK_SIZE_KB* KB +
99
- kStackLimitSlackForDeoptimizationInBytes <=
100
- MB);
101
-
102
- // Determine whether the short builtin calls optimization is enabled.
103
- #ifdef V8_SHORT_BUILTIN_CALLS
104
- #ifndef V8_COMPRESS_POINTERS
105
- // TODO(11527): Fix this by passing Isolate* to Code::OffHeapInstructionStart()
106
- // and friends.
107
- #error Short builtin calls feature requires pointer compression
108
- #endif
109
- #endif
110
-
111
- // This constant is used for detecting whether the machine has >= 4GB of
112
- // physical memory by checking the max old space size.
113
- const size_t kShortBuiltinCallsOldSpaceSizeThreshold = size_t{2} * GB;
114
-
115
- // Determine whether dict mode prototypes feature is enabled.
116
- #ifdef V8_ENABLE_SWISS_NAME_DICTIONARY
117
- #define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL true
118
- #else
119
- #define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL false
120
- #endif
121
-
122
- // Determine whether dict property constness tracking feature is enabled.
123
- #ifdef V8_DICT_PROPERTY_CONST_TRACKING
124
- #define V8_DICT_PROPERTY_CONST_TRACKING_BOOL true
125
- #else
126
- #define V8_DICT_PROPERTY_CONST_TRACKING_BOOL false
127
- #endif
128
-
129
- // Determine whether tagged pointers are 8 bytes (used in Torque layouts for
130
- // choosing where to insert padding).
131
- #if V8_TARGET_ARCH_64_BIT && !defined(V8_COMPRESS_POINTERS)
132
- #define TAGGED_SIZE_8_BYTES true
133
- #else
134
- #define TAGGED_SIZE_8_BYTES false
135
- #endif
136
-
137
- // Some types of tracing require the SFI to store a unique ID.
138
- #if defined(V8_TRACE_MAPS) || defined(V8_TRACE_UNOPTIMIZED)
139
- #define V8_SFI_HAS_UNIQUE_ID true
140
- #else
141
- #define V8_SFI_HAS_UNIQUE_ID false
142
- #endif
143
-
144
- #if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_X64)
145
- #define V8_OS_WIN_X64 true
146
- #endif
147
-
148
- #if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_ARM64)
149
- #define V8_OS_WIN_ARM64 true
150
- #endif
151
-
152
- #if defined(V8_OS_WIN_X64) || defined(V8_OS_WIN_ARM64)
153
- #define V8_OS_WIN64 true
154
- #endif
155
-
156
- // Superclass for classes only using static method functions.
157
- // The subclass of AllStatic cannot be instantiated at all.
158
- class AllStatic {
159
- #ifdef DEBUG
160
- public:
161
- AllStatic() = delete;
162
- #endif
163
- };
164
-
165
- using byte = uint8_t;
166
-
167
- // -----------------------------------------------------------------------------
168
- // Constants
169
-
170
- constexpr int kMaxInt = 0x7FFFFFFF;
171
- constexpr int kMinInt = -kMaxInt - 1;
172
- constexpr int kMaxInt8 = (1 << 7) - 1;
173
- constexpr int kMinInt8 = -(1 << 7);
174
- constexpr int kMaxUInt8 = (1 << 8) - 1;
175
- constexpr int kMinUInt8 = 0;
176
- constexpr int kMaxInt16 = (1 << 15) - 1;
177
- constexpr int kMinInt16 = -(1 << 15);
178
- constexpr int kMaxUInt16 = (1 << 16) - 1;
179
- constexpr int kMinUInt16 = 0;
180
- constexpr int kMaxInt31 = kMaxInt / 2;
181
- constexpr int kMinInt31 = kMinInt / 2;
182
-
183
- constexpr uint32_t kMaxUInt32 = 0xFFFFFFFFu;
184
- constexpr int kMinUInt32 = 0;
185
-
186
- constexpr int kUInt8Size = sizeof(uint8_t);
187
- constexpr int kByteSize = sizeof(byte);
188
- constexpr int kCharSize = sizeof(char);
189
- constexpr int kShortSize = sizeof(short); // NOLINT
190
- constexpr int kUInt16Size = sizeof(uint16_t);
191
- constexpr int kIntSize = sizeof(int);
192
- constexpr int kInt32Size = sizeof(int32_t);
193
- constexpr int kInt64Size = sizeof(int64_t);
194
- constexpr int kUInt32Size = sizeof(uint32_t);
195
- constexpr int kSizetSize = sizeof(size_t);
196
- constexpr int kFloatSize = sizeof(float);
197
- constexpr int kDoubleSize = sizeof(double);
198
- constexpr int kIntptrSize = sizeof(intptr_t);
199
- constexpr int kUIntptrSize = sizeof(uintptr_t);
200
- constexpr int kSystemPointerSize = sizeof(void*);
201
- constexpr int kSystemPointerHexDigits = kSystemPointerSize == 4 ? 8 : 12;
202
- constexpr int kPCOnStackSize = kSystemPointerSize;
203
- constexpr int kFPOnStackSize = kSystemPointerSize;
204
-
205
- #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32
206
- constexpr int kElidedFrameSlots = kPCOnStackSize / kSystemPointerSize;
207
- #else
208
- constexpr int kElidedFrameSlots = 0;
209
- #endif
210
-
211
- constexpr int kDoubleSizeLog2 = 3;
212
- // The maximal length of the string representation for a double value
213
- // (e.g. "-2.2250738585072020E-308"). It is composed as follows:
214
- // - 17 decimal digits, see kBase10MaximalLength (dtoa.h)
215
- // - 1 sign
216
- // - 1 decimal point
217
- // - 1 E or e
218
- // - 1 exponent sign
219
- // - 3 exponent
220
- constexpr int kMaxDoubleStringLength = 24;
221
-
222
- // Total wasm code space per engine (i.e. per process) is limited to make
223
- // certain attacks that rely on heap spraying harder.
224
- // Just below 4GB, such that {kMaxWasmCodeMemory} fits in a 32-bit size_t.
225
- constexpr size_t kMaxWasmCodeMB = 4095;
226
- constexpr size_t kMaxWasmCodeMemory = kMaxWasmCodeMB * MB;
227
-
228
- #if V8_HOST_ARCH_64_BIT
229
- constexpr int kSystemPointerSizeLog2 = 3;
230
- constexpr intptr_t kIntptrSignBit =
231
- static_cast<intptr_t>(uintptr_t{0x8000000000000000});
232
- constexpr bool kPlatformRequiresCodeRange = true;
233
- #if (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) && \
234
- (V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64) && V8_OS_LINUX
235
- constexpr size_t kMaximalCodeRangeSize = 512 * MB;
236
- constexpr size_t kMinExpectedOSPageSize = 64 * KB; // OS page on PPC Linux
237
- #elif V8_TARGET_ARCH_ARM64
238
- constexpr size_t kMaximalCodeRangeSize = 128 * MB;
239
- constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
240
- #else
241
- constexpr size_t kMaximalCodeRangeSize = 128 * MB;
242
- constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
243
- #endif
244
- #if V8_OS_WIN
245
- constexpr size_t kMinimumCodeRangeSize = 4 * MB;
246
- constexpr size_t kReservedCodeRangePages = 1;
247
- #else
248
- constexpr size_t kMinimumCodeRangeSize = 3 * MB;
249
- constexpr size_t kReservedCodeRangePages = 0;
250
- #endif
251
- #else
252
- constexpr int kSystemPointerSizeLog2 = 2;
253
- constexpr intptr_t kIntptrSignBit = 0x80000000;
254
- #if (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) && \
255
- (V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64) && V8_OS_LINUX
256
- constexpr bool kPlatformRequiresCodeRange = false;
257
- constexpr size_t kMaximalCodeRangeSize = 0 * MB;
258
- constexpr size_t kMinimumCodeRangeSize = 0 * MB;
259
- constexpr size_t kMinExpectedOSPageSize = 64 * KB; // OS page on PPC Linux
260
- #elif V8_TARGET_ARCH_MIPS
261
- constexpr bool kPlatformRequiresCodeRange = false;
262
- constexpr size_t kMaximalCodeRangeSize = 2048LL * MB;
263
- constexpr size_t kMinimumCodeRangeSize = 0 * MB;
264
- constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
265
- #else
266
- constexpr bool kPlatformRequiresCodeRange = false;
267
- constexpr size_t kMaximalCodeRangeSize = 0 * MB;
268
- constexpr size_t kMinimumCodeRangeSize = 0 * MB;
269
- constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
270
- #endif
271
- constexpr size_t kReservedCodeRangePages = 0;
272
- #endif
273
-
274
- STATIC_ASSERT(kSystemPointerSize == (1 << kSystemPointerSizeLog2));
275
-
276
- #ifdef V8_COMPRESS_ZONES
277
- #define COMPRESS_ZONES_BOOL true
278
- #else
279
- #define COMPRESS_ZONES_BOOL false
280
- #endif // V8_COMPRESS_ZONES
281
-
282
- // The flag controls whether zones pointer compression should be enabled for
283
- // TurboFan graphs or not.
284
- static constexpr bool kCompressGraphZone = COMPRESS_ZONES_BOOL;
285
-
286
- #ifdef V8_COMPRESS_POINTERS
287
- static_assert(
288
- kSystemPointerSize == kInt64Size,
289
- "Pointer compression can be enabled only for 64-bit architectures");
290
-
291
- constexpr int kTaggedSize = kInt32Size;
292
- constexpr int kTaggedSizeLog2 = 2;
293
-
294
- // These types define raw and atomic storage types for tagged values stored
295
- // on V8 heap.
296
- using Tagged_t = uint32_t;
297
- using AtomicTagged_t = base::Atomic32;
298
-
299
- #else
300
-
301
- constexpr int kTaggedSize = kSystemPointerSize;
302
- constexpr int kTaggedSizeLog2 = kSystemPointerSizeLog2;
303
-
304
- // These types define raw and atomic storage types for tagged values stored
305
- // on V8 heap.
306
- using Tagged_t = Address;
307
- using AtomicTagged_t = base::AtomicWord;
308
-
309
- #endif // V8_COMPRESS_POINTERS
310
-
311
- STATIC_ASSERT(kTaggedSize == (1 << kTaggedSizeLog2));
312
- STATIC_ASSERT((kTaggedSize == 8) == TAGGED_SIZE_8_BYTES);
313
-
314
- using AsAtomicTagged = base::AsAtomicPointerImpl<AtomicTagged_t>;
315
- STATIC_ASSERT(sizeof(Tagged_t) == kTaggedSize);
316
- STATIC_ASSERT(sizeof(AtomicTagged_t) == kTaggedSize);
317
-
318
- STATIC_ASSERT(kTaggedSize == kApiTaggedSize);
319
-
320
- // TODO(ishell): use kTaggedSize or kSystemPointerSize instead.
321
- #ifndef V8_COMPRESS_POINTERS
322
- constexpr int kPointerSize = kSystemPointerSize;
323
- constexpr int kPointerSizeLog2 = kSystemPointerSizeLog2;
324
- STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2));
325
- #endif
326
-
327
- // This type defines raw storage type for external (or off-V8 heap) pointers
328
- // stored on V8 heap.
329
- constexpr int kExternalPointerSize = sizeof(ExternalPointer_t);
330
-
331
- constexpr int kEmbedderDataSlotSize = kSystemPointerSize;
332
-
333
- constexpr int kEmbedderDataSlotSizeInTaggedSlots =
334
- kEmbedderDataSlotSize / kTaggedSize;
335
- STATIC_ASSERT(kEmbedderDataSlotSize >= kSystemPointerSize);
336
-
337
- constexpr int kExternalAllocationSoftLimit =
338
- internal::Internals::kExternalAllocationSoftLimit;
339
-
340
- // Maximum object size that gets allocated into regular pages. Objects larger
341
- // than that size are allocated in large object space and are never moved in
342
- // memory. This also applies to new space allocation, since objects are never
343
- // migrated from new space to large object space. Takes double alignment into
344
- // account.
345
- //
346
- // Current value: half of the page size.
347
- constexpr int kMaxRegularHeapObjectSize = (1 << (kPageSizeBits - 1));
348
-
349
- constexpr int kBitsPerByte = 8;
350
- constexpr int kBitsPerByteLog2 = 3;
351
- constexpr int kBitsPerSystemPointer = kSystemPointerSize * kBitsPerByte;
352
- constexpr int kBitsPerSystemPointerLog2 =
353
- kSystemPointerSizeLog2 + kBitsPerByteLog2;
354
- constexpr int kBitsPerInt = kIntSize * kBitsPerByte;
355
-
356
- // IEEE 754 single precision floating point number bit layout.
357
- constexpr uint32_t kBinary32SignMask = 0x80000000u;
358
- constexpr uint32_t kBinary32ExponentMask = 0x7f800000u;
359
- constexpr uint32_t kBinary32MantissaMask = 0x007fffffu;
360
- constexpr int kBinary32ExponentBias = 127;
361
- constexpr int kBinary32MaxExponent = 0xFE;
362
- constexpr int kBinary32MinExponent = 0x01;
363
- constexpr int kBinary32MantissaBits = 23;
364
- constexpr int kBinary32ExponentShift = 23;
365
-
366
- // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
367
- // other bits set.
368
- constexpr uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
369
-
370
- // Latin1/UTF-16 constants
371
- // Code-point values in Unicode 4.0 are 21 bits wide.
372
- // Code units in UTF-16 are 16 bits wide.
373
- using uc16 = uint16_t;
374
- using uc32 = uint32_t;
375
- constexpr int kOneByteSize = kCharSize;
376
- constexpr int kUC16Size = sizeof(uc16); // NOLINT
377
-
378
- // 128 bit SIMD value size.
379
- constexpr int kSimd128Size = 16;
380
-
381
- // Maximum ordinal used for tracking asynchronous module evaluation order.
382
- constexpr unsigned kMaxModuleAsyncEvaluatingOrdinal = (1 << 30) - 1;
383
-
384
- // FUNCTION_ADDR(f) gets the address of a C function f.
385
- #define FUNCTION_ADDR(f) (reinterpret_cast<v8::internal::Address>(f))
386
-
387
- // FUNCTION_CAST<F>(addr) casts an address into a function
388
- // of type F. Used to invoke generated code from within C.
389
- template <typename F>
390
- F FUNCTION_CAST(byte* addr) {
391
- return reinterpret_cast<F>(reinterpret_cast<Address>(addr));
392
- }
393
-
394
- template <typename F>
395
- F FUNCTION_CAST(Address addr) {
396
- return reinterpret_cast<F>(addr);
397
- }
398
-
399
- // Determine whether the architecture uses function descriptors
400
- // which provide a level of indirection between the function pointer
401
- // and the function entrypoint.
402
- #if (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64) && \
403
- (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN && \
404
- (!defined(_CALL_ELF) || _CALL_ELF == 1)))
405
- #define USES_FUNCTION_DESCRIPTORS 1
406
- #define FUNCTION_ENTRYPOINT_ADDRESS(f) \
407
- (reinterpret_cast<v8::internal::Address*>( \
408
- &(reinterpret_cast<intptr_t*>(f)[0])))
409
- #else
410
- #define USES_FUNCTION_DESCRIPTORS 0
411
- #endif
412
-
413
- // -----------------------------------------------------------------------------
414
- // Declarations for use in both the preparser and the rest of V8.
415
-
416
- // The Strict Mode (ECMA-262 5th edition, 4.2.2).
417
-
418
- enum class LanguageMode : bool { kSloppy, kStrict };
419
- static const size_t LanguageModeSize = 2;
420
-
421
- inline size_t hash_value(LanguageMode mode) {
422
- return static_cast<size_t>(mode);
423
- }
424
-
425
- inline const char* LanguageMode2String(LanguageMode mode) {
426
- switch (mode) {
427
- case LanguageMode::kSloppy:
428
- return "sloppy";
429
- case LanguageMode::kStrict:
430
- return "strict";
431
- }
432
- UNREACHABLE();
433
- }
434
-
435
- inline std::ostream& operator<<(std::ostream& os, LanguageMode mode) {
436
- return os << LanguageMode2String(mode);
437
- }
438
-
439
- inline bool is_sloppy(LanguageMode language_mode) {
440
- return language_mode == LanguageMode::kSloppy;
441
- }
442
-
443
- inline bool is_strict(LanguageMode language_mode) {
444
- return language_mode != LanguageMode::kSloppy;
445
- }
446
-
447
- inline bool is_valid_language_mode(int language_mode) {
448
- return language_mode == static_cast<int>(LanguageMode::kSloppy) ||
449
- language_mode == static_cast<int>(LanguageMode::kStrict);
450
- }
451
-
452
- inline LanguageMode construct_language_mode(bool strict_bit) {
453
- return static_cast<LanguageMode>(strict_bit);
454
- }
455
-
456
- // Return kStrict if either of the language modes is kStrict, or kSloppy
457
- // otherwise.
458
- inline LanguageMode stricter_language_mode(LanguageMode mode1,
459
- LanguageMode mode2) {
460
- STATIC_ASSERT(LanguageModeSize == 2);
461
- return static_cast<LanguageMode>(static_cast<int>(mode1) |
462
- static_cast<int>(mode2));
463
- }
464
-
465
- // A non-keyed store is of the form a.x = foo or a["x"] = foo whereas
466
- // a keyed store is of the form a[expression] = foo.
467
- enum class StoreOrigin { kMaybeKeyed, kNamed };
468
-
469
- enum class TypeofMode { kInside, kNotInside };
470
-
471
- // Enums used by CEntry.
472
- enum class SaveFPRegsMode { kIgnore, kSave };
473
- enum class ArgvMode { kStack, kRegister };
474
-
475
- // This constant is used as an undefined value when passing source positions.
476
- constexpr int kNoSourcePosition = -1;
477
-
478
- // This constant is used to signal the function entry implicit stack check
479
- // bytecode offset.
480
- constexpr int kFunctionEntryBytecodeOffset = -1;
481
-
482
- // This constant is used to signal the function exit interrupt budget handling
483
- // bytecode offset.
484
- constexpr int kFunctionExitBytecodeOffset = -1;
485
-
486
- // This constant is used to indicate missing deoptimization information.
487
- constexpr int kNoDeoptimizationId = -1;
488
-
489
- // Deoptimize bailout kind:
490
- // - Eager: a check failed in the optimized code and deoptimization happens
491
- // immediately.
492
- // - Lazy: the code has been marked as dependent on some assumption which
493
- // is checked elsewhere and can trigger deoptimization the next time the
494
- // code is executed.
495
- // - Soft: similar to lazy deoptimization, but does not contribute to the
496
- // total deopt count which can lead to disabling optimization for a function.
497
- // - Bailout: a check failed in the optimized code but we don't
498
- // deoptimize the code, but try to heal the feedback and try to rerun
499
- // the optimized code again.
500
- // - EagerWithResume: a check failed in the optimized code, but we can execute
501
- // a more expensive check in a builtin that might either result in us resuming
502
- // execution in the optimized code, or deoptimizing immediately.
503
- enum class DeoptimizeKind : uint8_t {
504
- kEager,
505
- kSoft,
506
- kBailout,
507
- kLazy,
508
- kEagerWithResume,
509
- };
510
- constexpr DeoptimizeKind kFirstDeoptimizeKind = DeoptimizeKind::kEager;
511
- constexpr DeoptimizeKind kLastDeoptimizeKind = DeoptimizeKind::kEagerWithResume;
512
- STATIC_ASSERT(static_cast<int>(kFirstDeoptimizeKind) == 0);
513
- constexpr int kDeoptimizeKindCount = static_cast<int>(kLastDeoptimizeKind) + 1;
514
- inline size_t hash_value(DeoptimizeKind kind) {
515
- return static_cast<size_t>(kind);
516
- }
517
- inline std::ostream& operator<<(std::ostream& os, DeoptimizeKind kind) {
518
- switch (kind) {
519
- case DeoptimizeKind::kEager:
520
- return os << "Eager";
521
- case DeoptimizeKind::kSoft:
522
- return os << "Soft";
523
- case DeoptimizeKind::kLazy:
524
- return os << "Lazy";
525
- case DeoptimizeKind::kBailout:
526
- return os << "Bailout";
527
- case DeoptimizeKind::kEagerWithResume:
528
- return os << "EagerMaybeResume";
529
- }
530
- }
531
-
532
- // Indicates whether the lookup is related to sloppy-mode block-scoped
533
- // function hoisting, and is a synthetic assignment for that.
534
- enum class LookupHoistingMode { kNormal, kLegacySloppy };
535
-
536
- inline std::ostream& operator<<(std::ostream& os,
537
- const LookupHoistingMode& mode) {
538
- switch (mode) {
539
- case LookupHoistingMode::kNormal:
540
- return os << "normal hoisting";
541
- case LookupHoistingMode::kLegacySloppy:
542
- return os << "legacy sloppy hoisting";
543
- }
544
- UNREACHABLE();
545
- }
546
-
547
- static_assert(kSmiValueSize <= 32, "Unsupported Smi tagging scheme");
548
- // Smi sign bit position must be 32-bit aligned so we can use sign extension
549
- // instructions on 64-bit architectures without additional shifts.
550
- static_assert((kSmiValueSize + kSmiShiftSize + kSmiTagSize) % 32 == 0,
551
- "Unsupported Smi tagging scheme");
552
-
553
- constexpr bool kIsSmiValueInUpper32Bits =
554
- (kSmiValueSize + kSmiShiftSize + kSmiTagSize) == 64;
555
- constexpr bool kIsSmiValueInLower32Bits =
556
- (kSmiValueSize + kSmiShiftSize + kSmiTagSize) == 32;
557
- static_assert(!SmiValuesAre32Bits() == SmiValuesAre31Bits(),
558
- "Unsupported Smi tagging scheme");
559
- static_assert(SmiValuesAre32Bits() == kIsSmiValueInUpper32Bits,
560
- "Unsupported Smi tagging scheme");
561
- static_assert(SmiValuesAre31Bits() == kIsSmiValueInLower32Bits,
562
- "Unsupported Smi tagging scheme");
563
-
564
- // Mask for the sign bit in a smi.
565
- constexpr intptr_t kSmiSignMask = static_cast<intptr_t>(
566
- uintptr_t{1} << (kSmiValueSize + kSmiShiftSize + kSmiTagSize - 1));
567
-
568
- // Desired alignment for tagged pointers.
569
- constexpr int kObjectAlignmentBits = kTaggedSizeLog2;
570
- constexpr intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
571
- constexpr intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
572
-
573
- // Desired alignment for system pointers.
574
- constexpr intptr_t kPointerAlignment = (1 << kSystemPointerSizeLog2);
575
- constexpr intptr_t kPointerAlignmentMask = kPointerAlignment - 1;
576
-
577
- // Desired alignment for double values.
578
- constexpr intptr_t kDoubleAlignment = 8;
579
- constexpr intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1;
580
-
581
- // Desired alignment for generated code is 32 bytes (to improve cache line
582
- // utilization).
583
- constexpr int kCodeAlignmentBits = 5;
584
- constexpr intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
585
- constexpr intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
586
-
587
- const Address kWeakHeapObjectMask = 1 << 1;
588
-
589
- // The lower 32 bits of the cleared weak reference value is always equal to
590
- // the |kClearedWeakHeapObjectLower32| constant but on 64-bit architectures
591
- // the value of the upper 32 bits part may be
592
- // 1) zero when pointer compression is disabled,
593
- // 2) upper 32 bits of the isolate root value when pointer compression is
594
- // enabled.
595
- // This is necessary to make pointer decompression computation also suitable
596
- // for cleared weak reference.
597
- // Note, that real heap objects can't have lower 32 bits equal to 3 because
598
- // this offset belongs to page header. So, in either case it's enough to
599
- // compare only the lower 32 bits of a MaybeObject value in order to figure
600
- // out if it's a cleared reference or not.
601
- const uint32_t kClearedWeakHeapObjectLower32 = 3;
602
-
603
- // Zap-value: The value used for zapping dead objects.
604
- // Should be a recognizable hex value tagged as a failure.
605
- #ifdef V8_HOST_ARCH_64_BIT
606
- constexpr uint64_t kClearedFreeMemoryValue = 0;
607
- constexpr uint64_t kZapValue = uint64_t{0xdeadbeedbeadbeef};
608
- constexpr uint64_t kHandleZapValue = uint64_t{0x1baddead0baddeaf};
609
- constexpr uint64_t kGlobalHandleZapValue = uint64_t{0x1baffed00baffedf};
610
- constexpr uint64_t kFromSpaceZapValue = uint64_t{0x1beefdad0beefdaf};
611
- constexpr uint64_t kDebugZapValue = uint64_t{0xbadbaddbbadbaddb};
612
- constexpr uint64_t kSlotsZapValue = uint64_t{0xbeefdeadbeefdeef};
613
- constexpr uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf;
614
- #else
615
- constexpr uint32_t kClearedFreeMemoryValue = 0;
616
- constexpr uint32_t kZapValue = 0xdeadbeef;
617
- constexpr uint32_t kHandleZapValue = 0xbaddeaf;
618
- constexpr uint32_t kGlobalHandleZapValue = 0xbaffedf;
619
- constexpr uint32_t kFromSpaceZapValue = 0xbeefdaf;
620
- constexpr uint32_t kSlotsZapValue = 0xbeefdeef;
621
- constexpr uint32_t kDebugZapValue = 0xbadbaddb;
622
- constexpr uint32_t kFreeListZapValue = 0xfeed1eaf;
623
- #endif
624
-
625
- constexpr int kCodeZapValue = 0xbadc0de;
626
- constexpr uint32_t kPhantomReferenceZap = 0xca11bac;
627
-
628
- // Page constants.
629
- static const intptr_t kPageAlignmentMask = (intptr_t{1} << kPageSizeBits) - 1;
630
-
631
- // On Intel architecture, cache line size is 64 bytes.
632
- // On ARM it may be less (32 bytes), but as far this constant is
633
- // used for aligning data, it doesn't hurt to align on a greater value.
634
- #define PROCESSOR_CACHE_LINE_SIZE 64
635
-
636
- // Constants relevant to double precision floating point numbers.
637
- // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
638
- constexpr uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
639
-
640
- enum class HeapObjectReferenceType {
641
- WEAK,
642
- STRONG,
643
- };
644
-
645
- enum class ArgumentsType {
646
- kRuntime,
647
- kJS,
648
- };
649
-
650
- // -----------------------------------------------------------------------------
651
- // Forward declarations for frequently used classes
652
-
653
- class AccessorInfo;
654
- template <ArgumentsType>
655
- class Arguments;
656
- using RuntimeArguments = Arguments<ArgumentsType::kRuntime>;
657
- using JavaScriptArguments = Arguments<ArgumentsType::kJS>;
658
- class Assembler;
659
- class ClassScope;
660
- class Code;
661
- class CodeSpace;
662
- class Context;
663
- class DeclarationScope;
664
- class Debug;
665
- class DebugInfo;
666
- class Descriptor;
667
- class DescriptorArray;
668
- class TransitionArray;
669
- class ExternalReference;
670
- class FeedbackVector;
671
- class FixedArray;
672
- class Foreign;
673
- class FreeStoreAllocationPolicy;
674
- class FunctionTemplateInfo;
675
- class GlobalDictionary;
676
- template <typename T>
677
- class Handle;
678
- class Heap;
679
- class HeapObject;
680
- class HeapObjectReference;
681
- class IC;
682
- class InterceptorInfo;
683
- class Isolate;
684
- class JSReceiver;
685
- class JSArray;
686
- class JSFunction;
687
- class JSObject;
688
- class LocalIsolate;
689
- class MacroAssembler;
690
- class Map;
691
- class MapSpace;
692
- class MarkCompactCollector;
693
- template <typename T>
694
- class MaybeHandle;
695
- class MaybeObject;
696
- class MemoryChunk;
697
- class MessageLocation;
698
- class ModuleScope;
699
- class Name;
700
- class NameDictionary;
701
- class NativeContext;
702
- class NewSpace;
703
- class NewLargeObjectSpace;
704
- class NumberDictionary;
705
- class Object;
706
- class OldLargeObjectSpace;
707
- template <HeapObjectReferenceType kRefType, typename StorageType>
708
- class TaggedImpl;
709
- class StrongTaggedValue;
710
- class TaggedValue;
711
- class CompressedObjectSlot;
712
- class CompressedMaybeObjectSlot;
713
- class CompressedMapWordSlot;
714
- class CompressedHeapObjectSlot;
715
- class OffHeapCompressedObjectSlot;
716
- class FullObjectSlot;
717
- class FullMaybeObjectSlot;
718
- class FullHeapObjectSlot;
719
- class OffHeapFullObjectSlot;
720
- class OldSpace;
721
- class ReadOnlySpace;
722
- class RelocInfo;
723
- class Scope;
724
- class ScopeInfo;
725
- class Script;
726
- class SimpleNumberDictionary;
727
- class Smi;
728
- template <typename Config, class Allocator = FreeStoreAllocationPolicy>
729
- class SplayTree;
730
- class String;
731
- class StringStream;
732
- class Struct;
733
- class Symbol;
734
- class Variable;
735
-
736
- // Slots are either full-pointer slots or compressed slots depending on whether
737
- // pointer compression is enabled or not.
738
- struct SlotTraits {
739
- #ifdef V8_COMPRESS_POINTERS
740
- using TObjectSlot = CompressedObjectSlot;
741
- using TMaybeObjectSlot = CompressedMaybeObjectSlot;
742
- using THeapObjectSlot = CompressedHeapObjectSlot;
743
- using TOffHeapObjectSlot = OffHeapCompressedObjectSlot;
744
- #else
745
- using TObjectSlot = FullObjectSlot;
746
- using TMaybeObjectSlot = FullMaybeObjectSlot;
747
- using THeapObjectSlot = FullHeapObjectSlot;
748
- using TOffHeapObjectSlot = OffHeapFullObjectSlot;
749
- #endif
750
- };
751
-
752
- // An ObjectSlot instance describes a kTaggedSize-sized on-heap field ("slot")
753
- // holding an Object value (smi or strong heap object).
754
- using ObjectSlot = SlotTraits::TObjectSlot;
755
-
756
- // A MaybeObjectSlot instance describes a kTaggedSize-sized on-heap field
757
- // ("slot") holding MaybeObject (smi or weak heap object or strong heap object).
758
- using MaybeObjectSlot = SlotTraits::TMaybeObjectSlot;
759
-
760
- // A HeapObjectSlot instance describes a kTaggedSize-sized field ("slot")
761
- // holding a weak or strong pointer to a heap object (think:
762
- // HeapObjectReference).
763
- using HeapObjectSlot = SlotTraits::THeapObjectSlot;
764
-
765
- // An OffHeapObjectSlot instance describes a kTaggedSize-sized field ("slot")
766
- // holding an Object value (smi or strong heap object), whose slot location is
767
- // off-heap.
768
- using OffHeapObjectSlot = SlotTraits::TOffHeapObjectSlot;
769
-
770
- using WeakSlotCallback = bool (*)(FullObjectSlot pointer);
771
-
772
- using WeakSlotCallbackWithHeap = bool (*)(Heap* heap, FullObjectSlot pointer);
773
-
774
- // -----------------------------------------------------------------------------
775
- // Miscellaneous
776
-
777
- // NOTE: SpaceIterator depends on AllocationSpace enumeration values being
778
- // consecutive.
779
- enum AllocationSpace {
780
- RO_SPACE, // Immortal, immovable and immutable objects,
781
- OLD_SPACE, // Old generation regular object space.
782
- CODE_SPACE, // Old generation code object space, marked executable.
783
- MAP_SPACE, // Old generation map object space, non-movable.
784
- LO_SPACE, // Old generation large object space.
785
- CODE_LO_SPACE, // Old generation large code object space.
786
- NEW_LO_SPACE, // Young generation large object space.
787
- NEW_SPACE, // Young generation semispaces for regular objects collected with
788
- // Scavenger.
789
-
790
- FIRST_SPACE = RO_SPACE,
791
- LAST_SPACE = NEW_SPACE,
792
- FIRST_MUTABLE_SPACE = OLD_SPACE,
793
- LAST_MUTABLE_SPACE = NEW_SPACE,
794
- FIRST_GROWABLE_PAGED_SPACE = OLD_SPACE,
795
- LAST_GROWABLE_PAGED_SPACE = MAP_SPACE
796
- };
797
- constexpr int kSpaceTagSize = 4;
798
- STATIC_ASSERT(FIRST_SPACE == 0);
799
-
800
- enum class AllocationType : uint8_t {
801
- kYoung, // Regular object allocated in NEW_SPACE or NEW_LO_SPACE
802
- kOld, // Regular object allocated in OLD_SPACE or LO_SPACE
803
- kCode, // Code object allocated in CODE_SPACE or CODE_LO_SPACE
804
- kMap, // Map object allocated in MAP_SPACE
805
- kReadOnly, // Object allocated in RO_SPACE
806
- kSharedOld, // Regular object allocated in SHARED_OLD_SPACE or
807
- // SHARED_LO_SPACE
808
- kSharedMap, // Map object in SHARED_MAP_SPACE
809
- };
810
-
811
- inline size_t hash_value(AllocationType kind) {
812
- return static_cast<uint8_t>(kind);
813
- }
814
-
815
- inline std::ostream& operator<<(std::ostream& os, AllocationType kind) {
816
- switch (kind) {
817
- case AllocationType::kYoung:
818
- return os << "Young";
819
- case AllocationType::kOld:
820
- return os << "Old";
821
- case AllocationType::kCode:
822
- return os << "Code";
823
- case AllocationType::kMap:
824
- return os << "Map";
825
- case AllocationType::kReadOnly:
826
- return os << "ReadOnly";
827
- case AllocationType::kSharedOld:
828
- return os << "SharedOld";
829
- case AllocationType::kSharedMap:
830
- return os << "SharedMap";
831
- }
832
- UNREACHABLE();
833
- }
834
-
835
- // TODO(ishell): review and rename kWordAligned to kTaggedAligned.
836
- enum AllocationAlignment { kWordAligned, kDoubleAligned, kDoubleUnaligned };
837
-
838
- enum class AccessMode { ATOMIC, NON_ATOMIC };
839
-
840
- enum class AllowLargeObjects { kFalse, kTrue };
841
-
842
- enum MinimumCapacity {
843
- USE_DEFAULT_MINIMUM_CAPACITY,
844
- USE_CUSTOM_MINIMUM_CAPACITY
845
- };
846
-
847
- enum GarbageCollector { SCAVENGER, MARK_COMPACTOR, MINOR_MARK_COMPACTOR };
848
-
849
- enum class LocalSpaceKind {
850
- kNone,
851
- kCompactionSpaceForScavenge,
852
- kCompactionSpaceForMarkCompact,
853
- kCompactionSpaceForMinorMarkCompact,
854
-
855
- kFirstCompactionSpace = kCompactionSpaceForScavenge,
856
- kLastCompactionSpace = kCompactionSpaceForMinorMarkCompact,
857
- };
858
-
859
- enum Executability { NOT_EXECUTABLE, EXECUTABLE };
860
-
861
- enum class BytecodeFlushMode {
862
- kDoNotFlushBytecode,
863
- kFlushBytecode,
864
- kStressFlushBytecode,
865
- };
866
-
867
- // Indicates whether a script should be parsed and compiled in REPL mode.
868
- enum class REPLMode {
869
- kYes,
870
- kNo,
871
- };
872
-
873
- inline REPLMode construct_repl_mode(bool is_repl_mode) {
874
- return is_repl_mode ? REPLMode::kYes : REPLMode::kNo;
875
- }
876
-
877
- // Flag indicating whether code is built into the VM (one of the natives files).
878
- enum NativesFlag { NOT_NATIVES_CODE, EXTENSION_CODE, INSPECTOR_CODE };
879
-
880
- // ParseRestriction is used to restrict the set of valid statements in a
881
- // unit of compilation. Restriction violations cause a syntax error.
882
- enum ParseRestriction : bool {
883
- NO_PARSE_RESTRICTION, // All expressions are allowed.
884
- ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression.
885
- };
886
-
887
- // State for inline cache call sites. Aliased as IC::State.
888
- enum InlineCacheState {
889
- // No feedback will be collected.
890
- NO_FEEDBACK,
891
- // Has never been executed.
892
- UNINITIALIZED,
893
- // Has been executed and only one receiver type has been seen.
894
- MONOMORPHIC,
895
- // Check failed due to prototype (or map deprecation).
896
- RECOMPUTE_HANDLER,
897
- // Multiple receiver types have been seen.
898
- POLYMORPHIC,
899
- // Many DOM receiver types have been seen for the same accessor.
900
- MEGADOM,
901
- // Many receiver types have been seen.
902
- MEGAMORPHIC,
903
- // A generic handler is installed and no extra typefeedback is recorded.
904
- GENERIC,
905
- };
906
-
907
- // Printing support.
908
- inline const char* InlineCacheState2String(InlineCacheState state) {
909
- switch (state) {
910
- case NO_FEEDBACK:
911
- return "NOFEEDBACK";
912
- case UNINITIALIZED:
913
- return "UNINITIALIZED";
914
- case MONOMORPHIC:
915
- return "MONOMORPHIC";
916
- case RECOMPUTE_HANDLER:
917
- return "RECOMPUTE_HANDLER";
918
- case POLYMORPHIC:
919
- return "POLYMORPHIC";
920
- case MEGAMORPHIC:
921
- return "MEGAMORPHIC";
922
- case MEGADOM:
923
- return "MEGADOM";
924
- case GENERIC:
925
- return "GENERIC";
926
- }
927
- UNREACHABLE();
928
- }
929
-
930
- enum WhereToStart { kStartAtReceiver, kStartAtPrototype };
931
-
932
- enum ResultSentinel { kNotFound = -1, kUnsupported = -2 };
933
-
934
- enum ShouldThrow {
935
- kThrowOnError = Internals::kThrowOnError,
936
- kDontThrow = Internals::kDontThrow
937
- };
938
-
939
- enum class ThreadKind { kMain, kBackground };
940
-
941
- // Union used for customized checking of the IEEE double types
942
- // inlined within v8 runtime, rather than going to the underlying
943
- // platform headers and libraries
944
- union IeeeDoubleLittleEndianArchType {
945
- double d;
946
- struct {
947
- unsigned int man_low : 32;
948
- unsigned int man_high : 20;
949
- unsigned int exp : 11;
950
- unsigned int sign : 1;
951
- } bits;
952
- };
953
-
954
- union IeeeDoubleBigEndianArchType {
955
- double d;
956
- struct {
957
- unsigned int sign : 1;
958
- unsigned int exp : 11;
959
- unsigned int man_high : 20;
960
- unsigned int man_low : 32;
961
- } bits;
962
- };
963
-
964
- #if V8_TARGET_LITTLE_ENDIAN
965
- using IeeeDoubleArchType = IeeeDoubleLittleEndianArchType;
966
- constexpr int kIeeeDoubleMantissaWordOffset = 0;
967
- constexpr int kIeeeDoubleExponentWordOffset = 4;
968
- #else
969
- using IeeeDoubleArchType = IeeeDoubleBigEndianArchType;
970
- constexpr int kIeeeDoubleMantissaWordOffset = 4;
971
- constexpr int kIeeeDoubleExponentWordOffset = 0;
972
- #endif
973
-
974
- // -----------------------------------------------------------------------------
975
- // Macros
976
-
977
- // Testers for test.
978
-
979
- #define HAS_SMI_TAG(value) \
980
- ((static_cast<i::Tagged_t>(value) & ::i::kSmiTagMask) == ::i::kSmiTag)
981
-
982
- #define HAS_STRONG_HEAP_OBJECT_TAG(value) \
983
- (((static_cast<i::Tagged_t>(value) & ::i::kHeapObjectTagMask) == \
984
- ::i::kHeapObjectTag))
985
-
986
- #define HAS_WEAK_HEAP_OBJECT_TAG(value) \
987
- (((static_cast<i::Tagged_t>(value) & ::i::kHeapObjectTagMask) == \
988
- ::i::kWeakHeapObjectTag))
989
-
990
- // OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer
991
- #define OBJECT_POINTER_ALIGN(value) \
992
- (((value) + ::i::kObjectAlignmentMask) & ~::i::kObjectAlignmentMask)
993
-
994
- // OBJECT_POINTER_PADDING returns the padding size required to align value
995
- // as a HeapObject pointer
996
- #define OBJECT_POINTER_PADDING(value) (OBJECT_POINTER_ALIGN(value) - (value))
997
-
998
- // POINTER_SIZE_ALIGN returns the value aligned as a system pointer.
999
- #define POINTER_SIZE_ALIGN(value) \
1000
- (((value) + ::i::kPointerAlignmentMask) & ~::i::kPointerAlignmentMask)
1001
-
1002
- // POINTER_SIZE_PADDING returns the padding size required to align value
1003
- // as a system pointer.
1004
- #define POINTER_SIZE_PADDING(value) (POINTER_SIZE_ALIGN(value) - (value))
1005
-
1006
- // CODE_POINTER_ALIGN returns the value aligned as a generated code segment.
1007
- #define CODE_POINTER_ALIGN(value) \
1008
- (((value) + ::i::kCodeAlignmentMask) & ~::i::kCodeAlignmentMask)
1009
-
1010
- // CODE_POINTER_PADDING returns the padding size required to align value
1011
- // as a generated code segment.
1012
- #define CODE_POINTER_PADDING(value) (CODE_POINTER_ALIGN(value) - (value))
1013
-
1014
- // DOUBLE_POINTER_ALIGN returns the value algined for double pointers.
1015
- #define DOUBLE_POINTER_ALIGN(value) \
1016
- (((value) + ::i::kDoubleAlignmentMask) & ~::i::kDoubleAlignmentMask)
1017
-
1018
- // Defines hints about receiver values based on structural knowledge.
1019
- enum class ConvertReceiverMode : unsigned {
1020
- kNullOrUndefined, // Guaranteed to be null or undefined.
1021
- kNotNullOrUndefined, // Guaranteed to never be null or undefined.
1022
- kAny // No specific knowledge about receiver.
1023
- };
1024
-
1025
- inline size_t hash_value(ConvertReceiverMode mode) {
1026
- return bit_cast<unsigned>(mode);
1027
- }
1028
-
1029
- inline std::ostream& operator<<(std::ostream& os, ConvertReceiverMode mode) {
1030
- switch (mode) {
1031
- case ConvertReceiverMode::kNullOrUndefined:
1032
- return os << "NULL_OR_UNDEFINED";
1033
- case ConvertReceiverMode::kNotNullOrUndefined:
1034
- return os << "NOT_NULL_OR_UNDEFINED";
1035
- case ConvertReceiverMode::kAny:
1036
- return os << "ANY";
1037
- }
1038
- UNREACHABLE();
1039
- }
1040
-
1041
- // Valid hints for the abstract operation OrdinaryToPrimitive,
1042
- // implemented according to ES6, section 7.1.1.
1043
- enum class OrdinaryToPrimitiveHint { kNumber, kString };
1044
-
1045
- // Valid hints for the abstract operation ToPrimitive,
1046
- // implemented according to ES6, section 7.1.1.
1047
- enum class ToPrimitiveHint { kDefault, kNumber, kString };
1048
-
1049
- // Defines specifics about arguments object or rest parameter creation.
1050
- enum class CreateArgumentsType : uint8_t {
1051
- kMappedArguments,
1052
- kUnmappedArguments,
1053
- kRestParameter
1054
- };
1055
-
1056
- inline size_t hash_value(CreateArgumentsType type) {
1057
- return bit_cast<uint8_t>(type);
1058
- }
1059
-
1060
- inline std::ostream& operator<<(std::ostream& os, CreateArgumentsType type) {
1061
- switch (type) {
1062
- case CreateArgumentsType::kMappedArguments:
1063
- return os << "MAPPED_ARGUMENTS";
1064
- case CreateArgumentsType::kUnmappedArguments:
1065
- return os << "UNMAPPED_ARGUMENTS";
1066
- case CreateArgumentsType::kRestParameter:
1067
- return os << "REST_PARAMETER";
1068
- }
1069
- UNREACHABLE();
1070
- }
1071
-
1072
- enum ScopeType : uint8_t {
1073
- CLASS_SCOPE, // The scope introduced by a class.
1074
- EVAL_SCOPE, // The top-level scope for an eval source.
1075
- FUNCTION_SCOPE, // The top-level scope for a function.
1076
- MODULE_SCOPE, // The scope introduced by a module literal
1077
- SCRIPT_SCOPE, // The top-level scope for a script or a top-level eval.
1078
- CATCH_SCOPE, // The scope introduced by catch.
1079
- BLOCK_SCOPE, // The scope introduced by a new block.
1080
- WITH_SCOPE // The scope introduced by with.
1081
- };
1082
-
1083
- inline std::ostream& operator<<(std::ostream& os, ScopeType type) {
1084
- switch (type) {
1085
- case ScopeType::EVAL_SCOPE:
1086
- return os << "EVAL_SCOPE";
1087
- case ScopeType::FUNCTION_SCOPE:
1088
- return os << "FUNCTION_SCOPE";
1089
- case ScopeType::MODULE_SCOPE:
1090
- return os << "MODULE_SCOPE";
1091
- case ScopeType::SCRIPT_SCOPE:
1092
- return os << "SCRIPT_SCOPE";
1093
- case ScopeType::CATCH_SCOPE:
1094
- return os << "CATCH_SCOPE";
1095
- case ScopeType::BLOCK_SCOPE:
1096
- return os << "BLOCK_SCOPE";
1097
- case ScopeType::CLASS_SCOPE:
1098
- return os << "CLASS_SCOPE";
1099
- case ScopeType::WITH_SCOPE:
1100
- return os << "WITH_SCOPE";
1101
- }
1102
- UNREACHABLE();
1103
- }
1104
-
1105
- // AllocationSiteMode controls whether allocations are tracked by an allocation
1106
- // site.
1107
- enum AllocationSiteMode {
1108
- DONT_TRACK_ALLOCATION_SITE,
1109
- TRACK_ALLOCATION_SITE,
1110
- LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE
1111
- };
1112
-
1113
- enum class AllocationSiteUpdateMode { kUpdate, kCheckOnly };
1114
-
1115
- // The mips architecture prior to revision 5 has inverted encoding for sNaN.
1116
- #if (V8_TARGET_ARCH_MIPS && !defined(_MIPS_ARCH_MIPS32R6) && \
1117
- (!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR))) || \
1118
- (V8_TARGET_ARCH_MIPS64 && !defined(_MIPS_ARCH_MIPS64R6) && \
1119
- (!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR)))
1120
- constexpr uint32_t kHoleNanUpper32 = 0xFFFF7FFF;
1121
- constexpr uint32_t kHoleNanLower32 = 0xFFFF7FFF;
1122
- #else
1123
- constexpr uint32_t kHoleNanUpper32 = 0xFFF7FFFF;
1124
- constexpr uint32_t kHoleNanLower32 = 0xFFF7FFFF;
1125
- #endif
1126
-
1127
- constexpr uint64_t kHoleNanInt64 =
1128
- (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32;
1129
-
1130
- // ES6 section 20.1.2.6 Number.MAX_SAFE_INTEGER
1131
- constexpr uint64_t kMaxSafeIntegerUint64 = 9007199254740991; // 2^53-1
1132
- constexpr double kMaxSafeInteger = static_cast<double>(kMaxSafeIntegerUint64);
1133
-
1134
- constexpr double kMaxUInt32Double = double{kMaxUInt32};
1135
-
1136
- // The order of this enum has to be kept in sync with the predicates below.
1137
- enum class VariableMode : uint8_t {
1138
- // User declared variables:
1139
- kLet, // declared via 'let' declarations (first lexical)
1140
-
1141
- kConst, // declared via 'const' declarations (last lexical)
1142
-
1143
- kVar, // declared via 'var', and 'function' declarations
1144
-
1145
- // Variables introduced by the compiler:
1146
- kTemporary, // temporary variables (not user-visible), stack-allocated
1147
- // unless the scope as a whole has forced context allocation
1148
-
1149
- kDynamic, // always require dynamic lookup (we don't know
1150
- // the declaration)
1151
-
1152
- kDynamicGlobal, // requires dynamic lookup, but we know that the
1153
- // variable is global unless it has been shadowed
1154
- // by an eval-introduced variable
1155
-
1156
- kDynamicLocal, // requires dynamic lookup, but we know that the
1157
- // variable is local and where it is unless it
1158
- // has been shadowed by an eval-introduced
1159
- // variable
1160
-
1161
- // Variables for private methods or accessors whose access require
1162
- // brand check. Declared only in class scopes by the compiler
1163
- // and allocated only in class contexts:
1164
- kPrivateMethod, // Does not coexist with any other variable with the same
1165
- // name in the same scope.
1166
-
1167
- kPrivateSetterOnly, // Incompatible with variables with the same name but
1168
- // any mode other than kPrivateGetterOnly. Transition to
1169
- // kPrivateGetterAndSetter if a later declaration for the
1170
- // same name with kPrivateGetterOnly is made.
1171
-
1172
- kPrivateGetterOnly, // Incompatible with variables with the same name but
1173
- // any mode other than kPrivateSetterOnly. Transition to
1174
- // kPrivateGetterAndSetter if a later declaration for the
1175
- // same name with kPrivateSetterOnly is made.
1176
-
1177
- kPrivateGetterAndSetter, // Does not coexist with any other variable with the
1178
- // same name in the same scope.
1179
-
1180
- kLastLexicalVariableMode = kConst,
1181
- };
1182
-
1183
- // Printing support
1184
- #ifdef DEBUG
1185
- inline const char* VariableMode2String(VariableMode mode) {
1186
- switch (mode) {
1187
- case VariableMode::kVar:
1188
- return "VAR";
1189
- case VariableMode::kLet:
1190
- return "LET";
1191
- case VariableMode::kPrivateGetterOnly:
1192
- return "PRIVATE_GETTER_ONLY";
1193
- case VariableMode::kPrivateSetterOnly:
1194
- return "PRIVATE_SETTER_ONLY";
1195
- case VariableMode::kPrivateMethod:
1196
- return "PRIVATE_METHOD";
1197
- case VariableMode::kPrivateGetterAndSetter:
1198
- return "PRIVATE_GETTER_AND_SETTER";
1199
- case VariableMode::kConst:
1200
- return "CONST";
1201
- case VariableMode::kDynamic:
1202
- return "DYNAMIC";
1203
- case VariableMode::kDynamicGlobal:
1204
- return "DYNAMIC_GLOBAL";
1205
- case VariableMode::kDynamicLocal:
1206
- return "DYNAMIC_LOCAL";
1207
- case VariableMode::kTemporary:
1208
- return "TEMPORARY";
1209
- }
1210
- UNREACHABLE();
1211
- }
1212
- #endif
1213
-
1214
- enum VariableKind : uint8_t {
1215
- NORMAL_VARIABLE,
1216
- PARAMETER_VARIABLE,
1217
- THIS_VARIABLE,
1218
- SLOPPY_BLOCK_FUNCTION_VARIABLE,
1219
- SLOPPY_FUNCTION_NAME_VARIABLE
1220
- };
1221
-
1222
- inline bool IsDynamicVariableMode(VariableMode mode) {
1223
- return mode >= VariableMode::kDynamic && mode <= VariableMode::kDynamicLocal;
1224
- }
1225
-
1226
- inline bool IsDeclaredVariableMode(VariableMode mode) {
1227
- STATIC_ASSERT(static_cast<uint8_t>(VariableMode::kLet) ==
1228
- 0); // Implies that mode >= VariableMode::kLet.
1229
- return mode <= VariableMode::kVar;
1230
- }
1231
-
1232
- inline bool IsPrivateMethodOrAccessorVariableMode(VariableMode mode) {
1233
- return mode >= VariableMode::kPrivateMethod &&
1234
- mode <= VariableMode::kPrivateGetterAndSetter;
1235
- }
1236
-
1237
- inline bool IsSerializableVariableMode(VariableMode mode) {
1238
- return IsDeclaredVariableMode(mode) ||
1239
- IsPrivateMethodOrAccessorVariableMode(mode);
1240
- }
1241
-
1242
- inline bool IsConstVariableMode(VariableMode mode) {
1243
- return mode == VariableMode::kConst ||
1244
- IsPrivateMethodOrAccessorVariableMode(mode);
1245
- }
1246
-
1247
- inline bool IsLexicalVariableMode(VariableMode mode) {
1248
- STATIC_ASSERT(static_cast<uint8_t>(VariableMode::kLet) ==
1249
- 0); // Implies that mode >= VariableMode::kLet.
1250
- return mode <= VariableMode::kLastLexicalVariableMode;
1251
- }
1252
-
1253
- enum VariableLocation : uint8_t {
1254
- // Before and during variable allocation, a variable whose location is
1255
- // not yet determined. After allocation, a variable looked up as a
1256
- // property on the global object (and possibly absent). name() is the
1257
- // variable name, index() is invalid.
1258
- UNALLOCATED,
1259
-
1260
- // A slot in the parameter section on the stack. index() is the
1261
- // parameter index, counting left-to-right. The receiver is index -1;
1262
- // the first parameter is index 0.
1263
- PARAMETER,
1264
-
1265
- // A slot in the local section on the stack. index() is the variable
1266
- // index in the stack frame, starting at 0.
1267
- LOCAL,
1268
-
1269
- // An indexed slot in a heap context. index() is the variable index in
1270
- // the context object on the heap, starting at 0. scope() is the
1271
- // corresponding scope.
1272
- CONTEXT,
1273
-
1274
- // A named slot in a heap context. name() is the variable name in the
1275
- // context object on the heap, with lookup starting at the current
1276
- // context. index() is invalid.
1277
- LOOKUP,
1278
-
1279
- // A named slot in a module's export table.
1280
- MODULE,
1281
-
1282
- // An indexed slot in a script context. index() is the variable
1283
- // index in the context object on the heap, starting at 0.
1284
- // Important: REPL_GLOBAL variables from different scripts with the
1285
- // same name share a single script context slot. Every
1286
- // script context will reserve a slot, but only one will be used.
1287
- // REPL_GLOBAL variables are stored in script contexts, but accessed like
1288
- // globals, i.e. they always require a lookup at runtime to find the right
1289
- // script context.
1290
- REPL_GLOBAL,
1291
-
1292
- kLastVariableLocation = REPL_GLOBAL
1293
- };
1294
-
1295
- // ES6 specifies declarative environment records with mutable and immutable
1296
- // bindings that can be in two states: initialized and uninitialized.
1297
- // When accessing a binding, it needs to be checked for initialization.
1298
- // However in the following cases the binding is initialized immediately
1299
- // after creation so the initialization check can always be skipped:
1300
- //
1301
- // 1. Var declared local variables.
1302
- // var foo;
1303
- // 2. A local variable introduced by a function declaration.
1304
- // function foo() {}
1305
- // 3. Parameters
1306
- // function x(foo) {}
1307
- // 4. Catch bound variables.
1308
- // try {} catch (foo) {}
1309
- // 6. Function name variables of named function expressions.
1310
- // var x = function foo() {}
1311
- // 7. Implicit binding of 'this'.
1312
- // 8. Implicit binding of 'arguments' in functions.
1313
- //
1314
- // The following enum specifies a flag that indicates if the binding needs a
1315
- // distinct initialization step (kNeedsInitialization) or if the binding is
1316
- // immediately initialized upon creation (kCreatedInitialized).
1317
- enum InitializationFlag : uint8_t { kNeedsInitialization, kCreatedInitialized };
1318
-
1319
- // Static variables can only be used with the class in the closest
1320
- // class scope as receivers.
1321
- enum class IsStaticFlag : uint8_t { kNotStatic, kStatic };
1322
-
1323
- enum MaybeAssignedFlag : uint8_t { kNotAssigned, kMaybeAssigned };
1324
-
1325
- enum class InterpreterPushArgsMode : unsigned {
1326
- kArrayFunction,
1327
- kWithFinalSpread,
1328
- kOther
1329
- };
1330
-
1331
- inline size_t hash_value(InterpreterPushArgsMode mode) {
1332
- return bit_cast<unsigned>(mode);
1333
- }
1334
-
1335
- inline std::ostream& operator<<(std::ostream& os,
1336
- InterpreterPushArgsMode mode) {
1337
- switch (mode) {
1338
- case InterpreterPushArgsMode::kArrayFunction:
1339
- return os << "ArrayFunction";
1340
- case InterpreterPushArgsMode::kWithFinalSpread:
1341
- return os << "WithFinalSpread";
1342
- case InterpreterPushArgsMode::kOther:
1343
- return os << "Other";
1344
- }
1345
- UNREACHABLE();
1346
- }
1347
-
1348
- inline uint32_t ObjectHash(Address address) {
1349
- // All objects are at least pointer aligned, so we can remove the trailing
1350
- // zeros.
1351
- return static_cast<uint32_t>(address >> kTaggedSizeLog2);
1352
- }
1353
-
1354
- // Type feedback is encoded in such a way that, we can combine the feedback
1355
- // at different points by performing an 'OR' operation. Type feedback moves
1356
- // to a more generic type when we combine feedback.
1357
- //
1358
- // kSignedSmall -> kSignedSmallInputs -> kNumber -> kNumberOrOddball -> kAny
1359
- // kString -> kAny
1360
- // kBigInt -> kAny
1361
- //
1362
- // Technically we wouldn't need the separation between the kNumber and the
1363
- // kNumberOrOddball values here, since for binary operations, we always
1364
- // truncate oddballs to numbers. In practice though it causes TurboFan to
1365
- // generate quite a lot of unused code though if we always handle numbers
1366
- // and oddballs everywhere, although in 99% of the use sites they are only
1367
- // used with numbers.
1368
- class BinaryOperationFeedback {
1369
- public:
1370
- enum {
1371
- kNone = 0x0,
1372
- kSignedSmall = 0x1,
1373
- kSignedSmallInputs = 0x3,
1374
- kNumber = 0x7,
1375
- kNumberOrOddball = 0xF,
1376
- kString = 0x10,
1377
- kBigInt = 0x20,
1378
- kAny = 0x7F
1379
- };
1380
- };
1381
-
1382
- // Type feedback is encoded in such a way that, we can combine the feedback
1383
- // at different points by performing an 'OR' operation.
1384
- // This is distinct from BinaryOperationFeedback on purpose, because the
1385
- // feedback that matters differs greatly as well as the way it is consumed.
1386
- class CompareOperationFeedback {
1387
- enum {
1388
- kSignedSmallFlag = 1 << 0,
1389
- kOtherNumberFlag = 1 << 1,
1390
- kBooleanFlag = 1 << 2,
1391
- kNullOrUndefinedFlag = 1 << 3,
1392
- kInternalizedStringFlag = 1 << 4,
1393
- kOtherStringFlag = 1 << 5,
1394
- kSymbolFlag = 1 << 6,
1395
- kBigIntFlag = 1 << 7,
1396
- kReceiverFlag = 1 << 8,
1397
- kAnyMask = 0x1FF,
1398
- };
1399
-
1400
- public:
1401
- enum Type {
1402
- kNone = 0,
1403
-
1404
- kBoolean = kBooleanFlag,
1405
- kNullOrUndefined = kNullOrUndefinedFlag,
1406
- kOddball = kBoolean | kNullOrUndefined,
1407
-
1408
- kSignedSmall = kSignedSmallFlag,
1409
- kNumber = kSignedSmall | kOtherNumberFlag,
1410
- kNumberOrBoolean = kNumber | kBoolean,
1411
- kNumberOrOddball = kNumber | kOddball,
1412
-
1413
- kInternalizedString = kInternalizedStringFlag,
1414
- kString = kInternalizedString | kOtherStringFlag,
1415
-
1416
- kReceiver = kReceiverFlag,
1417
- kReceiverOrNullOrUndefined = kReceiver | kNullOrUndefined,
1418
-
1419
- kBigInt = kBigIntFlag,
1420
- kSymbol = kSymbolFlag,
1421
-
1422
- kAny = kAnyMask,
1423
- };
1424
- };
1425
-
1426
- enum class Operation {
1427
- // Binary operations.
1428
- kAdd,
1429
- kSubtract,
1430
- kMultiply,
1431
- kDivide,
1432
- kModulus,
1433
- kExponentiate,
1434
- kBitwiseAnd,
1435
- kBitwiseOr,
1436
- kBitwiseXor,
1437
- kShiftLeft,
1438
- kShiftRight,
1439
- kShiftRightLogical,
1440
- // Unary operations.
1441
- kBitwiseNot,
1442
- kNegate,
1443
- kIncrement,
1444
- kDecrement,
1445
- // Compare operations.
1446
- kEqual,
1447
- kStrictEqual,
1448
- kLessThan,
1449
- kLessThanOrEqual,
1450
- kGreaterThan,
1451
- kGreaterThanOrEqual,
1452
- };
1453
-
1454
- // Type feedback is encoded in such a way that, we can combine the feedback
1455
- // at different points by performing an 'OR' operation. Type feedback moves
1456
- // to a more generic type when we combine feedback.
1457
- // kNone -> kEnumCacheKeysAndIndices -> kEnumCacheKeys -> kAny
1458
- enum class ForInFeedback : uint8_t {
1459
- kNone = 0x0,
1460
- kEnumCacheKeysAndIndices = 0x1,
1461
- kEnumCacheKeys = 0x3,
1462
- kAny = 0x7
1463
- };
1464
- STATIC_ASSERT((static_cast<int>(ForInFeedback::kNone) |
1465
- static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices)) ==
1466
- static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices));
1467
- STATIC_ASSERT((static_cast<int>(ForInFeedback::kEnumCacheKeysAndIndices) |
1468
- static_cast<int>(ForInFeedback::kEnumCacheKeys)) ==
1469
- static_cast<int>(ForInFeedback::kEnumCacheKeys));
1470
- STATIC_ASSERT((static_cast<int>(ForInFeedback::kEnumCacheKeys) |
1471
- static_cast<int>(ForInFeedback::kAny)) ==
1472
- static_cast<int>(ForInFeedback::kAny));
1473
-
1474
- enum class UnicodeEncoding : uint8_t {
1475
- // Different unicode encodings in a |word32|:
1476
- UTF16, // hi 16bits -> trailing surrogate or 0, low 16bits -> lead surrogate
1477
- UTF32, // full UTF32 code unit / Unicode codepoint
1478
- };
1479
-
1480
- inline size_t hash_value(UnicodeEncoding encoding) {
1481
- return static_cast<uint8_t>(encoding);
1482
- }
1483
-
1484
- inline std::ostream& operator<<(std::ostream& os, UnicodeEncoding encoding) {
1485
- switch (encoding) {
1486
- case UnicodeEncoding::UTF16:
1487
- return os << "UTF16";
1488
- case UnicodeEncoding::UTF32:
1489
- return os << "UTF32";
1490
- }
1491
- UNREACHABLE();
1492
- }
1493
-
1494
- enum class IterationKind { kKeys, kValues, kEntries };
1495
-
1496
- inline std::ostream& operator<<(std::ostream& os, IterationKind kind) {
1497
- switch (kind) {
1498
- case IterationKind::kKeys:
1499
- return os << "IterationKind::kKeys";
1500
- case IterationKind::kValues:
1501
- return os << "IterationKind::kValues";
1502
- case IterationKind::kEntries:
1503
- return os << "IterationKind::kEntries";
1504
- }
1505
- UNREACHABLE();
1506
- }
1507
-
1508
- enum class CollectionKind { kMap, kSet };
1509
-
1510
- inline std::ostream& operator<<(std::ostream& os, CollectionKind kind) {
1511
- switch (kind) {
1512
- case CollectionKind::kMap:
1513
- return os << "CollectionKind::kMap";
1514
- case CollectionKind::kSet:
1515
- return os << "CollectionKind::kSet";
1516
- }
1517
- UNREACHABLE();
1518
- }
1519
-
1520
- // Flags for the runtime function kDefineDataPropertyInLiteral. A property can
1521
- // be enumerable or not, and, in case of functions, the function name
1522
- // can be set or not.
1523
- enum class DataPropertyInLiteralFlag {
1524
- kNoFlags = 0,
1525
- kDontEnum = 1 << 0,
1526
- kSetFunctionName = 1 << 1
1527
- };
1528
- using DataPropertyInLiteralFlags = base::Flags<DataPropertyInLiteralFlag>;
1529
- DEFINE_OPERATORS_FOR_FLAGS(DataPropertyInLiteralFlags)
1530
-
1531
- enum ExternalArrayType {
1532
- kExternalInt8Array = 1,
1533
- kExternalUint8Array,
1534
- kExternalInt16Array,
1535
- kExternalUint16Array,
1536
- kExternalInt32Array,
1537
- kExternalUint32Array,
1538
- kExternalFloat32Array,
1539
- kExternalFloat64Array,
1540
- kExternalUint8ClampedArray,
1541
- kExternalBigInt64Array,
1542
- kExternalBigUint64Array,
1543
- };
1544
-
1545
- struct AssemblerDebugInfo {
1546
- AssemblerDebugInfo(const char* name, const char* file, int line)
1547
- : name(name), file(file), line(line) {}
1548
- const char* name;
1549
- const char* file;
1550
- int line;
1551
- };
1552
-
1553
- inline std::ostream& operator<<(std::ostream& os,
1554
- const AssemblerDebugInfo& info) {
1555
- os << "(" << info.name << ":" << info.file << ":" << info.line << ")";
1556
- return os;
1557
- }
1558
-
1559
- using FileAndLine = std::pair<const char*, int>;
1560
-
1561
- enum OptimizationMarker : int32_t {
1562
- // These values are set so that it is easy to check if there is a marker where
1563
- // some processing needs to be done.
1564
- kNone = 0b000,
1565
- kInOptimizationQueue = 0b001,
1566
- kCompileOptimized = 0b010,
1567
- kCompileOptimizedConcurrent = 0b011,
1568
- kLogFirstExecution = 0b100,
1569
- kLastOptimizationMarker = kLogFirstExecution
1570
- };
1571
- // For kNone or kInOptimizationQueue we don't need any special processing.
1572
- // To check both cases using a single mask, we expect the kNone to be 0 and
1573
- // kInOptimizationQueue to be 1 so that we can mask off the lsb for checking.
1574
- STATIC_ASSERT(kNone == 0b000 && kInOptimizationQueue == 0b001);
1575
- STATIC_ASSERT(kLastOptimizationMarker <= 0b111);
1576
- static constexpr uint32_t kNoneOrInOptimizationQueueMask = 0b110;
1577
-
1578
- inline bool IsInOptimizationQueueMarker(OptimizationMarker marker) {
1579
- return marker == OptimizationMarker::kInOptimizationQueue;
1580
- }
1581
-
1582
- inline bool IsCompileOptimizedMarker(OptimizationMarker marker) {
1583
- return marker == OptimizationMarker::kCompileOptimized ||
1584
- marker == OptimizationMarker::kCompileOptimizedConcurrent;
1585
- }
1586
-
1587
- inline std::ostream& operator<<(std::ostream& os,
1588
- const OptimizationMarker& marker) {
1589
- switch (marker) {
1590
- case OptimizationMarker::kLogFirstExecution:
1591
- return os << "OptimizationMarker::kLogFirstExecution";
1592
- case OptimizationMarker::kNone:
1593
- return os << "OptimizationMarker::kNone";
1594
- case OptimizationMarker::kCompileOptimized:
1595
- return os << "OptimizationMarker::kCompileOptimized";
1596
- case OptimizationMarker::kCompileOptimizedConcurrent:
1597
- return os << "OptimizationMarker::kCompileOptimizedConcurrent";
1598
- case OptimizationMarker::kInOptimizationQueue:
1599
- return os << "OptimizationMarker::kInOptimizationQueue";
1600
- }
1601
- }
1602
-
1603
- enum class OptimizationTier {
1604
- kNone = 0b00,
1605
- kMidTier = 0b01,
1606
- kTopTier = 0b10,
1607
- kLastOptimizationTier = kTopTier
1608
- };
1609
- static constexpr uint32_t kNoneOrMidTierMask = 0b10;
1610
- static constexpr uint32_t kNoneMask = 0b11;
1611
-
1612
- inline std::ostream& operator<<(std::ostream& os,
1613
- const OptimizationTier& tier) {
1614
- switch (tier) {
1615
- case OptimizationTier::kNone:
1616
- return os << "OptimizationTier::kNone";
1617
- case OptimizationTier::kMidTier:
1618
- return os << "OptimizationTier::kMidTier";
1619
- case OptimizationTier::kTopTier:
1620
- return os << "OptimizationTier::kTopTier";
1621
- }
1622
- }
1623
-
1624
- enum class SpeculationMode { kAllowSpeculation, kDisallowSpeculation };
1625
- enum class CallFeedbackContent { kTarget, kReceiver };
1626
-
1627
- inline std::ostream& operator<<(std::ostream& os,
1628
- SpeculationMode speculation_mode) {
1629
- switch (speculation_mode) {
1630
- case SpeculationMode::kAllowSpeculation:
1631
- return os << "SpeculationMode::kAllowSpeculation";
1632
- case SpeculationMode::kDisallowSpeculation:
1633
- return os << "SpeculationMode::kDisallowSpeculation";
1634
- }
1635
- UNREACHABLE();
1636
- return os;
1637
- }
1638
-
1639
- enum class BlockingBehavior { kBlock, kDontBlock };
1640
-
1641
- enum class ConcurrencyMode { kNotConcurrent, kConcurrent };
1642
-
1643
- #define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \
1644
- C(Handler, handler) \
1645
- C(CEntryFP, c_entry_fp) \
1646
- C(CFunction, c_function) \
1647
- C(Context, context) \
1648
- C(PendingException, pending_exception) \
1649
- C(PendingHandlerContext, pending_handler_context) \
1650
- C(PendingHandlerEntrypoint, pending_handler_entrypoint) \
1651
- C(PendingHandlerConstantPool, pending_handler_constant_pool) \
1652
- C(PendingHandlerFP, pending_handler_fp) \
1653
- C(PendingHandlerSP, pending_handler_sp) \
1654
- C(ExternalCaughtException, external_caught_exception) \
1655
- C(JSEntrySP, js_entry_sp)
1656
-
1657
- enum IsolateAddressId {
1658
- #define DECLARE_ENUM(CamelName, hacker_name) k##CamelName##Address,
1659
- FOR_EACH_ISOLATE_ADDRESS_NAME(DECLARE_ENUM)
1660
- #undef DECLARE_ENUM
1661
- kIsolateAddressCount
1662
- };
1663
-
1664
- enum class PoisoningMitigationLevel {
1665
- kPoisonAll,
1666
- kDontPoison,
1667
- kPoisonCriticalOnly
1668
- };
1669
-
1670
- enum class LoadSensitivity {
1671
- kCritical, // Critical loads are poisoned whenever we can run untrusted
1672
- // code (i.e., when --untrusted-code-mitigations is on).
1673
- kUnsafe, // Unsafe loads are poisoned when full poisoning is on
1674
- // (--branch-load-poisoning).
1675
- kSafe // Safe loads are never poisoned.
1676
- };
1677
-
1678
- // The reason for a WebAssembly trap.
1679
- #define FOREACH_WASM_TRAPREASON(V) \
1680
- V(TrapUnreachable) \
1681
- V(TrapMemOutOfBounds) \
1682
- V(TrapUnalignedAccess) \
1683
- V(TrapDivByZero) \
1684
- V(TrapDivUnrepresentable) \
1685
- V(TrapRemByZero) \
1686
- V(TrapFloatUnrepresentable) \
1687
- V(TrapFuncSigMismatch) \
1688
- V(TrapDataSegmentDropped) \
1689
- V(TrapElemSegmentDropped) \
1690
- V(TrapTableOutOfBounds) \
1691
- V(TrapRethrowNull) \
1692
- V(TrapNullDereference) \
1693
- V(TrapIllegalCast) \
1694
- V(TrapArrayOutOfBounds)
1695
-
1696
- enum KeyedAccessLoadMode {
1697
- STANDARD_LOAD,
1698
- LOAD_IGNORE_OUT_OF_BOUNDS,
1699
- };
1700
-
1701
- enum KeyedAccessStoreMode {
1702
- STANDARD_STORE,
1703
- STORE_AND_GROW_HANDLE_COW,
1704
- STORE_IGNORE_OUT_OF_BOUNDS,
1705
- STORE_HANDLE_COW
1706
- };
1707
-
1708
- enum MutableMode { MUTABLE, IMMUTABLE };
1709
-
1710
- inline bool IsCOWHandlingStoreMode(KeyedAccessStoreMode store_mode) {
1711
- return store_mode == STORE_HANDLE_COW ||
1712
- store_mode == STORE_AND_GROW_HANDLE_COW;
1713
- }
1714
-
1715
- inline bool IsGrowStoreMode(KeyedAccessStoreMode store_mode) {
1716
- return store_mode == STORE_AND_GROW_HANDLE_COW;
1717
- }
1718
-
1719
- enum IcCheckType { ELEMENT, PROPERTY };
1720
-
1721
- // Helper stubs can be called in different ways depending on where the target
1722
- // code is located and how the call sequence is expected to look like:
1723
- // - CodeObject: Call on-heap {Code} object via {RelocInfo::CODE_TARGET}.
1724
- // - WasmRuntimeStub: Call native {WasmCode} stub via
1725
- // {RelocInfo::WASM_STUB_CALL}.
1726
- // - BuiltinPointer: Call a builtin based on a builtin pointer with dynamic
1727
- // contents. If builtins are embedded, we call directly into off-heap code
1728
- // without going through the on-heap Code trampoline.
1729
- enum class StubCallMode {
1730
- kCallCodeObject,
1731
- #if V8_ENABLE_WEBASSEMBLY
1732
- kCallWasmRuntimeStub,
1733
- #endif // V8_ENABLE_WEBASSEMBLY
1734
- kCallBuiltinPointer,
1735
- };
1736
-
1737
- constexpr int kFunctionLiteralIdInvalid = -1;
1738
- constexpr int kFunctionLiteralIdTopLevel = 0;
1739
-
1740
- constexpr int kSwissNameDictionaryInitialCapacity = 4;
1741
-
1742
- constexpr int kSmallOrderedHashSetMinCapacity = 4;
1743
- constexpr int kSmallOrderedHashMapMinCapacity = 4;
1744
-
1745
- static const uint16_t kDontAdaptArgumentsSentinel = static_cast<uint16_t>(-1);
1746
-
1747
- // Opaque data type for identifying stack frames. Used extensively
1748
- // by the debugger.
1749
- // ID_MIN_VALUE and ID_MAX_VALUE are specified to ensure that enumeration type
1750
- // has correct value range (see Issue 830 for more details).
1751
- enum StackFrameId { ID_MIN_VALUE = kMinInt, ID_MAX_VALUE = kMaxInt, NO_ID = 0 };
1752
-
1753
- enum class ExceptionStatus : bool { kException = false, kSuccess = true };
1754
- V8_INLINE bool operator!(ExceptionStatus status) {
1755
- return !static_cast<bool>(status);
1756
- }
1757
-
1758
- enum class TraceRetainingPathMode { kEnabled, kDisabled };
1759
-
1760
- // Used in the ScopeInfo flags fields for the function name variable for named
1761
- // function expressions, and for the receiver. Must be declared here so that it
1762
- // can be used in Torque.
1763
- enum class VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED };
1764
-
1765
- enum class DynamicCheckMapsStatus : uint8_t {
1766
- kSuccess = 0,
1767
- kBailout = 1,
1768
- kDeopt = 2
1769
- };
1770
-
1771
- #ifdef V8_COMPRESS_POINTERS
1772
- class PtrComprCageBase {
1773
- public:
1774
- explicit constexpr PtrComprCageBase(Address address) : address_(address) {}
1775
- // NOLINTNEXTLINE
1776
- inline PtrComprCageBase(const Isolate* isolate);
1777
- // NOLINTNEXTLINE
1778
- inline PtrComprCageBase(const LocalIsolate* isolate);
1779
-
1780
- inline Address address() const;
1781
-
1782
- bool operator==(const PtrComprCageBase& other) const {
1783
- return address_ == other.address_;
1784
- }
1785
-
1786
- private:
1787
- Address address_;
1788
- };
1789
- #else
1790
- class PtrComprCageBase {
1791
- public:
1792
- PtrComprCageBase() = default;
1793
- // NOLINTNEXTLINE
1794
- PtrComprCageBase(const Isolate* isolate) {}
1795
- // NOLINTNEXTLINE
1796
- PtrComprCageBase(const LocalIsolate* isolate) {}
1797
- };
1798
- #endif
1799
-
1800
- class int31_t {
1801
- public:
1802
- constexpr int31_t() : value_(0) {}
1803
- constexpr int31_t(int value) : value_(value) { // NOLINT(runtime/explicit)
1804
- DCHECK_EQ((value & 0x80000000) != 0, (value & 0x40000000) != 0);
1805
- }
1806
- int31_t& operator=(int value) {
1807
- DCHECK_EQ((value & 0x80000000) != 0, (value & 0x40000000) != 0);
1808
- value_ = value;
1809
- return *this;
1810
- }
1811
- int32_t value() const { return value_; }
1812
- operator int32_t() const { return value_; }
1813
-
1814
- private:
1815
- int32_t value_;
1816
- };
1817
-
1818
- enum PropertiesEnumerationMode {
1819
- // String and then Symbol properties according to the spec
1820
- // ES#sec-object.assign
1821
- kEnumerationOrder,
1822
- // Order of property addition
1823
- kPropertyAdditionOrder,
1824
- };
1825
-
1826
- } // namespace internal
1827
-
1828
- // Tag dispatching support for acquire loads and release stores.
1829
- struct AcquireLoadTag {};
1830
- struct RelaxedLoadTag {};
1831
- struct ReleaseStoreTag {};
1832
- struct RelaxedStoreTag {};
1833
- static constexpr AcquireLoadTag kAcquireLoad;
1834
- static constexpr RelaxedLoadTag kRelaxedLoad;
1835
- static constexpr ReleaseStoreTag kReleaseStore;
1836
- static constexpr RelaxedStoreTag kRelaxedStore;
1837
-
1838
- } // namespace v8
1839
-
1840
- namespace i = v8::internal;
1841
-
1842
- #endif // V8_COMMON_GLOBALS_H_