@kungfu-tech/libnode-win32-x64 0.0.0-bootstrap.0 → 22.22.3-kf.1
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/LICENSE +201 -0
- package/README.md +3 -0
- package/dist/node/include/acorn_version.h +6 -0
- package/dist/node/include/aliased_buffer-inl.h +244 -0
- package/dist/node/include/aliased_buffer.h +206 -0
- package/dist/node/include/aliased_struct-inl.h +54 -0
- package/dist/node/include/aliased_struct.h +63 -0
- package/dist/node/include/amaro_version.h +6 -0
- package/dist/node/include/async_context_frame.h +33 -0
- package/dist/node/include/async_wrap-inl.h +96 -0
- package/dist/node/include/async_wrap.h +243 -0
- package/dist/node/include/base_object-inl.h +335 -0
- package/dist/node/include/base_object.h +342 -0
- package/dist/node/include/base_object_types.h +74 -0
- package/dist/node/include/blob_serializer_deserializer-inl.h +385 -0
- package/dist/node/include/blob_serializer_deserializer.h +132 -0
- package/dist/node/include/callback_queue-inl.h +97 -0
- package/dist/node/include/callback_queue.h +79 -0
- package/dist/node/include/cares_wrap.h +447 -0
- package/dist/node/include/cjs_module_lexer_version.h +6 -0
- package/dist/node/include/cleanup_queue-inl.h +36 -0
- package/dist/node/include/cleanup_queue.h +79 -0
- package/dist/node/include/compile_cache.h +104 -0
- package/dist/node/include/connect_wrap.h +26 -0
- package/dist/node/include/connection_wrap.h +30 -0
- package/dist/node/include/cppgc/allocation.h +310 -0
- package/dist/node/include/cppgc/common.h +28 -0
- package/dist/node/include/cppgc/cross-thread-persistent.h +466 -0
- package/dist/node/include/cppgc/custom-space.h +97 -0
- package/dist/node/include/cppgc/default-platform.h +67 -0
- package/dist/node/include/cppgc/ephemeron-pair.h +30 -0
- package/dist/node/include/cppgc/explicit-management.h +100 -0
- package/dist/node/include/cppgc/garbage-collected.h +106 -0
- package/dist/node/include/cppgc/heap-consistency.h +309 -0
- package/dist/node/include/cppgc/heap-handle.h +48 -0
- package/dist/node/include/cppgc/heap-state.h +82 -0
- package/dist/node/include/cppgc/heap-statistics.h +120 -0
- package/dist/node/include/cppgc/heap.h +202 -0
- package/dist/node/include/cppgc/internal/api-constants.h +87 -0
- package/dist/node/include/cppgc/internal/atomic-entry-flag.h +48 -0
- package/dist/node/include/cppgc/internal/base-page-handle.h +45 -0
- package/dist/node/include/cppgc/internal/caged-heap-local-data.h +121 -0
- package/dist/node/include/cppgc/internal/caged-heap.h +68 -0
- package/dist/node/include/cppgc/internal/compiler-specific.h +38 -0
- package/dist/node/include/cppgc/internal/finalizer-trait.h +93 -0
- package/dist/node/include/cppgc/internal/gc-info.h +148 -0
- package/dist/node/include/cppgc/internal/logging.h +50 -0
- package/dist/node/include/cppgc/internal/member-storage.h +256 -0
- package/dist/node/include/cppgc/internal/name-trait.h +137 -0
- package/dist/node/include/cppgc/internal/persistent-node.h +214 -0
- package/dist/node/include/cppgc/internal/pointer-policies.h +243 -0
- package/dist/node/include/cppgc/internal/write-barrier.h +487 -0
- package/dist/node/include/cppgc/liveness-broker.h +78 -0
- package/dist/node/include/cppgc/macros.h +35 -0
- package/dist/node/include/cppgc/member.h +629 -0
- package/dist/node/include/cppgc/name-provider.h +65 -0
- package/dist/node/include/cppgc/object-size-trait.h +58 -0
- package/dist/node/include/cppgc/persistent.h +377 -0
- package/dist/node/include/cppgc/platform.h +163 -0
- package/dist/node/include/cppgc/prefinalizer.h +75 -0
- package/dist/node/include/cppgc/process-heap-statistics.h +36 -0
- package/dist/node/include/cppgc/sentinel-pointer.h +39 -0
- package/dist/node/include/cppgc/source-location.h +16 -0
- package/dist/node/include/cppgc/testing.h +106 -0
- package/dist/node/include/cppgc/trace-trait.h +128 -0
- package/dist/node/include/cppgc/type-traits.h +271 -0
- package/dist/node/include/cppgc/visitor.h +504 -0
- package/dist/node/include/crypto/crypto_aes.h +88 -0
- package/dist/node/include/crypto/crypto_bio.h +193 -0
- package/dist/node/include/crypto/crypto_cipher.h +293 -0
- package/dist/node/include/crypto/crypto_clienthello-inl.h +90 -0
- package/dist/node/include/crypto/crypto_clienthello.h +131 -0
- package/dist/node/include/crypto/crypto_common.h +64 -0
- package/dist/node/include/crypto/crypto_context.h +171 -0
- package/dist/node/include/crypto/crypto_dh.h +126 -0
- package/dist/node/include/crypto/crypto_dsa.h +52 -0
- package/dist/node/include/crypto/crypto_ec.h +164 -0
- package/dist/node/include/crypto/crypto_hash.h +91 -0
- package/dist/node/include/crypto/crypto_hkdf.h +61 -0
- package/dist/node/include/crypto/crypto_hmac.h +92 -0
- package/dist/node/include/crypto/crypto_keygen.h +299 -0
- package/dist/node/include/crypto/crypto_keys.h +392 -0
- package/dist/node/include/crypto/crypto_pbkdf2.h +74 -0
- package/dist/node/include/crypto/crypto_random.h +124 -0
- package/dist/node/include/crypto/crypto_rsa.h +136 -0
- package/dist/node/include/crypto/crypto_scrypt.h +85 -0
- package/dist/node/include/crypto/crypto_sig.h +165 -0
- package/dist/node/include/crypto/crypto_spkac.h +21 -0
- package/dist/node/include/crypto/crypto_timing.h +20 -0
- package/dist/node/include/crypto/crypto_tls.h +305 -0
- package/dist/node/include/crypto/crypto_util.h +725 -0
- package/dist/node/include/crypto/crypto_x509.h +140 -0
- package/dist/node/include/dataqueue/queue.h +306 -0
- package/dist/node/include/debug_utils-inl.h +278 -0
- package/dist/node/include/debug_utils.h +196 -0
- package/dist/node/include/diagnosticfilename-inl.h +33 -0
- package/dist/node/include/embedded_data.h +17 -0
- package/dist/node/include/encoding_binding.h +61 -0
- package/dist/node/include/env-inl.h +984 -0
- package/dist/node/include/env.h +1287 -0
- package/dist/node/include/env_properties.h +540 -0
- package/dist/node/include/handle_wrap.h +123 -0
- package/dist/node/include/histogram-inl.h +107 -0
- package/dist/node/include/histogram.h +279 -0
- package/dist/node/include/inspector/io_agent.h +30 -0
- package/dist/node/include/inspector/main_thread_interface.h +116 -0
- package/dist/node/include/inspector/network_agent.h +94 -0
- package/dist/node/include/inspector/network_inspector.h +45 -0
- package/dist/node/include/inspector/network_requests_buffer.h +195 -0
- package/dist/node/include/inspector/network_resource_manager.h +29 -0
- package/dist/node/include/inspector/node_json.h +24 -0
- package/dist/node/include/inspector/node_string.h +101 -0
- package/dist/node/include/inspector/protocol_helper.h +27 -0
- package/dist/node/include/inspector/runtime_agent.h +41 -0
- package/dist/node/include/inspector/target_agent.h +75 -0
- package/dist/node/include/inspector/tracing_agent.h +43 -0
- package/dist/node/include/inspector/worker_agent.h +40 -0
- package/dist/node/include/inspector/worker_inspector.h +124 -0
- package/dist/node/include/inspector_agent.h +165 -0
- package/dist/node/include/inspector_io.h +78 -0
- package/dist/node/include/inspector_profiler.h +149 -0
- package/dist/node/include/inspector_socket.h +60 -0
- package/dist/node/include/inspector_socket_server.h +110 -0
- package/dist/node/include/js_native_api.h +607 -0
- package/dist/node/include/js_native_api_types.h +226 -0
- package/dist/node/include/js_native_api_v8.h +485 -0
- package/dist/node/include/js_native_api_v8_internals.h +45 -0
- package/dist/node/include/js_stream.h +52 -0
- package/dist/node/include/json_utils.h +172 -0
- package/dist/node/include/large_pages/node_large_page.h +34 -0
- package/dist/node/include/libplatform/libplatform-export.h +29 -0
- package/dist/node/include/libplatform/libplatform.h +112 -0
- package/dist/node/include/libplatform/v8-tracing.h +333 -0
- package/dist/node/include/memory_tracker-inl.h +359 -0
- package/dist/node/include/memory_tracker.h +289 -0
- package/dist/node/include/module_wrap.h +216 -0
- package/dist/node/include/node.h +1593 -0
- package/dist/node/include/node_api.h +265 -0
- package/dist/node/include/node_api_internals.h +48 -0
- package/dist/node/include/node_api_types.h +56 -0
- package/dist/node/include/node_binding.h +161 -0
- package/dist/node/include/node_blob.h +159 -0
- package/dist/node/include/node_bob-inl.h +36 -0
- package/dist/node/include/node_bob.h +107 -0
- package/dist/node/include/node_buffer.h +92 -0
- package/dist/node/include/node_builtins.h +220 -0
- package/dist/node/include/node_config_file.h +46 -0
- package/dist/node/include/node_constants.h +82 -0
- package/dist/node/include/node_context_data.h +168 -0
- package/dist/node/include/node_contextify.h +204 -0
- package/dist/node/include/node_crypto.h +56 -0
- package/dist/node/include/node_debug.h +30 -0
- package/dist/node/include/node_dir.h +52 -0
- package/dist/node/include/node_dotenv.h +45 -0
- package/dist/node/include/node_errors.h +380 -0
- package/dist/node/include/node_exit_code.h +54 -0
- package/dist/node/include/node_external_reference.h +165 -0
- package/dist/node/include/node_file-inl.h +406 -0
- package/dist/node/include/node_file.h +537 -0
- package/dist/node/include/node_http2.h +1177 -0
- package/dist/node/include/node_http2_state.h +159 -0
- package/dist/node/include/node_http_common-inl.h +202 -0
- package/dist/node/include/node_http_common.h +535 -0
- package/dist/node/include/node_i18n.h +132 -0
- package/dist/node/include/node_internals.h +483 -0
- package/dist/node/include/node_main_instance.h +67 -0
- package/dist/node/include/node_mem-inl.h +113 -0
- package/dist/node/include/node_mem.h +45 -0
- package/dist/node/include/node_messaging.h +389 -0
- package/dist/node/include/node_metadata.h +164 -0
- package/dist/node/include/node_modules.h +91 -0
- package/dist/node/include/node_mutex.h +323 -0
- package/dist/node/include/node_object_wrap.h +132 -0
- package/dist/node/include/node_options-inl.h +490 -0
- package/dist/node/include/node_options.h +615 -0
- package/dist/node/include/node_perf.h +166 -0
- package/dist/node/include/node_perf_common.h +102 -0
- package/dist/node/include/node_platform.h +238 -0
- package/dist/node/include/node_process-inl.h +26 -0
- package/dist/node/include/node_process.h +112 -0
- package/dist/node/include/node_realm-inl.h +151 -0
- package/dist/node/include/node_realm.h +183 -0
- package/dist/node/include/node_report.h +43 -0
- package/dist/node/include/node_revert.h +82 -0
- package/dist/node/include/node_root_certs.h +3520 -0
- package/dist/node/include/node_sea.h +74 -0
- package/dist/node/include/node_shadow_realm.h +46 -0
- package/dist/node/include/node_snapshot_builder.h +57 -0
- package/dist/node/include/node_snapshotable.h +174 -0
- package/dist/node/include/node_sockaddr-inl.h +257 -0
- package/dist/node/include/node_sockaddr.h +394 -0
- package/dist/node/include/node_sqlite.h +270 -0
- package/dist/node/include/node_stat_watcher.h +73 -0
- package/dist/node/include/node_task_runner.h +92 -0
- package/dist/node/include/node_threadsafe_cow-inl.h +54 -0
- package/dist/node/include/node_threadsafe_cow.h +105 -0
- package/dist/node/include/node_union_bytes.h +81 -0
- package/dist/node/include/node_url.h +96 -0
- package/dist/node/include/node_v8.h +77 -0
- package/dist/node/include/node_v8_platform-inl.h +185 -0
- package/dist/node/include/node_version.h +110 -0
- package/dist/node/include/node_wasi.h +184 -0
- package/dist/node/include/node_wasm_web_api.h +55 -0
- package/dist/node/include/node_watchdog.h +154 -0
- package/dist/node/include/node_webstorage.h +60 -0
- package/dist/node/include/node_worker.h +158 -0
- package/dist/node/include/path.h +33 -0
- package/dist/node/include/permission/addon_permission.h +31 -0
- package/dist/node/include/permission/child_process_permission.h +31 -0
- package/dist/node/include/permission/fs_permission.h +167 -0
- package/dist/node/include/permission/inspector_permission.h +31 -0
- package/dist/node/include/permission/permission.h +138 -0
- package/dist/node/include/permission/permission_base.h +65 -0
- package/dist/node/include/permission/wasi_permission.h +31 -0
- package/dist/node/include/permission/worker_permission.h +31 -0
- package/dist/node/include/pipe_wrap.h +80 -0
- package/dist/node/include/quic/application.h +159 -0
- package/dist/node/include/quic/bindingdata.h +272 -0
- package/dist/node/include/quic/cid.h +127 -0
- package/dist/node/include/quic/data.h +148 -0
- package/dist/node/include/quic/defs.h +245 -0
- package/dist/node/include/quic/endpoint.h +458 -0
- package/dist/node/include/quic/http3.h +15 -0
- package/dist/node/include/quic/logstream.h +81 -0
- package/dist/node/include/quic/packet.h +152 -0
- package/dist/node/include/quic/preferredaddress.h +72 -0
- package/dist/node/include/quic/session.h +443 -0
- package/dist/node/include/quic/sessionticket.h +108 -0
- package/dist/node/include/quic/streams.h +232 -0
- package/dist/node/include/quic/tlscontext.h +227 -0
- package/dist/node/include/quic/tokens.h +256 -0
- package/dist/node/include/quic/transportparams.h +165 -0
- package/dist/node/include/req_wrap-inl.h +171 -0
- package/dist/node/include/req_wrap.h +77 -0
- package/dist/node/include/spawn_sync.h +243 -0
- package/dist/node/include/stream_base-inl.h +173 -0
- package/dist/node/include/stream_base.h +478 -0
- package/dist/node/include/stream_pipe.h +76 -0
- package/dist/node/include/stream_wrap.h +132 -0
- package/dist/node/include/string_bytes.h +113 -0
- package/dist/node/include/string_decoder-inl.h +31 -0
- package/dist/node/include/string_decoder.h +49 -0
- package/dist/node/include/tcp_wrap.h +105 -0
- package/dist/node/include/threadpoolwork-inl.h +70 -0
- package/dist/node/include/timer_wrap-inl.h +32 -0
- package/dist/node/include/timer_wrap.h +85 -0
- package/dist/node/include/timers.h +70 -0
- package/dist/node/include/tracing/agent.h +195 -0
- package/dist/node/include/tracing/node_trace_buffer.h +83 -0
- package/dist/node/include/tracing/node_trace_writer.h +75 -0
- package/dist/node/include/tracing/trace_event.h +722 -0
- package/dist/node/include/tracing/trace_event_common.h +1109 -0
- package/dist/node/include/tracing/traced_value.h +129 -0
- package/dist/node/include/tty_wrap.h +65 -0
- package/dist/node/include/udp_wrap.h +230 -0
- package/dist/node/include/undici_version.h +6 -0
- package/dist/node/include/util-inl.h +700 -0
- package/dist/node/include/util.h +1021 -0
- package/dist/node/include/uv/aix.h +32 -0
- package/dist/node/include/uv/bsd.h +34 -0
- package/dist/node/include/uv/darwin.h +61 -0
- package/dist/node/include/uv/errno.h +483 -0
- package/dist/node/include/uv/linux.h +34 -0
- package/dist/node/include/uv/os390.h +33 -0
- package/dist/node/include/uv/posix.h +31 -0
- package/dist/node/include/uv/sunos.h +44 -0
- package/dist/node/include/uv/threadpool.h +37 -0
- package/dist/node/include/uv/tree.h +521 -0
- package/dist/node/include/uv/unix.h +512 -0
- package/dist/node/include/uv/version.h +43 -0
- package/dist/node/include/uv/win.h +698 -0
- package/dist/node/include/uv.h +1990 -0
- package/dist/node/include/v8-array-buffer.h +525 -0
- package/dist/node/include/v8-callbacks.h +462 -0
- package/dist/node/include/v8-container.h +183 -0
- package/dist/node/include/v8-context.h +485 -0
- package/dist/node/include/v8-cppgc.h +245 -0
- package/dist/node/include/v8-data.h +80 -0
- package/dist/node/include/v8-date.h +48 -0
- package/dist/node/include/v8-debug.h +168 -0
- package/dist/node/include/v8-embedder-heap.h +82 -0
- package/dist/node/include/v8-embedder-state-scope.h +52 -0
- package/dist/node/include/v8-exception.h +223 -0
- package/dist/node/include/v8-extension.h +62 -0
- package/dist/node/include/v8-external.h +37 -0
- package/dist/node/include/v8-fast-api-calls.h +984 -0
- package/dist/node/include/v8-forward.h +82 -0
- package/dist/node/include/v8-function-callback.h +607 -0
- package/dist/node/include/v8-function.h +140 -0
- package/dist/node/include/v8-handle-base.h +137 -0
- package/dist/node/include/v8-initialization.h +289 -0
- package/dist/node/include/v8-inspector-protocol.h +13 -0
- package/dist/node/include/v8-inspector.h +419 -0
- package/dist/node/include/v8-internal.h +1397 -0
- package/dist/node/include/v8-isolate.h +1767 -0
- package/dist/node/include/v8-json.h +47 -0
- package/dist/node/include/v8-local-handle.h +758 -0
- package/dist/node/include/v8-locker.h +138 -0
- package/dist/node/include/v8-maybe.h +160 -0
- package/dist/node/include/v8-memory-span.h +198 -0
- package/dist/node/include/v8-message.h +233 -0
- package/dist/node/include/v8-metrics.h +264 -0
- package/dist/node/include/v8-microtask-queue.h +157 -0
- package/dist/node/include/v8-microtask.h +28 -0
- package/dist/node/include/v8-object.h +824 -0
- package/dist/node/include/v8-persistent-handle.h +582 -0
- package/dist/node/include/v8-platform.h +1358 -0
- package/dist/node/include/v8-primitive-object.h +118 -0
- package/dist/node/include/v8-primitive.h +877 -0
- package/dist/node/include/v8-profiler.h +1302 -0
- package/dist/node/include/v8-promise.h +174 -0
- package/dist/node/include/v8-proxy.h +50 -0
- package/dist/node/include/v8-regexp.h +106 -0
- package/dist/node/include/v8-script.h +904 -0
- package/dist/node/include/v8-snapshot.h +266 -0
- package/dist/node/include/v8-source-location.h +92 -0
- package/dist/node/include/v8-statistics.h +238 -0
- package/dist/node/include/v8-template.h +1297 -0
- package/dist/node/include/v8-traced-handle.h +432 -0
- package/dist/node/include/v8-typed-array.h +390 -0
- package/dist/node/include/v8-unwinder-state.h +31 -0
- package/dist/node/include/v8-unwinder.h +132 -0
- package/dist/node/include/v8-util.h +665 -0
- package/dist/node/include/v8-value-serializer-version.h +24 -0
- package/dist/node/include/v8-value-serializer.h +316 -0
- package/dist/node/include/v8-value.h +655 -0
- package/dist/node/include/v8-version-string.h +38 -0
- package/dist/node/include/v8-version.h +20 -0
- package/dist/node/include/v8-wasm-trap-handler-posix.h +31 -0
- package/dist/node/include/v8-wasm-trap-handler-win.h +28 -0
- package/dist/node/include/v8-wasm.h +201 -0
- package/dist/node/include/v8-weak-callback-info.h +80 -0
- package/dist/node/include/v8.h +88 -0
- package/dist/node/include/v8config.h +981 -0
- package/dist/node/include/zlib_version.h +6 -0
- package/dist/node/libnode.dll +0 -0
- package/dist/node/libnode.lib +0 -0
- package/dist/node/libnodebuildinfo.json +10 -0
- package/dist/node/link_node.lib +0 -0
- package/dist/node/link_node.node +0 -0
- package/index.js +5 -0
- package/libnode.release.json +8 -0
- package/package.json +29 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
+
// copy of this software and associated documentation files (the
|
|
5
|
+
// "Software"), to deal in the Software without restriction, including
|
|
6
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
// following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included
|
|
12
|
+
// in all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
15
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
17
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
18
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
19
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
20
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
|
+
|
|
22
|
+
#ifndef SRC_NODE_STAT_WATCHER_H_
|
|
23
|
+
#define SRC_NODE_STAT_WATCHER_H_
|
|
24
|
+
|
|
25
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
26
|
+
|
|
27
|
+
#include "node.h"
|
|
28
|
+
#include "handle_wrap.h"
|
|
29
|
+
#include "uv.h"
|
|
30
|
+
#include "v8.h"
|
|
31
|
+
|
|
32
|
+
namespace node {
|
|
33
|
+
namespace fs {
|
|
34
|
+
class BindingData;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class Environment;
|
|
38
|
+
class ExternalReferenceRegistry;
|
|
39
|
+
|
|
40
|
+
class StatWatcher : public HandleWrap {
|
|
41
|
+
public:
|
|
42
|
+
static void CreatePerIsolateProperties(IsolateData* isolate_data,
|
|
43
|
+
v8::Local<v8::ObjectTemplate> ctor);
|
|
44
|
+
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
|
|
45
|
+
|
|
46
|
+
protected:
|
|
47
|
+
StatWatcher(fs::BindingData* binding_data,
|
|
48
|
+
v8::Local<v8::Object> wrap,
|
|
49
|
+
bool use_bigint);
|
|
50
|
+
|
|
51
|
+
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
52
|
+
static void Start(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
53
|
+
|
|
54
|
+
SET_NO_MEMORY_INFO()
|
|
55
|
+
SET_MEMORY_INFO_NAME(StatWatcher)
|
|
56
|
+
SET_SELF_SIZE(StatWatcher)
|
|
57
|
+
|
|
58
|
+
private:
|
|
59
|
+
static void Callback(uv_fs_poll_t* handle,
|
|
60
|
+
int status,
|
|
61
|
+
const uv_stat_t* prev,
|
|
62
|
+
const uv_stat_t* curr);
|
|
63
|
+
|
|
64
|
+
uv_fs_poll_t watcher_;
|
|
65
|
+
const bool use_bigint_;
|
|
66
|
+
BaseObjectPtr<fs::BindingData> binding_data_;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace node
|
|
70
|
+
|
|
71
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
72
|
+
|
|
73
|
+
#endif // SRC_NODE_STAT_WATCHER_H_
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#ifndef SRC_NODE_TASK_RUNNER_H_
|
|
2
|
+
#define SRC_NODE_TASK_RUNNER_H_
|
|
3
|
+
|
|
4
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
+
|
|
6
|
+
#include "node_internals.h"
|
|
7
|
+
#include "simdjson.h"
|
|
8
|
+
#include "spawn_sync.h"
|
|
9
|
+
#include "uv.h"
|
|
10
|
+
|
|
11
|
+
#include <filesystem>
|
|
12
|
+
#include <optional>
|
|
13
|
+
#include <string_view>
|
|
14
|
+
#include <tuple>
|
|
15
|
+
|
|
16
|
+
namespace node::task_runner {
|
|
17
|
+
|
|
18
|
+
using PositionalArgs = std::vector<std::string_view>;
|
|
19
|
+
|
|
20
|
+
// ProcessRunner is the class responsible for running a process.
|
|
21
|
+
// A class instance is created for each process to be run.
|
|
22
|
+
// The class is responsible for spawning the process and handling its exit.
|
|
23
|
+
// The class also handles the environment variables and arguments.
|
|
24
|
+
class ProcessRunner {
|
|
25
|
+
public:
|
|
26
|
+
ProcessRunner(std::shared_ptr<InitializationResultImpl> result,
|
|
27
|
+
const std::filesystem::path& package_json_path,
|
|
28
|
+
std::string_view script_name,
|
|
29
|
+
std::string_view command,
|
|
30
|
+
std::string_view path_env_var,
|
|
31
|
+
const PositionalArgs& positional_args);
|
|
32
|
+
void Run();
|
|
33
|
+
static void ExitCallback(uv_process_t* req,
|
|
34
|
+
int64_t exit_status,
|
|
35
|
+
int term_signal);
|
|
36
|
+
|
|
37
|
+
private:
|
|
38
|
+
uv_loop_t* loop_ = uv_default_loop();
|
|
39
|
+
uv_process_t process_{};
|
|
40
|
+
uv_process_options_t options_{};
|
|
41
|
+
uv_stdio_container_t child_stdio_[3]{};
|
|
42
|
+
std::shared_ptr<InitializationResultImpl> init_result_;
|
|
43
|
+
std::vector<std::string> command_args_{};
|
|
44
|
+
std::vector<std::string> env_vars_{};
|
|
45
|
+
std::unique_ptr<char* []> env_ {}; // memory for options_.env
|
|
46
|
+
std::unique_ptr<char* []> arg_ {}; // memory for options_.args
|
|
47
|
+
std::string cwd_;
|
|
48
|
+
|
|
49
|
+
// OnExit is the callback function that is called when the process exits.
|
|
50
|
+
void OnExit(int64_t exit_status, int term_signal);
|
|
51
|
+
void SetEnvironmentVariables();
|
|
52
|
+
|
|
53
|
+
#ifdef _WIN32
|
|
54
|
+
std::string file_ = "cmd.exe";
|
|
55
|
+
#else
|
|
56
|
+
std::string file_ = "/bin/sh";
|
|
57
|
+
#endif // _WIN32
|
|
58
|
+
|
|
59
|
+
// Represents the absolute path to the package.json file.
|
|
60
|
+
std::filesystem::path package_json_path_;
|
|
61
|
+
// Represents the name of the script that is being run.
|
|
62
|
+
std::string script_name_;
|
|
63
|
+
// Represents PATH environment variable that contains
|
|
64
|
+
// all subdirectory paths appended with node_modules/.bin suffix.
|
|
65
|
+
std::string path_env_var_;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// This function traverses up to the root directory.
|
|
69
|
+
// While traversing up, if it finds a package.json file, it reads its content.
|
|
70
|
+
// If it cannot find a package.json file, it returns std::nullopt.
|
|
71
|
+
// Otherwise, it returns a tuple of:
|
|
72
|
+
// - the path to the package.json file
|
|
73
|
+
// - package.json file content
|
|
74
|
+
// - `path_env_var` variable
|
|
75
|
+
//
|
|
76
|
+
// For example, on POSIX, it returns the following for `path_env_var`,
|
|
77
|
+
// if the current directory is `/anonrig`:
|
|
78
|
+
// `/anonrig/node_modules/.bin:/node_modules/.bin`
|
|
79
|
+
std::optional<std::tuple<std::filesystem::path, std::string, std::string>>
|
|
80
|
+
FindPackageJson(const std::filesystem::path& cwd);
|
|
81
|
+
|
|
82
|
+
void RunTask(const std::shared_ptr<InitializationResultImpl>& result,
|
|
83
|
+
std::string_view command_id,
|
|
84
|
+
const PositionalArgs& positional_args);
|
|
85
|
+
PositionalArgs GetPositionalArgs(const std::vector<std::string>& args);
|
|
86
|
+
std::string EscapeShell(std::string_view command);
|
|
87
|
+
|
|
88
|
+
} // namespace node::task_runner
|
|
89
|
+
|
|
90
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
91
|
+
|
|
92
|
+
#endif // SRC_NODE_TASK_RUNNER_H_
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#ifndef SRC_NODE_THREADSAFE_COW_INL_H_
|
|
2
|
+
#define SRC_NODE_THREADSAFE_COW_INL_H_
|
|
3
|
+
|
|
4
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
+
|
|
6
|
+
namespace node {
|
|
7
|
+
|
|
8
|
+
template <typename T>
|
|
9
|
+
T* CopyOnWrite<T>::write() {
|
|
10
|
+
if (data_.use_count() > 1l) {
|
|
11
|
+
data_ = std::make_shared<T>(*data_);
|
|
12
|
+
}
|
|
13
|
+
return data_.get();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
template <typename T>
|
|
17
|
+
ThreadsafeCopyOnWrite<T>::Read::Read(const ThreadsafeCopyOnWrite<T>* cow)
|
|
18
|
+
: cow_(cow), lock_(cow->impl_->mutex) {}
|
|
19
|
+
|
|
20
|
+
template <typename T>
|
|
21
|
+
const T& ThreadsafeCopyOnWrite<T>::Read::operator*() const {
|
|
22
|
+
return cow_->impl_->data;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
template <typename T>
|
|
26
|
+
const T* ThreadsafeCopyOnWrite<T>::Read::operator->() const {
|
|
27
|
+
return &cow_->impl_->data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
template <typename T>
|
|
31
|
+
ThreadsafeCopyOnWrite<T>::Write::Write(ThreadsafeCopyOnWrite<T>* cow)
|
|
32
|
+
: cow_(cow), impl_(cow->impl_.write()), lock_(impl_->mutex) {}
|
|
33
|
+
|
|
34
|
+
template <typename T>
|
|
35
|
+
T& ThreadsafeCopyOnWrite<T>::Write::operator*() {
|
|
36
|
+
return impl_->data;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
template <typename T>
|
|
40
|
+
T* ThreadsafeCopyOnWrite<T>::Write::operator->() {
|
|
41
|
+
return &impl_->data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
template <typename T>
|
|
45
|
+
ThreadsafeCopyOnWrite<T>::Impl::Impl(const Impl& other) {
|
|
46
|
+
RwLock::ScopedReadLock lock(other.mutex);
|
|
47
|
+
data = other.data;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
} // namespace node
|
|
51
|
+
|
|
52
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
53
|
+
|
|
54
|
+
#endif // SRC_NODE_THREADSAFE_COW_INL_H_
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#ifndef SRC_NODE_THREADSAFE_COW_H_
|
|
2
|
+
#define SRC_NODE_THREADSAFE_COW_H_
|
|
3
|
+
|
|
4
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
+
|
|
6
|
+
#include "util.h"
|
|
7
|
+
#include "uv.h"
|
|
8
|
+
|
|
9
|
+
#include <memory> // std::shared_ptr<T>
|
|
10
|
+
#include <utility> // std::forward<T>
|
|
11
|
+
|
|
12
|
+
namespace node {
|
|
13
|
+
|
|
14
|
+
// Copy-on-write utility. Not threadsafe, i.e. there is no synchronization
|
|
15
|
+
// of the copy operation with other operations.
|
|
16
|
+
template <typename T>
|
|
17
|
+
class CopyOnWrite final {
|
|
18
|
+
public:
|
|
19
|
+
template <typename... Args>
|
|
20
|
+
explicit CopyOnWrite(Args&&... args)
|
|
21
|
+
: data_(std::make_shared<T>(std::forward<Args>(args)...)) {}
|
|
22
|
+
|
|
23
|
+
CopyOnWrite(const CopyOnWrite<T>& other) = default;
|
|
24
|
+
CopyOnWrite& operator=(const CopyOnWrite<T>& other) = default;
|
|
25
|
+
CopyOnWrite(CopyOnWrite<T>&& other) = default;
|
|
26
|
+
CopyOnWrite& operator=(CopyOnWrite<T>&& other) = default;
|
|
27
|
+
|
|
28
|
+
const T* read() const { return data_.get(); }
|
|
29
|
+
T* write();
|
|
30
|
+
|
|
31
|
+
const T& operator*() const { return *read(); }
|
|
32
|
+
const T* operator->() const { return read(); }
|
|
33
|
+
|
|
34
|
+
private:
|
|
35
|
+
std::shared_ptr<T> data_;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Threadsafe copy-on-write utility. Consumers need to use the Read and
|
|
39
|
+
// Write helpers to access the target data structure.
|
|
40
|
+
template <typename T>
|
|
41
|
+
class ThreadsafeCopyOnWrite final {
|
|
42
|
+
private:
|
|
43
|
+
// Define this early since some of the public members depend on it
|
|
44
|
+
// and some compilers need it to be defined first in that case.
|
|
45
|
+
struct Impl {
|
|
46
|
+
explicit Impl(const T& data) : data(data) {}
|
|
47
|
+
explicit Impl(T&& data) : data(std::move(data)) {}
|
|
48
|
+
|
|
49
|
+
Impl(const Impl& other);
|
|
50
|
+
Impl& operator=(const Impl& other) = delete;
|
|
51
|
+
Impl(Impl&& other) = delete;
|
|
52
|
+
Impl& operator=(Impl&& other) = delete;
|
|
53
|
+
|
|
54
|
+
RwLock mutex;
|
|
55
|
+
T data;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
template <typename... Args>
|
|
60
|
+
ThreadsafeCopyOnWrite(Args&&... args)
|
|
61
|
+
: impl_(T(std::forward<Args>(args)...)) {}
|
|
62
|
+
|
|
63
|
+
ThreadsafeCopyOnWrite(const ThreadsafeCopyOnWrite<T>& other) = default;
|
|
64
|
+
ThreadsafeCopyOnWrite& operator=(const ThreadsafeCopyOnWrite<T>& other) =
|
|
65
|
+
default;
|
|
66
|
+
ThreadsafeCopyOnWrite(ThreadsafeCopyOnWrite<T>&& other) = default;
|
|
67
|
+
ThreadsafeCopyOnWrite& operator=(ThreadsafeCopyOnWrite<T>&& other) = default;
|
|
68
|
+
|
|
69
|
+
class Read {
|
|
70
|
+
public:
|
|
71
|
+
explicit Read(const ThreadsafeCopyOnWrite<T>* cow);
|
|
72
|
+
|
|
73
|
+
const T& operator*() const;
|
|
74
|
+
const T* operator->() const;
|
|
75
|
+
|
|
76
|
+
private:
|
|
77
|
+
const ThreadsafeCopyOnWrite<T>* cow_;
|
|
78
|
+
RwLock::ScopedReadLock lock_;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
class Write {
|
|
82
|
+
public:
|
|
83
|
+
explicit Write(ThreadsafeCopyOnWrite<T>* cow);
|
|
84
|
+
|
|
85
|
+
T& operator*();
|
|
86
|
+
T* operator->();
|
|
87
|
+
|
|
88
|
+
private:
|
|
89
|
+
ThreadsafeCopyOnWrite<T>* cow_;
|
|
90
|
+
typename ThreadsafeCopyOnWrite<T>::Impl* impl_;
|
|
91
|
+
RwLock::ScopedLock lock_;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
Read read() const { return Read(this); }
|
|
95
|
+
Write write() { return Write(this); }
|
|
96
|
+
|
|
97
|
+
private:
|
|
98
|
+
CopyOnWrite<Impl> impl_;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
} // namespace node
|
|
102
|
+
|
|
103
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
104
|
+
|
|
105
|
+
#endif // SRC_NODE_THREADSAFE_COW_H_
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
|
|
2
|
+
#ifndef SRC_NODE_UNION_BYTES_H_
|
|
3
|
+
#define SRC_NODE_UNION_BYTES_H_
|
|
4
|
+
|
|
5
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
6
|
+
|
|
7
|
+
#include "v8.h"
|
|
8
|
+
|
|
9
|
+
namespace node {
|
|
10
|
+
|
|
11
|
+
// An external resource intended to be used with static lifetime.
|
|
12
|
+
template <typename Char, typename IChar, typename Base>
|
|
13
|
+
class StaticExternalByteResource : public Base {
|
|
14
|
+
static_assert(sizeof(IChar) == sizeof(Char),
|
|
15
|
+
"incompatible interface and internal pointers");
|
|
16
|
+
|
|
17
|
+
public:
|
|
18
|
+
explicit StaticExternalByteResource(const Char* data,
|
|
19
|
+
size_t length,
|
|
20
|
+
std::shared_ptr<void> owning_ptr)
|
|
21
|
+
: data_(data), length_(length), owning_ptr_(owning_ptr) {}
|
|
22
|
+
|
|
23
|
+
const IChar* data() const override {
|
|
24
|
+
return reinterpret_cast<const IChar*>(data_);
|
|
25
|
+
}
|
|
26
|
+
size_t length() const override { return length_; }
|
|
27
|
+
|
|
28
|
+
void Dispose() override {
|
|
29
|
+
// We ignore Dispose calls from V8, even if we "own" a resource via
|
|
30
|
+
// owning_ptr_. All instantiations of this class are static or owned by a
|
|
31
|
+
// static map, and will be destructed when static variables are destructed.
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
StaticExternalByteResource(const StaticExternalByteResource&) = delete;
|
|
35
|
+
StaticExternalByteResource& operator=(const StaticExternalByteResource&) =
|
|
36
|
+
delete;
|
|
37
|
+
|
|
38
|
+
private:
|
|
39
|
+
const Char* data_;
|
|
40
|
+
const size_t length_;
|
|
41
|
+
std::shared_ptr<void> owning_ptr_;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
using StaticExternalOneByteResource =
|
|
45
|
+
StaticExternalByteResource<uint8_t,
|
|
46
|
+
char,
|
|
47
|
+
v8::String::ExternalOneByteStringResource>;
|
|
48
|
+
using StaticExternalTwoByteResource =
|
|
49
|
+
StaticExternalByteResource<uint16_t,
|
|
50
|
+
uint16_t,
|
|
51
|
+
v8::String::ExternalStringResource>;
|
|
52
|
+
|
|
53
|
+
// Similar to a v8::String, but it's independent from Isolates
|
|
54
|
+
// and can be materialized in Isolates as external Strings
|
|
55
|
+
// via ToStringChecked.
|
|
56
|
+
class UnionBytes {
|
|
57
|
+
public:
|
|
58
|
+
explicit UnionBytes(StaticExternalOneByteResource* one_byte_resource)
|
|
59
|
+
: one_byte_resource_(one_byte_resource), two_byte_resource_(nullptr) {}
|
|
60
|
+
explicit UnionBytes(StaticExternalTwoByteResource* two_byte_resource)
|
|
61
|
+
: one_byte_resource_(nullptr), two_byte_resource_(two_byte_resource) {}
|
|
62
|
+
|
|
63
|
+
UnionBytes(const UnionBytes&) = default;
|
|
64
|
+
UnionBytes& operator=(const UnionBytes&) = default;
|
|
65
|
+
UnionBytes(UnionBytes&&) = default;
|
|
66
|
+
UnionBytes& operator=(UnionBytes&&) = default;
|
|
67
|
+
|
|
68
|
+
bool is_one_byte() const { return one_byte_resource_ != nullptr; }
|
|
69
|
+
|
|
70
|
+
v8::Local<v8::String> ToStringChecked(v8::Isolate* isolate) const;
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
StaticExternalOneByteResource* one_byte_resource_;
|
|
74
|
+
StaticExternalTwoByteResource* two_byte_resource_;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace node
|
|
78
|
+
|
|
79
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
80
|
+
|
|
81
|
+
#endif // SRC_NODE_UNION_BYTES_H_
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#ifndef SRC_NODE_URL_H_
|
|
2
|
+
#define SRC_NODE_URL_H_
|
|
3
|
+
|
|
4
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
+
|
|
6
|
+
#include <cinttypes>
|
|
7
|
+
#include "ada.h"
|
|
8
|
+
#include "aliased_buffer.h"
|
|
9
|
+
#include "node.h"
|
|
10
|
+
#include "node_snapshotable.h"
|
|
11
|
+
#include "util.h"
|
|
12
|
+
#include "v8-fast-api-calls.h"
|
|
13
|
+
#include "v8.h"
|
|
14
|
+
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
|
|
18
|
+
namespace node {
|
|
19
|
+
class ExternalReferenceRegistry;
|
|
20
|
+
|
|
21
|
+
namespace url {
|
|
22
|
+
|
|
23
|
+
enum url_update_action {
|
|
24
|
+
kProtocol = 0,
|
|
25
|
+
kHost = 1,
|
|
26
|
+
kHostname = 2,
|
|
27
|
+
kPort = 3,
|
|
28
|
+
kUsername = 4,
|
|
29
|
+
kPassword = 5,
|
|
30
|
+
kPathname = 6,
|
|
31
|
+
kSearch = 7,
|
|
32
|
+
kHash = 8,
|
|
33
|
+
kHref = 9,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
class BindingData : public SnapshotableObject {
|
|
37
|
+
public:
|
|
38
|
+
BindingData(Realm* realm, v8::Local<v8::Object> obj);
|
|
39
|
+
|
|
40
|
+
using InternalFieldInfo = InternalFieldInfoBase;
|
|
41
|
+
|
|
42
|
+
SERIALIZABLE_OBJECT_METHODS()
|
|
43
|
+
SET_BINDING_ID(url_binding_data)
|
|
44
|
+
|
|
45
|
+
void MemoryInfo(MemoryTracker* tracker) const override;
|
|
46
|
+
SET_SELF_SIZE(BindingData)
|
|
47
|
+
SET_MEMORY_INFO_NAME(BindingData)
|
|
48
|
+
|
|
49
|
+
static void DomainToASCII(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
50
|
+
static void DomainToUnicode(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
51
|
+
|
|
52
|
+
static void CanParse(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
53
|
+
static bool FastCanParse(v8::Local<v8::Value> receiver,
|
|
54
|
+
const v8::FastOneByteString& input);
|
|
55
|
+
static bool FastCanParseWithBase(v8::Local<v8::Value> receiver,
|
|
56
|
+
const v8::FastOneByteString& input,
|
|
57
|
+
const v8::FastOneByteString& base);
|
|
58
|
+
|
|
59
|
+
static void Format(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
60
|
+
static void GetOrigin(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
61
|
+
static void Parse(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
62
|
+
static void PathToFileURL(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
63
|
+
static void Update(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
64
|
+
|
|
65
|
+
static void CreatePerIsolateProperties(IsolateData* isolate_data,
|
|
66
|
+
v8::Local<v8::ObjectTemplate> ctor);
|
|
67
|
+
static void CreatePerContextProperties(v8::Local<v8::Object> target,
|
|
68
|
+
v8::Local<v8::Value> unused,
|
|
69
|
+
v8::Local<v8::Context> context,
|
|
70
|
+
void* priv);
|
|
71
|
+
static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
static constexpr size_t kURLComponentsLength = 9;
|
|
75
|
+
AliasedUint32Array url_components_buffer_;
|
|
76
|
+
|
|
77
|
+
void UpdateComponents(const ada::url_components& components,
|
|
78
|
+
const ada::scheme::type type);
|
|
79
|
+
|
|
80
|
+
static v8::CFunction fast_can_parse_methods_[];
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
void ThrowInvalidURL(Environment* env,
|
|
84
|
+
std::string_view input,
|
|
85
|
+
std::optional<std::string> base);
|
|
86
|
+
std::string FromFilePath(std::string_view file_path);
|
|
87
|
+
std::optional<std::string> FileURLToPath(Environment* env,
|
|
88
|
+
const ada::url_aggregator& file_url);
|
|
89
|
+
|
|
90
|
+
} // namespace url
|
|
91
|
+
|
|
92
|
+
} // namespace node
|
|
93
|
+
|
|
94
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
95
|
+
|
|
96
|
+
#endif // SRC_NODE_URL_H_
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#ifndef SRC_NODE_V8_H_
|
|
2
|
+
#define SRC_NODE_V8_H_
|
|
3
|
+
|
|
4
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
+
|
|
6
|
+
#include <sstream>
|
|
7
|
+
#include "aliased_buffer.h"
|
|
8
|
+
#include "base_object.h"
|
|
9
|
+
#include "json_utils.h"
|
|
10
|
+
#include "node_snapshotable.h"
|
|
11
|
+
#include "util.h"
|
|
12
|
+
#include "v8.h"
|
|
13
|
+
|
|
14
|
+
namespace node {
|
|
15
|
+
class Environment;
|
|
16
|
+
struct InternalFieldInfoBase;
|
|
17
|
+
|
|
18
|
+
namespace v8_utils {
|
|
19
|
+
class BindingData : public SnapshotableObject {
|
|
20
|
+
public:
|
|
21
|
+
struct InternalFieldInfo : public node::InternalFieldInfoBase {
|
|
22
|
+
AliasedBufferIndex heap_statistics_buffer;
|
|
23
|
+
AliasedBufferIndex heap_space_statistics_buffer;
|
|
24
|
+
AliasedBufferIndex heap_code_statistics_buffer;
|
|
25
|
+
};
|
|
26
|
+
BindingData(Realm* realm,
|
|
27
|
+
v8::Local<v8::Object> obj,
|
|
28
|
+
InternalFieldInfo* info = nullptr);
|
|
29
|
+
|
|
30
|
+
SERIALIZABLE_OBJECT_METHODS()
|
|
31
|
+
SET_BINDING_ID(v8_binding_data)
|
|
32
|
+
|
|
33
|
+
AliasedFloat64Array heap_statistics_buffer;
|
|
34
|
+
AliasedFloat64Array heap_space_statistics_buffer;
|
|
35
|
+
AliasedFloat64Array heap_code_statistics_buffer;
|
|
36
|
+
|
|
37
|
+
void MemoryInfo(MemoryTracker* tracker) const override;
|
|
38
|
+
SET_SELF_SIZE(BindingData)
|
|
39
|
+
SET_MEMORY_INFO_NAME(BindingData)
|
|
40
|
+
|
|
41
|
+
private:
|
|
42
|
+
InternalFieldInfo* internal_field_info_ = nullptr;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
class GCProfiler : public BaseObject {
|
|
46
|
+
public:
|
|
47
|
+
enum class GCProfilerState { kInitialized, kStarted, kStopped };
|
|
48
|
+
GCProfiler(Environment* env, v8::Local<v8::Object> object);
|
|
49
|
+
inline ~GCProfiler() override;
|
|
50
|
+
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
51
|
+
static void Start(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
52
|
+
static void Stop(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
53
|
+
|
|
54
|
+
JSONWriter* writer();
|
|
55
|
+
|
|
56
|
+
std::ostringstream* out_stream();
|
|
57
|
+
|
|
58
|
+
SET_NO_MEMORY_INFO()
|
|
59
|
+
SET_MEMORY_INFO_NAME(GCProfiler)
|
|
60
|
+
SET_SELF_SIZE(GCProfiler)
|
|
61
|
+
|
|
62
|
+
uint64_t start_time;
|
|
63
|
+
uint8_t current_gc_type;
|
|
64
|
+
GCProfilerState state;
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
std::ostringstream out_stream_;
|
|
68
|
+
JSONWriter writer_;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace v8_utils
|
|
72
|
+
|
|
73
|
+
} // namespace node
|
|
74
|
+
|
|
75
|
+
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
76
|
+
|
|
77
|
+
#endif // SRC_NODE_V8_H_
|