@nativescript/canvas 2.0.0-alpha.3 → 2.0.0-alpha.5
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.
- package/Canvas/common.js +8 -15
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.js +7 -9
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.ios.d.ts +3 -0
- package/Canvas/index.ios.js +50 -28
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +20 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/ImageBitmap/index.js +0 -1
- package/ImageBitmap/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js +3 -3
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +4 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +306 -35
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +22 -6
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +4 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +306 -35
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +306 -35
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +11 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +24 -24
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/src/cpp/Helpers.h +5 -3
- package/platforms/ios/src/cpp/VecMutableBuffer.h +10 -15
- package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.cc +14 -1
- package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.h +6 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +5 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.mm +22 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.mm +121 -42
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +28 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.mm +35 -14
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +30 -0
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.mm +3 -1
- package/pods/Headers/include/APIDesign.md +72 -0
- package/pods/Headers/include/DEPS +10 -0
- package/pods/Headers/include/DIR_METADATA +11 -0
- package/pods/Headers/include/OWNERS +23 -0
- package/pods/Headers/include/cppgc/DEPS +8 -0
- package/pods/Headers/include/cppgc/OWNERS +2 -0
- package/pods/Headers/include/cppgc/README.md +133 -0
- package/pods/Headers/include/cppgc/allocation.h +310 -0
- package/pods/Headers/include/cppgc/common.h +29 -0
- package/pods/Headers/include/cppgc/cross-thread-persistent.h +465 -0
- package/pods/Headers/include/cppgc/custom-space.h +97 -0
- package/pods/Headers/include/cppgc/default-platform.h +67 -0
- package/pods/Headers/include/cppgc/ephemeron-pair.h +30 -0
- package/pods/Headers/include/cppgc/explicit-management.h +100 -0
- package/pods/Headers/include/cppgc/garbage-collected.h +106 -0
- package/pods/Headers/include/cppgc/heap-consistency.h +266 -0
- package/pods/Headers/include/cppgc/heap-state.h +82 -0
- package/pods/Headers/include/cppgc/heap-statistics.h +120 -0
- package/pods/Headers/include/cppgc/heap.h +206 -0
- package/pods/Headers/include/cppgc/internal/api-constants.h +55 -0
- package/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +48 -0
- package/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +79 -0
- package/pods/Headers/include/cppgc/internal/compiler-specific.h +38 -0
- package/pods/Headers/include/cppgc/internal/finalizer-trait.h +93 -0
- package/pods/Headers/include/cppgc/internal/gc-info.h +156 -0
- package/pods/Headers/include/cppgc/internal/logging.h +50 -0
- package/pods/Headers/include/cppgc/internal/name-trait.h +122 -0
- package/pods/Headers/include/cppgc/internal/persistent-node.h +216 -0
- package/pods/Headers/include/cppgc/internal/pointer-policies.h +186 -0
- package/pods/Headers/include/cppgc/internal/write-barrier.h +435 -0
- package/pods/Headers/include/cppgc/liveness-broker.h +77 -0
- package/pods/Headers/include/cppgc/macros.h +26 -0
- package/pods/Headers/include/cppgc/member.h +291 -0
- package/pods/Headers/include/cppgc/name-provider.h +65 -0
- package/pods/Headers/include/cppgc/object-size-trait.h +58 -0
- package/pods/Headers/include/cppgc/persistent.h +370 -0
- package/pods/Headers/include/cppgc/platform.h +156 -0
- package/pods/Headers/include/cppgc/prefinalizer.h +75 -0
- package/pods/Headers/include/cppgc/process-heap-statistics.h +36 -0
- package/pods/Headers/include/cppgc/sentinel-pointer.h +32 -0
- package/pods/Headers/include/cppgc/source-location.h +92 -0
- package/pods/Headers/include/cppgc/testing.h +106 -0
- package/pods/Headers/include/cppgc/trace-trait.h +116 -0
- package/pods/Headers/include/cppgc/type-traits.h +240 -0
- package/pods/Headers/include/cppgc/visitor.h +379 -0
- package/pods/Headers/include/js_protocol-1.2.json +936 -0
- package/pods/Headers/include/js_protocol-1.3.json +1112 -0
- package/pods/Headers/include/js_protocol.pdl +1709 -0
- package/pods/Headers/include/libffi/arm64/ffi.h +524 -0
- package/pods/Headers/include/libffi/arm64/ffitarget.h +92 -0
- package/pods/Headers/include/libffi/x86_64/ffi.h +524 -0
- package/pods/Headers/include/libffi/x86_64/ffitarget.h +147 -0
- package/pods/Headers/include/libffi.h +12 -0
- package/pods/Headers/include/libplatform/DEPS +9 -0
- package/pods/Headers/include/libplatform/libplatform-export.h +29 -0
- package/pods/Headers/include/libplatform/libplatform.h +106 -0
- package/pods/Headers/include/libplatform/v8-tracing.h +333 -0
- package/pods/Headers/include/v8-array-buffer.h +433 -0
- package/pods/Headers/include/v8-callbacks.h +397 -0
- package/pods/Headers/include/v8-container.h +129 -0
- package/pods/Headers/include/v8-context.h +407 -0
- package/pods/Headers/include/v8-cppgc.h +215 -0
- package/pods/Headers/include/v8-data.h +80 -0
- package/pods/Headers/include/v8-date.h +43 -0
- package/pods/Headers/include/v8-debug.h +168 -0
- package/pods/Headers/include/v8-embedder-heap.h +218 -0
- package/pods/Headers/include/v8-embedder-state-scope.h +51 -0
- package/pods/Headers/include/v8-exception.h +217 -0
- package/pods/Headers/include/v8-extension.h +62 -0
- package/pods/Headers/include/v8-external.h +37 -0
- package/pods/Headers/include/v8-fast-api-calls.h +939 -0
- package/pods/Headers/include/v8-forward.h +81 -0
- package/pods/Headers/include/v8-function-callback.h +475 -0
- package/pods/Headers/include/v8-function.h +125 -0
- package/pods/Headers/include/v8-initialization.h +315 -0
- package/pods/Headers/include/v8-inspector-protocol.h +13 -0
- package/pods/Headers/include/v8-inspector.h +376 -0
- package/pods/Headers/include/v8-internal.h +661 -0
- package/pods/Headers/include/v8-isolate.h +1709 -0
- package/pods/Headers/include/v8-json.h +47 -0
- package/pods/Headers/include/v8-local-handle.h +455 -0
- package/pods/Headers/include/v8-locker.h +149 -0
- package/pods/Headers/include/v8-maybe.h +137 -0
- package/pods/Headers/include/v8-memory-span.h +43 -0
- package/pods/Headers/include/v8-message.h +216 -0
- package/pods/Headers/include/v8-metrics.h +255 -0
- package/pods/Headers/include/v8-microtask-queue.h +152 -0
- package/pods/Headers/include/v8-microtask.h +28 -0
- package/pods/Headers/include/v8-object.h +775 -0
- package/pods/Headers/include/v8-persistent-handle.h +590 -0
- package/pods/Headers/include/v8-platform.h +1092 -0
- package/pods/Headers/include/v8-primitive-object.h +118 -0
- package/pods/Headers/include/v8-primitive.h +866 -0
- package/pods/Headers/include/v8-profiler.h +1198 -0
- package/pods/Headers/include/v8-promise.h +174 -0
- package/pods/Headers/include/v8-proxy.h +50 -0
- package/pods/Headers/include/v8-regexp.h +105 -0
- package/pods/Headers/include/v8-script.h +748 -0
- package/pods/Headers/include/v8-snapshot.h +196 -0
- package/pods/Headers/include/v8-statistics.h +217 -0
- package/pods/Headers/include/v8-template.h +1079 -0
- package/pods/Headers/include/v8-traced-handle.h +420 -0
- package/pods/Headers/include/v8-typed-array.h +282 -0
- package/pods/Headers/include/v8-unwinder-state.h +31 -0
- package/pods/Headers/include/v8-unwinder.h +132 -0
- package/pods/Headers/include/v8-util.h +658 -0
- package/pods/Headers/include/v8-value-serializer-version.h +24 -0
- package/pods/Headers/include/v8-value-serializer.h +279 -0
- package/pods/Headers/include/v8-value.h +526 -0
- package/pods/Headers/include/v8-version-string.h +38 -0
- package/pods/Headers/include/v8-version.h +20 -0
- package/pods/Headers/include/v8-wasm-trap-handler-posix.h +31 -0
- package/pods/Headers/include/v8-wasm-trap-handler-win.h +28 -0
- package/pods/Headers/include/v8-wasm.h +257 -0
- package/pods/Headers/include/v8-weak-callback-info.h +86 -0
- package/pods/Headers/include/v8.h +88 -0
- package/pods/Headers/include/v8config.h +605 -0
- package/pods/Headers/inspector/InspectorServer.h +20 -0
- package/pods/Headers/inspector/JsV8InspectorClient.h +66 -0
- package/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +1123 -0
- package/pods/Headers/inspector/base64.h +9 -0
- package/pods/Headers/inspector/src/base/address-region.h +95 -0
- package/pods/Headers/inspector/src/base/atomic-utils.h +219 -0
- package/pods/Headers/inspector/src/base/atomicops.h +332 -0
- package/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +89 -0
- package/pods/Headers/inspector/src/base/base-export.h +31 -0
- package/pods/Headers/inspector/src/base/bits.h +343 -0
- package/pods/Headers/inspector/src/base/build_config.h +234 -0
- package/pods/Headers/inspector/src/base/compiler-specific.h +136 -0
- package/pods/Headers/inspector/src/base/export-template.h +163 -0
- package/pods/Headers/inspector/src/base/flags.h +130 -0
- package/pods/Headers/inspector/src/base/immediate-crash.h +162 -0
- package/pods/Headers/inspector/src/base/lazy-instance.h +258 -0
- package/pods/Headers/inspector/src/base/logging.h +417 -0
- package/pods/Headers/inspector/src/base/macros.h +423 -0
- package/pods/Headers/inspector/src/base/memory.h +89 -0
- package/pods/Headers/inspector/src/base/once.h +108 -0
- package/pods/Headers/inspector/src/base/optional.h +882 -0
- package/pods/Headers/inspector/src/base/platform/mutex.h +370 -0
- package/pods/Headers/inspector/src/base/platform/platform.h +476 -0
- package/pods/Headers/inspector/src/base/platform/semaphore.h +108 -0
- package/pods/Headers/inspector/src/base/platform/v8-time.h +513 -0
- package/pods/Headers/inspector/src/base/platform/wrappers.h +73 -0
- package/pods/Headers/inspector/src/base/safe_conversions.h +389 -0
- package/pods/Headers/inspector/src/base/safe_conversions_impl.h +822 -0
- package/pods/Headers/inspector/src/base/template-utils.h +113 -0
- package/pods/Headers/inspector/src/base/v8-fallthrough.h +21 -0
- package/pods/Headers/inspector/src/common/checks.h +38 -0
- package/pods/Headers/inspector/src/common/globals.h +1842 -0
- package/pods/Headers/inspector/src/debug/debug-interface.h +667 -0
- package/pods/Headers/inspector/src/debug/interface-types.h +175 -0
- package/pods/Headers/inspector/src/init/v8.h +52 -0
- package/pods/Headers/inspector/src/inspector/custom-preview.h +24 -0
- package/pods/Headers/inspector/src/inspector/injected-script.h +251 -0
- package/pods/Headers/inspector/src/inspector/inspected-context.h +79 -0
- package/pods/Headers/inspector/src/inspector/protocol/CSS.h +2148 -0
- package/pods/Headers/inspector/src/inspector/protocol/Console.h +211 -0
- package/pods/Headers/inspector/src/inspector/protocol/DOM.h +1008 -0
- package/pods/Headers/inspector/src/inspector/protocol/Debugger.h +892 -0
- package/pods/Headers/inspector/src/inspector/protocol/Forward.h +75 -0
- package/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +346 -0
- package/pods/Headers/inspector/src/inspector/protocol/Log.h +342 -0
- package/pods/Headers/inspector/src/inspector/protocol/Network.h +2528 -0
- package/pods/Headers/inspector/src/inspector/protocol/Overlay.h +281 -0
- package/pods/Headers/inspector/src/inspector/protocol/Page.h +1189 -0
- package/pods/Headers/inspector/src/inspector/protocol/Profiler.h +1001 -0
- package/pods/Headers/inspector/src/inspector/protocol/Protocol.h +617 -0
- package/pods/Headers/inspector/src/inspector/protocol/Runtime.h +1696 -0
- package/pods/Headers/inspector/src/inspector/protocol/Schema.h +146 -0
- package/pods/Headers/inspector/src/inspector/protocol/Security.h +793 -0
- package/pods/Headers/inspector/src/inspector/remote-object-id.h +54 -0
- package/pods/Headers/inspector/src/inspector/search-util.h +26 -0
- package/pods/Headers/inspector/src/inspector/string-16.h +180 -0
- package/pods/Headers/inspector/src/inspector/string-util.h +128 -0
- package/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +48 -0
- package/pods/Headers/inspector/src/inspector/v8-console-message.h +147 -0
- package/pods/Headers/inspector/src/inspector/v8-console.h +173 -0
- package/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +62 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +248 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-id.h +44 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-script.h +123 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger.h +257 -0
- package/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +91 -0
- package/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +80 -0
- package/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +191 -0
- package/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +156 -0
- package/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +34 -0
- package/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +71 -0
- package/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +24 -0
- package/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +70 -0
- package/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +88 -0
- package/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +104 -0
- package/pods/Headers/inspector/src/inspector/v8-regex.h +38 -0
- package/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +157 -0
- package/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +38 -0
- package/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +164 -0
- package/pods/Headers/inspector/src/inspector/v8-string-conversions.h +17 -0
- package/pods/Headers/inspector/src/inspector/v8-value-utils.h +23 -0
- package/pods/Headers/inspector/src/inspector/value-mirror.h +87 -0
- package/pods/Headers/inspector/src/libplatform/default-platform.h +92 -0
- package/pods/Headers/inspector/src/logging/tracing-flags.h +50 -0
- package/pods/Headers/inspector/src/numbers/conversions.h +183 -0
- package/pods/Headers/inspector/src/tracing/trace-event.h +664 -0
- package/pods/Headers/inspector/src/utils/allocation.h +367 -0
- package/pods/Headers/inspector/src/utils/vector.h +324 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +305 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +314 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +62 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +6 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +58 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +47 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +80 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +52 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +26 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +104 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +39 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +406 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +32 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +158 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +99 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +139 -0
- package/pods/Headers/inspector/utils.h +32 -0
- package/pods/Headers/inspector/v8-inspector-platform.h +44 -0
- package/pods/Headers/jsi/decorator.h +770 -0
- package/pods/Headers/jsi/instrumentation.h +117 -0
- package/pods/Headers/jsi/jsi-inl.h +338 -0
- package/pods/Headers/jsi/jsi.h +1571 -0
- package/pods/Headers/jsi/jsilib.h +59 -0
- package/pods/Headers/jsi/threadsafe.h +79 -0
- package/pods/Headers/runtime/ArgConverter.h +61 -0
- package/pods/Headers/runtime/ArrayAdapter.h +13 -0
- package/pods/Headers/runtime/Caches.h +98 -0
- package/pods/Headers/runtime/ClassBuilder.h +61 -0
- package/pods/Headers/runtime/Common.h +9 -0
- package/pods/Headers/runtime/ConcurrentMap.h +55 -0
- package/pods/Headers/runtime/ConcurrentQueue.h +28 -0
- package/pods/Headers/runtime/Console.h +27 -0
- package/pods/Headers/runtime/Constants.h +15 -0
- package/pods/Headers/runtime/DataWrapper.h +671 -0
- package/pods/Headers/runtime/DictionaryAdapter.h +13 -0
- package/pods/Headers/runtime/ExtVector.h +21 -0
- package/pods/Headers/runtime/FFICall.h +105 -0
- package/pods/Headers/runtime/FastEnumerationAdapter.h +13 -0
- package/pods/Headers/runtime/FunctionReference.h +18 -0
- package/pods/Headers/runtime/Helpers.h +84 -0
- package/pods/Headers/runtime/InlineFunctions.h +16 -0
- package/pods/Headers/runtime/Interop.h +202 -0
- package/pods/Headers/runtime/KnownUnknownClassPair.h +35 -0
- package/pods/Headers/runtime/Metadata.h +981 -0
- package/pods/Headers/runtime/MetadataBuilder.h +72 -0
- package/pods/Headers/runtime/MetadataInlines.h +157 -0
- package/pods/Headers/runtime/ModuleInternal.h +59 -0
- package/pods/Headers/runtime/NSDataAdapter.h +13 -0
- package/pods/Headers/runtime/NativeScriptException.h +27 -0
- package/pods/Headers/runtime/ObjectManager.h +31 -0
- package/pods/Headers/runtime/OneByteStringResource.h +21 -0
- package/pods/Headers/runtime/Pointer.h +26 -0
- package/pods/Headers/runtime/PromiseProxy.h +15 -0
- package/pods/Headers/runtime/Reference.h +38 -0
- package/pods/Headers/runtime/Runtime.h +67 -0
- package/pods/Headers/runtime/RuntimeConfig.h +17 -0
- package/pods/Headers/runtime/SetTimeout.h +34 -0
- package/pods/Headers/runtime/SimpleAllocator.h +23 -0
- package/pods/Headers/runtime/StringHasher.h +315 -0
- package/pods/Headers/runtime/SymbolIterator.h +18 -0
- package/pods/Headers/runtime/SymbolLoader.h +27 -0
- package/pods/Headers/runtime/TNSDerivedClass.h +8 -0
- package/pods/Headers/runtime/TSHelpers.h +15 -0
- package/pods/Headers/runtime/Tasks.h +19 -0
- package/pods/Headers/runtime/UnmanagedType.h +21 -0
- package/pods/Headers/runtime/WeakRef.h +15 -0
- package/pods/Headers/runtime/Worker.h +26 -0
- package/pods/Headers/runtime/robin_hood.h +2184 -0
- package/pods/Headers/v8runtime/HostProxy.h +71 -0
- package/pods/Headers/v8runtime/JSIV8ValueConverter.h +74 -0
- package/pods/Headers/v8runtime/V8PointerValue.h +44 -0
- package/pods/Headers/v8runtime/V8Runtime.h +240 -0
- package/pods/Headers/v8runtime/V8RuntimeConfig.h +26 -0
- package/pods/Headers/v8runtime/V8RuntimeFactory.h +21 -0
- package/pods/NativeScript.podspec +68 -0
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
#include "Helpers.h"
|
|
16
16
|
#include "RafImpl.h"
|
|
17
17
|
#include "OnRafCallback.h"
|
|
18
|
+
#include "gl.h"
|
|
18
19
|
|
|
19
20
|
enum class WebGLRenderingVersion : uint8_t {
|
|
20
21
|
V1,
|
|
@@ -49,7 +50,31 @@ public:
|
|
|
49
50
|
RafImpl *GetRaf();
|
|
50
51
|
|
|
51
52
|
WebGLRenderingVersion GetVersion() const;
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
int GetDisplayFramebuffer(){
|
|
55
|
+
return displayFramebuffer_;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
int GetDisplayRenderbuffer(){
|
|
59
|
+
return displayRenderbuffer_;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void StartRaf();
|
|
63
|
+
void StopRaf();
|
|
64
|
+
|
|
65
|
+
void UpdateBindings(){
|
|
66
|
+
auto displayFramebuffer = canvas_native_webgl_get_parameter(GL_FRAMEBUFFER_BINDING, *state_);
|
|
67
|
+
|
|
68
|
+
auto displayRenderbuffer = canvas_native_webgl_get_parameter(GL_RENDERER, *state_);
|
|
69
|
+
|
|
70
|
+
if(!canvas_native_webgl_result_get_is_none(*displayFramebuffer)){
|
|
71
|
+
displayFramebuffer_ = canvas_native_webgl_result_get_i32(*displayFramebuffer);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if(!canvas_native_webgl_result_get_is_none(*displayRenderbuffer)){
|
|
75
|
+
displayRenderbuffer_ = canvas_native_webgl_result_get_i32(*displayRenderbuffer);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
53
78
|
|
|
54
79
|
private:
|
|
55
80
|
rust::Box<WebGLState> state_;
|
|
@@ -59,5 +84,7 @@ private:
|
|
|
59
84
|
int invalidateState_ = static_cast<int>(InvalidateState::NONE);
|
|
60
85
|
|
|
61
86
|
std::shared_ptr<RafImpl> raf_;
|
|
87
|
+
int displayFramebuffer_;
|
|
88
|
+
int displayRenderbuffer_;
|
|
62
89
|
};
|
|
63
90
|
|
|
@@ -6,29 +6,50 @@
|
|
|
6
6
|
|
|
7
7
|
WebGLRenderingContextBase::WebGLRenderingContextBase(rust::Box<WebGLState> state,
|
|
8
8
|
WebGLRenderingVersion version)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
: state_(std::move(state)), version_(version) {
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
auto ctx_ptr = reinterpret_cast<intptr_t>(reinterpret_cast<intptr_t *>(this));
|
|
13
13
|
auto raf_callback = new OnRafCallback(
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
ctx_ptr,
|
|
15
|
+
version == WebGLRenderingVersion::V2 ? 2 : 1);
|
|
16
16
|
auto raf_callback_ptr = reinterpret_cast<intptr_t>(reinterpret_cast<intptr_t *>(raf_callback));
|
|
17
17
|
auto raf = canvas_native_raf_create(
|
|
18
|
-
|
|
18
|
+
raf_callback_ptr);
|
|
19
19
|
this->SetRaf(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
std::make_shared<RafImpl>(
|
|
21
|
+
raf_callback,
|
|
22
|
+
raf_callback_ptr,
|
|
23
|
+
std::move(
|
|
24
|
+
raf)));
|
|
25
|
+
|
|
26
26
|
auto _raf = this->GetRaf();
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
if (_raf != nullptr) {
|
|
29
29
|
canvas_native_raf_start(_raf->GetRaf());
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
UpdateBindings();
|
|
33
|
+
}
|
|
31
34
|
|
|
35
|
+
|
|
36
|
+
void WebGLRenderingContextBase::StartRaf() {
|
|
37
|
+
auto raf = this->GetRaf();
|
|
38
|
+
if (raf != nullptr) {
|
|
39
|
+
if (!canvas_native_raf_get_started(raf->GetRaf())) {
|
|
40
|
+
canvas_native_raf_start(raf->GetRaf());
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
void WebGLRenderingContextBase::StopRaf() {
|
|
47
|
+
auto raf = this->GetRaf();
|
|
48
|
+
if (raf != nullptr) {
|
|
49
|
+
if (canvas_native_raf_get_started(raf->GetRaf())) {
|
|
50
|
+
canvas_native_raf_stop(raf->GetRaf());
|
|
51
|
+
}
|
|
52
|
+
}
|
|
32
53
|
}
|
|
33
54
|
|
|
34
55
|
void WebGLRenderingContextBase::UpdateInvalidateState() {
|
|
@@ -92,6 +113,6 @@ WebGLRenderingContextBase::~WebGLRenderingContextBase() {
|
|
|
92
113
|
auto _raf = this->GetRaf();
|
|
93
114
|
if (_raf != nullptr) {
|
|
94
115
|
canvas_native_raf_start(
|
|
95
|
-
|
|
116
|
+
_raf->GetRaf());
|
|
96
117
|
}
|
|
97
118
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 02/05/2022.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "rust/cxx.h"
|
|
8
|
+
#include "NativeScript/JSIRuntime.h"
|
|
9
|
+
|
|
10
|
+
using namespace facebook;
|
|
11
|
+
|
|
12
|
+
class JSI_EXPORT OES_fbo_render_mipmapImpl : public jsi::HostObject {
|
|
13
|
+
public:
|
|
14
|
+
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override {
|
|
15
|
+
std::vector<jsi::PropNameID> ret;
|
|
16
|
+
ret.emplace_back(
|
|
17
|
+
jsi::PropNameID::forUtf8(rt, std::string("ext_name")));
|
|
18
|
+
return ret;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
jsi::Value get(jsi::Runtime &runtime, const jsi::PropNameID &name) override {
|
|
22
|
+
auto methodName = name.utf8(runtime);
|
|
23
|
+
|
|
24
|
+
if (methodName == "ext_name") {
|
|
25
|
+
return jsi::String::createFromAscii(runtime, "OES_fbo_render_mipmap");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return jsi::Value::undefined();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -20,7 +20,7 @@ std::vector<jsi::PropNameID> WebGL2RenderingContext::getPropertyNames(jsi::Runti
|
|
|
20
20
|
std::vector<jsi::PropNameID> ret;
|
|
21
21
|
|
|
22
22
|
// gl2 + gl1 props
|
|
23
|
-
ret.reserve(
|
|
23
|
+
ret.reserve(353 + 434);
|
|
24
24
|
|
|
25
25
|
// 351
|
|
26
26
|
ret.push_back(jsi::PropNameID::forAscii(rt, "beginQuery"));
|
|
@@ -499,6 +499,8 @@ std::vector<jsi::PropNameID> WebGL2RenderingContext::getPropertyNames(jsi::Runti
|
|
|
499
499
|
/* GL 1 */
|
|
500
500
|
|
|
501
501
|
ret.push_back(jsi::PropNameID::forUtf8(rt, "__resized"));
|
|
502
|
+
ret.push_back(jsi::PropNameID::forUtf8(rt, "__startRaf"));
|
|
503
|
+
ret.push_back(jsi::PropNameID::forUtf8(rt, "__stopRaf"));
|
|
502
504
|
ret.push_back(jsi::PropNameID::forUtf8(rt, std::string("activeTexture")));
|
|
503
505
|
ret.push_back(jsi::PropNameID::forUtf8(rt, std::string("attachShader")));
|
|
504
506
|
ret.push_back(jsi::PropNameID::forUtf8(rt, std::string("bindAttribLocation")));
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# The V8 public C++ API
|
|
2
|
+
|
|
3
|
+
# Overview
|
|
4
|
+
|
|
5
|
+
The V8 public C++ API aims to support four use cases:
|
|
6
|
+
|
|
7
|
+
1. Enable applications that embed V8 (called the embedder) to configure and run
|
|
8
|
+
one or more instances of V8.
|
|
9
|
+
2. Expose ECMAScript-like capabilities to the embedder.
|
|
10
|
+
3. Enable the embedder to interact with ECMAScript by exposing API objects.
|
|
11
|
+
4. Provide access to the V8 debugger (inspector).
|
|
12
|
+
|
|
13
|
+
# Configuring and running an instance of V8
|
|
14
|
+
|
|
15
|
+
V8 requires access to certain OS-level primitives such as the ability to
|
|
16
|
+
schedule work on threads, or allocate memory.
|
|
17
|
+
|
|
18
|
+
The embedder can define how to access those primitives via the v8::Platform
|
|
19
|
+
interface. While V8 bundles a basic implementation, embedders are highly
|
|
20
|
+
encouraged to implement v8::Platform themselves.
|
|
21
|
+
|
|
22
|
+
Currently, the v8::ArrayBuffer::Allocator is passed to the v8::Isolate factory
|
|
23
|
+
method, however, conceptually it should also be part of the v8::Platform since
|
|
24
|
+
all instances of V8 should share one allocator.
|
|
25
|
+
|
|
26
|
+
Once the v8::Platform is configured, an v8::Isolate can be created. All
|
|
27
|
+
further interactions with V8 should explicitly reference the v8::Isolate they
|
|
28
|
+
refer to. All API methods should eventually take an v8::Isolate parameter.
|
|
29
|
+
|
|
30
|
+
When a given instance of V8 is no longer needed, it can be destroyed by
|
|
31
|
+
disposing the respective v8::Isolate. If the embedder wishes to free all memory
|
|
32
|
+
associated with the v8::Isolate, it has to first clear all global handles
|
|
33
|
+
associated with that v8::Isolate.
|
|
34
|
+
|
|
35
|
+
# ECMAScript-like capabilities
|
|
36
|
+
|
|
37
|
+
In general, the C++ API shouldn't enable capabilities that aren't available to
|
|
38
|
+
scripts running in V8. Experience has shown that it's not possible to maintain
|
|
39
|
+
such API methods in the long term. However, capabilities also available to
|
|
40
|
+
scripts, i.e., ones that are defined in the ECMAScript standard are there to
|
|
41
|
+
stay, and we can safely expose them to embedders.
|
|
42
|
+
|
|
43
|
+
The C++ API should also be pleasant to use, and not require learning new
|
|
44
|
+
paradigms. Similarly to how the API exposed to scripts aims to provide good
|
|
45
|
+
ergonomics, we should aim to provide a reasonable developer experience for this
|
|
46
|
+
API surface.
|
|
47
|
+
|
|
48
|
+
ECMAScript makes heavy use of exceptions, however, V8's C++ code doesn't use
|
|
49
|
+
C++ exceptions. Therefore, all API methods that can throw exceptions should
|
|
50
|
+
indicate so by returning a v8::Maybe<> or v8::MaybeLocal<> result,
|
|
51
|
+
and by taking a v8::Local<v8::Context> parameter that indicates in which
|
|
52
|
+
context a possible exception should be thrown.
|
|
53
|
+
|
|
54
|
+
# API objects
|
|
55
|
+
|
|
56
|
+
V8 allows embedders to define special objects that expose additional
|
|
57
|
+
capabilities and APIs to scripts. The most prominent example is exposing the
|
|
58
|
+
HTML DOM in Blink. Other examples are e.g. node.js. It is less clear what kind
|
|
59
|
+
of capabilities we want to expose via this API surface. As a rule of thumb, we
|
|
60
|
+
want to expose operations as defined in the WebIDL and HTML spec: we
|
|
61
|
+
assume that those requirements are somewhat stable, and that they are a
|
|
62
|
+
superset of the requirements of other embedders including node.js.
|
|
63
|
+
|
|
64
|
+
Ideally, the API surfaces defined in those specs hook into the ECMAScript spec
|
|
65
|
+
which in turn guarantees long-term stability of the API.
|
|
66
|
+
|
|
67
|
+
# The V8 inspector
|
|
68
|
+
|
|
69
|
+
All debugging capabilities of V8 should be exposed via the inspector protocol.
|
|
70
|
+
The exception to this are profiling features exposed via v8-profiler.h.
|
|
71
|
+
Changes to the inspector protocol need to ensure backwards compatibility and
|
|
72
|
+
commitment to maintain.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include_rules = [
|
|
2
|
+
# v8-inspector-protocol.h depends on generated files under include/inspector.
|
|
3
|
+
"+inspector",
|
|
4
|
+
"+cppgc/common.h",
|
|
5
|
+
# Used by v8-cppgc.h to bridge to cppgc.
|
|
6
|
+
"+cppgc/custom-space.h",
|
|
7
|
+
"+cppgc/heap-statistics.h",
|
|
8
|
+
"+cppgc/internal/write-barrier.h",
|
|
9
|
+
"+cppgc/visitor.h",
|
|
10
|
+
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Metadata information for this directory.
|
|
2
|
+
#
|
|
3
|
+
# For more information on DIR_METADATA files, see:
|
|
4
|
+
# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
|
|
5
|
+
#
|
|
6
|
+
# For the schema of this file, see Metadata message:
|
|
7
|
+
# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
|
|
8
|
+
|
|
9
|
+
monorail {
|
|
10
|
+
component: "Blink>JavaScript>API"
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
adamk@chromium.org
|
|
2
|
+
cbruni@chromium.org
|
|
3
|
+
leszeks@chromium.org
|
|
4
|
+
mlippautz@chromium.org
|
|
5
|
+
verwaest@chromium.org
|
|
6
|
+
yangguo@chromium.org
|
|
7
|
+
|
|
8
|
+
per-file *DEPS=file:../COMMON_OWNERS
|
|
9
|
+
per-file v8-internal.h=file:../COMMON_OWNERS
|
|
10
|
+
|
|
11
|
+
per-file v8-debug.h=file:../src/debug/OWNERS
|
|
12
|
+
|
|
13
|
+
per-file js_protocol.pdl=file:../src/inspector/OWNERS
|
|
14
|
+
per-file v8-inspector*=file:../src/inspector/OWNERS
|
|
15
|
+
per-file v8-inspector*=file:../src/inspector/OWNERS
|
|
16
|
+
|
|
17
|
+
# Needed by the auto_tag builder
|
|
18
|
+
per-file v8-version.h=v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com
|
|
19
|
+
|
|
20
|
+
# For branch updates:
|
|
21
|
+
per-file v8-version.h=file:../INFRA_OWNERS
|
|
22
|
+
per-file v8-version.h=hablich@chromium.org
|
|
23
|
+
per-file v8-version.h=vahl@chromium.org
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Oilpan: C++ Garbage Collection
|
|
2
|
+
|
|
3
|
+
Oilpan is an open-source garbage collection library for C++ that can be used stand-alone or in collaboration with V8's JavaScript garbage collector.
|
|
4
|
+
Oilpan implements mark-and-sweep garbage collection (GC) with limited compaction (for a subset of objects).
|
|
5
|
+
|
|
6
|
+
**Key properties**
|
|
7
|
+
|
|
8
|
+
- Trace-based garbage collection;
|
|
9
|
+
- Incremental and concurrent marking;
|
|
10
|
+
- Incremental and concurrent sweeping;
|
|
11
|
+
- Precise on-heap memory layout;
|
|
12
|
+
- Conservative on-stack memory layout;
|
|
13
|
+
- Allows for collection with and without considering stack;
|
|
14
|
+
- Non-incremental and non-concurrent compaction for selected spaces;
|
|
15
|
+
|
|
16
|
+
See the [Hello World](https://chromium.googlesource.com/v8/v8/+/main/samples/cppgc/hello-world.cc) example on how to get started using Oilpan to manage C++ code.
|
|
17
|
+
|
|
18
|
+
Oilpan follows V8's project organization, see e.g. on how we accept [contributions](https://v8.dev/docs/contribute) and [provide a stable API](https://v8.dev/docs/api).
|
|
19
|
+
|
|
20
|
+
## Threading model
|
|
21
|
+
|
|
22
|
+
Oilpan features thread-local garbage collection and assumes heaps are not shared among threads.
|
|
23
|
+
In other words, objects are accessed and ultimately reclaimed by the garbage collector on the same thread that allocates them.
|
|
24
|
+
This allows Oilpan to run garbage collection in parallel with mutators running in other threads.
|
|
25
|
+
|
|
26
|
+
References to objects belonging to another thread's heap are modeled using cross-thread roots.
|
|
27
|
+
This is even true for on-heap to on-heap references.
|
|
28
|
+
|
|
29
|
+
## Heap partitioning
|
|
30
|
+
|
|
31
|
+
Oilpan's heaps are partitioned into spaces.
|
|
32
|
+
The space for an object is chosen depending on a number of criteria, e.g.:
|
|
33
|
+
|
|
34
|
+
- Objects over 64KiB are allocated in a large object space
|
|
35
|
+
- Objects can be assigned to a dedicated custom space.
|
|
36
|
+
Custom spaces can also be marked as compactable.
|
|
37
|
+
- Other objects are allocated in one of the normal page spaces bucketed depending on their size.
|
|
38
|
+
|
|
39
|
+
## Precise and conservative garbage collection
|
|
40
|
+
|
|
41
|
+
Oilpan supports two kinds of GCs:
|
|
42
|
+
|
|
43
|
+
1. **Conservative GC.**
|
|
44
|
+
A GC is called conservative when it is executed while the regular native stack is not empty.
|
|
45
|
+
In this case, the native stack might contain references to objects in Oilpan's heap, which should be kept alive.
|
|
46
|
+
The GC scans the native stack and treats the pointers discovered via the native stack as part of the root set.
|
|
47
|
+
This kind of GC is considered imprecise because values on stack other than references may accidentally appear as references to on-heap object, which means these objects will be kept alive despite being in practice unreachable from the application as an actual reference.
|
|
48
|
+
|
|
49
|
+
2. **Precise GC.**
|
|
50
|
+
A precise GC is triggered at the end of an event loop, which is controlled by an embedder via a platform.
|
|
51
|
+
At this point, it is guaranteed that there are no on-stack references pointing to Oilpan's heap.
|
|
52
|
+
This means there is no risk of confusing other value types with references.
|
|
53
|
+
Oilpan has precise knowledge of on-heap object layouts, and so it knows exactly where pointers lie in memory.
|
|
54
|
+
Oilpan can just start marking from the regular root set and collect all garbage precisely.
|
|
55
|
+
|
|
56
|
+
## Atomic, incremental and concurrent garbage collection
|
|
57
|
+
|
|
58
|
+
Oilpan has three modes of operation:
|
|
59
|
+
|
|
60
|
+
1. **Atomic GC.**
|
|
61
|
+
The entire GC cycle, including all its phases (e.g. see [Marking](#Marking-phase) and [Sweeping](#Sweeping-phase)), are executed back to back in a single pause.
|
|
62
|
+
This mode of operation is also known as Stop-The-World (STW) garbage collection.
|
|
63
|
+
It results in the most jank (due to a single long pause), but is overall the most efficient (e.g. no need for write barriers).
|
|
64
|
+
|
|
65
|
+
2. **Incremental GC.**
|
|
66
|
+
Garbage collection work is split up into multiple steps which are interleaved with the mutator, i.e. user code chunked into tasks.
|
|
67
|
+
Each step is a small chunk of work that is executed either as dedicated tasks between mutator tasks or, as needed, during mutator tasks.
|
|
68
|
+
Using incremental GC introduces the need for write barriers that record changes to the object graph so that a consistent state is observed and no objects are accidentally considered dead and reclaimed.
|
|
69
|
+
The incremental steps are followed by a smaller atomic pause to finalize garbage collection.
|
|
70
|
+
The smaller pause times, due to smaller chunks of work, helps with reducing jank.
|
|
71
|
+
|
|
72
|
+
3. **Concurrent GC.**
|
|
73
|
+
This is the most common type of GC.
|
|
74
|
+
It builds on top of incremental GC and offloads much of the garbage collection work away from the mutator thread and on to background threads.
|
|
75
|
+
Using concurrent GC allows the mutator thread to spend less time on GC and more on the actual mutator.
|
|
76
|
+
|
|
77
|
+
## Marking phase
|
|
78
|
+
|
|
79
|
+
The marking phase consists of the following steps:
|
|
80
|
+
|
|
81
|
+
1. Mark all objects in the root set.
|
|
82
|
+
|
|
83
|
+
2. Mark all objects transitively reachable from the root set by calling `Trace()` methods defined on each object.
|
|
84
|
+
|
|
85
|
+
3. Clear out all weak handles to unreachable objects and run weak callbacks.
|
|
86
|
+
|
|
87
|
+
The marking phase can be executed atomically in a stop-the-world manner, in which all 3 steps are executed one after the other.
|
|
88
|
+
|
|
89
|
+
Alternatively, it can also be executed incrementally/concurrently.
|
|
90
|
+
With incremental/concurrent marking, step 1 is executed in a short pause after which the mutator regains control.
|
|
91
|
+
Step 2 is repeatedly executed in an interleaved manner with the mutator.
|
|
92
|
+
When the GC is ready to finalize, i.e. step 2 is (almost) finished, another short pause is triggered in which step 2 is finished and step 3 is performed.
|
|
93
|
+
|
|
94
|
+
To prevent a user-after-free (UAF) issues it is required for Oilpan to know about all edges in the object graph.
|
|
95
|
+
This means that all pointers except on-stack pointers must be wrapped with Oilpan's handles (i.e., Persistent<>, Member<>, WeakMember<>).
|
|
96
|
+
Raw pointers to on-heap objects create an edge that Oilpan cannot observe and cause UAF issues
|
|
97
|
+
Thus, raw pointers shall not be used to reference on-heap objects (except for raw pointers on native stacks).
|
|
98
|
+
|
|
99
|
+
## Sweeping phase
|
|
100
|
+
|
|
101
|
+
The sweeping phase consists of the following steps:
|
|
102
|
+
|
|
103
|
+
1. Invoke pre-finalizers.
|
|
104
|
+
At this point, no destructors have been invoked and no memory has been reclaimed.
|
|
105
|
+
Pre-finalizers are allowed to access any other on-heap objects, even those that may get destructed.
|
|
106
|
+
|
|
107
|
+
2. Sweeping invokes destructors of the dead (unreachable) objects and reclaims memory to be reused by future allocations.
|
|
108
|
+
|
|
109
|
+
Assumptions should not be made about the order and the timing of their execution.
|
|
110
|
+
There is no guarantee on the order in which the destructors are invoked.
|
|
111
|
+
That's why destructors must not access any other on-heap objects (which might have already been destructed).
|
|
112
|
+
If some destructor unavoidably needs to access other on-heap objects, it will have to be converted to a pre-finalizer.
|
|
113
|
+
The pre-finalizer is allowed to access other on-heap objects.
|
|
114
|
+
|
|
115
|
+
The mutator is resumed before all destructors have ran.
|
|
116
|
+
For example, imagine a case where X is a client of Y, and Y holds a list of clients.
|
|
117
|
+
If the code relies on X's destructor removing X from the list, there is a risk that Y iterates the list and calls some method of X which may touch other on-heap objects.
|
|
118
|
+
This causes a use-after-free.
|
|
119
|
+
Care must be taken to make sure that X is explicitly removed from the list before the mutator resumes its execution in a way that doesn't rely on X's destructor (e.g. a pre-finalizer).
|
|
120
|
+
|
|
121
|
+
Similar to marking, sweeping can be executed in either an atomic stop-the-world manner or incrementally/concurrently.
|
|
122
|
+
With incremental/concurrent sweeping, step 2 is interleaved with mutator.
|
|
123
|
+
Incremental/concurrent sweeping can be atomically finalized in case it is needed to trigger another GC cycle.
|
|
124
|
+
Even with concurrent sweeping, destructors are guaranteed to run on the thread the object has been allocated on to preserve C++ semantics.
|
|
125
|
+
|
|
126
|
+
Notes:
|
|
127
|
+
|
|
128
|
+
* Weak processing runs only when the holder object of the WeakMember outlives the pointed object.
|
|
129
|
+
If the holder object and the pointed object die at the same time, weak processing doesn't run.
|
|
130
|
+
It is wrong to write code assuming that the weak processing always runs.
|
|
131
|
+
|
|
132
|
+
* Pre-finalizers are heavy because the thread needs to scan all pre-finalizers at each sweeping phase to determine which pre-finalizers should be invoked (the thread needs to invoke pre-finalizers of dead objects).
|
|
133
|
+
Adding pre-finalizers to frequently created objects should be avoided.
|