@nativescript/canvas 2.0.0-alpha.10 → 2.0.0-alpha.12

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 (372) hide show
  1. package/Canvas/index.android.d.ts +4 -0
  2. package/Canvas/index.android.js +15 -1
  3. package/Canvas/index.android.js.map +1 -1
  4. package/Canvas/index.ios.js +0 -1
  5. package/Canvas/index.ios.js.map +1 -1
  6. package/WebGL/WebGLRenderingContext/index.js +9 -1
  7. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/platforms/android/canvas-release.aar +0 -0
  10. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  11. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +4 -0
  12. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +46 -0
  13. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  14. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +381 -16
  15. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +3 -0
  16. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +3 -0
  17. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  18. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  19. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +8 -0
  20. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +46 -0
  21. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  22. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  23. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +381 -16
  24. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3 -0
  25. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -0
  26. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +381 -16
  27. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +3 -0
  28. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +3 -0
  29. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +24 -24
  30. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  31. package/platforms/ios/Podfile +1 -1
  32. package/platforms/ios/build.xcconfig +1 -1
  33. package/platforms/ios/src/CanvasModule.h +1 -1
  34. package/platforms/ios/src/cpp/CanvasJSIModule.h +1 -1
  35. package/platforms/ios/src/cpp/CanvasJSIModule.mm +17 -17
  36. package/platforms/ios/src/cpp/Helpers.h +1 -1
  37. package/platforms/ios/src/cpp/ImageAssetImpl.h +1 -1
  38. package/platforms/ios/src/cpp/ImageBitmapImpl.h +1 -1
  39. package/platforms/ios/src/cpp/JSICallback.h +1 -1
  40. package/platforms/ios/src/cpp/JSIReadFileCallback.h +1 -1
  41. package/platforms/ios/src/cpp/TextDecoderImpl.h +1 -1
  42. package/platforms/ios/src/cpp/VecMutableBuffer.h +1 -1
  43. package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +1 -1
  44. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +1 -1
  45. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +1 -1
  46. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +1 -1
  47. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +1 -1
  48. package/platforms/ios/src/cpp/canvas2d/Path2D.h +1 -1
  49. package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +1 -1
  50. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
  51. package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
  52. package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
  53. package/platforms/ios/src/cpp/webgl/WebGLProgram.h +1 -1
  54. package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +1 -1
  55. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
  56. package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +1 -1
  57. package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.mm +1 -1
  58. package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
  59. package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +1 -1
  60. package/platforms/ios/src/cpp/webgl/WebGLTexture.h +1 -1
  61. package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +1 -1
  62. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
  63. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
  64. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
  65. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
  66. package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
  67. package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
  68. package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
  69. package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +1 -1
  70. package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +1 -1
  71. package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
  72. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
  73. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
  74. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
  75. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
  76. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
  77. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
  78. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
  79. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
  80. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +1 -1
  81. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
  82. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
  83. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
  84. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
  85. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
  86. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
  87. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
  88. package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
  89. package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
  90. package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
  91. package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
  92. package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +1 -1
  93. package/pods/Headers/include/APIDesign.md +0 -72
  94. package/pods/Headers/include/DEPS +0 -10
  95. package/pods/Headers/include/DIR_METADATA +0 -11
  96. package/pods/Headers/include/OWNERS +0 -23
  97. package/pods/Headers/include/cppgc/DEPS +0 -8
  98. package/pods/Headers/include/cppgc/OWNERS +0 -2
  99. package/pods/Headers/include/cppgc/README.md +0 -133
  100. package/pods/Headers/include/cppgc/allocation.h +0 -310
  101. package/pods/Headers/include/cppgc/common.h +0 -29
  102. package/pods/Headers/include/cppgc/cross-thread-persistent.h +0 -465
  103. package/pods/Headers/include/cppgc/custom-space.h +0 -97
  104. package/pods/Headers/include/cppgc/default-platform.h +0 -67
  105. package/pods/Headers/include/cppgc/ephemeron-pair.h +0 -30
  106. package/pods/Headers/include/cppgc/explicit-management.h +0 -100
  107. package/pods/Headers/include/cppgc/garbage-collected.h +0 -106
  108. package/pods/Headers/include/cppgc/heap-consistency.h +0 -266
  109. package/pods/Headers/include/cppgc/heap-state.h +0 -82
  110. package/pods/Headers/include/cppgc/heap-statistics.h +0 -120
  111. package/pods/Headers/include/cppgc/heap.h +0 -206
  112. package/pods/Headers/include/cppgc/internal/api-constants.h +0 -55
  113. package/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +0 -48
  114. package/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +0 -79
  115. package/pods/Headers/include/cppgc/internal/compiler-specific.h +0 -38
  116. package/pods/Headers/include/cppgc/internal/finalizer-trait.h +0 -93
  117. package/pods/Headers/include/cppgc/internal/gc-info.h +0 -156
  118. package/pods/Headers/include/cppgc/internal/logging.h +0 -50
  119. package/pods/Headers/include/cppgc/internal/name-trait.h +0 -122
  120. package/pods/Headers/include/cppgc/internal/persistent-node.h +0 -216
  121. package/pods/Headers/include/cppgc/internal/pointer-policies.h +0 -186
  122. package/pods/Headers/include/cppgc/internal/write-barrier.h +0 -435
  123. package/pods/Headers/include/cppgc/liveness-broker.h +0 -77
  124. package/pods/Headers/include/cppgc/macros.h +0 -26
  125. package/pods/Headers/include/cppgc/member.h +0 -291
  126. package/pods/Headers/include/cppgc/name-provider.h +0 -65
  127. package/pods/Headers/include/cppgc/object-size-trait.h +0 -58
  128. package/pods/Headers/include/cppgc/persistent.h +0 -370
  129. package/pods/Headers/include/cppgc/platform.h +0 -156
  130. package/pods/Headers/include/cppgc/prefinalizer.h +0 -75
  131. package/pods/Headers/include/cppgc/process-heap-statistics.h +0 -36
  132. package/pods/Headers/include/cppgc/sentinel-pointer.h +0 -32
  133. package/pods/Headers/include/cppgc/source-location.h +0 -92
  134. package/pods/Headers/include/cppgc/testing.h +0 -106
  135. package/pods/Headers/include/cppgc/trace-trait.h +0 -116
  136. package/pods/Headers/include/cppgc/type-traits.h +0 -240
  137. package/pods/Headers/include/cppgc/visitor.h +0 -379
  138. package/pods/Headers/include/js_protocol-1.2.json +0 -936
  139. package/pods/Headers/include/js_protocol-1.3.json +0 -1112
  140. package/pods/Headers/include/js_protocol.pdl +0 -1709
  141. package/pods/Headers/include/libffi/arm64/ffi.h +0 -524
  142. package/pods/Headers/include/libffi/arm64/ffitarget.h +0 -92
  143. package/pods/Headers/include/libffi/x86_64/ffi.h +0 -524
  144. package/pods/Headers/include/libffi/x86_64/ffitarget.h +0 -147
  145. package/pods/Headers/include/libffi.h +0 -12
  146. package/pods/Headers/include/libplatform/DEPS +0 -9
  147. package/pods/Headers/include/libplatform/libplatform-export.h +0 -29
  148. package/pods/Headers/include/libplatform/libplatform.h +0 -106
  149. package/pods/Headers/include/libplatform/v8-tracing.h +0 -333
  150. package/pods/Headers/include/v8-array-buffer.h +0 -433
  151. package/pods/Headers/include/v8-callbacks.h +0 -397
  152. package/pods/Headers/include/v8-container.h +0 -129
  153. package/pods/Headers/include/v8-context.h +0 -407
  154. package/pods/Headers/include/v8-cppgc.h +0 -215
  155. package/pods/Headers/include/v8-data.h +0 -80
  156. package/pods/Headers/include/v8-date.h +0 -43
  157. package/pods/Headers/include/v8-debug.h +0 -168
  158. package/pods/Headers/include/v8-embedder-heap.h +0 -218
  159. package/pods/Headers/include/v8-embedder-state-scope.h +0 -51
  160. package/pods/Headers/include/v8-exception.h +0 -217
  161. package/pods/Headers/include/v8-extension.h +0 -62
  162. package/pods/Headers/include/v8-external.h +0 -37
  163. package/pods/Headers/include/v8-fast-api-calls.h +0 -939
  164. package/pods/Headers/include/v8-forward.h +0 -81
  165. package/pods/Headers/include/v8-function-callback.h +0 -475
  166. package/pods/Headers/include/v8-function.h +0 -125
  167. package/pods/Headers/include/v8-initialization.h +0 -315
  168. package/pods/Headers/include/v8-inspector-protocol.h +0 -13
  169. package/pods/Headers/include/v8-inspector.h +0 -376
  170. package/pods/Headers/include/v8-internal.h +0 -661
  171. package/pods/Headers/include/v8-isolate.h +0 -1709
  172. package/pods/Headers/include/v8-json.h +0 -47
  173. package/pods/Headers/include/v8-local-handle.h +0 -455
  174. package/pods/Headers/include/v8-locker.h +0 -149
  175. package/pods/Headers/include/v8-maybe.h +0 -137
  176. package/pods/Headers/include/v8-memory-span.h +0 -43
  177. package/pods/Headers/include/v8-message.h +0 -216
  178. package/pods/Headers/include/v8-metrics.h +0 -255
  179. package/pods/Headers/include/v8-microtask-queue.h +0 -152
  180. package/pods/Headers/include/v8-microtask.h +0 -28
  181. package/pods/Headers/include/v8-object.h +0 -775
  182. package/pods/Headers/include/v8-persistent-handle.h +0 -590
  183. package/pods/Headers/include/v8-platform.h +0 -1092
  184. package/pods/Headers/include/v8-primitive-object.h +0 -118
  185. package/pods/Headers/include/v8-primitive.h +0 -866
  186. package/pods/Headers/include/v8-profiler.h +0 -1198
  187. package/pods/Headers/include/v8-promise.h +0 -174
  188. package/pods/Headers/include/v8-proxy.h +0 -50
  189. package/pods/Headers/include/v8-regexp.h +0 -105
  190. package/pods/Headers/include/v8-script.h +0 -748
  191. package/pods/Headers/include/v8-snapshot.h +0 -196
  192. package/pods/Headers/include/v8-statistics.h +0 -217
  193. package/pods/Headers/include/v8-template.h +0 -1079
  194. package/pods/Headers/include/v8-traced-handle.h +0 -420
  195. package/pods/Headers/include/v8-typed-array.h +0 -282
  196. package/pods/Headers/include/v8-unwinder-state.h +0 -31
  197. package/pods/Headers/include/v8-unwinder.h +0 -132
  198. package/pods/Headers/include/v8-util.h +0 -658
  199. package/pods/Headers/include/v8-value-serializer-version.h +0 -24
  200. package/pods/Headers/include/v8-value-serializer.h +0 -279
  201. package/pods/Headers/include/v8-value.h +0 -526
  202. package/pods/Headers/include/v8-version-string.h +0 -38
  203. package/pods/Headers/include/v8-version.h +0 -20
  204. package/pods/Headers/include/v8-wasm-trap-handler-posix.h +0 -31
  205. package/pods/Headers/include/v8-wasm-trap-handler-win.h +0 -28
  206. package/pods/Headers/include/v8-wasm.h +0 -257
  207. package/pods/Headers/include/v8-weak-callback-info.h +0 -86
  208. package/pods/Headers/include/v8.h +0 -88
  209. package/pods/Headers/include/v8config.h +0 -605
  210. package/pods/Headers/inspector/InspectorServer.h +0 -20
  211. package/pods/Headers/inspector/JsV8InspectorClient.h +0 -66
  212. package/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +0 -1123
  213. package/pods/Headers/inspector/base64.h +0 -9
  214. package/pods/Headers/inspector/src/base/address-region.h +0 -95
  215. package/pods/Headers/inspector/src/base/atomic-utils.h +0 -219
  216. package/pods/Headers/inspector/src/base/atomicops.h +0 -332
  217. package/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +0 -89
  218. package/pods/Headers/inspector/src/base/base-export.h +0 -31
  219. package/pods/Headers/inspector/src/base/bits.h +0 -343
  220. package/pods/Headers/inspector/src/base/build_config.h +0 -234
  221. package/pods/Headers/inspector/src/base/compiler-specific.h +0 -136
  222. package/pods/Headers/inspector/src/base/export-template.h +0 -163
  223. package/pods/Headers/inspector/src/base/flags.h +0 -130
  224. package/pods/Headers/inspector/src/base/immediate-crash.h +0 -162
  225. package/pods/Headers/inspector/src/base/lazy-instance.h +0 -258
  226. package/pods/Headers/inspector/src/base/logging.h +0 -417
  227. package/pods/Headers/inspector/src/base/macros.h +0 -423
  228. package/pods/Headers/inspector/src/base/memory.h +0 -89
  229. package/pods/Headers/inspector/src/base/once.h +0 -108
  230. package/pods/Headers/inspector/src/base/optional.h +0 -882
  231. package/pods/Headers/inspector/src/base/platform/mutex.h +0 -370
  232. package/pods/Headers/inspector/src/base/platform/platform.h +0 -476
  233. package/pods/Headers/inspector/src/base/platform/semaphore.h +0 -108
  234. package/pods/Headers/inspector/src/base/platform/v8-time.h +0 -513
  235. package/pods/Headers/inspector/src/base/platform/wrappers.h +0 -73
  236. package/pods/Headers/inspector/src/base/safe_conversions.h +0 -389
  237. package/pods/Headers/inspector/src/base/safe_conversions_impl.h +0 -822
  238. package/pods/Headers/inspector/src/base/template-utils.h +0 -113
  239. package/pods/Headers/inspector/src/base/v8-fallthrough.h +0 -21
  240. package/pods/Headers/inspector/src/common/checks.h +0 -38
  241. package/pods/Headers/inspector/src/common/globals.h +0 -1842
  242. package/pods/Headers/inspector/src/debug/debug-interface.h +0 -667
  243. package/pods/Headers/inspector/src/debug/interface-types.h +0 -175
  244. package/pods/Headers/inspector/src/init/v8.h +0 -52
  245. package/pods/Headers/inspector/src/inspector/custom-preview.h +0 -24
  246. package/pods/Headers/inspector/src/inspector/injected-script.h +0 -251
  247. package/pods/Headers/inspector/src/inspector/inspected-context.h +0 -79
  248. package/pods/Headers/inspector/src/inspector/protocol/CSS.h +0 -2148
  249. package/pods/Headers/inspector/src/inspector/protocol/Console.h +0 -211
  250. package/pods/Headers/inspector/src/inspector/protocol/DOM.h +0 -1008
  251. package/pods/Headers/inspector/src/inspector/protocol/Debugger.h +0 -892
  252. package/pods/Headers/inspector/src/inspector/protocol/Forward.h +0 -75
  253. package/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +0 -346
  254. package/pods/Headers/inspector/src/inspector/protocol/Log.h +0 -342
  255. package/pods/Headers/inspector/src/inspector/protocol/Network.h +0 -2528
  256. package/pods/Headers/inspector/src/inspector/protocol/Overlay.h +0 -281
  257. package/pods/Headers/inspector/src/inspector/protocol/Page.h +0 -1189
  258. package/pods/Headers/inspector/src/inspector/protocol/Profiler.h +0 -1001
  259. package/pods/Headers/inspector/src/inspector/protocol/Protocol.h +0 -617
  260. package/pods/Headers/inspector/src/inspector/protocol/Runtime.h +0 -1696
  261. package/pods/Headers/inspector/src/inspector/protocol/Schema.h +0 -146
  262. package/pods/Headers/inspector/src/inspector/protocol/Security.h +0 -793
  263. package/pods/Headers/inspector/src/inspector/remote-object-id.h +0 -54
  264. package/pods/Headers/inspector/src/inspector/search-util.h +0 -26
  265. package/pods/Headers/inspector/src/inspector/string-16.h +0 -180
  266. package/pods/Headers/inspector/src/inspector/string-util.h +0 -128
  267. package/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +0 -48
  268. package/pods/Headers/inspector/src/inspector/v8-console-message.h +0 -147
  269. package/pods/Headers/inspector/src/inspector/v8-console.h +0 -173
  270. package/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +0 -62
  271. package/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +0 -248
  272. package/pods/Headers/inspector/src/inspector/v8-debugger-id.h +0 -44
  273. package/pods/Headers/inspector/src/inspector/v8-debugger-script.h +0 -123
  274. package/pods/Headers/inspector/src/inspector/v8-debugger.h +0 -257
  275. package/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +0 -91
  276. package/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +0 -80
  277. package/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +0 -191
  278. package/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +0 -156
  279. package/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +0 -34
  280. package/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +0 -71
  281. package/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +0 -24
  282. package/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +0 -70
  283. package/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +0 -88
  284. package/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +0 -104
  285. package/pods/Headers/inspector/src/inspector/v8-regex.h +0 -38
  286. package/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +0 -157
  287. package/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +0 -38
  288. package/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +0 -164
  289. package/pods/Headers/inspector/src/inspector/v8-string-conversions.h +0 -17
  290. package/pods/Headers/inspector/src/inspector/v8-value-utils.h +0 -23
  291. package/pods/Headers/inspector/src/inspector/value-mirror.h +0 -87
  292. package/pods/Headers/inspector/src/libplatform/default-platform.h +0 -92
  293. package/pods/Headers/inspector/src/logging/tracing-flags.h +0 -50
  294. package/pods/Headers/inspector/src/numbers/conversions.h +0 -183
  295. package/pods/Headers/inspector/src/tracing/trace-event.h +0 -664
  296. package/pods/Headers/inspector/src/utils/allocation.h +0 -367
  297. package/pods/Headers/inspector/src/utils/vector.h +0 -324
  298. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +0 -305
  299. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +0 -314
  300. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +0 -62
  301. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +0 -6
  302. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +0 -58
  303. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +0 -47
  304. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +0 -80
  305. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +0 -52
  306. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +0 -26
  307. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +0 -104
  308. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +0 -39
  309. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +0 -406
  310. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +0 -32
  311. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +0 -158
  312. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +0 -99
  313. package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +0 -139
  314. package/pods/Headers/inspector/utils.h +0 -32
  315. package/pods/Headers/inspector/v8-inspector-platform.h +0 -44
  316. package/pods/Headers/jsi/decorator.h +0 -770
  317. package/pods/Headers/jsi/instrumentation.h +0 -117
  318. package/pods/Headers/jsi/jsi-inl.h +0 -338
  319. package/pods/Headers/jsi/jsi.h +0 -1571
  320. package/pods/Headers/jsi/jsilib.h +0 -59
  321. package/pods/Headers/jsi/threadsafe.h +0 -79
  322. package/pods/Headers/runtime/ArgConverter.h +0 -61
  323. package/pods/Headers/runtime/ArrayAdapter.h +0 -13
  324. package/pods/Headers/runtime/Caches.h +0 -98
  325. package/pods/Headers/runtime/ClassBuilder.h +0 -61
  326. package/pods/Headers/runtime/Common.h +0 -9
  327. package/pods/Headers/runtime/ConcurrentMap.h +0 -55
  328. package/pods/Headers/runtime/ConcurrentQueue.h +0 -28
  329. package/pods/Headers/runtime/Console.h +0 -27
  330. package/pods/Headers/runtime/Constants.h +0 -15
  331. package/pods/Headers/runtime/DataWrapper.h +0 -671
  332. package/pods/Headers/runtime/DictionaryAdapter.h +0 -13
  333. package/pods/Headers/runtime/ExtVector.h +0 -21
  334. package/pods/Headers/runtime/FFICall.h +0 -105
  335. package/pods/Headers/runtime/FastEnumerationAdapter.h +0 -13
  336. package/pods/Headers/runtime/FunctionReference.h +0 -18
  337. package/pods/Headers/runtime/Helpers.h +0 -84
  338. package/pods/Headers/runtime/InlineFunctions.h +0 -16
  339. package/pods/Headers/runtime/Interop.h +0 -202
  340. package/pods/Headers/runtime/KnownUnknownClassPair.h +0 -35
  341. package/pods/Headers/runtime/Metadata.h +0 -981
  342. package/pods/Headers/runtime/MetadataBuilder.h +0 -72
  343. package/pods/Headers/runtime/MetadataInlines.h +0 -157
  344. package/pods/Headers/runtime/ModuleInternal.h +0 -59
  345. package/pods/Headers/runtime/NSDataAdapter.h +0 -13
  346. package/pods/Headers/runtime/NativeScriptException.h +0 -27
  347. package/pods/Headers/runtime/ObjectManager.h +0 -31
  348. package/pods/Headers/runtime/OneByteStringResource.h +0 -21
  349. package/pods/Headers/runtime/Pointer.h +0 -26
  350. package/pods/Headers/runtime/PromiseProxy.h +0 -15
  351. package/pods/Headers/runtime/Reference.h +0 -38
  352. package/pods/Headers/runtime/Runtime.h +0 -67
  353. package/pods/Headers/runtime/RuntimeConfig.h +0 -17
  354. package/pods/Headers/runtime/SetTimeout.h +0 -34
  355. package/pods/Headers/runtime/SimpleAllocator.h +0 -23
  356. package/pods/Headers/runtime/StringHasher.h +0 -315
  357. package/pods/Headers/runtime/SymbolIterator.h +0 -18
  358. package/pods/Headers/runtime/SymbolLoader.h +0 -27
  359. package/pods/Headers/runtime/TNSDerivedClass.h +0 -8
  360. package/pods/Headers/runtime/TSHelpers.h +0 -15
  361. package/pods/Headers/runtime/Tasks.h +0 -19
  362. package/pods/Headers/runtime/UnmanagedType.h +0 -21
  363. package/pods/Headers/runtime/WeakRef.h +0 -15
  364. package/pods/Headers/runtime/Worker.h +0 -26
  365. package/pods/Headers/runtime/robin_hood.h +0 -2184
  366. package/pods/Headers/v8runtime/HostProxy.h +0 -71
  367. package/pods/Headers/v8runtime/JSIV8ValueConverter.h +0 -74
  368. package/pods/Headers/v8runtime/V8PointerValue.h +0 -44
  369. package/pods/Headers/v8runtime/V8Runtime.h +0 -240
  370. package/pods/Headers/v8runtime/V8RuntimeConfig.h +0 -26
  371. package/pods/Headers/v8runtime/V8RuntimeFactory.h +0 -21
  372. package/pods/NativeScript.podspec +0 -68
