@triniwiz/nativescript-masonkit 1.0.0-alpha.5 → 1.0.0-alpha.6

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 (345) hide show
  1. package/common.d.ts +7 -9
  2. package/common.js +277 -552
  3. package/common.js.map +1 -1
  4. package/helpers.d.ts +32 -10
  5. package/helpers.js +772 -286
  6. package/helpers.js.map +1 -1
  7. package/index.android.d.ts +6 -2
  8. package/index.android.js +21 -3
  9. package/index.android.js.map +1 -1
  10. package/index.d.ts +64 -7
  11. package/index.ios.d.ts +9 -6
  12. package/index.ios.js +39 -25
  13. package/index.ios.js.map +1 -1
  14. package/package.json +1 -1
  15. package/platforms/android/include.gradle +18 -1
  16. package/platforms/android/masonkit-release.aar +0 -0
  17. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +108 -64
  18. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +47 -20
  19. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  20. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  21. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  22. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +10744 -1631
  23. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +58 -21
  24. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  25. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +58 -21
  26. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  27. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +216 -128
  28. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +47 -20
  29. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  30. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  32. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +10744 -1631
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +58 -21
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +58 -21
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +10744 -1631
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +58 -21
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +58 -21
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +43 -43
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  43. package/platforms/ios/build.xcconfig +1 -2
  44. package/platforms/ios/src/MasonV8Module.h +583 -0
  45. package/platforms/ios/src/MasonV8Module.mm +1005 -0
  46. package/platforms/ios/src/{include → cpp/include}/mason_native.h +47 -20
  47. package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
  48. package/platforms/ios/src/module.modulemap +2 -2
  49. package/platforms/new_native_src/cpp/Caches.cpp +36 -0
  50. package/platforms/new_native_src/cpp/Caches.h +42 -0
  51. package/platforms/new_native_src/cpp/Common.h +34 -0
  52. package/platforms/new_native_src/cpp/ConcurrentMap.h +57 -0
  53. package/platforms/new_native_src/cpp/Helpers.cpp +101 -0
  54. package/platforms/new_native_src/cpp/Helpers.h +364 -0
  55. package/platforms/new_native_src/cpp/MasonImpl.cpp +68 -0
  56. package/platforms/new_native_src/cpp/MasonImpl.h +40 -0
  57. package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +89 -0
  58. package/platforms/new_native_src/cpp/MasonNodeImpl.h +47 -0
  59. package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +2181 -0
  60. package/platforms/new_native_src/cpp/MasonStyleImpl.h +420 -0
  61. package/platforms/{ios/Mason.xcframework/ios-arm64/Mason.framework/PrivateHeaders → new_native_src/cpp/include}/mason_native.h +464 -168
  62. package/platforms/new_native_src/cpp/include/robin_hood.h +2544 -0
  63. package/pods/Headers/include/APIDesign.md +72 -0
  64. package/pods/Headers/include/DEPS +10 -0
  65. package/pods/Headers/include/DIR_METADATA +11 -0
  66. package/pods/Headers/include/OWNERS +23 -0
  67. package/pods/Headers/include/cppgc/DEPS +8 -0
  68. package/pods/Headers/include/cppgc/OWNERS +2 -0
  69. package/pods/Headers/include/cppgc/README.md +133 -0
  70. package/pods/Headers/include/cppgc/allocation.h +310 -0
  71. package/pods/Headers/include/cppgc/common.h +29 -0
  72. package/pods/Headers/include/cppgc/cross-thread-persistent.h +465 -0
  73. package/pods/Headers/include/cppgc/custom-space.h +97 -0
  74. package/pods/Headers/include/cppgc/default-platform.h +67 -0
  75. package/pods/Headers/include/cppgc/ephemeron-pair.h +30 -0
  76. package/pods/Headers/include/cppgc/explicit-management.h +100 -0
  77. package/pods/Headers/include/cppgc/garbage-collected.h +106 -0
  78. package/pods/Headers/include/cppgc/heap-consistency.h +266 -0
  79. package/pods/Headers/include/cppgc/heap-state.h +82 -0
  80. package/pods/Headers/include/cppgc/heap-statistics.h +120 -0
  81. package/pods/Headers/include/cppgc/heap.h +206 -0
  82. package/pods/Headers/include/cppgc/internal/api-constants.h +55 -0
  83. package/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +48 -0
  84. package/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +79 -0
  85. package/pods/Headers/include/cppgc/internal/compiler-specific.h +38 -0
  86. package/pods/Headers/include/cppgc/internal/finalizer-trait.h +93 -0
  87. package/pods/Headers/include/cppgc/internal/gc-info.h +156 -0
  88. package/pods/Headers/include/cppgc/internal/logging.h +50 -0
  89. package/pods/Headers/include/cppgc/internal/name-trait.h +122 -0
  90. package/pods/Headers/include/cppgc/internal/persistent-node.h +216 -0
  91. package/pods/Headers/include/cppgc/internal/pointer-policies.h +186 -0
  92. package/pods/Headers/include/cppgc/internal/write-barrier.h +435 -0
  93. package/pods/Headers/include/cppgc/liveness-broker.h +77 -0
  94. package/pods/Headers/include/cppgc/macros.h +26 -0
  95. package/pods/Headers/include/cppgc/member.h +291 -0
  96. package/pods/Headers/include/cppgc/name-provider.h +65 -0
  97. package/pods/Headers/include/cppgc/object-size-trait.h +58 -0
  98. package/pods/Headers/include/cppgc/persistent.h +370 -0
  99. package/pods/Headers/include/cppgc/platform.h +156 -0
  100. package/pods/Headers/include/cppgc/prefinalizer.h +75 -0
  101. package/pods/Headers/include/cppgc/process-heap-statistics.h +36 -0
  102. package/pods/Headers/include/cppgc/sentinel-pointer.h +32 -0
  103. package/pods/Headers/include/cppgc/source-location.h +92 -0
  104. package/pods/Headers/include/cppgc/testing.h +106 -0
  105. package/pods/Headers/include/cppgc/trace-trait.h +116 -0
  106. package/pods/Headers/include/cppgc/type-traits.h +240 -0
  107. package/pods/Headers/include/cppgc/visitor.h +379 -0
  108. package/pods/Headers/include/js_protocol-1.2.json +936 -0
  109. package/pods/Headers/include/js_protocol-1.3.json +1112 -0
  110. package/pods/Headers/include/js_protocol.pdl +1709 -0
  111. package/pods/Headers/include/libffi/arm64/ffi.h +524 -0
  112. package/pods/Headers/include/libffi/arm64/ffitarget.h +92 -0
  113. package/pods/Headers/include/libffi/x86_64/ffi.h +524 -0
  114. package/pods/Headers/include/libffi/x86_64/ffitarget.h +147 -0
  115. package/pods/Headers/include/libffi.h +12 -0
  116. package/pods/Headers/include/libplatform/DEPS +9 -0
  117. package/pods/Headers/include/libplatform/libplatform-export.h +29 -0
  118. package/pods/Headers/include/libplatform/libplatform.h +106 -0
  119. package/pods/Headers/include/libplatform/v8-tracing.h +333 -0
  120. package/pods/Headers/include/v8-array-buffer.h +433 -0
  121. package/pods/Headers/include/v8-callbacks.h +397 -0
  122. package/pods/Headers/include/v8-container.h +129 -0
  123. package/pods/Headers/include/v8-context.h +407 -0
  124. package/pods/Headers/include/v8-cppgc.h +215 -0
  125. package/pods/Headers/include/v8-data.h +80 -0
  126. package/pods/Headers/include/v8-date.h +43 -0
  127. package/pods/Headers/include/v8-debug.h +168 -0
  128. package/pods/Headers/include/v8-embedder-heap.h +218 -0
  129. package/pods/Headers/include/v8-embedder-state-scope.h +51 -0
  130. package/pods/Headers/include/v8-exception.h +217 -0
  131. package/pods/Headers/include/v8-extension.h +62 -0
  132. package/pods/Headers/include/v8-external.h +37 -0
  133. package/pods/Headers/include/v8-fast-api-calls.h +939 -0
  134. package/pods/Headers/include/v8-forward.h +81 -0
  135. package/pods/Headers/include/v8-function-callback.h +475 -0
  136. package/pods/Headers/include/v8-function.h +125 -0
  137. package/pods/Headers/include/v8-initialization.h +315 -0
  138. package/pods/Headers/include/v8-inspector-protocol.h +13 -0
  139. package/pods/Headers/include/v8-inspector.h +376 -0
  140. package/pods/Headers/include/v8-internal.h +661 -0
  141. package/pods/Headers/include/v8-isolate.h +1709 -0
  142. package/pods/Headers/include/v8-json.h +47 -0
  143. package/pods/Headers/include/v8-local-handle.h +455 -0
  144. package/pods/Headers/include/v8-locker.h +149 -0
  145. package/pods/Headers/include/v8-maybe.h +137 -0
  146. package/pods/Headers/include/v8-memory-span.h +43 -0
  147. package/pods/Headers/include/v8-message.h +216 -0
  148. package/pods/Headers/include/v8-metrics.h +255 -0
  149. package/pods/Headers/include/v8-microtask-queue.h +152 -0
  150. package/pods/Headers/include/v8-microtask.h +28 -0
  151. package/pods/Headers/include/v8-object.h +775 -0
  152. package/pods/Headers/include/v8-persistent-handle.h +590 -0
  153. package/pods/Headers/include/v8-platform.h +1092 -0
  154. package/pods/Headers/include/v8-primitive-object.h +118 -0
  155. package/pods/Headers/include/v8-primitive.h +866 -0
  156. package/pods/Headers/include/v8-profiler.h +1198 -0
  157. package/pods/Headers/include/v8-promise.h +174 -0
  158. package/pods/Headers/include/v8-proxy.h +50 -0
  159. package/pods/Headers/include/v8-regexp.h +105 -0
  160. package/pods/Headers/include/v8-script.h +748 -0
  161. package/pods/Headers/include/v8-snapshot.h +196 -0
  162. package/pods/Headers/include/v8-statistics.h +217 -0
  163. package/pods/Headers/include/v8-template.h +1079 -0
  164. package/pods/Headers/include/v8-traced-handle.h +420 -0
  165. package/pods/Headers/include/v8-typed-array.h +282 -0
  166. package/pods/Headers/include/v8-unwinder-state.h +31 -0
  167. package/pods/Headers/include/v8-unwinder.h +132 -0
  168. package/pods/Headers/include/v8-util.h +658 -0
  169. package/pods/Headers/include/v8-value-serializer-version.h +24 -0
  170. package/pods/Headers/include/v8-value-serializer.h +279 -0
  171. package/pods/Headers/include/v8-value.h +526 -0
  172. package/pods/Headers/include/v8-version-string.h +38 -0
  173. package/pods/Headers/include/v8-version.h +20 -0
  174. package/pods/Headers/include/v8-wasm-trap-handler-posix.h +31 -0
  175. package/pods/Headers/include/v8-wasm-trap-handler-win.h +28 -0
  176. package/pods/Headers/include/v8-wasm.h +257 -0
  177. package/pods/Headers/include/v8-weak-callback-info.h +86 -0
  178. package/pods/Headers/include/v8.h +88 -0
  179. package/pods/Headers/include/v8config.h +605 -0
  180. package/pods/Headers/inspector/InspectorServer.h +20 -0
  181. package/pods/Headers/inspector/JsV8InspectorClient.h +66 -0
  182. package/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +1123 -0
  183. package/pods/Headers/inspector/base64.h +9 -0
  184. package/pods/Headers/inspector/src/base/address-region.h +95 -0
  185. package/pods/Headers/inspector/src/base/atomic-utils.h +219 -0
  186. package/pods/Headers/inspector/src/base/atomicops.h +332 -0
  187. package/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +89 -0
  188. package/pods/Headers/inspector/src/base/base-export.h +31 -0
  189. package/pods/Headers/inspector/src/base/bits.h +343 -0
  190. package/pods/Headers/inspector/src/base/build_config.h +234 -0
  191. package/pods/Headers/inspector/src/base/compiler-specific.h +136 -0
  192. package/pods/Headers/inspector/src/base/export-template.h +163 -0
  193. package/pods/Headers/inspector/src/base/flags.h +130 -0
  194. package/pods/Headers/inspector/src/base/immediate-crash.h +162 -0
  195. package/pods/Headers/inspector/src/base/lazy-instance.h +258 -0
  196. package/pods/Headers/inspector/src/base/logging.h +417 -0
  197. package/pods/Headers/inspector/src/base/macros.h +423 -0
  198. package/pods/Headers/inspector/src/base/memory.h +89 -0
  199. package/pods/Headers/inspector/src/base/once.h +108 -0
  200. package/pods/Headers/inspector/src/base/optional.h +882 -0
  201. package/pods/Headers/inspector/src/base/platform/mutex.h +370 -0
  202. package/pods/Headers/inspector/src/base/platform/platform.h +476 -0
  203. package/pods/Headers/inspector/src/base/platform/semaphore.h +108 -0
  204. package/pods/Headers/inspector/src/base/platform/v8-time.h +513 -0
  205. package/pods/Headers/inspector/src/base/platform/wrappers.h +73 -0
  206. package/pods/Headers/inspector/src/base/safe_conversions.h +389 -0
  207. package/pods/Headers/inspector/src/base/safe_conversions_impl.h +822 -0
  208. package/pods/Headers/inspector/src/base/template-utils.h +113 -0
  209. package/pods/Headers/inspector/src/base/v8-fallthrough.h +21 -0
  210. package/pods/Headers/inspector/src/common/checks.h +38 -0
  211. package/pods/Headers/inspector/src/common/globals.h +1842 -0
  212. package/pods/Headers/inspector/src/debug/debug-interface.h +667 -0
  213. package/pods/Headers/inspector/src/debug/interface-types.h +175 -0
  214. package/pods/Headers/inspector/src/init/v8.h +52 -0
  215. package/pods/Headers/inspector/src/inspector/custom-preview.h +24 -0
  216. package/pods/Headers/inspector/src/inspector/injected-script.h +251 -0
  217. package/pods/Headers/inspector/src/inspector/inspected-context.h +79 -0
  218. package/pods/Headers/inspector/src/inspector/protocol/CSS.h +2148 -0
  219. package/pods/Headers/inspector/src/inspector/protocol/Console.h +211 -0
  220. package/pods/Headers/inspector/src/inspector/protocol/DOM.h +1008 -0
  221. package/pods/Headers/inspector/src/inspector/protocol/Debugger.h +892 -0
  222. package/pods/Headers/inspector/src/inspector/protocol/Forward.h +75 -0
  223. package/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +346 -0
  224. package/pods/Headers/inspector/src/inspector/protocol/Log.h +342 -0
  225. package/pods/Headers/inspector/src/inspector/protocol/Network.h +2528 -0
  226. package/pods/Headers/inspector/src/inspector/protocol/Overlay.h +281 -0
  227. package/pods/Headers/inspector/src/inspector/protocol/Page.h +1189 -0
  228. package/pods/Headers/inspector/src/inspector/protocol/Profiler.h +1001 -0
  229. package/pods/Headers/inspector/src/inspector/protocol/Protocol.h +617 -0
  230. package/pods/Headers/inspector/src/inspector/protocol/Runtime.h +1696 -0
  231. package/pods/Headers/inspector/src/inspector/protocol/Schema.h +146 -0
  232. package/pods/Headers/inspector/src/inspector/protocol/Security.h +793 -0
  233. package/pods/Headers/inspector/src/inspector/remote-object-id.h +54 -0
  234. package/pods/Headers/inspector/src/inspector/search-util.h +26 -0
  235. package/pods/Headers/inspector/src/inspector/string-16.h +180 -0
  236. package/pods/Headers/inspector/src/inspector/string-util.h +128 -0
  237. package/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +48 -0
  238. package/pods/Headers/inspector/src/inspector/v8-console-message.h +147 -0
  239. package/pods/Headers/inspector/src/inspector/v8-console.h +173 -0
  240. package/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +62 -0
  241. package/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +248 -0
  242. package/pods/Headers/inspector/src/inspector/v8-debugger-id.h +44 -0
  243. package/pods/Headers/inspector/src/inspector/v8-debugger-script.h +123 -0
  244. package/pods/Headers/inspector/src/inspector/v8-debugger.h +257 -0
  245. package/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +91 -0
  246. package/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +80 -0
  247. package/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +191 -0
  248. package/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +156 -0
  249. package/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +34 -0
  250. package/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +71 -0
  251. package/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +24 -0
  252. package/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +70 -0
  253. package/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +88 -0
  254. package/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +104 -0
  255. package/pods/Headers/inspector/src/inspector/v8-regex.h +38 -0
  256. package/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +157 -0
  257. package/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +38 -0
  258. package/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +164 -0
  259. package/pods/Headers/inspector/src/inspector/v8-string-conversions.h +17 -0
  260. package/pods/Headers/inspector/src/inspector/v8-value-utils.h +23 -0
  261. package/pods/Headers/inspector/src/inspector/value-mirror.h +87 -0
  262. package/pods/Headers/inspector/src/libplatform/default-platform.h +92 -0
  263. package/pods/Headers/inspector/src/logging/tracing-flags.h +50 -0
  264. package/pods/Headers/inspector/src/numbers/conversions.h +183 -0
  265. package/pods/Headers/inspector/src/tracing/trace-event.h +664 -0
  266. package/pods/Headers/inspector/src/utils/allocation.h +367 -0
  267. package/pods/Headers/inspector/src/utils/vector.h +324 -0
  268. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +305 -0
  269. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +314 -0
  270. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +62 -0
  271. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +6 -0
  272. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +58 -0
  273. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +47 -0
  274. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +80 -0
  275. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +52 -0
  276. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +26 -0
  277. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +104 -0
  278. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +39 -0
  279. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +406 -0
  280. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +32 -0
  281. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +158 -0
  282. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +99 -0
  283. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +139 -0
  284. package/pods/Headers/inspector/utils.h +32 -0
  285. package/pods/Headers/inspector/v8-inspector-platform.h +44 -0
  286. package/pods/Headers/jsi/decorator.h +762 -0
  287. package/pods/Headers/jsi/instrumentation.h +117 -0
  288. package/pods/Headers/jsi/jsi-inl.h +322 -0
  289. package/pods/Headers/jsi/jsi.h +1387 -0
  290. package/pods/Headers/jsi/jsilib.h +59 -0
  291. package/pods/Headers/jsi/threadsafe.h +79 -0
  292. package/pods/Headers/runtime/ArgConverter.h +61 -0
  293. package/pods/Headers/runtime/ArrayAdapter.h +13 -0
  294. package/pods/Headers/runtime/Caches.h +98 -0
  295. package/pods/Headers/runtime/ClassBuilder.h +61 -0
  296. package/pods/Headers/runtime/Common.h +9 -0
  297. package/pods/Headers/runtime/ConcurrentMap.h +55 -0
  298. package/pods/Headers/runtime/ConcurrentQueue.h +28 -0
  299. package/pods/Headers/runtime/Console.h +27 -0
  300. package/pods/Headers/runtime/Constants.h +15 -0
  301. package/pods/Headers/runtime/DataWrapper.h +671 -0
  302. package/pods/Headers/runtime/DictionaryAdapter.h +13 -0
  303. package/pods/Headers/runtime/ExtVector.h +21 -0
  304. package/pods/Headers/runtime/FFICall.h +105 -0
  305. package/pods/Headers/runtime/FastEnumerationAdapter.h +13 -0
  306. package/pods/Headers/runtime/FunctionReference.h +18 -0
  307. package/pods/Headers/runtime/Helpers.h +84 -0
  308. package/pods/Headers/runtime/InlineFunctions.h +16 -0
  309. package/pods/Headers/runtime/Interop.h +202 -0
  310. package/pods/Headers/runtime/KnownUnknownClassPair.h +35 -0
  311. package/pods/Headers/runtime/Metadata.h +981 -0
  312. package/pods/Headers/runtime/MetadataBuilder.h +72 -0
  313. package/pods/Headers/runtime/MetadataInlines.h +157 -0
  314. package/pods/Headers/runtime/ModuleInternal.h +59 -0
  315. package/pods/Headers/runtime/NSDataAdapter.h +13 -0
  316. package/pods/Headers/runtime/NativeScriptException.h +27 -0
  317. package/pods/Headers/runtime/ObjectManager.h +31 -0
  318. package/pods/Headers/runtime/OneByteStringResource.h +21 -0
  319. package/pods/Headers/runtime/Pointer.h +26 -0
  320. package/pods/Headers/runtime/PromiseProxy.h +15 -0
  321. package/pods/Headers/runtime/Reference.h +38 -0
  322. package/pods/Headers/runtime/Runtime.h +67 -0
  323. package/pods/Headers/runtime/RuntimeConfig.h +17 -0
  324. package/pods/Headers/runtime/SetTimeout.h +34 -0
  325. package/pods/Headers/runtime/SimpleAllocator.h +23 -0
  326. package/pods/Headers/runtime/StringHasher.h +315 -0
  327. package/pods/Headers/runtime/SymbolIterator.h +18 -0
  328. package/pods/Headers/runtime/SymbolLoader.h +27 -0
  329. package/pods/Headers/runtime/TNSDerivedClass.h +8 -0
  330. package/pods/Headers/runtime/TSHelpers.h +15 -0
  331. package/pods/Headers/runtime/Tasks.h +19 -0
  332. package/pods/Headers/runtime/UnmanagedType.h +21 -0
  333. package/pods/Headers/runtime/WeakRef.h +15 -0
  334. package/pods/Headers/runtime/Worker.h +26 -0
  335. package/pods/Headers/runtime/robin_hood.h +2184 -0
  336. package/pods/Headers/v8runtime/HostProxy.h +71 -0
  337. package/pods/Headers/v8runtime/JSIV8ValueConverter.h +70 -0
  338. package/pods/Headers/v8runtime/V8PointerValue.h +44 -0
  339. package/pods/Headers/v8runtime/V8Runtime.h +215 -0
  340. package/pods/Headers/v8runtime/V8RuntimeConfig.h +26 -0
  341. package/pods/Headers/v8runtime/V8RuntimeFactory.h +21 -0
  342. package/pods/NativeScript.podspec +68 -0
  343. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/PrivateHeaders/mason_native.h +0 -676
  344. package/platforms/ios/src/JSIModule.h +0 -217
  345. package/platforms/ios/src/JSIModule.mm +0 -2788
