@triniwiz/nativescript-masonkit 1.0.0-alpha.8 → 1.0.0-beta.0

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 (397) hide show
  1. package/button/index.android.d.ts +13 -0
  2. package/button/index.android.js +56 -0
  3. package/button/index.android.js.map +1 -0
  4. package/button/index.ios.d.ts +21 -0
  5. package/button/index.ios.js +216 -0
  6. package/button/index.ios.js.map +1 -0
  7. package/common.d.ts +78 -33
  8. package/common.js +1121 -251
  9. package/common.js.map +1 -1
  10. package/img/index.android.d.ts +10 -0
  11. package/img/index.android.js +40 -0
  12. package/img/index.android.js.map +1 -0
  13. package/img/index.ios.d.ts +13 -0
  14. package/img/index.ios.js +102 -0
  15. package/img/index.ios.js.map +1 -0
  16. package/index.android.d.ts +6 -34
  17. package/index.android.js +6 -139
  18. package/index.android.js.map +1 -1
  19. package/index.d.ts +88 -60
  20. package/index.ios.d.ts +6 -48
  21. package/index.ios.js +6 -355
  22. package/index.ios.js.map +1 -1
  23. package/package.json +5 -2
  24. package/platforms/android/include.gradle +5 -1
  25. package/platforms/android/masonkit-release.aar +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +794 -284
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason.h +0 -5
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/NSObject+MasonElement_Defaults.h +100 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +118 -93
  30. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  32. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +58079 -23135
  34. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +1234 -255
  35. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +1234 -255
  37. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  38. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4252 -1932
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +1588 -568
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason.h +0 -5
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/NSObject+MasonElement_Defaults.h +100 -0
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +118 -93
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +58076 -23132
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1211 -232
  49. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  50. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1211 -232
  51. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +58076 -23132
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1211 -232
  53. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  54. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1211 -232
  55. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +31 -31
  56. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  57. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4246 -1932
  58. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +4124 -1883
  59. package/scroll/index.android.d.ts +12 -0
  60. package/scroll/index.android.js +50 -0
  61. package/scroll/index.android.js.map +1 -0
  62. package/scroll/index.ios.d.ts +14 -0
  63. package/scroll/index.ios.js +120 -0
  64. package/scroll/index.ios.js.map +1 -0
  65. package/style.d.ts +110 -53
  66. package/style.js +1176 -110
  67. package/style.js.map +1 -1
  68. package/text/index.android.d.ts +30 -0
  69. package/text/index.android.js +124 -0
  70. package/text/index.android.js.map +1 -0
  71. package/text/index.ios.d.ts +38 -0
  72. package/text/index.ios.js +251 -0
  73. package/text/index.ios.js.map +1 -0
  74. package/tree/index.android.d.ts +28 -0
  75. package/tree/index.android.js +77 -0
  76. package/tree/index.android.js.map +1 -0
  77. package/tree/index.ios.d.ts +29 -0
  78. package/tree/index.ios.js +76 -0
  79. package/tree/index.ios.js.map +1 -0
  80. package/utils/index.android.d.ts +187 -0
  81. package/utils/index.android.js +514 -0
  82. package/utils/index.android.js.map +1 -0
  83. package/utils/index.ios.d.ts +198 -0
  84. package/utils/index.ios.js +710 -0
  85. package/utils/index.ios.js.map +1 -0
  86. package/view/index.android.d.ts +12 -0
  87. package/view/index.android.js +50 -0
  88. package/view/index.android.js.map +1 -0
  89. package/view/index.ios.d.ts +16 -0
  90. package/view/index.ios.js +124 -0
  91. package/view/index.ios.js.map +1 -0
  92. package/web.d.ts +55 -0
  93. package/web.js +189 -0
  94. package/web.js.map +1 -0
  95. package/helpers.d.ts +0 -255
  96. package/helpers.js +0 -1318
  97. package/helpers.js.map +0 -1
  98. package/node.d.ts +0 -2
  99. package/node.js +0 -3
  100. package/node.js.map +0 -1
  101. package/platforms/ios/Podfile +0 -1
  102. package/platforms/ios/build.xcconfig +0 -5
  103. package/platforms/ios/prebuild.sh +0 -101
  104. package/platforms/new_native_src/cpp/Caches.cpp +0 -36
  105. package/platforms/new_native_src/cpp/Caches.h +0 -42
  106. package/platforms/new_native_src/cpp/Common.h +0 -34
  107. package/platforms/new_native_src/cpp/ConcurrentMap.h +0 -57
  108. package/platforms/new_native_src/cpp/Helpers.cpp +0 -101
  109. package/platforms/new_native_src/cpp/Helpers.h +0 -364
  110. package/platforms/new_native_src/cpp/MasonImpl.cpp +0 -68
  111. package/platforms/new_native_src/cpp/MasonImpl.h +0 -40
  112. package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +0 -89
  113. package/platforms/new_native_src/cpp/MasonNodeImpl.h +0 -47
  114. package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +0 -2181
  115. package/platforms/new_native_src/cpp/MasonStyleImpl.h +0 -420
  116. package/platforms/new_native_src/cpp/include/mason_native.h +0 -972
  117. package/platforms/new_native_src/cpp/include/robin_hood.h +0 -2544
  118. package/src-native/pods/Headers/include/APIDesign.md +0 -72
  119. package/src-native/pods/Headers/include/DEPS +0 -10
  120. package/src-native/pods/Headers/include/DIR_METADATA +0 -11
  121. package/src-native/pods/Headers/include/OWNERS +0 -23
  122. package/src-native/pods/Headers/include/cppgc/DEPS +0 -8
  123. package/src-native/pods/Headers/include/cppgc/OWNERS +0 -2
  124. package/src-native/pods/Headers/include/cppgc/README.md +0 -133
  125. package/src-native/pods/Headers/include/cppgc/allocation.h +0 -310
  126. package/src-native/pods/Headers/include/cppgc/common.h +0 -29
  127. package/src-native/pods/Headers/include/cppgc/cross-thread-persistent.h +0 -465
  128. package/src-native/pods/Headers/include/cppgc/custom-space.h +0 -97
  129. package/src-native/pods/Headers/include/cppgc/default-platform.h +0 -67
  130. package/src-native/pods/Headers/include/cppgc/ephemeron-pair.h +0 -30
  131. package/src-native/pods/Headers/include/cppgc/explicit-management.h +0 -100
  132. package/src-native/pods/Headers/include/cppgc/garbage-collected.h +0 -106
  133. package/src-native/pods/Headers/include/cppgc/heap-consistency.h +0 -266
  134. package/src-native/pods/Headers/include/cppgc/heap-state.h +0 -82
  135. package/src-native/pods/Headers/include/cppgc/heap-statistics.h +0 -120
  136. package/src-native/pods/Headers/include/cppgc/heap.h +0 -206
  137. package/src-native/pods/Headers/include/cppgc/internal/api-constants.h +0 -55
  138. package/src-native/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +0 -48
  139. package/src-native/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +0 -79
  140. package/src-native/pods/Headers/include/cppgc/internal/compiler-specific.h +0 -38
  141. package/src-native/pods/Headers/include/cppgc/internal/finalizer-trait.h +0 -93
  142. package/src-native/pods/Headers/include/cppgc/internal/gc-info.h +0 -156
  143. package/src-native/pods/Headers/include/cppgc/internal/logging.h +0 -50
  144. package/src-native/pods/Headers/include/cppgc/internal/name-trait.h +0 -122
  145. package/src-native/pods/Headers/include/cppgc/internal/persistent-node.h +0 -216
  146. package/src-native/pods/Headers/include/cppgc/internal/pointer-policies.h +0 -186
  147. package/src-native/pods/Headers/include/cppgc/internal/write-barrier.h +0 -435
  148. package/src-native/pods/Headers/include/cppgc/liveness-broker.h +0 -77
  149. package/src-native/pods/Headers/include/cppgc/macros.h +0 -26
  150. package/src-native/pods/Headers/include/cppgc/member.h +0 -291
  151. package/src-native/pods/Headers/include/cppgc/name-provider.h +0 -65
  152. package/src-native/pods/Headers/include/cppgc/object-size-trait.h +0 -58
  153. package/src-native/pods/Headers/include/cppgc/persistent.h +0 -370
  154. package/src-native/pods/Headers/include/cppgc/platform.h +0 -156
  155. package/src-native/pods/Headers/include/cppgc/prefinalizer.h +0 -75
  156. package/src-native/pods/Headers/include/cppgc/process-heap-statistics.h +0 -36
  157. package/src-native/pods/Headers/include/cppgc/sentinel-pointer.h +0 -32
  158. package/src-native/pods/Headers/include/cppgc/source-location.h +0 -92
  159. package/src-native/pods/Headers/include/cppgc/testing.h +0 -106
  160. package/src-native/pods/Headers/include/cppgc/trace-trait.h +0 -116
  161. package/src-native/pods/Headers/include/cppgc/type-traits.h +0 -240
  162. package/src-native/pods/Headers/include/cppgc/visitor.h +0 -379
  163. package/src-native/pods/Headers/include/js_protocol-1.2.json +0 -936
  164. package/src-native/pods/Headers/include/js_protocol-1.3.json +0 -1112
  165. package/src-native/pods/Headers/include/js_protocol.pdl +0 -1709
  166. package/src-native/pods/Headers/include/libffi/arm64/ffi.h +0 -524
  167. package/src-native/pods/Headers/include/libffi/arm64/ffitarget.h +0 -92
  168. package/src-native/pods/Headers/include/libffi/x86_64/ffi.h +0 -524
  169. package/src-native/pods/Headers/include/libffi/x86_64/ffitarget.h +0 -147
  170. package/src-native/pods/Headers/include/libffi.h +0 -12
  171. package/src-native/pods/Headers/include/libplatform/DEPS +0 -9
  172. package/src-native/pods/Headers/include/libplatform/libplatform-export.h +0 -29
  173. package/src-native/pods/Headers/include/libplatform/libplatform.h +0 -106
  174. package/src-native/pods/Headers/include/libplatform/v8-tracing.h +0 -333
  175. package/src-native/pods/Headers/include/v8-array-buffer.h +0 -433
  176. package/src-native/pods/Headers/include/v8-callbacks.h +0 -397
  177. package/src-native/pods/Headers/include/v8-container.h +0 -129
  178. package/src-native/pods/Headers/include/v8-context.h +0 -407
  179. package/src-native/pods/Headers/include/v8-cppgc.h +0 -215
  180. package/src-native/pods/Headers/include/v8-data.h +0 -80
  181. package/src-native/pods/Headers/include/v8-date.h +0 -43
  182. package/src-native/pods/Headers/include/v8-debug.h +0 -168
  183. package/src-native/pods/Headers/include/v8-embedder-heap.h +0 -218
  184. package/src-native/pods/Headers/include/v8-embedder-state-scope.h +0 -51
  185. package/src-native/pods/Headers/include/v8-exception.h +0 -217
  186. package/src-native/pods/Headers/include/v8-extension.h +0 -62
  187. package/src-native/pods/Headers/include/v8-external.h +0 -37
  188. package/src-native/pods/Headers/include/v8-fast-api-calls.h +0 -939
  189. package/src-native/pods/Headers/include/v8-forward.h +0 -81
  190. package/src-native/pods/Headers/include/v8-function-callback.h +0 -475
  191. package/src-native/pods/Headers/include/v8-function.h +0 -125
  192. package/src-native/pods/Headers/include/v8-initialization.h +0 -315
  193. package/src-native/pods/Headers/include/v8-inspector-protocol.h +0 -13
  194. package/src-native/pods/Headers/include/v8-inspector.h +0 -376
  195. package/src-native/pods/Headers/include/v8-internal.h +0 -661
  196. package/src-native/pods/Headers/include/v8-isolate.h +0 -1709
  197. package/src-native/pods/Headers/include/v8-json.h +0 -47
  198. package/src-native/pods/Headers/include/v8-local-handle.h +0 -455
  199. package/src-native/pods/Headers/include/v8-locker.h +0 -149
  200. package/src-native/pods/Headers/include/v8-maybe.h +0 -137
  201. package/src-native/pods/Headers/include/v8-memory-span.h +0 -43
  202. package/src-native/pods/Headers/include/v8-message.h +0 -216
  203. package/src-native/pods/Headers/include/v8-metrics.h +0 -255
  204. package/src-native/pods/Headers/include/v8-microtask-queue.h +0 -152
  205. package/src-native/pods/Headers/include/v8-microtask.h +0 -28
  206. package/src-native/pods/Headers/include/v8-object.h +0 -775
  207. package/src-native/pods/Headers/include/v8-persistent-handle.h +0 -590
  208. package/src-native/pods/Headers/include/v8-platform.h +0 -1092
  209. package/src-native/pods/Headers/include/v8-primitive-object.h +0 -118
  210. package/src-native/pods/Headers/include/v8-primitive.h +0 -866
  211. package/src-native/pods/Headers/include/v8-profiler.h +0 -1198
  212. package/src-native/pods/Headers/include/v8-promise.h +0 -174
  213. package/src-native/pods/Headers/include/v8-proxy.h +0 -50
  214. package/src-native/pods/Headers/include/v8-regexp.h +0 -105
  215. package/src-native/pods/Headers/include/v8-script.h +0 -748
  216. package/src-native/pods/Headers/include/v8-snapshot.h +0 -196
  217. package/src-native/pods/Headers/include/v8-statistics.h +0 -217
  218. package/src-native/pods/Headers/include/v8-template.h +0 -1079
  219. package/src-native/pods/Headers/include/v8-traced-handle.h +0 -420
  220. package/src-native/pods/Headers/include/v8-typed-array.h +0 -282
  221. package/src-native/pods/Headers/include/v8-unwinder-state.h +0 -31
  222. package/src-native/pods/Headers/include/v8-unwinder.h +0 -132
  223. package/src-native/pods/Headers/include/v8-util.h +0 -658
  224. package/src-native/pods/Headers/include/v8-value-serializer-version.h +0 -24
  225. package/src-native/pods/Headers/include/v8-value-serializer.h +0 -279
  226. package/src-native/pods/Headers/include/v8-value.h +0 -526
  227. package/src-native/pods/Headers/include/v8-version-string.h +0 -38
  228. package/src-native/pods/Headers/include/v8-version.h +0 -20
  229. package/src-native/pods/Headers/include/v8-wasm-trap-handler-posix.h +0 -31
  230. package/src-native/pods/Headers/include/v8-wasm-trap-handler-win.h +0 -28
  231. package/src-native/pods/Headers/include/v8-wasm.h +0 -257
  232. package/src-native/pods/Headers/include/v8-weak-callback-info.h +0 -86
  233. package/src-native/pods/Headers/include/v8.h +0 -88
  234. package/src-native/pods/Headers/include/v8config.h +0 -605
  235. package/src-native/pods/Headers/inspector/InspectorServer.h +0 -20
  236. package/src-native/pods/Headers/inspector/JsV8InspectorClient.h +0 -66
  237. package/src-native/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +0 -1123
  238. package/src-native/pods/Headers/inspector/base64.h +0 -9
  239. package/src-native/pods/Headers/inspector/src/base/address-region.h +0 -95
  240. package/src-native/pods/Headers/inspector/src/base/atomic-utils.h +0 -219
  241. package/src-native/pods/Headers/inspector/src/base/atomicops.h +0 -332
  242. package/src-native/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +0 -89
  243. package/src-native/pods/Headers/inspector/src/base/base-export.h +0 -31
  244. package/src-native/pods/Headers/inspector/src/base/bits.h +0 -343
  245. package/src-native/pods/Headers/inspector/src/base/build_config.h +0 -234
  246. package/src-native/pods/Headers/inspector/src/base/compiler-specific.h +0 -136
  247. package/src-native/pods/Headers/inspector/src/base/export-template.h +0 -163
  248. package/src-native/pods/Headers/inspector/src/base/flags.h +0 -130
  249. package/src-native/pods/Headers/inspector/src/base/immediate-crash.h +0 -162
  250. package/src-native/pods/Headers/inspector/src/base/lazy-instance.h +0 -258
  251. package/src-native/pods/Headers/inspector/src/base/logging.h +0 -417
  252. package/src-native/pods/Headers/inspector/src/base/macros.h +0 -423
  253. package/src-native/pods/Headers/inspector/src/base/memory.h +0 -89
  254. package/src-native/pods/Headers/inspector/src/base/once.h +0 -108
  255. package/src-native/pods/Headers/inspector/src/base/optional.h +0 -882
  256. package/src-native/pods/Headers/inspector/src/base/platform/mutex.h +0 -370
  257. package/src-native/pods/Headers/inspector/src/base/platform/platform.h +0 -476
  258. package/src-native/pods/Headers/inspector/src/base/platform/semaphore.h +0 -108
  259. package/src-native/pods/Headers/inspector/src/base/platform/v8-time.h +0 -513
  260. package/src-native/pods/Headers/inspector/src/base/platform/wrappers.h +0 -73
  261. package/src-native/pods/Headers/inspector/src/base/safe_conversions.h +0 -389
  262. package/src-native/pods/Headers/inspector/src/base/safe_conversions_impl.h +0 -822
  263. package/src-native/pods/Headers/inspector/src/base/template-utils.h +0 -113
  264. package/src-native/pods/Headers/inspector/src/base/v8-fallthrough.h +0 -21
  265. package/src-native/pods/Headers/inspector/src/common/checks.h +0 -38
  266. package/src-native/pods/Headers/inspector/src/common/globals.h +0 -1842
  267. package/src-native/pods/Headers/inspector/src/debug/debug-interface.h +0 -667
  268. package/src-native/pods/Headers/inspector/src/debug/interface-types.h +0 -175
  269. package/src-native/pods/Headers/inspector/src/init/v8.h +0 -52
  270. package/src-native/pods/Headers/inspector/src/inspector/custom-preview.h +0 -24
  271. package/src-native/pods/Headers/inspector/src/inspector/injected-script.h +0 -251
  272. package/src-native/pods/Headers/inspector/src/inspector/inspected-context.h +0 -79
  273. package/src-native/pods/Headers/inspector/src/inspector/protocol/CSS.h +0 -2148
  274. package/src-native/pods/Headers/inspector/src/inspector/protocol/Console.h +0 -211
  275. package/src-native/pods/Headers/inspector/src/inspector/protocol/DOM.h +0 -1008
  276. package/src-native/pods/Headers/inspector/src/inspector/protocol/Debugger.h +0 -892
  277. package/src-native/pods/Headers/inspector/src/inspector/protocol/Forward.h +0 -75
  278. package/src-native/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +0 -346
  279. package/src-native/pods/Headers/inspector/src/inspector/protocol/Log.h +0 -342
  280. package/src-native/pods/Headers/inspector/src/inspector/protocol/Network.h +0 -2528
  281. package/src-native/pods/Headers/inspector/src/inspector/protocol/Overlay.h +0 -281
  282. package/src-native/pods/Headers/inspector/src/inspector/protocol/Page.h +0 -1189
  283. package/src-native/pods/Headers/inspector/src/inspector/protocol/Profiler.h +0 -1001
  284. package/src-native/pods/Headers/inspector/src/inspector/protocol/Protocol.h +0 -617
  285. package/src-native/pods/Headers/inspector/src/inspector/protocol/Runtime.h +0 -1696
  286. package/src-native/pods/Headers/inspector/src/inspector/protocol/Schema.h +0 -146
  287. package/src-native/pods/Headers/inspector/src/inspector/protocol/Security.h +0 -793
  288. package/src-native/pods/Headers/inspector/src/inspector/remote-object-id.h +0 -54
  289. package/src-native/pods/Headers/inspector/src/inspector/search-util.h +0 -26
  290. package/src-native/pods/Headers/inspector/src/inspector/string-16.h +0 -180
  291. package/src-native/pods/Headers/inspector/src/inspector/string-util.h +0 -128
  292. package/src-native/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +0 -48
  293. package/src-native/pods/Headers/inspector/src/inspector/v8-console-message.h +0 -147
  294. package/src-native/pods/Headers/inspector/src/inspector/v8-console.h +0 -173
  295. package/src-native/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +0 -62
  296. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +0 -248
  297. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-id.h +0 -44
  298. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-script.h +0 -123
  299. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger.h +0 -257
  300. package/src-native/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +0 -91
  301. package/src-native/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +0 -80
  302. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +0 -191
  303. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +0 -156
  304. package/src-native/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +0 -34
  305. package/src-native/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +0 -71
  306. package/src-native/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +0 -24
  307. package/src-native/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +0 -70
  308. package/src-native/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +0 -88
  309. package/src-native/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +0 -104
  310. package/src-native/pods/Headers/inspector/src/inspector/v8-regex.h +0 -38
  311. package/src-native/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +0 -157
  312. package/src-native/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +0 -38
  313. package/src-native/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +0 -164
  314. package/src-native/pods/Headers/inspector/src/inspector/v8-string-conversions.h +0 -17
  315. package/src-native/pods/Headers/inspector/src/inspector/v8-value-utils.h +0 -23
  316. package/src-native/pods/Headers/inspector/src/inspector/value-mirror.h +0 -87
  317. package/src-native/pods/Headers/inspector/src/libplatform/default-platform.h +0 -92
  318. package/src-native/pods/Headers/inspector/src/logging/tracing-flags.h +0 -50
  319. package/src-native/pods/Headers/inspector/src/numbers/conversions.h +0 -183
  320. package/src-native/pods/Headers/inspector/src/tracing/trace-event.h +0 -664
  321. package/src-native/pods/Headers/inspector/src/utils/allocation.h +0 -367
  322. package/src-native/pods/Headers/inspector/src/utils/vector.h +0 -324
  323. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +0 -305
  324. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +0 -314
  325. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +0 -62
  326. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +0 -6
  327. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +0 -58
  328. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +0 -47
  329. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +0 -80
  330. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +0 -52
  331. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +0 -26
  332. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +0 -104
  333. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +0 -39
  334. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +0 -406
  335. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +0 -32
  336. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +0 -158
  337. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +0 -99
  338. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +0 -139
  339. package/src-native/pods/Headers/inspector/utils.h +0 -32
  340. package/src-native/pods/Headers/inspector/v8-inspector-platform.h +0 -44
  341. package/src-native/pods/Headers/jsi/decorator.h +0 -762
  342. package/src-native/pods/Headers/jsi/instrumentation.h +0 -117
  343. package/src-native/pods/Headers/jsi/jsi-inl.h +0 -322
  344. package/src-native/pods/Headers/jsi/jsi.h +0 -1387
  345. package/src-native/pods/Headers/jsi/jsilib.h +0 -59
  346. package/src-native/pods/Headers/jsi/threadsafe.h +0 -79
  347. package/src-native/pods/Headers/runtime/ArgConverter.h +0 -61
  348. package/src-native/pods/Headers/runtime/ArrayAdapter.h +0 -13
  349. package/src-native/pods/Headers/runtime/Caches.h +0 -98
  350. package/src-native/pods/Headers/runtime/ClassBuilder.h +0 -61
  351. package/src-native/pods/Headers/runtime/Common.h +0 -9
  352. package/src-native/pods/Headers/runtime/ConcurrentMap.h +0 -55
  353. package/src-native/pods/Headers/runtime/ConcurrentQueue.h +0 -28
  354. package/src-native/pods/Headers/runtime/Console.h +0 -27
  355. package/src-native/pods/Headers/runtime/Constants.h +0 -15
  356. package/src-native/pods/Headers/runtime/DataWrapper.h +0 -671
  357. package/src-native/pods/Headers/runtime/DictionaryAdapter.h +0 -13
  358. package/src-native/pods/Headers/runtime/ExtVector.h +0 -21
  359. package/src-native/pods/Headers/runtime/FFICall.h +0 -105
  360. package/src-native/pods/Headers/runtime/FastEnumerationAdapter.h +0 -13
  361. package/src-native/pods/Headers/runtime/FunctionReference.h +0 -18
  362. package/src-native/pods/Headers/runtime/Helpers.h +0 -84
  363. package/src-native/pods/Headers/runtime/InlineFunctions.h +0 -16
  364. package/src-native/pods/Headers/runtime/Interop.h +0 -202
  365. package/src-native/pods/Headers/runtime/KnownUnknownClassPair.h +0 -35
  366. package/src-native/pods/Headers/runtime/Metadata.h +0 -981
  367. package/src-native/pods/Headers/runtime/MetadataBuilder.h +0 -72
  368. package/src-native/pods/Headers/runtime/MetadataInlines.h +0 -157
  369. package/src-native/pods/Headers/runtime/ModuleInternal.h +0 -59
  370. package/src-native/pods/Headers/runtime/NSDataAdapter.h +0 -13
  371. package/src-native/pods/Headers/runtime/NativeScriptException.h +0 -27
  372. package/src-native/pods/Headers/runtime/ObjectManager.h +0 -31
  373. package/src-native/pods/Headers/runtime/OneByteStringResource.h +0 -21
  374. package/src-native/pods/Headers/runtime/Pointer.h +0 -26
  375. package/src-native/pods/Headers/runtime/PromiseProxy.h +0 -15
  376. package/src-native/pods/Headers/runtime/Reference.h +0 -38
  377. package/src-native/pods/Headers/runtime/Runtime.h +0 -67
  378. package/src-native/pods/Headers/runtime/RuntimeConfig.h +0 -17
  379. package/src-native/pods/Headers/runtime/SetTimeout.h +0 -34
  380. package/src-native/pods/Headers/runtime/SimpleAllocator.h +0 -23
  381. package/src-native/pods/Headers/runtime/StringHasher.h +0 -315
  382. package/src-native/pods/Headers/runtime/SymbolIterator.h +0 -18
  383. package/src-native/pods/Headers/runtime/SymbolLoader.h +0 -27
  384. package/src-native/pods/Headers/runtime/TNSDerivedClass.h +0 -8
  385. package/src-native/pods/Headers/runtime/TSHelpers.h +0 -15
  386. package/src-native/pods/Headers/runtime/Tasks.h +0 -19
  387. package/src-native/pods/Headers/runtime/UnmanagedType.h +0 -21
  388. package/src-native/pods/Headers/runtime/WeakRef.h +0 -15
  389. package/src-native/pods/Headers/runtime/Worker.h +0 -26
  390. package/src-native/pods/Headers/runtime/robin_hood.h +0 -2184
  391. package/src-native/pods/Headers/v8runtime/HostProxy.h +0 -71
  392. package/src-native/pods/Headers/v8runtime/JSIV8ValueConverter.h +0 -70
  393. package/src-native/pods/Headers/v8runtime/V8PointerValue.h +0 -44
  394. package/src-native/pods/Headers/v8runtime/V8Runtime.h +0 -215
  395. package/src-native/pods/Headers/v8runtime/V8RuntimeConfig.h +0 -26
  396. package/src-native/pods/Headers/v8runtime/V8RuntimeFactory.h +0 -21
  397. package/src-native/pods/NativeScript.podspec +0 -68