@@ -1,258 +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
- // The LazyInstance<Type, Traits> class manages a single instance of Type,
6
- // which will be lazily created on the first time it's accessed. This class is
7
- // useful for places you would normally use a function-level static, but you
8
- // need to have guaranteed thread-safety. The Type constructor will only ever
9
- // be called once, even if two threads are racing to create the object. Get()
10
- // and Pointer() will always return the same, completely initialized instance.
11
- //
12
- // LazyInstance is completely thread safe, assuming that you create it safely.
13
- // The class was designed to be POD initialized, so it shouldn't require a
14
- // static constructor. It really only makes sense to declare a LazyInstance as
15
- // a global variable using the LAZY_INSTANCE_INITIALIZER initializer.
16
- //
17
- // LazyInstance is similar to Singleton, except it does not have the singleton
18
- // property. You can have multiple LazyInstance's of the same type, and each
19
- // will manage a unique instance. It also preallocates the space for Type, as
20
- // to avoid allocating the Type instance on the heap. This may help with the
21
- // performance of creating the instance, and reducing heap fragmentation. This
22
- // requires that Type be a complete type so we can determine the size. See
23
- // notes for advanced users below for more explanations.
24
- //
25
- // Example usage:
26
- // static LazyInstance<MyClass>::type my_instance = LAZY_INSTANCE_INITIALIZER;
27
- // void SomeMethod() {
28
- // my_instance.Get().SomeMethod(); // MyClass::SomeMethod()
29
- //
30
- // MyClass* ptr = my_instance.Pointer();
31
- // ptr->DoDoDo(); // MyClass::DoDoDo
32
- // }
33
- //
34
- // Additionally you can override the way your instance is constructed by
35
- // providing your own trait:
36
- // Example usage:
37
- // struct MyCreateTrait {
38
- // static void Construct(void* allocated_ptr) {
39
- // new (allocated_ptr) MyClass(/* extra parameters... */);
40
- // }
41
- // };
42
- // static LazyInstance<MyClass, MyCreateTrait>::type my_instance =
43
- // LAZY_INSTANCE_INITIALIZER;
44
- //
45
- // WARNINGS:
46
- // - This implementation of LazyInstance IS THREAD-SAFE by default. See
47
- // SingleThreadInitOnceTrait if you don't care about thread safety.
48
- // - Lazy initialization comes with a cost. Make sure that you don't use it on
49
- // critical path. Consider adding your initialization code to a function
50
- // which is explicitly called once.
51
- //
52
- // Notes for advanced users:
53
- // LazyInstance can actually be used in two different ways:
54
- //
55
- // - "Static mode" which is the default mode since it is the most efficient
56
- // (no extra heap allocation). In this mode, the instance is statically
57
- // allocated (stored in the global data section at compile time).
58
- // The macro LAZY_STATIC_INSTANCE_INITIALIZER (= LAZY_INSTANCE_INITIALIZER)
59
- // must be used to initialize static lazy instances.
60
- //
61
- // - "Dynamic mode". In this mode, the instance is dynamically allocated and
62
- // constructed (using new) by default. This mode is useful if you have to
63
- // deal with some code already allocating the instance for you (e.g.
64
- // OS::Mutex() which returns a new private OS-dependent subclass of Mutex).
65
- // The macro LAZY_DYNAMIC_INSTANCE_INITIALIZER must be used to initialize
66
- // dynamic lazy instances.
67
-
68
- #ifndef V8_BASE_LAZY_INSTANCE_H_
69
- #define V8_BASE_LAZY_INSTANCE_H_
70
-
71
- #include <type_traits>
72
-
73
- #include "src/base/macros.h"
74
- #include "src/base/once.h"
75
-
76
- namespace v8 {
77
- namespace base {
78
-
79
- #define LAZY_STATIC_INSTANCE_INITIALIZER { V8_ONCE_INIT, { {} } }
80
- #define LAZY_DYNAMIC_INSTANCE_INITIALIZER { V8_ONCE_INIT, 0 }
81
-
82
- // Default to static mode.
83
- #define LAZY_INSTANCE_INITIALIZER LAZY_STATIC_INSTANCE_INITIALIZER
84
-
85
-
86
- template <typename T>
87
- struct LeakyInstanceTrait {
88
- static void Destroy(T* /* instance */) {}
89
- };
90
-
91
-
92
- // Traits that define how an instance is allocated and accessed.
93
-
94
-
95
- template <typename T>
96
- struct StaticallyAllocatedInstanceTrait {
97
- using StorageType =
98
- typename std::aligned_storage<sizeof(T), alignof(T)>::type;
99
-
100
- static T* MutableInstance(StorageType* storage) {
101
- return reinterpret_cast<T*>(storage);
102
- }
103
-
104
- template <typename ConstructTrait>
105
- static void InitStorageUsingTrait(StorageType* storage) {
106
- ConstructTrait::Construct(storage);
107
- }
108
- };
109
-
110
-
111
- template <typename T>
112
- struct DynamicallyAllocatedInstanceTrait {
113
- using StorageType = T*;
114
-
115
- static T* MutableInstance(StorageType* storage) {
116
- return *storage;
117
- }
118
-
119
- template <typename CreateTrait>
120
- static void InitStorageUsingTrait(StorageType* storage) {
121
- *storage = CreateTrait::Create();
122
- }
123
- };
124
-
125
-
126
- template <typename T>
127
- struct DefaultConstructTrait {
128
- // Constructs the provided object which was already allocated.
129
- static void Construct(void* allocated_ptr) { new (allocated_ptr) T(); }
130
- };
131
-
132
-
133
- template <typename T>
134
- struct DefaultCreateTrait {
135
- static T* Create() {
136
- return new T();
137
- }
138
- };
139
-
140
-
141
- struct ThreadSafeInitOnceTrait {
142
- template <typename Function, typename Storage>
143
- static void Init(OnceType* once, Function function, Storage storage) {
144
- CallOnce(once, function, storage);
145
- }
146
- };
147
-
148
-
149
- // Initialization trait for users who don't care about thread-safety.
150
- struct SingleThreadInitOnceTrait {
151
- template <typename Function, typename Storage>
152
- static void Init(OnceType* once, Function function, Storage storage) {
153
- if (*once == ONCE_STATE_UNINITIALIZED) {
154
- function(storage);
155
- *once = ONCE_STATE_DONE;
156
- }
157
- }
158
- };
159
-
160
-
161
- // TODO(pliard): Handle instances destruction (using global destructors).
162
- template <typename T, typename AllocationTrait, typename CreateTrait,
163
- typename InitOnceTrait, typename DestroyTrait /* not used yet. */>
164
- struct LazyInstanceImpl {
165
- public:
166
- using StorageType = typename AllocationTrait::StorageType;
167
-
168
- private:
169
- static void InitInstance(void* storage) {
170
- AllocationTrait::template InitStorageUsingTrait<CreateTrait>(
171
- static_cast<StorageType*>(storage));
172
- }
173
-
174
- void Init() const {
175
- InitOnceTrait::Init(&once_, &InitInstance, static_cast<void*>(&storage_));
176
- }
177
-
178
- public:
179
- T* Pointer() {
180
- Init();
181
- return AllocationTrait::MutableInstance(&storage_);
182
- }
183
-
184
- const T& Get() const {
185
- Init();
186
- return *AllocationTrait::MutableInstance(&storage_);
187
- }
188
-
189
- mutable OnceType once_;
190
- // Note that the previous field, OnceType, is an AtomicWord which guarantees
191
- // 4-byte alignment of the storage field below. If compiling with GCC (>4.2),
192
- // the LAZY_ALIGN macro above will guarantee correctness for any alignment.
193
- mutable StorageType storage_;
194
- };
195
-
196
-
197
- template <typename T,
198
- typename CreateTrait = DefaultConstructTrait<T>,
199
- typename InitOnceTrait = ThreadSafeInitOnceTrait,
200
- typename DestroyTrait = LeakyInstanceTrait<T> >
201
- struct LazyStaticInstance {
202
- using type = LazyInstanceImpl<T, StaticallyAllocatedInstanceTrait<T>,
203
- CreateTrait, InitOnceTrait, DestroyTrait>;
204
- };
205
-
206
-
207
- template <typename T,
208
- typename CreateTrait = DefaultConstructTrait<T>,
209
- typename InitOnceTrait = ThreadSafeInitOnceTrait,
210
- typename DestroyTrait = LeakyInstanceTrait<T> >
211
- struct LazyInstance {
212
- // A LazyInstance is a LazyStaticInstance.
213
- using type = typename LazyStaticInstance<T, CreateTrait, InitOnceTrait,
214
- DestroyTrait>::type;
215
- };
216
-
217
-
218
- template <typename T,
219
- typename CreateTrait = DefaultCreateTrait<T>,
220
- typename InitOnceTrait = ThreadSafeInitOnceTrait,
221
- typename DestroyTrait = LeakyInstanceTrait<T> >
222
- struct LazyDynamicInstance {
223
- using type = LazyInstanceImpl<T, DynamicallyAllocatedInstanceTrait<T>,
224
- CreateTrait, InitOnceTrait, DestroyTrait>;
225
- };
226
-
227
- // LeakyObject<T> wraps an object of type T, which is initialized in the
228
- // constructor but never destructed. Thus LeakyObject<T> is trivially
229
- // destructible and can be used in static (lazily initialized) variables.
230
- template <typename T>
231
- class LeakyObject {
232
- public:
233
- template <typename... Args>
234
- explicit LeakyObject(Args&&... args) {
235
- new (&storage_) T(std::forward<Args>(args)...);
236
- }
237
-
238
- LeakyObject(const LeakyObject&) = delete;
239
- LeakyObject& operator=(const LeakyObject&) = delete;
240
-
241
- T* get() { return reinterpret_cast<T*>(&storage_); }
242
-
243
- private:
244
- typename std::aligned_storage<sizeof(T), alignof(T)>::type storage_;
245
- };
246
-
247
- // Define a function which returns a pointer to a lazily initialized and never
248
- // destructed object of type T.
249
- #define DEFINE_LAZY_LEAKY_OBJECT_GETTER(T, FunctionName, ...) \
250
- T* FunctionName() { \
251
- static ::v8::base::LeakyObject<T> object{__VA_ARGS__}; \
252
- return object.get(); \
253
- }
254
-
255
- } // namespace base
256
- } // namespace v8
257
-
258
- #endif // V8_BASE_LAZY_INSTANCE_H_
@@ -1,417 +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_BASE_LOGGING_H_
6
- #define V8_BASE_LOGGING_H_
7
-
8
- #include <cstring>
9
- #include <sstream>
10
- #include <string>
11
-
12
- #include "src/base/base-export.h"
13
- #include "src/base/build_config.h"
14
- #include "src/base/compiler-specific.h"
15
- #include "src/base/immediate-crash.h"
16
- #include "src/base/template-utils.h"
17
-
18
- V8_BASE_EXPORT V8_NOINLINE void V8_Dcheck(const char* file, int line,
19
- const char* message);
20
-
21
- #ifdef DEBUG
22
- // In debug, include file, line, and full error message for all
23
- // FATAL() calls.
24
- [[noreturn]] PRINTF_FORMAT(3, 4) V8_BASE_EXPORT V8_NOINLINE
25
- void V8_Fatal(const char* file, int line, const char* format, ...);
26
- #define FATAL(...) V8_Fatal(__FILE__, __LINE__, __VA_ARGS__)
27
-
28
- #else
29
- [[noreturn]] PRINTF_FORMAT(1, 2) V8_BASE_EXPORT V8_NOINLINE
30
- void V8_Fatal(const char* format, ...);
31
- #if !defined(OFFICIAL_BUILD)
32
- // In non-official release, include full error message, but drop file & line
33
- // numbers. It saves binary size to drop the |file| & |line| as opposed to just
34
- // passing in "", 0 for them.
35
- #define FATAL(...) V8_Fatal(__VA_ARGS__)
36
- #else
37
- // FATAL(msg) -> IMMEDIATE_CRASH()
38
- // FATAL(msg, ...) -> V8_Fatal(msg, ...)
39
- #define FATAL_HELPER(_7, _6, _5, _4, _3, _2, _1, _0, ...) _0
40
- #define FATAL_DISCARD_ARG(arg) IMMEDIATE_CRASH()
41
- #define FATAL(...) \
42
- FATAL_HELPER(__VA_ARGS__, V8_Fatal, V8_Fatal, V8_Fatal, V8_Fatal, V8_Fatal, \
43
- V8_Fatal, FATAL_DISCARD_ARG) \
44
- (__VA_ARGS__)
45
- #endif // !defined(OFFICIAL_BUILD)
46
- #endif // DEBUG
47
-
48
- #define UNIMPLEMENTED() FATAL("unimplemented code")
49
- #define UNREACHABLE() FATAL("unreachable code")
50
-
51
- namespace v8 {
52
- namespace base {
53
-
54
- class CheckMessageStream : public std::ostringstream {};
55
-
56
- // Overwrite the default function that prints a stack trace.
57
- V8_BASE_EXPORT void SetPrintStackTrace(void (*print_stack_trace_)());
58
-
59
- // Override the default function that handles DCHECKs.
60
- V8_BASE_EXPORT void SetDcheckFunction(void (*dcheck_Function)(const char*, int,
61
- const char*));
62
-
63
- // In official builds, assume all check failures can be debugged given just the
64
- // stack trace.
65
- #if !defined(DEBUG) && defined(OFFICIAL_BUILD)
66
- #define CHECK_FAILED_HANDLER(message) FATAL("ignored")
67
- #else
68
- #define CHECK_FAILED_HANDLER(message) FATAL("Check failed: %s.", message)
69
- #endif
70
-
71
- // CHECK dies with a fatal error if condition is not true. It is *not*
72
- // controlled by DEBUG, so the check will be executed regardless of
73
- // compilation mode.
74
- //
75
- // We make sure CHECK et al. always evaluates their arguments, as
76
- // doing CHECK(FunctionWithSideEffect()) is a common idiom.
77
- #define CHECK_WITH_MSG(condition, message) \
78
- do { \
79
- if (V8_UNLIKELY(!(condition))) { \
80
- CHECK_FAILED_HANDLER(message); \
81
- } \
82
- } while (false)
83
- #define CHECK(condition) CHECK_WITH_MSG(condition, #condition)
84
-
85
- #ifdef DEBUG
86
-
87
- #define DCHECK_WITH_MSG(condition, message) \
88
- do { \
89
- if (V8_UNLIKELY(!(condition))) { \
90
- V8_Dcheck(__FILE__, __LINE__, message); \
91
- } \
92
- } while (false)
93
- #define DCHECK(condition) DCHECK_WITH_MSG(condition, #condition)
94
-
95
- // Helper macro for binary operators.
96
- // Don't use this macro directly in your code, use CHECK_EQ et al below.
97
- #define CHECK_OP(name, op, lhs, rhs) \
98
- do { \
99
- if (std::string* _msg = ::v8::base::Check##name##Impl< \
100
- typename ::v8::base::pass_value_or_ref<decltype(lhs)>::type, \
101
- typename ::v8::base::pass_value_or_ref<decltype(rhs)>::type>( \
102
- (lhs), (rhs), #lhs " " #op " " #rhs)) { \
103
- FATAL("Check failed: %s.", _msg->c_str()); \
104
- delete _msg; \
105
- } \
106
- } while (false)
107
-
108
- #define DCHECK_OP(name, op, lhs, rhs) \
109
- do { \
110
- if (std::string* _msg = ::v8::base::Check##name##Impl< \
111
- typename ::v8::base::pass_value_or_ref<decltype(lhs)>::type, \
112
- typename ::v8::base::pass_value_or_ref<decltype(rhs)>::type>( \
113
- (lhs), (rhs), #lhs " " #op " " #rhs)) { \
114
- V8_Dcheck(__FILE__, __LINE__, _msg->c_str()); \
115
- delete _msg; \
116
- } \
117
- } while (false)
118
-
119
- #else
120
-
121
- // Make all CHECK functions discard their log strings to reduce code
122
- // bloat for official release builds.
123
-
124
- #define CHECK_OP(name, op, lhs, rhs) \
125
- do { \
126
- bool _cmp = ::v8::base::Cmp##name##Impl< \
127
- typename ::v8::base::pass_value_or_ref<decltype(lhs)>::type, \
128
- typename ::v8::base::pass_value_or_ref<decltype(rhs)>::type>((lhs), \
129
- (rhs)); \
130
- CHECK_WITH_MSG(_cmp, #lhs " " #op " " #rhs); \
131
- } while (false)
132
-
133
- #define DCHECK_WITH_MSG(condition, msg) void(0);
134
-
135
- #endif
136
-
137
- namespace detail {
138
- template <typename... Ts>
139
- std::string PrintToString(Ts&&... ts) {
140
- CheckMessageStream oss;
141
- int unused_results[]{((oss << std::forward<Ts>(ts)), 0)...};
142
- (void)unused_results; // Avoid "unused variable" warning.
143
- return oss.str();
144
- }
145
-
146
- template <typename T>
147
- auto GetUnderlyingEnumTypeForPrinting(T val) {
148
- using underlying_t = typename std::underlying_type<T>::type;
149
- // For single-byte enums, return a 16-bit integer to avoid printing the value
150
- // as a character.
151
- using int_t = typename std::conditional_t<
152
- sizeof(underlying_t) != 1, underlying_t,
153
- std::conditional_t<std::is_signed<underlying_t>::value, int16_t,
154
- uint16_t> >;
155
- return static_cast<int_t>(static_cast<underlying_t>(val));
156
- }
157
- } // namespace detail
158
-
159
- // Define PrintCheckOperand<T> for each T which defines operator<< for ostream.
160
- template <typename T>
161
- typename std::enable_if<
162
- !std::is_function<typename std::remove_pointer<T>::type>::value &&
163
- !std::is_enum<T>::value &&
164
- has_output_operator<T, CheckMessageStream>::value,
165
- std::string>::type
166
- PrintCheckOperand(T val) {
167
- return detail::PrintToString(std::forward<T>(val));
168
- }
169
-
170
- // Provide an overload for functions and function pointers. Function pointers
171
- // don't implicitly convert to void* but do implicitly convert to bool, so
172
- // without this function pointers are always printed as 1 or 0. (MSVC isn't
173
- // standards-conforming here and converts function pointers to regular
174
- // pointers, so this is a no-op for MSVC.)
175
- template <typename T>
176
- typename std::enable_if<
177
- std::is_function<typename std::remove_pointer<T>::type>::value,
178
- std::string>::type
179
- PrintCheckOperand(T val) {
180
- return PrintCheckOperand(reinterpret_cast<const void*>(val));
181
- }
182
-
183
- // Define PrintCheckOperand<T> for enums with an output operator.
184
- template <typename T>
185
- typename std::enable_if<std::is_enum<T>::value &&
186
- has_output_operator<T, CheckMessageStream>::value,
187
- std::string>::type
188
- PrintCheckOperand(T val) {
189
- std::string val_str = detail::PrintToString(val);
190
- std::string int_str =
191
- detail::PrintToString(detail::GetUnderlyingEnumTypeForPrinting(val));
192
- // Printing the original enum might have printed a single non-printable
193
- // character. Ignore it in that case. Also ignore if it printed the same as
194
- // the integral representation.
195
- // TODO(clemensb): Can we somehow statically find out if the output operator
196
- // is the default one, printing the integral value?
197
- if ((val_str.length() == 1 && !std::isprint(val_str[0])) ||
198
- val_str == int_str) {
199
- return int_str;
200
- }
201
- return detail::PrintToString(val_str, " (", int_str, ")");
202
- }
203
-
204
- // Define PrintCheckOperand<T> for enums without an output operator.
205
- template <typename T>
206
- typename std::enable_if<std::is_enum<T>::value &&
207
- !has_output_operator<T, CheckMessageStream>::value,
208
- std::string>::type
209
- PrintCheckOperand(T val) {
210
- return detail::PrintToString(detail::GetUnderlyingEnumTypeForPrinting(val));
211
- }
212
-
213
- // Define default PrintCheckOperand<T> for non-printable types.
214
- template <typename T>
215
- typename std::enable_if<!has_output_operator<T, CheckMessageStream>::value &&
216
- !std::is_enum<T>::value,
217
- std::string>::type
218
- PrintCheckOperand(T val) {
219
- return "<unprintable>";
220
- }
221
-
222
- // Define specializations for character types, defined in logging.cc.
223
- #define DEFINE_PRINT_CHECK_OPERAND_CHAR(type) \
224
- template <> \
225
- V8_BASE_EXPORT std::string PrintCheckOperand<type>(type ch); \
226
- template <> \
227
- V8_BASE_EXPORT std::string PrintCheckOperand<type*>(type * cstr); \
228
- template <> \
229
- V8_BASE_EXPORT std::string PrintCheckOperand<const type*>(const type* cstr);
230
-
231
- DEFINE_PRINT_CHECK_OPERAND_CHAR(char)
232
- DEFINE_PRINT_CHECK_OPERAND_CHAR(signed char)
233
- DEFINE_PRINT_CHECK_OPERAND_CHAR(unsigned char)
234
- #undef DEFINE_PRINT_CHECK_OPERAND_CHAR
235
-
236
- // Build the error message string. This is separate from the "Impl"
237
- // function template because it is not performance critical and so can
238
- // be out of line, while the "Impl" code should be inline. Caller
239
- // takes ownership of the returned string.
240
- template <typename Lhs, typename Rhs>
241
- V8_NOINLINE std::string* MakeCheckOpString(Lhs lhs, Rhs rhs, char const* msg) {
242
- std::string lhs_str = PrintCheckOperand<Lhs>(lhs);
243
- std::string rhs_str = PrintCheckOperand<Rhs>(rhs);
244
- CheckMessageStream ss;
245
- ss << msg;
246
- constexpr size_t kMaxInlineLength = 50;
247
- if (lhs_str.size() <= kMaxInlineLength &&
248
- rhs_str.size() <= kMaxInlineLength) {
249
- ss << " (" << lhs_str << " vs. " << rhs_str << ")";
250
- } else {
251
- ss << "\n " << lhs_str << "\n vs.\n " << rhs_str << "\n";
252
- }
253
- return new std::string(ss.str());
254
- }
255
-
256
- // Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
257
- // in logging.cc.
258
- #define EXPLICIT_CHECK_OP_INSTANTIATION(type) \
259
- extern template V8_BASE_EXPORT std::string* MakeCheckOpString<type, type>( \
260
- type, type, char const*); \
261
- extern template V8_BASE_EXPORT std::string PrintCheckOperand<type>(type);
262
-
263
- EXPLICIT_CHECK_OP_INSTANTIATION(int)
264
- EXPLICIT_CHECK_OP_INSTANTIATION(long) // NOLINT(runtime/int)
265
- EXPLICIT_CHECK_OP_INSTANTIATION(long long) // NOLINT(runtime/int)
266
- EXPLICIT_CHECK_OP_INSTANTIATION(unsigned int)
267
- EXPLICIT_CHECK_OP_INSTANTIATION(unsigned long) // NOLINT(runtime/int)
268
- EXPLICIT_CHECK_OP_INSTANTIATION(unsigned long long) // NOLINT(runtime/int)
269
- EXPLICIT_CHECK_OP_INSTANTIATION(void const*)
270
- #undef EXPLICIT_CHECK_OP_INSTANTIATION
271
-
272
- // comparison_underlying_type provides the underlying integral type of an enum,
273
- // or std::decay<T>::type if T is not an enum. Booleans are converted to
274
- // "unsigned int", to allow "unsigned int == bool" comparisons.
275
- template <typename T>
276
- struct comparison_underlying_type {
277
- // std::underlying_type must only be used with enum types, thus use this
278
- // {Dummy} type if the given type is not an enum.
279
- enum Dummy {};
280
- using decay = typename std::decay<T>::type;
281
- static constexpr bool is_enum = std::is_enum<decay>::value;
282
- using underlying = typename std::underlying_type<
283
- typename std::conditional<is_enum, decay, Dummy>::type>::type;
284
- using type_or_bool =
285
- typename std::conditional<is_enum, underlying, decay>::type;
286
- using type =
287
- typename std::conditional<std::is_same<type_or_bool, bool>::value,
288
- unsigned int, type_or_bool>::type;
289
- };
290
- // Cast a value to its underlying type
291
- #define MAKE_UNDERLYING(Type, value) \
292
- static_cast<typename comparison_underlying_type<Type>::type>(value)
293
-
294
- // is_signed_vs_unsigned::value is true if both types are integral, Lhs is
295
- // signed, and Rhs is unsigned. False in all other cases.
296
- template <typename Lhs, typename Rhs>
297
- struct is_signed_vs_unsigned {
298
- using lhs_underlying = typename comparison_underlying_type<Lhs>::type;
299
- using rhs_underlying = typename comparison_underlying_type<Rhs>::type;
300
- static constexpr bool value = std::is_integral<lhs_underlying>::value &&
301
- std::is_integral<rhs_underlying>::value &&
302
- std::is_signed<lhs_underlying>::value &&
303
- std::is_unsigned<rhs_underlying>::value;
304
- };
305
- // Same thing, other way around: Lhs is unsigned, Rhs signed.
306
- template <typename Lhs, typename Rhs>
307
- struct is_unsigned_vs_signed : public is_signed_vs_unsigned<Rhs, Lhs> {};
308
-
309
- // Specialize the compare functions for signed vs. unsigned comparisons.
310
- // std::enable_if ensures that this template is only instantiable if both Lhs
311
- // and Rhs are integral types, and their signedness does not match.
312
- #define MAKE_UNSIGNED(Type, value) \
313
- static_cast<typename std::make_unsigned< \
314
- typename comparison_underlying_type<Type>::type>::type>(value)
315
- #define DEFINE_SIGNED_MISMATCH_COMP(CHECK, NAME, IMPL) \
316
- template <typename Lhs, typename Rhs> \
317
- V8_INLINE constexpr \
318
- typename std::enable_if<CHECK<Lhs, Rhs>::value, bool>::type \
319
- Cmp##NAME##Impl(Lhs lhs, Rhs rhs) { \
320
- return IMPL; \
321
- }
322
- DEFINE_SIGNED_MISMATCH_COMP(is_signed_vs_unsigned, EQ,
323
- lhs >= 0 && MAKE_UNSIGNED(Lhs, lhs) ==
324
- MAKE_UNDERLYING(Rhs, rhs))
325
- DEFINE_SIGNED_MISMATCH_COMP(is_signed_vs_unsigned, LT,
326
- lhs < 0 || MAKE_UNSIGNED(Lhs, lhs) <
327
- MAKE_UNDERLYING(Rhs, rhs))
328
- DEFINE_SIGNED_MISMATCH_COMP(is_signed_vs_unsigned, LE,
329
- lhs <= 0 || MAKE_UNSIGNED(Lhs, lhs) <=
330
- MAKE_UNDERLYING(Rhs, rhs))
331
- DEFINE_SIGNED_MISMATCH_COMP(is_signed_vs_unsigned, NE, !CmpEQImpl(lhs, rhs))
332
- DEFINE_SIGNED_MISMATCH_COMP(is_signed_vs_unsigned, GT, !CmpLEImpl(lhs, rhs))
333
- DEFINE_SIGNED_MISMATCH_COMP(is_signed_vs_unsigned, GE, !CmpLTImpl(lhs, rhs))
334
- DEFINE_SIGNED_MISMATCH_COMP(is_unsigned_vs_signed, EQ, CmpEQImpl(rhs, lhs))
335
- DEFINE_SIGNED_MISMATCH_COMP(is_unsigned_vs_signed, NE, CmpNEImpl(rhs, lhs))
336
- DEFINE_SIGNED_MISMATCH_COMP(is_unsigned_vs_signed, LT, CmpGTImpl(rhs, lhs))
337
- DEFINE_SIGNED_MISMATCH_COMP(is_unsigned_vs_signed, LE, CmpGEImpl(rhs, lhs))
338
- DEFINE_SIGNED_MISMATCH_COMP(is_unsigned_vs_signed, GT, CmpLTImpl(rhs, lhs))
339
- DEFINE_SIGNED_MISMATCH_COMP(is_unsigned_vs_signed, GE, CmpLEImpl(rhs, lhs))
340
- #undef MAKE_UNSIGNED
341
- #undef DEFINE_SIGNED_MISMATCH_COMP
342
-
343
- // Helper functions for CHECK_OP macro.
344
- // The (float, float) and (double, double) instantiations are explicitly
345
- // externalized to ensure proper 32/64-bit comparisons on x86.
346
- // The Cmp##NAME##Impl function is only instantiable if one of the two types is
347
- // not integral or their signedness matches (i.e. whenever no specialization is
348
- // required, see above). Otherwise it is disabled by the enable_if construct,
349
- // and the compiler will pick a specialization from above.
350
- #define DEFINE_CHECK_OP_IMPL(NAME, op) \
351
- template <typename Lhs, typename Rhs> \
352
- V8_INLINE constexpr \
353
- typename std::enable_if<!is_signed_vs_unsigned<Lhs, Rhs>::value && \
354
- !is_unsigned_vs_signed<Lhs, Rhs>::value, \
355
- bool>::type Cmp##NAME##Impl(Lhs lhs, Rhs rhs) { \
356
- return lhs op rhs; \
357
- } \
358
- template <typename Lhs, typename Rhs> \
359
- V8_INLINE constexpr std::string* Check##NAME##Impl(Lhs lhs, Rhs rhs, \
360
- char const* msg) { \
361
- using LhsPassT = typename pass_value_or_ref<Lhs>::type; \
362
- using RhsPassT = typename pass_value_or_ref<Rhs>::type; \
363
- bool cmp = Cmp##NAME##Impl<LhsPassT, RhsPassT>(lhs, rhs); \
364
- return V8_LIKELY(cmp) \
365
- ? nullptr \
366
- : MakeCheckOpString<LhsPassT, RhsPassT>(lhs, rhs, msg); \
367
- }
368
- DEFINE_CHECK_OP_IMPL(EQ, ==)
369
- DEFINE_CHECK_OP_IMPL(NE, !=)
370
- DEFINE_CHECK_OP_IMPL(LE, <=)
371
- DEFINE_CHECK_OP_IMPL(LT, < )
372
- DEFINE_CHECK_OP_IMPL(GE, >=)
373
- DEFINE_CHECK_OP_IMPL(GT, > )
374
- #undef DEFINE_CHECK_OP_IMPL
375
-
376
- #define CHECK_EQ(lhs, rhs) CHECK_OP(EQ, ==, lhs, rhs)
377
- #define CHECK_NE(lhs, rhs) CHECK_OP(NE, !=, lhs, rhs)
378
- #define CHECK_LE(lhs, rhs) CHECK_OP(LE, <=, lhs, rhs)
379
- #define CHECK_LT(lhs, rhs) CHECK_OP(LT, <, lhs, rhs)
380
- #define CHECK_GE(lhs, rhs) CHECK_OP(GE, >=, lhs, rhs)
381
- #define CHECK_GT(lhs, rhs) CHECK_OP(GT, >, lhs, rhs)
382
- #define CHECK_NULL(val) CHECK((val) == nullptr)
383
- #define CHECK_NOT_NULL(val) CHECK((val) != nullptr)
384
- #define CHECK_IMPLIES(lhs, rhs) \
385
- CHECK_WITH_MSG(!(lhs) || (rhs), #lhs " implies " #rhs)
386
-
387
- } // namespace base
388
- } // namespace v8
389
-
390
-
391
- // The DCHECK macro is equivalent to CHECK except that it only
392
- // generates code in debug builds.
393
- #ifdef DEBUG
394
- #define DCHECK_EQ(lhs, rhs) DCHECK_OP(EQ, ==, lhs, rhs)
395
- #define DCHECK_NE(lhs, rhs) DCHECK_OP(NE, !=, lhs, rhs)
396
- #define DCHECK_GT(lhs, rhs) DCHECK_OP(GT, >, lhs, rhs)
397
- #define DCHECK_GE(lhs, rhs) DCHECK_OP(GE, >=, lhs, rhs)
398
- #define DCHECK_LT(lhs, rhs) DCHECK_OP(LT, <, lhs, rhs)
399
- #define DCHECK_LE(lhs, rhs) DCHECK_OP(LE, <=, lhs, rhs)
400
- #define DCHECK_NULL(val) DCHECK((val) == nullptr)
401
- #define DCHECK_NOT_NULL(val) DCHECK((val) != nullptr)
402
- #define DCHECK_IMPLIES(lhs, rhs) \
403
- DCHECK_WITH_MSG(!(lhs) || (rhs), #lhs " implies " #rhs)
404
- #else
405
- #define DCHECK(condition) ((void) 0)
406
- #define DCHECK_EQ(v1, v2) ((void) 0)
407
- #define DCHECK_NE(v1, v2) ((void) 0)
408
- #define DCHECK_GT(v1, v2) ((void) 0)
409
- #define DCHECK_GE(v1, v2) ((void) 0)
410
- #define DCHECK_LT(v1, v2) ((void) 0)
411
- #define DCHECK_LE(v1, v2) ((void) 0)
412
- #define DCHECK_NULL(val) ((void) 0)
413
- #define DCHECK_NOT_NULL(val) ((void) 0)
414
- #define DCHECK_IMPLIES(v1, v2) ((void) 0)
415
- #endif
416
-
417
- #endif // V8_BASE_LOGGING_H_