@@ -0,0 +1,423 @@
1
+ // Copyright 2014 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_BASE_MACROS_H_
6
+ #define V8_BASE_MACROS_H_
7
+
8
+ #include <limits>
9
+ #include <type_traits>
10
+
11
+ #include "src/base/compiler-specific.h"
12
+ #include "src/base/logging.h"
13
+ #include "src/base/platform/wrappers.h"
14
+
15
+ // No-op macro which is used to work around MSVC's funky VA_ARGS support.
16
+ #define EXPAND(x) x
17
+
18
+ // This macro does nothing. That's all.
19
+ #define NOTHING(...)
20
+
21
+ // TODO(all) Replace all uses of this macro with C++'s offsetof. To do that, we
22
+ // have to make sure that only standard-layout types and simple field
23
+ // designators are used.
24
+ #define OFFSET_OF(type, field) \
25
+ (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(16)->field)) - 16)
26
+
27
+
28
+ // The arraysize(arr) macro returns the # of elements in an array arr.
29
+ // The expression is a compile-time constant, and therefore can be
30
+ // used in defining new arrays, for example. If you use arraysize on
31
+ // a pointer by mistake, you will get a compile-time error.
32
+ #define arraysize(array) (sizeof(ArraySizeHelper(array)))
33
+
34
+
35
+ // This template function declaration is used in defining arraysize.
36
+ // Note that the function doesn't need an implementation, as we only
37
+ // use its type.
38
+ template <typename T, size_t N>
39
+ char (&ArraySizeHelper(T (&array)[N]))[N];
40
+
41
+
42
+ #if !V8_CC_MSVC
43
+ // That gcc wants both of these prototypes seems mysterious. VC, for
44
+ // its part, can't decide which to use (another mystery). Matching of
45
+ // template overloads: the final frontier.
46
+ template <typename T, size_t N>
47
+ char (&ArraySizeHelper(const T (&array)[N]))[N];
48
+ #endif
49
+
50
+ // bit_cast<Dest,Source> is a template function that implements the
51
+ // equivalent of "*reinterpret_cast<Dest*>(&source)". We need this in
52
+ // very low-level functions like the protobuf library and fast math
53
+ // support.
54
+ //
55
+ // float f = 3.14159265358979;
56
+ // int i = bit_cast<int32>(f);
57
+ // // i = 0x40490fdb
58
+ //
59
+ // The classical address-casting method is:
60
+ //
61
+ // // WRONG
62
+ // float f = 3.14159265358979; // WRONG
63
+ // int i = * reinterpret_cast<int*>(&f); // WRONG
64
+ //
65
+ // The address-casting method actually produces undefined behavior
66
+ // according to ISO C++ specification section 3.10 -15 -. Roughly, this
67
+ // section says: if an object in memory has one type, and a program
68
+ // accesses it with a different type, then the result is undefined
69
+ // behavior for most values of "different type".
70
+ //
71
+ // This is true for any cast syntax, either *(int*)&f or
72
+ // *reinterpret_cast<int*>(&f). And it is particularly true for
73
+ // conversions between integral lvalues and floating-point lvalues.
74
+ //
75
+ // The purpose of 3.10 -15- is to allow optimizing compilers to assume
76
+ // that expressions with different types refer to different memory. gcc
77
+ // 4.0.1 has an optimizer that takes advantage of this. So a
78
+ // non-conforming program quietly produces wildly incorrect output.
79
+ //
80
+ // The problem is not the use of reinterpret_cast. The problem is type
81
+ // punning: holding an object in memory of one type and reading its bits
82
+ // back using a different type.
83
+ //
84
+ // The C++ standard is more subtle and complex than this, but that
85
+ // is the basic idea.
86
+ //
87
+ // Anyways ...
88
+ //
89
+ // bit_cast<> calls memcpy() which is blessed by the standard,
90
+ // especially by the example in section 3.9 . Also, of course,
91
+ // bit_cast<> wraps up the nasty logic in one place.
92
+ //
93
+ // Fortunately memcpy() is very fast. In optimized mode, with a
94
+ // constant size, gcc 2.95.3, gcc 4.0.1, and msvc 7.1 produce inline
95
+ // code with the minimal amount of data movement. On a 32-bit system,
96
+ // memcpy(d,s,4) compiles to one load and one store, and memcpy(d,s,8)
97
+ // compiles to two loads and two stores.
98
+ //
99
+ // I tested this code with gcc 2.95.3, gcc 4.0.1, icc 8.1, and msvc 7.1.
100
+ //
101
+ // WARNING: if Dest or Source is a non-POD type, the result of the memcpy
102
+ // is likely to surprise you.
103
+ template <class Dest, class Source>
104
+ V8_INLINE Dest bit_cast(Source const& source) {
105
+ static_assert(sizeof(Dest) == sizeof(Source),
106
+ "source and dest must be same size");
107
+ Dest dest;
108
+ v8::base::Memcpy(&dest, &source, sizeof(dest));
109
+ return dest;
110
+ }
111
+
112
+ // Explicitly declare the assignment operator as deleted.
113
+ // Note: This macro is deprecated and will be removed soon. Please explicitly
114
+ // delete the assignment operator instead.
115
+ #define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete
116
+
117
+ // Explicitly declare all implicit constructors as deleted, namely the
118
+ // default constructor, copy constructor and operator= functions.
119
+ // This is especially useful for classes containing only static methods.
120
+ #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
121
+ TypeName() = delete; \
122
+ TypeName(const TypeName&) = delete; \
123
+ DISALLOW_ASSIGN(TypeName)
124
+
125
+ // Disallow copying a type, but provide default construction, move construction
126
+ // and move assignment. Especially useful for move-only structs.
127
+ #define MOVE_ONLY_WITH_DEFAULT_CONSTRUCTORS(TypeName) \
128
+ TypeName() = default; \
129
+ MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeName)
130
+
131
+ // Disallow copying a type, and only provide move construction and move
132
+ // assignment. Especially useful for move-only structs.
133
+ #define MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeName) \
134
+ TypeName(TypeName&&) V8_NOEXCEPT = default; \
135
+ TypeName& operator=(TypeName&&) V8_NOEXCEPT = default; \
136
+ TypeName(const TypeName&) = delete; \
137
+ DISALLOW_ASSIGN(TypeName)
138
+
139
+ // A macro to disallow the dynamic allocation.
140
+ // This should be used in the private: declarations for a class
141
+ // Declaring operator new and delete as deleted is not spec compliant.
142
+ // Extract from 3.2.2 of C++11 spec:
143
+ // [...] A non-placement deallocation function for a class is
144
+ // odr-used by the definition of the destructor of that class, [...]
145
+ #define DISALLOW_NEW_AND_DELETE() \
146
+ void* operator new(size_t) { v8::base::OS::Abort(); } \
147
+ void* operator new[](size_t) { v8::base::OS::Abort(); } \
148
+ void operator delete(void*, size_t) { v8::base::OS::Abort(); } \
149
+ void operator delete[](void*, size_t) { v8::base::OS::Abort(); }
150
+
151
+ // Define V8_USE_ADDRESS_SANITIZER macro.
152
+ #if defined(__has_feature)
153
+ #if __has_feature(address_sanitizer)
154
+ #define V8_USE_ADDRESS_SANITIZER 1
155
+ #endif
156
+ #endif
157
+
158
+ // Define DISABLE_ASAN macro.
159
+ #ifdef V8_USE_ADDRESS_SANITIZER
160
+ #define DISABLE_ASAN __attribute__((no_sanitize_address))
161
+ #else
162
+ #define DISABLE_ASAN
163
+ #endif
164
+
165
+ // Define V8_USE_MEMORY_SANITIZER macro.
166
+ #if defined(__has_feature)
167
+ #if __has_feature(memory_sanitizer)
168
+ #define V8_USE_MEMORY_SANITIZER 1
169
+ #endif
170
+ #endif
171
+
172
+ // DISABLE_CFI_PERF -- Disable Control Flow Integrity checks for Perf reasons.
173
+ #define DISABLE_CFI_PERF V8_CLANG_NO_SANITIZE("cfi")
174
+
175
+ // DISABLE_CFI_ICALL -- Disable Control Flow Integrity indirect call checks,
176
+ // useful because calls into JITed code can not be CFI verified.
177
+ #ifdef V8_OS_WIN
178
+ // On Windows, also needs __declspec(guard(nocf)) for CFG.
179
+ #define DISABLE_CFI_ICALL \
180
+ V8_CLANG_NO_SANITIZE("cfi-icall") \
181
+ __declspec(guard(nocf))
182
+ #else
183
+ #define DISABLE_CFI_ICALL V8_CLANG_NO_SANITIZE("cfi-icall")
184
+ #endif
185
+
186
+ // A convenience wrapper around static_assert without a string message argument.
187
+ // Once C++17 becomes the default, this macro can be removed in favor of the
188
+ // new static_assert(condition) overload.
189
+ #define STATIC_ASSERT(test) static_assert(test, #test)
190
+
191
+ namespace v8 {
192
+ namespace base {
193
+
194
+ // Note that some implementations of std::is_trivially_copyable mandate that at
195
+ // least one of the copy constructor, move constructor, copy assignment or move
196
+ // assignment is non-deleted, while others do not. Be aware that also
197
+ // base::is_trivially_copyable will differ for these cases.
198
+ template <typename T>
199
+ struct is_trivially_copyable {
200
+ #if V8_CC_MSVC
201
+ // Unfortunately, MSVC 2015 is broken in that std::is_trivially_copyable can
202
+ // be false even though it should be true according to the standard.
203
+ // (status at 2018-02-26, observed on the msvc waterfall bot).
204
+ // Interestingly, the lower-level primitives used below are working as
205
+ // intended, so we reimplement this according to the standard.
206
+ // See also https://developercommunity.visualstudio.com/content/problem/
207
+ // 170883/msvc-type-traits-stdis-trivial-is-bugged.html.
208
+ static constexpr bool value =
209
+ // Copy constructor is trivial or deleted.
210
+ (std::is_trivially_copy_constructible<T>::value ||
211
+ !std::is_copy_constructible<T>::value) &&
212
+ // Copy assignment operator is trivial or deleted.
213
+ (std::is_trivially_copy_assignable<T>::value ||
214
+ !std::is_copy_assignable<T>::value) &&
215
+ // Move constructor is trivial or deleted.
216
+ (std::is_trivially_move_constructible<T>::value ||
217
+ !std::is_move_constructible<T>::value) &&
218
+ // Move assignment operator is trivial or deleted.
219
+ (std::is_trivially_move_assignable<T>::value ||
220
+ !std::is_move_assignable<T>::value) &&
221
+ // (Some implementations mandate that one of the above is non-deleted, but
222
+ // the standard does not, so let's skip this check.)
223
+ // Trivial non-deleted destructor.
224
+ std::is_trivially_destructible<T>::value;
225
+ #else
226
+ static constexpr bool value = std::is_trivially_copyable<T>::value;
227
+ #endif
228
+ };
229
+ #define ASSERT_TRIVIALLY_COPYABLE(T) \
230
+ static_assert(::v8::base::is_trivially_copyable<T>::value, \
231
+ #T " should be trivially copyable")
232
+ #define ASSERT_NOT_TRIVIALLY_COPYABLE(T) \
233
+ static_assert(!::v8::base::is_trivially_copyable<T>::value, \
234
+ #T " should not be trivially copyable")
235
+
236
+ // The USE(x, ...) template is used to silence C++ compiler warnings
237
+ // issued for (yet) unused variables (typically parameters).
238
+ // The arguments are guaranteed to be evaluated from left to right.
239
+ struct Use {
240
+ template <typename T>
241
+ Use(T&&) {} // NOLINT(runtime/explicit)
242
+ };
243
+ #define USE(...) \
244
+ do { \
245
+ ::v8::base::Use unused_tmp_array_for_use_macro[]{__VA_ARGS__}; \
246
+ (void)unused_tmp_array_for_use_macro; \
247
+ } while (false)
248
+
249
+ // Evaluate the instantiations of an expression with parameter packs.
250
+ // Since USE has left-to-right evaluation order of it's arguments,
251
+ // the parameter pack is iterated from left to right and side effects
252
+ // have defined behavior.
253
+ #define ITERATE_PACK(...) USE(0, ((__VA_ARGS__), 0)...)
254
+
255
+ } // namespace base
256
+ } // namespace v8
257
+
258
+ // implicit_cast<A>(x) triggers an implicit cast from {x} to type {A}. This is
259
+ // useful in situations where static_cast<A>(x) would do too much.
260
+ // Only use this for cheap-to-copy types, or use move semantics explicitly.
261
+ template <class A>
262
+ V8_INLINE A implicit_cast(A x) {
263
+ return x;
264
+ }
265
+
266
+ // Define our own macros for writing 64-bit constants. This is less fragile
267
+ // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it
268
+ // works on compilers that don't have it (like MSVC).
269
+ #if V8_CC_MSVC
270
+ # if V8_HOST_ARCH_64_BIT
271
+ # define V8_PTR_PREFIX "ll"
272
+ # else
273
+ # define V8_PTR_PREFIX ""
274
+ # endif // V8_HOST_ARCH_64_BIT
275
+ #elif V8_CC_MINGW64
276
+ # define V8_PTR_PREFIX "I64"
277
+ #elif V8_HOST_ARCH_64_BIT
278
+ # define V8_PTR_PREFIX "l"
279
+ #else
280
+ #if V8_OS_AIX
281
+ #define V8_PTR_PREFIX "l"
282
+ #else
283
+ # define V8_PTR_PREFIX ""
284
+ #endif
285
+ #endif
286
+
287
+ #define V8PRIxPTR V8_PTR_PREFIX "x"
288
+ #define V8PRIdPTR V8_PTR_PREFIX "d"
289
+ #define V8PRIuPTR V8_PTR_PREFIX "u"
290
+
291
+ #if V8_TARGET_ARCH_64_BIT
292
+ #define V8_PTR_HEX_DIGITS 12
293
+ #define V8PRIxPTR_FMT "0x%012" V8PRIxPTR
294
+ #else
295
+ #define V8_PTR_HEX_DIGITS 8
296
+ #define V8PRIxPTR_FMT "0x%08" V8PRIxPTR
297
+ #endif
298
+
299
+ // ptrdiff_t is 't' according to the standard, but MSVC uses 'I'.
300
+ #if V8_CC_MSVC
301
+ #define V8PRIxPTRDIFF "Ix"
302
+ #define V8PRIdPTRDIFF "Id"
303
+ #define V8PRIuPTRDIFF "Iu"
304
+ #else
305
+ #define V8PRIxPTRDIFF "tx"
306
+ #define V8PRIdPTRDIFF "td"
307
+ #define V8PRIuPTRDIFF "tu"
308
+ #endif
309
+
310
+ // Fix for Mac OS X defining uintptr_t as "unsigned long":
311
+ #if V8_OS_MACOSX
312
+ #undef V8PRIxPTR
313
+ #define V8PRIxPTR "lx"
314
+ #undef V8PRIdPTR
315
+ #define V8PRIdPTR "ld"
316
+ #undef V8PRIuPTR
317
+ #define V8PRIuPTR "lxu"
318
+ #endif
319
+
320
+ // Make a uint64 from two uint32_t halves.
321
+ inline uint64_t make_uint64(uint32_t high, uint32_t low) {
322
+ return (uint64_t{high} << 32) + low;
323
+ }
324
+
325
+ // Return the largest multiple of m which is <= x.
326
+ template <typename T>
327
+ inline T RoundDown(T x, intptr_t m) {
328
+ STATIC_ASSERT(std::is_integral<T>::value);
329
+ // m must be a power of two.
330
+ DCHECK(m != 0 && ((m & (m - 1)) == 0));
331
+ return x & static_cast<T>(-m);
332
+ }
333
+ template <intptr_t m, typename T>
334
+ constexpr inline T RoundDown(T x) {
335
+ STATIC_ASSERT(std::is_integral<T>::value);
336
+ // m must be a power of two.
337
+ STATIC_ASSERT(m != 0 && ((m & (m - 1)) == 0));
338
+ return x & static_cast<T>(-m);
339
+ }
340
+
341
+ // Return the smallest multiple of m which is >= x.
342
+ template <typename T>
343
+ inline T RoundUp(T x, intptr_t m) {
344
+ STATIC_ASSERT(std::is_integral<T>::value);
345
+ return RoundDown<T>(static_cast<T>(x + m - 1), m);
346
+ }
347
+ template <intptr_t m, typename T>
348
+ constexpr inline T RoundUp(T x) {
349
+ STATIC_ASSERT(std::is_integral<T>::value);
350
+ return RoundDown<m, T>(static_cast<T>(x + (m - 1)));
351
+ }
352
+
353
+ template <typename T, typename U>
354
+ constexpr inline bool IsAligned(T value, U alignment) {
355
+ return (value & (alignment - 1)) == 0;
356
+ }
357
+
358
+ inline void* AlignedAddress(void* address, size_t alignment) {
359
+ // The alignment must be a power of two.
360
+ DCHECK_EQ(alignment & (alignment - 1), 0u);
361
+ return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(address) &
362
+ ~static_cast<uintptr_t>(alignment - 1));
363
+ }
364
+
365
+ // Bounds checks for float to integer conversions, which does truncation. Hence,
366
+ // the range of legal values is (min - 1, max + 1).
367
+ template <typename int_t, typename float_t, typename biggest_int_t = int64_t>
368
+ bool is_inbounds(float_t v) {
369
+ static_assert(sizeof(int_t) < sizeof(biggest_int_t),
370
+ "int_t can't be bounds checked by the compiler");
371
+ constexpr float_t kLowerBound =
372
+ static_cast<float_t>(std::numeric_limits<int_t>::min()) - 1;
373
+ constexpr float_t kUpperBound =
374
+ static_cast<float_t>(std::numeric_limits<int_t>::max()) + 1;
375
+ constexpr bool kLowerBoundIsMin =
376
+ static_cast<biggest_int_t>(kLowerBound) ==
377
+ static_cast<biggest_int_t>(std::numeric_limits<int_t>::min());
378
+ constexpr bool kUpperBoundIsMax =
379
+ static_cast<biggest_int_t>(kUpperBound) ==
380
+ static_cast<biggest_int_t>(std::numeric_limits<int_t>::max());
381
+ // Using USE(var) is only a workaround for a GCC 8.1 bug.
382
+ USE(kLowerBoundIsMin);
383
+ USE(kUpperBoundIsMax);
384
+ return (kLowerBoundIsMin ? (kLowerBound <= v) : (kLowerBound < v)) &&
385
+ (kUpperBoundIsMax ? (v <= kUpperBound) : (v < kUpperBound));
386
+ }
387
+
388
+ #ifdef V8_OS_WIN
389
+
390
+ // Setup for Windows shared library export.
391
+ #ifdef BUILDING_V8_SHARED
392
+ #define V8_EXPORT_PRIVATE __declspec(dllexport)
393
+ #elif USING_V8_SHARED
394
+ #define V8_EXPORT_PRIVATE __declspec(dllimport)
395
+ #else
396
+ #define V8_EXPORT_PRIVATE
397
+ #endif // BUILDING_V8_SHARED
398
+
399
+ #else // V8_OS_WIN
400
+
401
+ // Setup for Linux shared library export.
402
+ #if V8_HAS_ATTRIBUTE_VISIBILITY
403
+ #ifdef BUILDING_V8_SHARED
404
+ #define V8_EXPORT_PRIVATE __attribute__((visibility("default")))
405
+ #else
406
+ #define V8_EXPORT_PRIVATE
407
+ #endif
408
+ #else
409
+ #define V8_EXPORT_PRIVATE
410
+ #endif
411
+
412
+ #endif // V8_OS_WIN
413
+
414
+ // Defines IF_WASM, to be used in macro lists for elements that should only be
415
+ // there if WebAssembly is enabled.
416
+ #if V8_ENABLE_WEBASSEMBLY
417
+ // EXPAND is needed to work around MSVC's broken __VA_ARGS__ expansion.
418
+ #define IF_WASM(V, ...) EXPAND(V(__VA_ARGS__))
419
+ #else
420
+ #define IF_WASM(V, ...)
421
+ #endif // V8_ENABLE_WEBASSEMBLY
422
+
423
+ #endif // V8_BASE_MACROS_H_
@@ -0,0 +1,89 @@
1
+ // Copyright 2011 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_BASE_MEMORY_H_
6
+ #define V8_BASE_MEMORY_H_
7
+
8
+ #include "src/base/macros.h"
9
+ #include "src/base/platform/wrappers.h"
10
+
11
+ namespace v8 {
12
+ namespace base {
13
+
14
+ using Address = uintptr_t;
15
+ using byte = uint8_t;
16
+
17
+ // Memory provides an interface to 'raw' memory. It encapsulates the casts
18
+ // that typically are needed when incompatible pointer types are used.
19
+ // Note that this class currently relies on undefined behaviour. There is a
20
+ // proposal (http://wg21.link/p0593r2) to make it defined behaviour though.
21
+ template <class T>
22
+ inline T& Memory(Address addr) {
23
+ DCHECK(IsAligned(addr, alignof(T)));
24
+ return *reinterpret_cast<T*>(addr);
25
+ }
26
+ template <class T>
27
+ inline T& Memory(byte* addr) {
28
+ return Memory<T>(reinterpret_cast<Address>(addr));
29
+ }
30
+
31
+ template <typename V>
32
+ static inline V ReadUnalignedValue(Address p) {
33
+ ASSERT_TRIVIALLY_COPYABLE(V);
34
+ V r;
35
+ base::Memcpy(&r, reinterpret_cast<void*>(p), sizeof(V));
36
+ return r;
37
+ }
38
+
39
+ template <typename V>
40
+ static inline void WriteUnalignedValue(Address p, V value) {
41
+ ASSERT_TRIVIALLY_COPYABLE(V);
42
+ base::Memcpy(reinterpret_cast<void*>(p), &value, sizeof(V));
43
+ }
44
+
45
+ template <typename V>
46
+ static inline V ReadLittleEndianValue(Address p) {
47
+ #if defined(V8_TARGET_LITTLE_ENDIAN)
48
+ return ReadUnalignedValue<V>(p);
49
+ #elif defined(V8_TARGET_BIG_ENDIAN)
50
+ V ret{};
51
+ const byte* src = reinterpret_cast<const byte*>(p);
52
+ byte* dst = reinterpret_cast<byte*>(&ret);
53
+ for (size_t i = 0; i < sizeof(V); i++) {
54
+ dst[i] = src[sizeof(V) - i - 1];
55
+ }
56
+ return ret;
57
+ #endif // V8_TARGET_LITTLE_ENDIAN
58
+ }
59
+
60
+ template <typename V>
61
+ static inline void WriteLittleEndianValue(Address p, V value) {
62
+ #if defined(V8_TARGET_LITTLE_ENDIAN)
63
+ WriteUnalignedValue<V>(p, value);
64
+ #elif defined(V8_TARGET_BIG_ENDIAN)
65
+ byte* src = reinterpret_cast<byte*>(&value);
66
+ byte* dst = reinterpret_cast<byte*>(p);
67
+ for (size_t i = 0; i < sizeof(V); i++) {
68
+ dst[i] = src[sizeof(V) - i - 1];
69
+ }
70
+ #endif // V8_TARGET_LITTLE_ENDIAN
71
+ }
72
+
73
+ template <typename V>
74
+ static inline V ReadLittleEndianValue(V* p) {
75
+ return ReadLittleEndianValue<V>(reinterpret_cast<Address>(p));
76
+ }
77
+
78
+ template <typename V>
79
+ static inline void WriteLittleEndianValue(V* p, V value) {
80
+ static_assert(
81
+ !std::is_array<V>::value,
82
+ "Passing an array decays to pointer, causing unexpected results.");
83
+ WriteLittleEndianValue<V>(reinterpret_cast<Address>(p), value);
84
+ }
85
+
86
+ } // namespace base
87
+ } // namespace v8
88
+
89
+ #endif // V8_BASE_MEMORY_H_
@@ -0,0 +1,108 @@
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
+ // emulates google3/base/once.h
6
+ //
7
+ // This header is intended to be included only by v8's internal code. Users
8
+ // should not use this directly.
9
+ //
10
+ // This is basically a portable version of pthread_once().
11
+ //
12
+ // This header declares:
13
+ // * A type called OnceType.
14
+ // * A macro V8_DECLARE_ONCE() which declares a (global) variable of type
15
+ // OnceType.
16
+ // * A function CallOnce(OnceType* once, void (*init_func)()).
17
+ // This function, when invoked multiple times given the same OnceType object,
18
+ // will invoke init_func on the first call only, and will make sure none of
19
+ // the calls return before that first call to init_func has finished.
20
+ //
21
+ // Additionally, the following features are supported:
22
+ // * A macro V8_ONCE_INIT which is expanded into the expression used to
23
+ // initialize a OnceType. This is only useful when clients embed a OnceType
24
+ // into a structure of their own and want to initialize it statically.
25
+ // * The user can provide a parameter which CallOnce() forwards to the
26
+ // user-provided function when it is called. Usage example:
27
+ // CallOnce(&my_once, &MyFunctionExpectingIntArgument, 10);
28
+ // * This implementation guarantees that OnceType is a POD (i.e. no static
29
+ // initializer generated).
30
+ //
31
+ // This implements a way to perform lazy initialization. It's more efficient
32
+ // than using mutexes as no lock is needed if initialization has already
33
+ // happened.
34
+ //
35
+ // Example usage:
36
+ // void Init();
37
+ // V8_DECLARE_ONCE(once_init);
38
+ //
39
+ // // Calls Init() exactly once.
40
+ // void InitOnce() {
41
+ // CallOnce(&once_init, &Init);
42
+ // }
43
+ //
44
+ // Note that if CallOnce() is called before main() has begun, it must
45
+ // only be called by the thread that will eventually call main() -- that is,
46
+ // the thread that performs dynamic initialization. In general this is a safe
47
+ // assumption since people don't usually construct threads before main() starts,
48
+ // but it is technically not guaranteed. Unfortunately, Win32 provides no way
49
+ // whatsoever to statically-initialize its synchronization primitives, so our
50
+ // only choice is to assume that dynamic initialization is single-threaded.
51
+
52
+ #ifndef V8_BASE_ONCE_H_
53
+ #define V8_BASE_ONCE_H_
54
+
55
+ #include <stddef.h>
56
+
57
+ #include <atomic>
58
+ #include <functional>
59
+
60
+ #include "src/base/base-export.h"
61
+ #include "src/base/template-utils.h"
62
+
63
+ namespace v8 {
64
+ namespace base {
65
+
66
+ using OnceType = std::atomic<uint8_t>;
67
+
68
+ #define V8_ONCE_INIT \
69
+ { 0 }
70
+
71
+ #define V8_DECLARE_ONCE(NAME) ::v8::base::OnceType NAME
72
+
73
+ enum : uint8_t {
74
+ ONCE_STATE_UNINITIALIZED = 0,
75
+ ONCE_STATE_EXECUTING_FUNCTION = 1,
76
+ ONCE_STATE_DONE = 2
77
+ };
78
+
79
+ using PointerArgFunction = void (*)(void* arg);
80
+
81
+ template <typename... Args>
82
+ struct FunctionWithArgs {
83
+ using type = void (*)(Args...);
84
+ };
85
+
86
+ V8_BASE_EXPORT void CallOnceImpl(OnceType* once,
87
+ std::function<void()> init_func);
88
+
89
+ inline void CallOnce(OnceType* once, std::function<void()> init_func) {
90
+ if (once->load(std::memory_order_acquire) != ONCE_STATE_DONE) {
91
+ CallOnceImpl(once, init_func);
92
+ }
93
+ }
94
+
95
+ template <typename... Args, typename = std::enable_if_t<
96
+ conjunction<std::is_scalar<Args>...>::value>>
97
+ inline void CallOnce(OnceType* once,
98
+ typename FunctionWithArgs<Args...>::type init_func,
99
+ Args... args) {
100
+ if (once->load(std::memory_order_acquire) != ONCE_STATE_DONE) {
101
+ CallOnceImpl(once, [=]() { init_func(args...); });
102
+ }
103
+ }
104
+
105
+ } // namespace base
106
+ } // namespace v8
107
+
108
+ #endif // V8_BASE_ONCE_H_