@@ -1,367 +0,0 @@
1
- // Copyright 2012 the V8 project authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- #ifndef V8_UTILS_ALLOCATION_H_
6
- #define V8_UTILS_ALLOCATION_H_
7
-
8
- #include "include/v8-platform.h"
9
- #include "src/base/address-region.h"
10
- #include "src/base/compiler-specific.h"
11
- #include "src/base/platform/platform.h"
12
- #include "src/common/globals.h"
13
- #include "src/init/v8.h"
14
-
15
- namespace v8 {
16
-
17
- namespace base {
18
- class BoundedPageAllocator;
19
- } // namespace base
20
-
21
- namespace internal {
22
-
23
- class Isolate;
24
-
25
- // This file defines memory allocation functions. If a first attempt at an
26
- // allocation fails, these functions call back into the embedder, then attempt
27
- // the allocation a second time. The embedder callback must not reenter V8.
28
-
29
- // Called when allocation routines fail to allocate, even with a possible retry.
30
- // This function should not return, but should terminate the current processing.
31
- [[noreturn]] V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(
32
- Isolate* isolate, const char* message);
33
-
34
- // Superclass for classes managed with new & delete.
35
- class V8_EXPORT_PRIVATE Malloced {
36
- public:
37
- static void* operator new(size_t size);
38
- static void operator delete(void* p);
39
- };
40
-
41
- template <typename T>
42
- T* NewArray(size_t size) {
43
- T* result = new (std::nothrow) T[size];
44
- if (result == nullptr) {
45
- V8::GetCurrentPlatform()->OnCriticalMemoryPressure();
46
- result = new (std::nothrow) T[size];
47
- if (result == nullptr) FatalProcessOutOfMemory(nullptr, "NewArray");
48
- }
49
- return result;
50
- }
51
-
52
- template <typename T, typename = typename std::enable_if<
53
- base::is_trivially_copyable<T>::value>::type>
54
- T* NewArray(size_t size, T default_val) {
55
- T* result = reinterpret_cast<T*>(NewArray<uint8_t>(sizeof(T) * size));
56
- for (size_t i = 0; i < size; ++i) result[i] = default_val;
57
- return result;
58
- }
59
-
60
- template <typename T>
61
- void DeleteArray(T* array) {
62
- delete[] array;
63
- }
64
-
65
- template <typename T>
66
- struct ArrayDeleter {
67
- void operator()(T* array) { DeleteArray(array); }
68
- };
69
-
70
- template <typename T>
71
- using ArrayUniquePtr = std::unique_ptr<T, ArrayDeleter<T>>;
72
-
73
- // The normal strdup functions use malloc. These versions of StrDup
74
- // and StrNDup uses new and calls the FatalProcessOutOfMemory handler
75
- // if allocation fails.
76
- V8_EXPORT_PRIVATE char* StrDup(const char* str);
77
- char* StrNDup(const char* str, int n);
78
-
79
- // Allocation policy for allocating in the C free store using malloc
80
- // and free. Used as the default policy for lists.
81
- class FreeStoreAllocationPolicy {
82
- public:
83
- template <typename T, typename TypeTag = T[]>
84
- V8_INLINE T* NewArray(size_t length) {
85
- return static_cast<T*>(Malloced::operator new(length * sizeof(T)));
86
- }
87
- template <typename T, typename TypeTag = T[]>
88
- V8_INLINE void DeleteArray(T* p, size_t length) {
89
- Malloced::operator delete(p);
90
- }
91
- };
92
-
93
- // Performs a malloc, with retry logic on failure. Returns nullptr on failure.
94
- // Call free to release memory allocated with this function.
95
- void* AllocWithRetry(size_t size);
96
-
97
- V8_EXPORT_PRIVATE void* AlignedAlloc(size_t size, size_t alignment);
98
- V8_EXPORT_PRIVATE void AlignedFree(void* ptr);
99
-
100
- // Returns platfrom page allocator instance. Guaranteed to be a valid pointer.
101
- V8_EXPORT_PRIVATE v8::PageAllocator* GetPlatformPageAllocator();
102
-
103
- // Sets the given page allocator as the platform page allocator and returns
104
- // the current one. This function *must* be used only for testing purposes.
105
- // It is not thread-safe and the testing infrastructure should ensure that
106
- // the tests do not modify the value simultaneously.
107
- V8_EXPORT_PRIVATE v8::PageAllocator* SetPlatformPageAllocatorForTesting(
108
- v8::PageAllocator* page_allocator);
109
-
110
- // Gets the page granularity for AllocatePages and FreePages. Addresses returned
111
- // by AllocatePages are aligned to this size.
112
- V8_EXPORT_PRIVATE size_t AllocatePageSize();
113
-
114
- // Gets the granularity at which the permissions and release calls can be made.
115
- V8_EXPORT_PRIVATE size_t CommitPageSize();
116
-
117
- // Sets the random seed so that GetRandomMmapAddr() will generate repeatable
118
- // sequences of random mmap addresses.
119
- V8_EXPORT_PRIVATE void SetRandomMmapSeed(int64_t seed);
120
-
121
- // Generate a random address to be used for hinting allocation calls.
122
- V8_EXPORT_PRIVATE void* GetRandomMmapAddr();
123
-
124
- // Allocates memory. Permissions are set according to the access argument.
125
- // |address| is a hint. |size| and |alignment| must be multiples of
126
- // AllocatePageSize(). Returns the address of the allocated memory, with the
127
- // specified size and alignment, or nullptr on failure.
128
- V8_EXPORT_PRIVATE
129
- V8_WARN_UNUSED_RESULT void* AllocatePages(v8::PageAllocator* page_allocator,
130
- void* address, size_t size,
131
- size_t alignment,
132
- PageAllocator::Permission access);
133
-
134
- // Frees memory allocated by a call to AllocatePages. |address| and |size| must
135
- // be multiples of AllocatePageSize(). Returns true on success, otherwise false.
136
- V8_EXPORT_PRIVATE
137
- V8_WARN_UNUSED_RESULT bool FreePages(v8::PageAllocator* page_allocator,
138
- void* address, const size_t size);
139
-
140
- // Releases memory that is no longer needed. The range specified by |address|
141
- // and |size| must be an allocated memory region. |size| and |new_size| must be
142
- // multiples of CommitPageSize(). Memory from |new_size| to |size| is released.
143
- // Released memory is left in an undefined state, so it should not be accessed.
144
- // Returns true on success, otherwise false.
145
- V8_EXPORT_PRIVATE
146
- V8_WARN_UNUSED_RESULT bool ReleasePages(v8::PageAllocator* page_allocator,
147
- void* address, size_t size,
148
- size_t new_size);
149
-
150
- // Sets permissions according to |access|. |address| and |size| must be
151
- // multiples of CommitPageSize(). Setting permission to kNoAccess may
152
- // cause the memory contents to be lost. Returns true on success, otherwise
153
- // false.
154
- V8_EXPORT_PRIVATE
155
- V8_WARN_UNUSED_RESULT bool SetPermissions(v8::PageAllocator* page_allocator,
156
- void* address, size_t size,
157
- PageAllocator::Permission access);
158
- inline bool SetPermissions(v8::PageAllocator* page_allocator, Address address,
159
- size_t size, PageAllocator::Permission access) {
160
- return SetPermissions(page_allocator, reinterpret_cast<void*>(address), size,
161
- access);
162
- }
163
-
164
- // Function that may release reserved memory regions to allow failed allocations
165
- // to succeed. |length| is the amount of memory needed. Returns |true| if memory
166
- // could be released, false otherwise.
167
- V8_EXPORT_PRIVATE bool OnCriticalMemoryPressure(size_t length);
168
-
169
- // Represents and controls an area of reserved memory.
170
- class VirtualMemory final {
171
- public:
172
- enum JitPermission { kNoJit, kMapAsJittable };
173
-
174
- // Empty VirtualMemory object, controlling no reserved memory.
175
- V8_EXPORT_PRIVATE VirtualMemory();
176
-
177
- VirtualMemory(const VirtualMemory&) = delete;
178
- VirtualMemory& operator=(const VirtualMemory&) = delete;
179
-
180
- // Reserves virtual memory containing an area of the given size that is
181
- // aligned per |alignment| rounded up to the |page_allocator|'s allocate page
182
- // size. The |size| must be aligned with |page_allocator|'s commit page size.
183
- // This may not be at the position returned by address().
184
- V8_EXPORT_PRIVATE VirtualMemory(v8::PageAllocator* page_allocator,
185
- size_t size, void* hint, size_t alignment = 1,
186
- JitPermission jit = kNoJit);
187
-
188
- // Construct a virtual memory by assigning it some already mapped address
189
- // and size.
190
- VirtualMemory(v8::PageAllocator* page_allocator, Address address, size_t size)
191
- : page_allocator_(page_allocator), region_(address, size) {
192
- DCHECK_NOT_NULL(page_allocator);
193
- DCHECK(IsAligned(address, page_allocator->AllocatePageSize()));
194
- DCHECK(IsAligned(size, page_allocator->CommitPageSize()));
195
- }
196
-
197
- // Releases the reserved memory, if any, controlled by this VirtualMemory
198
- // object.
199
- V8_EXPORT_PRIVATE ~VirtualMemory();
200
-
201
- // Move constructor.
202
- VirtualMemory(VirtualMemory&& other) V8_NOEXCEPT { *this = std::move(other); }
203
-
204
- // Move assignment operator.
205
- VirtualMemory& operator=(VirtualMemory&& other) V8_NOEXCEPT {
206
- DCHECK(!IsReserved());
207
- page_allocator_ = other.page_allocator_;
208
- region_ = other.region_;
209
- other.Reset();
210
- return *this;
211
- }
212
-
213
- // Returns whether the memory has been reserved.
214
- bool IsReserved() const { return region_.begin() != kNullAddress; }
215
-
216
- // Initialize or resets an embedded VirtualMemory object.
217
- V8_EXPORT_PRIVATE void Reset();
218
-
219
- v8::PageAllocator* page_allocator() { return page_allocator_; }
220
-
221
- const base::AddressRegion& region() const { return region_; }
222
-
223
- // Returns the start address of the reserved memory.
224
- // If the memory was reserved with an alignment, this address is not
225
- // necessarily aligned. The user might need to round it up to a multiple of
226
- // the alignment to get the start of the aligned block.
227
- Address address() const {
228
- DCHECK(IsReserved());
229
- return region_.begin();
230
- }
231
-
232
- Address end() const {
233
- DCHECK(IsReserved());
234
- return region_.end();
235
- }
236
-
237
- // Returns the size of the reserved memory. The returned value is only
238
- // meaningful when IsReserved() returns true.
239
- // If the memory was reserved with an alignment, this size may be larger
240
- // than the requested size.
241
- size_t size() const { return region_.size(); }
242
-
243
- // Sets permissions according to the access argument. address and size must be
244
- // multiples of CommitPageSize(). Returns true on success, otherwise false.
245
- V8_EXPORT_PRIVATE bool SetPermissions(Address address, size_t size,
246
- PageAllocator::Permission access);
247
-
248
- // Releases memory after |free_start|. Returns the number of bytes released.
249
- V8_EXPORT_PRIVATE size_t Release(Address free_start);
250
-
251
- // Frees all memory.
252
- V8_EXPORT_PRIVATE void Free();
253
-
254
- // As with Free but does not write to the VirtualMemory object itself so it
255
- // can be called on a VirtualMemory that is itself not writable.
256
- V8_EXPORT_PRIVATE void FreeReadOnly();
257
-
258
- bool InVM(Address address, size_t size) const {
259
- return region_.contains(address, size);
260
- }
261
-
262
- private:
263
- // Page allocator that controls the virtual memory.
264
- v8::PageAllocator* page_allocator_ = nullptr;
265
- base::AddressRegion region_;
266
- };
267
-
268
- // Represents a VirtualMemory reservation along with a BoundedPageAllocator that
269
- // can be used to allocate within the reservation.
270
- //
271
- // Virtual memory cages are used for both the pointer compression cage and code
272
- // ranges (on platforms that require code ranges) and are configurable via
273
- // ReservationParams.
274
- //
275
- // +------------+-----------+----------- ~~~ -+
276
- // | ... | ... | ... |
277
- // +------------+-----------+------------ ~~~ -+
278
- // ^ ^ ^
279
- // start cage base allocatable base
280
- //
281
- // <------------> <------------------->
282
- // base bias size allocatable size
283
- // <-------------------------------------------->
284
- // reservation size
285
- //
286
- // - The reservation is made using ReservationParams::page_allocator.
287
- // - start is the start of the virtual memory reservation.
288
- // - cage base is the base address of the cage.
289
- // - allocatable base is the cage base rounded up to the nearest
290
- // ReservationParams::page_size, and is the start of the allocatable area for
291
- // the BoundedPageAllocator.
292
- //
293
- // - The base bias is configured by ReservationParams::base_bias_size.
294
- // - The reservation size is configured by ReservationParams::reservation_size.
295
- //
296
- // Additionally,
297
- // - The alignment of the cage base is configured by
298
- // ReservationParams::base_alignment.
299
- // - The page size of the BoundedPageAllocator is configured by
300
- // ReservationParams::page_size.
301
- // - A hint for the value of start can be passed by
302
- // ReservationParams::requested_start_hint.
303
- //
304
- // The configuration is subject to the following alignment requirements.
305
- // Below, AllocatePageSize is short for
306
- // ReservationParams::page_allocator->AllocatePageSize().
307
- //
308
- // - The reservation size must be AllocatePageSize-aligned.
309
- // - If the base alignment is not kAnyBaseAlignment, both the base alignment
310
- // and the base bias size must be AllocatePageSize-aligned.
311
- // - The base alignment may be kAnyBaseAlignment to denote any alignment is
312
- // acceptable. In this case the base bias size does not need to be aligned.
313
- class VirtualMemoryCage {
314
- public:
315
- VirtualMemoryCage();
316
- virtual ~VirtualMemoryCage();
317
-
318
- VirtualMemoryCage(const VirtualMemoryCage&) = delete;
319
- VirtualMemoryCage& operator=(VirtualMemoryCage&) = delete;
320
-
321
- VirtualMemoryCage(VirtualMemoryCage&& other) V8_NOEXCEPT;
322
- VirtualMemoryCage& operator=(VirtualMemoryCage&& other) V8_NOEXCEPT;
323
-
324
- Address base() const { return base_; }
325
-
326
- base::BoundedPageAllocator* page_allocator() const {
327
- return page_allocator_.get();
328
- }
329
-
330
- VirtualMemory* reservation() { return &reservation_; }
331
- const VirtualMemory* reservation() const { return &reservation_; }
332
-
333
- bool IsReserved() const {
334
- DCHECK_EQ(base_ != kNullAddress, reservation_.IsReserved());
335
- return reservation_.IsReserved();
336
- }
337
-
338
- struct ReservationParams {
339
- // The allocator to use to reserve the virtual memory.
340
- v8::PageAllocator* page_allocator;
341
- // See diagram above.
342
- size_t reservation_size;
343
- size_t base_alignment;
344
- size_t base_bias_size;
345
- size_t page_size;
346
- Address requested_start_hint;
347
-
348
- static constexpr size_t kAnyBaseAlignment = 1;
349
- };
350
-
351
- // A number of attempts is made to try to reserve a region that satisfies the
352
- // constraints in params, but this may fail. The base address may be different
353
- // than the one requested.
354
- bool InitReservation(const ReservationParams& params);
355
-
356
- void Free();
357
-
358
- protected:
359
- Address base_ = kNullAddress;
360
- std::unique_ptr<base::BoundedPageAllocator> page_allocator_;
361
- VirtualMemory reservation_;
362
- };
363
-
364
- } // namespace internal
365
- } // namespace v8
366
-
367
- #endif // V8_UTILS_ALLOCATION_H_
@@ -1,324 +0,0 @@
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_UTILS_VECTOR_H_
6
- #define V8_UTILS_VECTOR_H_
7
-
8
- #include <algorithm>
9
- #include <cstring>
10
- #include <iterator>
11
- #include <memory>
12
- #include <type_traits>
13
-
14
- #include "src/common/checks.h"
15
- #include "src/common/globals.h"
16
- #include "src/utils/allocation.h"
17
-
18
- namespace v8 {
19
- namespace internal {
20
-
21
- template <typename T>
22
- class Vector {
23
- public:
24
- using value_type = T;
25
- using iterator = T*;
26
- using const_iterator = const T*;
27
-
28
- constexpr Vector() : start_(nullptr), length_(0) {}
29
-
30
- constexpr Vector(T* data, size_t length) : start_(data), length_(length) {
31
- DCHECK(length == 0 || data != nullptr);
32
- }
33
-
34
- static Vector<T> New(size_t length) {
35
- return Vector<T>(NewArray<T>(length), length);
36
- }
37
-
38
- // Returns a vector using the same backing storage as this one,
39
- // spanning from and including 'from', to but not including 'to'.
40
- Vector<T> SubVector(size_t from, size_t to) const {
41
- DCHECK_LE(from, to);
42
- DCHECK_LE(to, length_);
43
- return Vector<T>(begin() + from, to - from);
44
- }
45
-
46
- // Returns the length of the vector. Only use this if you really need an
47
- // integer return value. Use {size()} otherwise.
48
- int length() const {
49
- DCHECK_GE(std::numeric_limits<int>::max(), length_);
50
- return static_cast<int>(length_);
51
- }
52
-
53
- // Returns the length of the vector as a size_t.
54
- constexpr size_t size() const { return length_; }
55
-
56
- // Returns whether or not the vector is empty.
57
- constexpr bool empty() const { return length_ == 0; }
58
-
59
- // Access individual vector elements - checks bounds in debug mode.
60
- T& operator[](size_t index) const {
61
- DCHECK_LT(index, length_);
62
- return start_[index];
63
- }
64
-
65
- const T& at(size_t index) const { return operator[](index); }
66
-
67
- T& first() { return start_[0]; }
68
-
69
- T& last() {
70
- DCHECK_LT(0, length_);
71
- return start_[length_ - 1];
72
- }
73
-
74
- // Returns a pointer to the start of the data in the vector.
75
- constexpr T* begin() const { return start_; }
76
-
77
- // For consistency with other containers, do also provide a {data} accessor.
78
- constexpr T* data() const { return start_; }
79
-
80
- // Returns a pointer past the end of the data in the vector.
81
- constexpr T* end() const { return start_ + length_; }
82
-
83
- // Returns a clone of this vector with a new backing store.
84
- Vector<T> Clone() const {
85
- T* result = NewArray<T>(length_);
86
- for (size_t i = 0; i < length_; i++) result[i] = start_[i];
87
- return Vector<T>(result, length_);
88
- }
89
-
90
- void Truncate(size_t length) {
91
- DCHECK(length <= length_);
92
- length_ = length;
93
- }
94
-
95
- // Releases the array underlying this vector. Once disposed the
96
- // vector is empty.
97
- void Dispose() {
98
- DeleteArray(start_);
99
- start_ = nullptr;
100
- length_ = 0;
101
- }
102
-
103
- Vector<T> operator+(size_t offset) {
104
- DCHECK_LE(offset, length_);
105
- return Vector<T>(start_ + offset, length_ - offset);
106
- }
107
-
108
- Vector<T> operator+=(size_t offset) {
109
- DCHECK_LE(offset, length_);
110
- start_ += offset;
111
- length_ -= offset;
112
- return *this;
113
- }
114
-
115
- // Implicit conversion from Vector<T> to Vector<const T>.
116
- operator Vector<const T>() const { return {start_, length_}; }
117
-
118
- template <typename S>
119
- static Vector<T> cast(Vector<S> input) {
120
- // Casting is potentially dangerous, so be really restrictive here. This
121
- // might be lifted once we have use cases for that.
122
- STATIC_ASSERT(std::is_pod<S>::value);
123
- STATIC_ASSERT(std::is_pod<T>::value);
124
- DCHECK_EQ(0, (input.size() * sizeof(S)) % sizeof(T));
125
- DCHECK_EQ(0, reinterpret_cast<uintptr_t>(input.begin()) % alignof(T));
126
- return Vector<T>(reinterpret_cast<T*>(input.begin()),
127
- input.size() * sizeof(S) / sizeof(T));
128
- }
129
-
130
- bool operator==(const Vector<const T> other) const {
131
- return std::equal(begin(), end(), other.begin(), other.end());
132
- }
133
-
134
- bool operator!=(const Vector<const T> other) const {
135
- return !operator==(other);
136
- }
137
-
138
- private:
139
- T* start_;
140
- size_t length_;
141
- };
142
-
143
- template <typename T>
144
- class V8_NODISCARD ScopedVector : public Vector<T> {
145
- public:
146
- explicit ScopedVector(size_t length)
147
- : Vector<T>(NewArray<T>(length), length) {}
148
- ~ScopedVector() { DeleteArray(this->begin()); }
149
-
150
- private:
151
- DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedVector);
152
- };
153
-
154
- template <typename T>
155
- class OwnedVector {
156
- public:
157
- MOVE_ONLY_WITH_DEFAULT_CONSTRUCTORS(OwnedVector);
158
- OwnedVector(std::unique_ptr<T[]> data, size_t length)
159
- : data_(std::move(data)), length_(length) {
160
- DCHECK_IMPLIES(length_ > 0, data_ != nullptr);
161
- }
162
-
163
- // Implicit conversion from {OwnedVector<U>} to {OwnedVector<T>}, instantiable
164
- // if {std::unique_ptr<U>} can be converted to {std::unique_ptr<T>}.
165
- // Can be used to convert {OwnedVector<T>} to {OwnedVector<const T>}.
166
- template <typename U,
167
- typename = typename std::enable_if<std::is_convertible<
168
- std::unique_ptr<U>, std::unique_ptr<T>>::value>::type>
169
- OwnedVector(OwnedVector<U>&& other)
170
- : data_(std::move(other.data_)), length_(other.length_) {
171
- STATIC_ASSERT(sizeof(U) == sizeof(T));
172
- other.length_ = 0;
173
- }
174
-
175
- // Returns the length of the vector as a size_t.
176
- constexpr size_t size() const { return length_; }
177
-
178
- // Returns whether or not the vector is empty.
179
- constexpr bool empty() const { return length_ == 0; }
180
-
181
- // Returns the pointer to the start of the data in the vector.
182
- T* start() const {
183
- DCHECK_IMPLIES(length_ > 0, data_ != nullptr);
184
- return data_.get();
185
- }
186
-
187
- constexpr T* begin() const { return start(); }
188
- constexpr T* end() const { return start() + size(); }
189
-
190
- // Access individual vector elements - checks bounds in debug mode.
191
- T& operator[](size_t index) const {
192
- DCHECK_LT(index, length_);
193
- return data_[index];
194
- }
195
-
196
- // Returns a {Vector<T>} view of the data in this vector.
197
- Vector<T> as_vector() const { return Vector<T>(start(), size()); }
198
-
199
- // Releases the backing data from this vector and transfers ownership to the
200
- // caller. This vector will be empty afterwards.
201
- std::unique_ptr<T[]> ReleaseData() {
202
- length_ = 0;
203
- return std::move(data_);
204
- }
205
-
206
- // Allocates a new vector of the specified size via the default allocator.
207
- // Elements in the new vector are value-initialized.
208
- static OwnedVector<T> New(size_t size) {
209
- if (size == 0) return {};
210
- return OwnedVector<T>(std::make_unique<T[]>(size), size);
211
- }
212
-
213
- // Allocates a new vector of the specified size via the default allocator.
214
- // Elements in the new vector are default-initialized.
215
- static OwnedVector<T> NewForOverwrite(size_t size) {
216
- if (size == 0) return {};
217
- // TODO(v8): Use {std::make_unique_for_overwrite} once we allow C++20.
218
- return OwnedVector<T>(std::unique_ptr<T[]>(new T[size]), size);
219
- }
220
-
221
- // Allocates a new vector containing the specified collection of values.
222
- // {Iterator} is the common type of {std::begin} and {std::end} called on a
223
- // {const U&}. This function is only instantiable if that type exists.
224
- template <typename U, typename Iterator = typename std::common_type<
225
- decltype(std::begin(std::declval<const U&>())),
226
- decltype(std::end(std::declval<const U&>()))>::type>
227
- static OwnedVector<T> Of(const U& collection) {
228
- Iterator begin = std::begin(collection);
229
- Iterator end = std::end(collection);
230
- using non_const_t = typename std::remove_const<T>::type;
231
- auto vec =
232
- OwnedVector<non_const_t>::NewForOverwrite(std::distance(begin, end));
233
- std::copy(begin, end, vec.start());
234
- return vec;
235
- }
236
-
237
- bool operator==(std::nullptr_t) const { return data_ == nullptr; }
238
- bool operator!=(std::nullptr_t) const { return data_ != nullptr; }
239
-
240
- private:
241
- template <typename U>
242
- friend class OwnedVector;
243
-
244
- std::unique_ptr<T[]> data_;
245
- size_t length_ = 0;
246
- };
247
-
248
- // The vectors returned by {StaticCharVector}, {CStrVector}, or {OneByteVector}
249
- // do not contain a null-termination byte. If you want the null byte, use
250
- // {ArrayVector}.
251
-
252
- // Known length, constexpr.
253
- template <size_t N>
254
- constexpr Vector<const char> StaticCharVector(const char (&array)[N]) {
255
- return {array, N - 1};
256
- }
257
-
258
- // Unknown length, not constexpr.
259
- inline Vector<const char> CStrVector(const char* data) {
260
- return {data, strlen(data)};
261
- }
262
-
263
- // OneByteVector is never constexpr because the data pointer is
264
- // {reinterpret_cast}ed.
265
- inline Vector<const uint8_t> OneByteVector(const char* data, size_t length) {
266
- return {reinterpret_cast<const uint8_t*>(data), length};
267
- }
268
-
269
- inline Vector<const uint8_t> OneByteVector(const char* data) {
270
- return OneByteVector(data, strlen(data));
271
- }
272
-
273
- template <size_t N>
274
- Vector<const uint8_t> StaticOneByteVector(const char (&array)[N]) {
275
- return OneByteVector(array, N - 1);
276
- }
277
-
278
- // For string literals, ArrayVector("foo") returns a vector ['f', 'o', 'o', \0]
279
- // with length 4 and null-termination.
280
- // If you want ['f', 'o', 'o'], use CStrVector("foo").
281
- template <typename T, size_t N>
282
- inline constexpr Vector<T> ArrayVector(T (&arr)[N]) {
283
- return {arr, N};
284
- }
285
-
286
- // Construct a Vector from a start pointer and a size.
287
- template <typename T>
288
- inline constexpr Vector<T> VectorOf(T* start, size_t size) {
289
- return {start, size};
290
- }
291
-
292
- // Construct a Vector from anything providing a {data()} and {size()} accessor.
293
- template <typename Container>
294
- inline constexpr auto VectorOf(Container&& c)
295
- -> decltype(VectorOf(c.data(), c.size())) {
296
- return VectorOf(c.data(), c.size());
297
- }
298
-
299
- // Construct a Vector from an initializer list. The vector can obviously only be
300
- // used as long as the initializer list is live. Valid uses include direct use
301
- // in parameter lists: F(VectorOf({1, 2, 3}));
302
- template <typename T>
303
- inline constexpr Vector<const T> VectorOf(std::initializer_list<T> list) {
304
- return VectorOf(list.begin(), list.size());
305
- }
306
-
307
- template <typename T, size_t kSize>
308
- class EmbeddedVector : public Vector<T> {
309
- public:
310
- EmbeddedVector() : Vector<T>(buffer_, kSize) {}
311
- explicit EmbeddedVector(const T& initial_value) : Vector<T>(buffer_, kSize) {
312
- std::fill_n(buffer_, kSize, initial_value);
313
- }
314
- EmbeddedVector(const EmbeddedVector&) = delete;
315
- EmbeddedVector& operator=(const EmbeddedVector&) = delete;
316
-
317
- private:
318
- T buffer_[kSize];
319
- };
320
-
321
- } // namespace internal
322
- } // namespace v8
323
-
324
- #endif // V8_UTILS_VECTOR_H_