@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,9 @@
1
+ #ifndef BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A
2
+ #define BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A
3
+
4
+ #include <string>
5
+
6
+ std::string base64_encode(const char* , unsigned int len);
7
+ std::string base64_decode(std::string const& s);
8
+
9
+ #endif /* BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A */
@@ -0,0 +1,95 @@
1
+ // Copyright 2018 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_ADDRESS_REGION_H_
6
+ #define V8_BASE_ADDRESS_REGION_H_
7
+
8
+ #include <iostream>
9
+
10
+ #include "src/base/macros.h"
11
+
12
+ namespace v8 {
13
+ namespace base {
14
+
15
+ // Helper class representing an address region of certain size.
16
+ class AddressRegion {
17
+ public:
18
+ // Function object that compares the start address of two regions. Usable as
19
+ // compare function on std data structures and algorithms.
20
+ struct StartAddressLess {
21
+ bool operator()(base::AddressRegion a, base::AddressRegion b) const {
22
+ return a.begin() < b.begin();
23
+ }
24
+ };
25
+
26
+ using Address = uintptr_t;
27
+
28
+ constexpr AddressRegion() = default;
29
+
30
+ constexpr AddressRegion(Address address, size_t size)
31
+ : address_(address), size_(size) {}
32
+
33
+ Address begin() const { return address_; }
34
+ Address end() const { return address_ + size_; }
35
+
36
+ size_t size() const { return size_; }
37
+ void set_size(size_t size) { size_ = size; }
38
+
39
+ bool is_empty() const { return size_ == 0; }
40
+
41
+ bool contains(Address address) const {
42
+ STATIC_ASSERT(std::is_unsigned<Address>::value);
43
+ return (address - begin()) < size();
44
+ }
45
+
46
+ bool contains(Address address, size_t size) const {
47
+ STATIC_ASSERT(std::is_unsigned<Address>::value);
48
+ Address offset = address - begin();
49
+ return (offset < size_) && (offset + size <= size_);
50
+ }
51
+
52
+ bool contains(AddressRegion region) const {
53
+ return contains(region.address_, region.size_);
54
+ }
55
+
56
+ base::AddressRegion GetOverlap(AddressRegion region) const {
57
+ Address overlap_start = std::max(begin(), region.begin());
58
+ Address overlap_end =
59
+ std::max(overlap_start, std::min(end(), region.end()));
60
+ return {overlap_start, overlap_end - overlap_start};
61
+ }
62
+
63
+ bool operator==(AddressRegion other) const {
64
+ return address_ == other.address_ && size_ == other.size_;
65
+ }
66
+
67
+ bool operator!=(AddressRegion other) const {
68
+ return address_ != other.address_ || size_ != other.size_;
69
+ }
70
+
71
+ private:
72
+ Address address_ = 0;
73
+ size_t size_ = 0;
74
+ };
75
+ ASSERT_TRIVIALLY_COPYABLE(AddressRegion);
76
+
77
+ // Construct an AddressRegion from anything providing a {data()} and {size()}
78
+ // accessor.
79
+ template <typename Container,
80
+ typename = decltype(std::declval<Container>().data()),
81
+ typename = decltype(std::declval<Container>().size())>
82
+ inline constexpr AddressRegion AddressRegionOf(Container&& c) {
83
+ return AddressRegion{reinterpret_cast<AddressRegion::Address>(c.data()),
84
+ sizeof(*c.data()) * c.size()};
85
+ }
86
+
87
+ inline std::ostream& operator<<(std::ostream& out, AddressRegion region) {
88
+ return out << "[" << reinterpret_cast<void*>(region.begin()) << "+"
89
+ << region.size() << "]";
90
+ }
91
+
92
+ } // namespace base
93
+ } // namespace v8
94
+
95
+ #endif // V8_BASE_ADDRESS_REGION_H_
@@ -0,0 +1,219 @@
1
+ // Copyright 2015 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_ATOMIC_UTILS_H_
6
+ #define V8_BASE_ATOMIC_UTILS_H_
7
+
8
+ #include <limits.h>
9
+ #include <type_traits>
10
+
11
+ #include "src/base/atomicops.h"
12
+ #include "src/base/macros.h"
13
+
14
+ namespace v8 {
15
+ namespace base {
16
+
17
+ // Deprecated. Use std::atomic<T> for new code.
18
+ // Flag using T atomically. Also accepts void* as T.
19
+ template <typename T>
20
+ class AtomicValue {
21
+ public:
22
+ AtomicValue() : value_(0) {}
23
+
24
+ explicit AtomicValue(T initial)
25
+ : value_(cast_helper<T>::to_storage_type(initial)) {}
26
+
27
+ V8_INLINE T Value() const {
28
+ return cast_helper<T>::to_return_type(base::Acquire_Load(&value_));
29
+ }
30
+
31
+ V8_INLINE void SetValue(T new_value) {
32
+ base::Release_Store(&value_, cast_helper<T>::to_storage_type(new_value));
33
+ }
34
+
35
+ private:
36
+ STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
37
+
38
+ template <typename S>
39
+ struct cast_helper {
40
+ static base::AtomicWord to_storage_type(S value) {
41
+ return static_cast<base::AtomicWord>(value);
42
+ }
43
+ static S to_return_type(base::AtomicWord value) {
44
+ return static_cast<S>(value);
45
+ }
46
+ };
47
+
48
+ template <typename S>
49
+ struct cast_helper<S*> {
50
+ static base::AtomicWord to_storage_type(S* value) {
51
+ return reinterpret_cast<base::AtomicWord>(value);
52
+ }
53
+ static S* to_return_type(base::AtomicWord value) {
54
+ return reinterpret_cast<S*>(value);
55
+ }
56
+ };
57
+
58
+ base::AtomicWord value_;
59
+ };
60
+
61
+ // Provides atomic operations for a values stored at some address.
62
+ template <typename TAtomicStorageType>
63
+ class AsAtomicImpl {
64
+ public:
65
+ using AtomicStorageType = TAtomicStorageType;
66
+
67
+ template <typename T>
68
+ static T Acquire_Load(T* addr) {
69
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
70
+ return cast_helper<T>::to_return_type(
71
+ base::Acquire_Load(to_storage_addr(addr)));
72
+ }
73
+
74
+ template <typename T>
75
+ static T Relaxed_Load(T* addr) {
76
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
77
+ return cast_helper<T>::to_return_type(
78
+ base::Relaxed_Load(to_storage_addr(addr)));
79
+ }
80
+
81
+ template <typename T>
82
+ static void Release_Store(T* addr,
83
+ typename std::remove_reference<T>::type new_value) {
84
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
85
+ base::Release_Store(to_storage_addr(addr),
86
+ cast_helper<T>::to_storage_type(new_value));
87
+ }
88
+
89
+ template <typename T>
90
+ static void Relaxed_Store(T* addr,
91
+ typename std::remove_reference<T>::type new_value) {
92
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
93
+ base::Relaxed_Store(to_storage_addr(addr),
94
+ cast_helper<T>::to_storage_type(new_value));
95
+ }
96
+
97
+ template <typename T>
98
+ static T Release_CompareAndSwap(
99
+ T* addr, typename std::remove_reference<T>::type old_value,
100
+ typename std::remove_reference<T>::type new_value) {
101
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
102
+ return cast_helper<T>::to_return_type(base::Release_CompareAndSwap(
103
+ to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
104
+ cast_helper<T>::to_storage_type(new_value)));
105
+ }
106
+
107
+ template <typename T>
108
+ static T Relaxed_CompareAndSwap(
109
+ T* addr, typename std::remove_reference<T>::type old_value,
110
+ typename std::remove_reference<T>::type new_value) {
111
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
112
+ return cast_helper<T>::to_return_type(base::Relaxed_CompareAndSwap(
113
+ to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
114
+ cast_helper<T>::to_storage_type(new_value)));
115
+ }
116
+
117
+ template <typename T>
118
+ static T AcquireRelease_CompareAndSwap(
119
+ T* addr, typename std::remove_reference<T>::type old_value,
120
+ typename std::remove_reference<T>::type new_value) {
121
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
122
+ return cast_helper<T>::to_return_type(base::AcquireRelease_CompareAndSwap(
123
+ to_storage_addr(addr), cast_helper<T>::to_storage_type(old_value),
124
+ cast_helper<T>::to_storage_type(new_value)));
125
+ }
126
+
127
+ // Atomically sets bits selected by the mask to the given value.
128
+ // Returns false if the bits are already set as needed.
129
+ template <typename T>
130
+ static bool SetBits(T* addr, T bits, T mask) {
131
+ STATIC_ASSERT(sizeof(T) <= sizeof(AtomicStorageType));
132
+ DCHECK_EQ(bits & ~mask, static_cast<T>(0));
133
+ T old_value = Relaxed_Load(addr);
134
+ T new_value, old_value_before_cas;
135
+ do {
136
+ if ((old_value & mask) == bits) return false;
137
+ new_value = (old_value & ~mask) | bits;
138
+ old_value_before_cas = old_value;
139
+ old_value = Release_CompareAndSwap(addr, old_value, new_value);
140
+ } while (old_value != old_value_before_cas);
141
+ return true;
142
+ }
143
+
144
+ private:
145
+ template <typename U>
146
+ struct cast_helper {
147
+ static AtomicStorageType to_storage_type(U value) {
148
+ return static_cast<AtomicStorageType>(value);
149
+ }
150
+ static U to_return_type(AtomicStorageType value) {
151
+ return static_cast<U>(value);
152
+ }
153
+ };
154
+
155
+ template <typename U>
156
+ struct cast_helper<U*> {
157
+ static AtomicStorageType to_storage_type(U* value) {
158
+ return reinterpret_cast<AtomicStorageType>(value);
159
+ }
160
+ static U* to_return_type(AtomicStorageType value) {
161
+ return reinterpret_cast<U*>(value);
162
+ }
163
+ };
164
+
165
+ template <typename T>
166
+ static AtomicStorageType* to_storage_addr(T* value) {
167
+ return reinterpret_cast<AtomicStorageType*>(value);
168
+ }
169
+ template <typename T>
170
+ static const AtomicStorageType* to_storage_addr(const T* value) {
171
+ return reinterpret_cast<const AtomicStorageType*>(value);
172
+ }
173
+ };
174
+
175
+ using AsAtomic8 = AsAtomicImpl<base::Atomic8>;
176
+ using AsAtomic32 = AsAtomicImpl<base::Atomic32>;
177
+ using AsAtomicWord = AsAtomicImpl<base::AtomicWord>;
178
+
179
+ // This is similar to AsAtomicWord but it explicitly deletes functionality
180
+ // provided atomic access to bit representation of stored values.
181
+ template <typename TAtomicStorageType>
182
+ class AsAtomicPointerImpl : public AsAtomicImpl<TAtomicStorageType> {
183
+ public:
184
+ template <typename T>
185
+ static bool SetBits(T* addr, T bits, T mask) = delete;
186
+ };
187
+
188
+ using AsAtomicPointer = AsAtomicPointerImpl<base::AtomicWord>;
189
+
190
+ template <typename T,
191
+ typename = typename std::enable_if<std::is_unsigned<T>::value>::type>
192
+ inline void CheckedIncrement(std::atomic<T>* number, T amount) {
193
+ const T old = number->fetch_add(amount);
194
+ DCHECK_GE(old + amount, old);
195
+ USE(old);
196
+ }
197
+
198
+ template <typename T,
199
+ typename = typename std::enable_if<std::is_unsigned<T>::value>::type>
200
+ inline void CheckedDecrement(std::atomic<T>* number, T amount) {
201
+ const T old = number->fetch_sub(amount);
202
+ DCHECK_GE(old, amount);
203
+ USE(old);
204
+ }
205
+
206
+ template <typename T>
207
+ V8_INLINE std::atomic<T>* AsAtomicPtr(T* t) {
208
+ return reinterpret_cast<std::atomic<T>*>(t);
209
+ }
210
+
211
+ template <typename T>
212
+ V8_INLINE const std::atomic<T>* AsAtomicPtr(const T* t) {
213
+ return reinterpret_cast<const std::atomic<T>*>(t);
214
+ }
215
+
216
+ } // namespace base
217
+ } // namespace v8
218
+
219
+ #endif // V8_BASE_ATOMIC_UTILS_H_
@@ -0,0 +1,332 @@
1
+ // Copyright 2010 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
+ // The routines exported by this module are subtle. If you use them, even if
6
+ // you get the code right, it will depend on careful reasoning about atomicity
7
+ // and memory ordering; it will be less readable, and harder to maintain. If
8
+ // you plan to use these routines, you should have a good reason, such as solid
9
+ // evidence that performance would otherwise suffer, or there being no
10
+ // alternative. You should assume only properties explicitly guaranteed by the
11
+ // specifications in this file. You are almost certainly _not_ writing code
12
+ // just for the x86; if you assume x86 semantics, x86 hardware bugs and
13
+ // implementations on other archtectures will cause your code to break. If you
14
+ // do not know what you are doing, avoid these routines, and use a Mutex.
15
+ //
16
+ // It is incorrect to make direct assignments to/from an atomic variable.
17
+ // You should use one of the Load or Store routines. The Relaxed versions
18
+ // are provided when no fences are needed:
19
+ // Relaxed_Store()
20
+ // Relaxed_Load()
21
+ // Although there are currently no compiler enforcement, you are encouraged
22
+ // to use these.
23
+ //
24
+
25
+ #ifndef V8_BASE_ATOMICOPS_H_
26
+ #define V8_BASE_ATOMICOPS_H_
27
+
28
+ #include <stdint.h>
29
+
30
+ #include <atomic>
31
+
32
+ // Small C++ header which defines implementation specific macros used to
33
+ // identify the STL implementation.
34
+ // - libc++: captures __config for _LIBCPP_VERSION
35
+ // - libstdc++: captures bits/c++config.h for __GLIBCXX__
36
+ #include <cstddef>
37
+
38
+ #include "src/base/base-export.h"
39
+ #include "src/base/build_config.h"
40
+ #include "src/base/macros.h"
41
+
42
+ #if defined(V8_OS_STARBOARD)
43
+ #include "starboard/atomic.h"
44
+
45
+ #if SB_API_VERSION < 10
46
+ #error Your version of Starboard must support SbAtomic8 in order to use V8.
47
+ #endif // SB_API_VERSION < 10
48
+ #endif // V8_OS_STARBOARD
49
+
50
+ namespace v8 {
51
+ namespace base {
52
+
53
+ #ifdef V8_OS_STARBOARD
54
+ using Atomic8 = SbAtomic8;
55
+ using Atomic16 = int16_t;
56
+ using Atomic32 = SbAtomic32;
57
+ #if SB_IS_64_BIT
58
+ using Atomic64 = SbAtomic64;
59
+ #endif
60
+ #else
61
+ using Atomic8 = char;
62
+ using Atomic16 = int16_t;
63
+ using Atomic32 = int32_t;
64
+ #if defined(V8_HOST_ARCH_64_BIT)
65
+ // We need to be able to go between Atomic64 and AtomicWord implicitly. This
66
+ // means Atomic64 and AtomicWord should be the same type on 64-bit.
67
+ #if defined(__ILP32__)
68
+ using Atomic64 = int64_t;
69
+ #else
70
+ using Atomic64 = intptr_t;
71
+ #endif // defined(__ILP32__)
72
+ #endif // defined(V8_HOST_ARCH_64_BIT)
73
+ #endif // V8_OS_STARBOARD
74
+
75
+ // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
76
+ // Atomic64 routines below, depending on your architecture.
77
+ #if defined(V8_OS_STARBOARD)
78
+ using AtomicWord = SbAtomicPtr;
79
+ #else
80
+ using AtomicWord = intptr_t;
81
+ #endif
82
+
83
+ namespace helper {
84
+ template <typename T>
85
+ volatile std::atomic<T>* to_std_atomic(volatile T* ptr) {
86
+ return reinterpret_cast<volatile std::atomic<T>*>(ptr);
87
+ }
88
+ template <typename T>
89
+ volatile const std::atomic<T>* to_std_atomic_const(volatile const T* ptr) {
90
+ return reinterpret_cast<volatile const std::atomic<T>*>(ptr);
91
+ }
92
+ } // namespace helper
93
+
94
+ inline void SeqCst_MemoryFence() {
95
+ std::atomic_thread_fence(std::memory_order_seq_cst);
96
+ }
97
+
98
+ // Atomically execute:
99
+ // result = *ptr;
100
+ // if (result == old_value)
101
+ // *ptr = new_value;
102
+ // return result;
103
+ //
104
+ // I.e. replace |*ptr| with |new_value| if |*ptr| used to be |old_value|.
105
+ // Always return the value of |*ptr| before the operation.
106
+ // Acquire, Relaxed, Release correspond to standard C++ memory orders.
107
+ inline Atomic8 Relaxed_CompareAndSwap(volatile Atomic8* ptr, Atomic8 old_value,
108
+ Atomic8 new_value) {
109
+ std::atomic_compare_exchange_strong_explicit(
110
+ helper::to_std_atomic(ptr), &old_value, new_value,
111
+ std::memory_order_relaxed, std::memory_order_relaxed);
112
+ return old_value;
113
+ }
114
+
115
+ inline Atomic16 Relaxed_CompareAndSwap(volatile Atomic16* ptr,
116
+ Atomic16 old_value, Atomic16 new_value) {
117
+ std::atomic_compare_exchange_strong_explicit(
118
+ helper::to_std_atomic(ptr), &old_value, new_value,
119
+ std::memory_order_relaxed, std::memory_order_relaxed);
120
+ return old_value;
121
+ }
122
+
123
+ inline Atomic32 Relaxed_CompareAndSwap(volatile Atomic32* ptr,
124
+ Atomic32 old_value, Atomic32 new_value) {
125
+ std::atomic_compare_exchange_strong_explicit(
126
+ helper::to_std_atomic(ptr), &old_value, new_value,
127
+ std::memory_order_relaxed, std::memory_order_relaxed);
128
+ return old_value;
129
+ }
130
+
131
+ inline Atomic32 Relaxed_AtomicExchange(volatile Atomic32* ptr,
132
+ Atomic32 new_value) {
133
+ return std::atomic_exchange_explicit(helper::to_std_atomic(ptr), new_value,
134
+ std::memory_order_relaxed);
135
+ }
136
+
137
+ inline Atomic32 Relaxed_AtomicIncrement(volatile Atomic32* ptr,
138
+ Atomic32 increment) {
139
+ return increment + std::atomic_fetch_add_explicit(helper::to_std_atomic(ptr),
140
+ increment,
141
+ std::memory_order_relaxed);
142
+ }
143
+
144
+ inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
145
+ Atomic32 old_value, Atomic32 new_value) {
146
+ atomic_compare_exchange_strong_explicit(
147
+ helper::to_std_atomic(ptr), &old_value, new_value,
148
+ std::memory_order_acquire, std::memory_order_acquire);
149
+ return old_value;
150
+ }
151
+
152
+ inline Atomic8 Release_CompareAndSwap(volatile Atomic8* ptr, Atomic8 old_value,
153
+ Atomic8 new_value) {
154
+ bool result = atomic_compare_exchange_strong_explicit(
155
+ helper::to_std_atomic(ptr), &old_value, new_value,
156
+ std::memory_order_release, std::memory_order_relaxed);
157
+ USE(result); // Make gcc compiler happy.
158
+ return old_value;
159
+ }
160
+
161
+ inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
162
+ Atomic32 old_value, Atomic32 new_value) {
163
+ atomic_compare_exchange_strong_explicit(
164
+ helper::to_std_atomic(ptr), &old_value, new_value,
165
+ std::memory_order_release, std::memory_order_relaxed);
166
+ return old_value;
167
+ }
168
+
169
+ inline Atomic32 AcquireRelease_CompareAndSwap(volatile Atomic32* ptr,
170
+ Atomic32 old_value,
171
+ Atomic32 new_value) {
172
+ atomic_compare_exchange_strong_explicit(
173
+ helper::to_std_atomic(ptr), &old_value, new_value,
174
+ std::memory_order_acq_rel, std::memory_order_acquire);
175
+ return old_value;
176
+ }
177
+
178
+ inline void Relaxed_Store(volatile Atomic8* ptr, Atomic8 value) {
179
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
180
+ std::memory_order_relaxed);
181
+ }
182
+
183
+ inline void Relaxed_Store(volatile Atomic16* ptr, Atomic16 value) {
184
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
185
+ std::memory_order_relaxed);
186
+ }
187
+
188
+ inline void Relaxed_Store(volatile Atomic32* ptr, Atomic32 value) {
189
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
190
+ std::memory_order_relaxed);
191
+ }
192
+
193
+ inline void Release_Store(volatile Atomic8* ptr, Atomic8 value) {
194
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
195
+ std::memory_order_release);
196
+ }
197
+
198
+ inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
199
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
200
+ std::memory_order_release);
201
+ }
202
+
203
+ inline Atomic8 Relaxed_Load(volatile const Atomic8* ptr) {
204
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
205
+ std::memory_order_relaxed);
206
+ }
207
+
208
+ inline Atomic16 Relaxed_Load(volatile const Atomic16* ptr) {
209
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
210
+ std::memory_order_relaxed);
211
+ }
212
+
213
+ inline Atomic32 Relaxed_Load(volatile const Atomic32* ptr) {
214
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
215
+ std::memory_order_relaxed);
216
+ }
217
+
218
+ inline Atomic8 Acquire_Load(volatile const Atomic8* ptr) {
219
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
220
+ std::memory_order_acquire);
221
+ }
222
+
223
+ inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
224
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
225
+ std::memory_order_acquire);
226
+ }
227
+
228
+ #if defined(V8_HOST_ARCH_64_BIT)
229
+
230
+ inline Atomic64 Relaxed_CompareAndSwap(volatile Atomic64* ptr,
231
+ Atomic64 old_value, Atomic64 new_value) {
232
+ std::atomic_compare_exchange_strong_explicit(
233
+ helper::to_std_atomic(ptr), &old_value, new_value,
234
+ std::memory_order_relaxed, std::memory_order_relaxed);
235
+ return old_value;
236
+ }
237
+
238
+ inline Atomic64 Relaxed_AtomicExchange(volatile Atomic64* ptr,
239
+ Atomic64 new_value) {
240
+ return std::atomic_exchange_explicit(helper::to_std_atomic(ptr), new_value,
241
+ std::memory_order_relaxed);
242
+ }
243
+
244
+ inline Atomic64 Relaxed_AtomicIncrement(volatile Atomic64* ptr,
245
+ Atomic64 increment) {
246
+ return increment + std::atomic_fetch_add_explicit(helper::to_std_atomic(ptr),
247
+ increment,
248
+ std::memory_order_relaxed);
249
+ }
250
+
251
+ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
252
+ Atomic64 old_value, Atomic64 new_value) {
253
+ std::atomic_compare_exchange_strong_explicit(
254
+ helper::to_std_atomic(ptr), &old_value, new_value,
255
+ std::memory_order_acquire, std::memory_order_acquire);
256
+ return old_value;
257
+ }
258
+
259
+ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
260
+ Atomic64 old_value, Atomic64 new_value) {
261
+ std::atomic_compare_exchange_strong_explicit(
262
+ helper::to_std_atomic(ptr), &old_value, new_value,
263
+ std::memory_order_release, std::memory_order_relaxed);
264
+ return old_value;
265
+ }
266
+
267
+ inline Atomic64 AcquireRelease_CompareAndSwap(volatile Atomic64* ptr,
268
+ Atomic64 old_value,
269
+ Atomic64 new_value) {
270
+ std::atomic_compare_exchange_strong_explicit(
271
+ helper::to_std_atomic(ptr), &old_value, new_value,
272
+ std::memory_order_acq_rel, std::memory_order_acquire);
273
+ return old_value;
274
+ }
275
+
276
+ inline void Relaxed_Store(volatile Atomic64* ptr, Atomic64 value) {
277
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
278
+ std::memory_order_relaxed);
279
+ }
280
+
281
+ inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
282
+ std::atomic_store_explicit(helper::to_std_atomic(ptr), value,
283
+ std::memory_order_release);
284
+ }
285
+
286
+ inline Atomic64 Relaxed_Load(volatile const Atomic64* ptr) {
287
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
288
+ std::memory_order_relaxed);
289
+ }
290
+
291
+ inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
292
+ return std::atomic_load_explicit(helper::to_std_atomic_const(ptr),
293
+ std::memory_order_acquire);
294
+ }
295
+
296
+ #endif // defined(V8_HOST_ARCH_64_BIT)
297
+
298
+ inline void Relaxed_Memcpy(volatile Atomic8* dst, volatile const Atomic8* src,
299
+ size_t bytes) {
300
+ constexpr size_t kAtomicWordSize = sizeof(AtomicWord);
301
+ while (bytes > 0 &&
302
+ !IsAligned(reinterpret_cast<uintptr_t>(dst), kAtomicWordSize)) {
303
+ Relaxed_Store(dst++, Relaxed_Load(src++));
304
+ --bytes;
305
+ }
306
+ if (IsAligned(reinterpret_cast<uintptr_t>(src), kAtomicWordSize) &&
307
+ IsAligned(reinterpret_cast<uintptr_t>(dst), kAtomicWordSize)) {
308
+ while (bytes >= kAtomicWordSize) {
309
+ Relaxed_Store(
310
+ reinterpret_cast<volatile AtomicWord*>(dst),
311
+ Relaxed_Load(reinterpret_cast<const volatile AtomicWord*>(src)));
312
+ dst += kAtomicWordSize;
313
+ src += kAtomicWordSize;
314
+ bytes -= kAtomicWordSize;
315
+ }
316
+ }
317
+ while (bytes > 0) {
318
+ Relaxed_Store(dst++, Relaxed_Load(src++));
319
+ --bytes;
320
+ }
321
+ }
322
+
323
+ } // namespace base
324
+ } // namespace v8
325
+
326
+ // On some platforms we need additional declarations to make
327
+ // AtomicWord compatible with our other Atomic* types.
328
+ #if defined(V8_OS_MACOSX) || defined(V8_OS_OPENBSD) || defined(V8_OS_AIX)
329
+ #include "src/base/atomicops_internals_atomicword_compat.h"
330
+ #endif
331
+
332
+ #endif // V8_BASE_ATOMICOPS_H_