@encharm/cws 4.4.1 → 4.5.2
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/binding.gyp +1 -1
- package/dist/bindings/cws_darwin_arm64_node115.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node127.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node137.node +0 -0
- package/dist/bindings/cws_linux_arm64_node115.node +0 -0
- package/dist/bindings/cws_linux_arm64_node127.node +0 -0
- package/dist/bindings/cws_linux_x64_node115.node +0 -0
- package/dist/bindings/cws_linux_x64_node127.node +0 -0
- package/dist/bindings/cws_linux_x64_node137.node +0 -0
- package/dist/bindings/cws_win32_x64_node108.node +0 -0
- package/dist/bindings/cws_win32_x64_node115.node +0 -0
- package/dist/bindings/cws_win32_x64_node127.node +0 -0
- package/dist/bindings/cws_win32_x64_node83.node +0 -0
- package/dist/bindings/cws_win32_x64_node93.node +0 -0
- package/package.json +1 -1
- package/src/Addon.h +13 -23
- package/src/Socket.h +0 -1
- package/src/headers/22/acorn_version.h +6 -0
- package/src/headers/22/aliased_buffer-inl.h +243 -0
- package/src/headers/22/aliased_buffer.h +206 -0
- package/src/headers/{18 → 22}/async_wrap-inl.h +8 -6
- package/src/headers/{18 → 22}/async_wrap.h +65 -59
- package/src/headers/{18 → 22}/base_object-inl.h +57 -117
- package/src/headers/{18 → 22}/base_object.h +58 -30
- package/src/headers/22/base_object_types.h +74 -0
- package/src/headers/22/blob_serializer_deserializer-inl.h +385 -0
- package/src/headers/22/blob_serializer_deserializer.h +132 -0
- package/src/headers/{16 → 22}/callback_queue.h +1 -0
- package/src/headers/{16 → 22}/cares_wrap.h +27 -20
- package/src/headers/22/cjs_module_lexer_version.h +6 -0
- package/src/headers/22/cleanup_queue-inl.h +62 -0
- package/src/headers/22/cleanup_queue.h +85 -0
- package/src/headers/22/compile_cache.h +104 -0
- package/src/headers/{18 → 22}/crypto/crypto_clienthello.h +1 -1
- package/src/headers/{18 → 22}/crypto/crypto_context.h +31 -7
- package/src/headers/{18 → 22}/crypto/crypto_keys.h +118 -148
- package/src/headers/{18 → 22}/crypto/crypto_tls.h +20 -5
- package/src/headers/{18 → 22}/crypto/crypto_util.h +219 -263
- package/src/headers/22/crypto/ncrypto.h +752 -0
- package/src/headers/{16 → 22}/debug_utils-inl.h +15 -7
- package/src/headers/{18 → 22}/debug_utils.h +25 -19
- package/src/headers/22/encoding_binding.h +59 -0
- package/src/headers/{14 → 22}/env-inl.h +276 -409
- package/src/headers/22/env.h +1266 -0
- package/src/headers/22/env_properties.h +497 -0
- package/src/headers/{18 → 22}/handle_wrap.h +2 -0
- package/src/headers/{18 → 22}/histogram.h +88 -48
- package/src/headers/{16 → 22}/inspector_agent.h +17 -1
- package/src/headers/{16 → 22}/inspector_profiler.h +15 -13
- package/src/headers/22/js_native_api.h +619 -0
- package/src/headers/{18 → 22}/js_native_api_types.h +46 -1
- package/src/headers/22/js_native_api_v8.h +485 -0
- package/src/headers/{18 → 22}/js_native_api_v8_internals.h +6 -0
- package/src/headers/22/json_parser.h +40 -0
- package/src/headers/{16 → 22}/json_utils.h +19 -8
- package/src/headers/{18 → 22}/memory_tracker-inl.h +16 -13
- package/src/headers/{14 → 22}/memory_tracker.h +13 -8
- package/src/headers/{16 → 22}/module_wrap.h +49 -19
- package/src/headers/22/ncrypto/ncrypto.h +752 -0
- package/src/headers/{18 → 22}/node.h +465 -68
- package/src/headers/{18 → 22}/node_api.h +66 -81
- package/src/headers/{18 → 22}/node_api_internals.h +8 -4
- package/src/headers/{18 → 22}/node_api_types.h +5 -0
- package/src/headers/22/node_binding.h +154 -0
- package/src/headers/{18 → 22}/node_blob.h +46 -78
- package/src/headers/{18 → 22}/node_bob-inl.h +1 -2
- package/src/headers/{18 → 22}/node_bob.h +2 -6
- package/src/headers/{18 → 22}/node_buffer.h +1 -1
- package/src/headers/22/node_builtins.h +220 -0
- package/src/headers/{18 → 22}/node_constants.h +3 -5
- package/src/headers/22/node_context_data.h +168 -0
- package/src/headers/22/node_contextify.h +199 -0
- package/src/headers/{16 → 22}/node_crypto.h +1 -2
- package/src/headers/22/node_dotenv.h +45 -0
- package/src/headers/{18 → 22}/node_errors.h +86 -27
- package/src/headers/22/node_exit_code.h +54 -0
- package/src/headers/22/node_external_reference.h +249 -0
- package/src/headers/{18 → 22}/node_file-inl.h +127 -30
- package/src/headers/{16 → 22}/node_file.h +122 -11
- package/src/headers/{18 → 22}/node_http2.h +28 -11
- package/src/headers/{16 → 22}/node_http2_state.h +34 -25
- package/src/headers/{18 → 22}/node_http_common-inl.h +2 -1
- package/src/headers/{18 → 22}/node_http_common.h +56 -55
- package/src/headers/{16 → 22}/node_i18n.h +5 -18
- package/src/headers/{18 → 22}/node_internals.h +121 -59
- package/src/headers/{18 → 22}/node_main_instance.h +4 -31
- package/src/headers/{18 → 22}/node_messaging.h +27 -10
- package/src/headers/{18 → 22}/node_metadata.h +23 -1
- package/src/headers/{18 → 22}/node_options-inl.h +24 -11
- package/src/headers/{18 → 22}/node_options.h +124 -39
- package/src/headers/{18 → 22}/node_perf.h +0 -2
- package/src/headers/{18 → 22}/node_perf_common.h +20 -9
- package/src/headers/{18 → 22}/node_platform.h +11 -5
- package/src/headers/{18 → 22}/node_process.h +26 -14
- package/src/headers/22/node_realm-inl.h +145 -0
- package/src/headers/22/node_realm.h +184 -0
- package/src/headers/{16 → 22}/node_report.h +13 -17
- package/src/headers/{16 → 22}/node_revert.h +3 -3
- package/src/headers/{16 → 22}/node_root_certs.h +902 -461
- package/src/headers/22/node_sea.h +64 -0
- package/src/headers/22/node_shadow_realm.h +46 -0
- package/src/headers/22/node_snapshot_builder.h +57 -0
- package/src/headers/22/node_snapshotable.h +174 -0
- package/src/headers/{18 → 22}/node_sockaddr.h +2 -2
- package/src/headers/{16 → 22}/node_stat_watcher.h +2 -1
- package/src/headers/22/node_threadsafe_cow-inl.h +54 -0
- package/src/headers/22/node_threadsafe_cow.h +105 -0
- package/src/headers/22/node_union_bytes.h +81 -0
- package/src/headers/22/node_url.h +96 -0
- package/src/headers/22/node_v8.h +77 -0
- package/src/headers/{14 → 22}/node_v8_platform-inl.h +17 -6
- package/src/headers/{16 → 22}/node_version.h +21 -9
- package/src/headers/22/node_wasi.h +185 -0
- package/src/headers/{14 → 22}/node_watchdog.h +2 -0
- package/src/headers/{18 → 22}/node_worker.h +7 -2
- package/src/headers/22/permission/child_process_permission.h +31 -0
- package/src/headers/22/permission/fs_permission.h +167 -0
- package/src/headers/22/permission/inspector_permission.h +31 -0
- package/src/headers/22/permission/permission.h +99 -0
- package/src/headers/22/permission/permission_base.h +60 -0
- package/src/headers/22/permission/wasi_permission.h +31 -0
- package/src/headers/22/permission/worker_permission.h +31 -0
- package/src/headers/{16 → 22}/req_wrap-inl.h +7 -6
- package/src/headers/{14 → 22}/spawn_sync.h +3 -3
- package/src/headers/{18 → 22}/stream_base-inl.h +0 -135
- package/src/headers/{18 → 22}/stream_base.h +35 -16
- package/src/headers/{18 → 22}/stream_pipe.h +3 -4
- package/src/headers/{16 → 22}/stream_wrap.h +2 -1
- package/src/headers/{18 → 22}/string_bytes.h +5 -14
- package/src/headers/{14 → 22}/string_decoder-inl.h +0 -6
- package/src/headers/{16 → 22}/string_decoder.h +0 -1
- package/src/headers/{18 → 22}/tcp_wrap.h +1 -1
- package/src/headers/{18 → 22}/threadpoolwork-inl.h +14 -1
- package/src/headers/22/timers.h +76 -0
- package/src/headers/{18 → 22}/tracing/trace_event.h +7 -5
- package/src/headers/{16 → 22}/udp_wrap.h +8 -5
- package/src/headers/22/undici_version.h +6 -0
- package/src/headers/{18 → 22}/util-inl.h +97 -127
- package/src/headers/{18 → 22}/util.h +293 -106
- package/src/headers/{18 → 22}/v8-fast-api-calls.h +103 -58
- package/src/headers/24/acorn_version.h +6 -0
- package/src/headers/24/addon_permission.h +31 -0
- package/src/headers/{16/tracing → 24}/agent.h +1 -1
- package/src/headers/24/aliased_buffer-inl.h +244 -0
- package/src/headers/24/aliased_buffer.h +206 -0
- package/src/headers/24/amaro_version.h +6 -0
- package/src/headers/24/application.h +165 -0
- package/src/headers/24/async_context_frame.h +33 -0
- package/src/headers/{14 → 24}/async_wrap-inl.h +8 -6
- package/src/headers/{16 → 24}/async_wrap.h +86 -88
- package/src/headers/{16 → 24}/base_object-inl.h +75 -119
- package/src/headers/{16 → 24}/base_object.h +84 -40
- package/src/headers/24/base_object_types.h +74 -0
- package/src/headers/24/bindingdata.h +272 -0
- package/src/headers/24/blob_serializer_deserializer-inl.h +385 -0
- package/src/headers/24/blob_serializer_deserializer.h +132 -0
- package/src/headers/{18 → 24}/callback_queue.h +1 -0
- package/src/headers/{18 → 24}/cares_wrap.h +68 -144
- package/src/headers/24/child_process_permission.h +31 -0
- package/src/headers/24/cid.h +127 -0
- package/src/headers/24/cjs_module_lexer_version.h +6 -0
- package/src/headers/24/cleanup_queue-inl.h +36 -0
- package/src/headers/24/cleanup_queue.h +79 -0
- package/src/headers/24/compile_cache.h +113 -0
- package/src/headers/24/cppgc_helpers-inl.h +65 -0
- package/src/headers/24/cppgc_helpers.h +162 -0
- package/src/headers/24/crypto/crypto_aes.h +97 -0
- package/src/headers/24/crypto/crypto_argon2.h +86 -0
- package/src/headers/{16 → 24}/crypto/crypto_bio.h +8 -9
- package/src/headers/24/crypto/crypto_chacha20_poly1305.h +64 -0
- package/src/headers/{18 → 24}/crypto/crypto_cipher.h +48 -58
- package/src/headers/{16 → 24}/crypto/crypto_clienthello-inl.h +2 -2
- package/src/headers/{16 → 24}/crypto/crypto_clienthello.h +1 -1
- package/src/headers/24/crypto/crypto_common.h +48 -0
- package/src/headers/{16 → 24}/crypto/crypto_context.h +46 -22
- package/src/headers/{18 → 24}/crypto/crypto_dh.h +27 -57
- package/src/headers/{18 → 24}/crypto/crypto_dsa.h +7 -34
- package/src/headers/{18 → 24}/crypto/crypto_ec.h +42 -49
- package/src/headers/{18 → 24}/crypto/crypto_hash.h +11 -11
- package/src/headers/{18 → 24}/crypto/crypto_hkdf.h +10 -14
- package/src/headers/{18 → 24}/crypto/crypto_hmac.h +11 -13
- package/src/headers/24/crypto/crypto_kem.h +113 -0
- package/src/headers/{18 → 24}/crypto/crypto_keygen.h +59 -74
- package/src/headers/{16 → 24}/crypto/crypto_keys.h +134 -154
- package/src/headers/24/crypto/crypto_ml_dsa.h +21 -0
- package/src/headers/{18 → 24}/crypto/crypto_pbkdf2.h +9 -11
- package/src/headers/{18 → 24}/crypto/crypto_random.h +28 -34
- package/src/headers/{18 → 24}/crypto/crypto_rsa.h +30 -35
- package/src/headers/{18 → 24}/crypto/crypto_scrypt.h +8 -10
- package/src/headers/{18 → 24}/crypto/crypto_sig.h +36 -48
- package/src/headers/{16 → 24}/crypto/crypto_tls.h +35 -18
- package/src/headers/{16 → 24}/crypto/crypto_util.h +183 -321
- package/src/headers/24/crypto/crypto_x509.h +140 -0
- package/src/headers/24/data.h +148 -0
- package/src/headers/{14 → 24}/debug_utils-inl.h +17 -8
- package/src/headers/{16 → 24}/debug_utils.h +31 -22
- package/src/headers/24/defs.h +254 -0
- package/src/headers/24/embedded_data.h +17 -0
- package/src/headers/24/encoding_binding.h +60 -0
- package/src/headers/24/endpoint.h +421 -0
- package/src/headers/{16 → 24}/env-inl.h +198 -540
- package/src/headers/24/env.h +1257 -0
- package/src/headers/24/env_properties.h +561 -0
- package/src/headers/24/fs_permission.h +167 -0
- package/src/headers/{16 → 24}/handle_wrap.h +4 -2
- package/src/headers/{16 → 24}/histogram-inl.h +34 -15
- package/src/headers/24/histogram.h +279 -0
- package/src/headers/24/http3.h +44 -0
- package/src/headers/{18 → 24}/inspector_agent.h +23 -2
- package/src/headers/24/inspector_permission.h +31 -0
- package/src/headers/{18 → 24}/inspector_profiler.h +15 -15
- package/src/headers/24/io_agent.h +30 -0
- package/src/headers/{18 → 24}/js_native_api.h +74 -30
- package/src/headers/{16 → 24}/js_native_api_types.h +61 -10
- package/src/headers/{18 → 24}/js_native_api_v8.h +205 -160
- package/src/headers/{16 → 24}/js_native_api_v8_internals.h +12 -6
- package/src/headers/24/json_parser.h +40 -0
- package/src/headers/{18 → 24}/json_utils.h +19 -8
- package/src/headers/24/logstream.h +81 -0
- package/src/headers/24/main_thread_interface.h +116 -0
- package/src/headers/{16 → 24}/memory_tracker-inl.h +115 -17
- package/src/headers/{16 → 24}/memory_tracker.h +58 -9
- package/src/headers/24/module_wrap.h +229 -0
- package/src/headers/24/ncrypto.h +1625 -0
- package/src/headers/24/network_agent.h +118 -0
- package/src/headers/24/network_inspector.h +45 -0
- package/src/headers/24/network_resource_manager.h +29 -0
- package/src/headers/{16 → 24}/node.h +560 -72
- package/src/headers/24/node_api.h +269 -0
- package/src/headers/24/node_api_internals.h +46 -0
- package/src/headers/{16 → 24}/node_api_types.h +13 -11
- package/src/headers/24/node_binding.h +163 -0
- package/src/headers/{16 → 24}/node_blob.h +46 -78
- package/src/headers/{16 → 24}/node_bob-inl.h +1 -2
- package/src/headers/{16 → 24}/node_bob.h +2 -6
- package/src/headers/{14 → 24}/node_buffer.h +1 -1
- package/src/headers/24/node_builtins.h +223 -0
- package/src/headers/24/node_config_file.h +65 -0
- package/src/headers/{14 → 24}/node_constants.h +3 -5
- package/src/headers/24/node_context_data.h +168 -0
- package/src/headers/24/node_contextify.h +261 -0
- package/src/headers/{18 → 24}/node_crypto.h +7 -2
- package/src/headers/24/node_debug.h +25 -0
- package/src/headers/24/node_dotenv.h +45 -0
- package/src/headers/{16 → 24}/node_errors.h +146 -32
- package/src/headers/24/node_exit_code.h +54 -0
- package/src/headers/{18 → 24}/node_external_reference.h +44 -22
- package/src/headers/{16 → 24}/node_file-inl.h +156 -50
- package/src/headers/{18 → 24}/node_file.h +129 -15
- package/src/headers/{16 → 24}/node_http2.h +53 -18
- package/src/headers/{14 → 24}/node_http2_state.h +35 -25
- package/src/headers/{16 → 24}/node_http_common-inl.h +8 -10
- package/src/headers/{16 → 24}/node_http_common.h +63 -59
- package/src/headers/{18 → 24}/node_i18n.h +5 -18
- package/src/headers/{16 → 24}/node_internals.h +131 -76
- package/src/headers/24/node_json.h +24 -0
- package/src/headers/24/node_large_page.h +34 -0
- package/src/headers/24/node_locks.h +180 -0
- package/src/headers/{14 → 24}/node_main_instance.h +15 -44
- package/src/headers/{16 → 24}/node_mem-inl.h +7 -7
- package/src/headers/{16 → 24}/node_messaging.h +27 -11
- package/src/headers/{16 → 24}/node_metadata.h +44 -2
- package/src/headers/24/node_modules.h +93 -0
- package/src/headers/{16 → 24}/node_options-inl.h +93 -46
- package/src/headers/{16 → 24}/node_options.h +251 -63
- package/src/headers/{16 → 24}/node_perf.h +6 -25
- package/src/headers/{16 → 24}/node_perf_common.h +23 -10
- package/src/headers/24/node_platform.h +286 -0
- package/src/headers/24/node_process.h +111 -0
- package/src/headers/24/node_realm-inl.h +153 -0
- package/src/headers/24/node_realm.h +236 -0
- package/src/headers/{18 → 24}/node_report.h +13 -17
- package/src/headers/{18 → 24}/node_revert.h +3 -3
- package/src/headers/{18 → 24}/node_root_certs.h +1010 -710
- package/src/headers/24/node_sea.h +74 -0
- package/src/headers/24/node_shadow_realm.h +46 -0
- package/src/headers/24/node_snapshot_builder.h +57 -0
- package/src/headers/24/node_snapshotable.h +174 -0
- package/src/headers/{16 → 24}/node_sockaddr-inl.h +11 -20
- package/src/headers/{16 → 24}/node_sockaddr.h +9 -20
- package/src/headers/24/node_sqlite.h +270 -0
- package/src/headers/{18 → 24}/node_stat_watcher.h +2 -1
- package/src/headers/24/node_string.h +101 -0
- package/src/headers/24/node_task_runner.h +92 -0
- package/src/headers/24/node_threadsafe_cow-inl.h +54 -0
- package/src/headers/24/node_threadsafe_cow.h +105 -0
- package/src/headers/24/node_union_bytes.h +81 -0
- package/src/headers/24/node_url.h +101 -0
- package/src/headers/24/node_url_pattern.h +118 -0
- package/src/headers/24/node_v8.h +77 -0
- package/src/headers/{18 → 24}/node_v8_platform-inl.h +22 -31
- package/src/headers/{18 → 24}/node_version.h +18 -6
- package/src/headers/24/node_wasi.h +185 -0
- package/src/headers/24/node_wasm_web_api.h +55 -0
- package/src/headers/{18 → 24}/node_watchdog.h +2 -0
- package/src/headers/24/node_webstorage.h +60 -0
- package/src/headers/{16 → 24}/node_worker.h +24 -10
- package/src/headers/24/packet.h +155 -0
- package/src/headers/24/path.h +33 -0
- package/src/headers/24/permission/addon_permission.h +31 -0
- package/src/headers/24/permission/child_process_permission.h +31 -0
- package/src/headers/24/permission/fs_permission.h +167 -0
- package/src/headers/24/permission/inspector_permission.h +31 -0
- package/src/headers/24/permission/permission.h +100 -0
- package/src/headers/24/permission/permission_base.h +65 -0
- package/src/headers/24/permission/wasi_permission.h +31 -0
- package/src/headers/24/permission/worker_permission.h +31 -0
- package/src/headers/24/permission.h +100 -0
- package/src/headers/24/permission_base.h +65 -0
- package/src/headers/24/preferredaddress.h +72 -0
- package/src/headers/24/protocol_helper.h +27 -0
- package/src/headers/24/queue.h +306 -0
- package/src/headers/{18 → 24}/req_wrap-inl.h +12 -6
- package/src/headers/{16 → 24}/req_wrap.h +3 -1
- package/src/headers/24/runtime_agent.h +41 -0
- package/src/headers/24/session.h +528 -0
- package/src/headers/24/sessionticket.h +108 -0
- package/src/headers/{18 → 24}/spawn_sync.h +9 -8
- package/src/headers/{16 → 24}/stream_base-inl.h +3 -133
- package/src/headers/{16 → 24}/stream_base.h +43 -19
- package/src/headers/{16 → 24}/stream_pipe.h +7 -4
- package/src/headers/{18 → 24}/stream_wrap.h +2 -3
- package/src/headers/24/streams.h +370 -0
- package/src/headers/{16 → 24}/string_bytes.h +8 -21
- package/src/headers/{18 → 24}/string_decoder-inl.h +0 -6
- package/src/headers/{18 → 24}/string_decoder.h +0 -1
- package/src/headers/24/target_agent.h +75 -0
- package/src/headers/{16 → 24}/tcp_wrap.h +3 -1
- package/src/headers/{14 → 24}/threadpoolwork-inl.h +14 -1
- package/src/headers/24/timer_wrap-inl.h +32 -0
- package/src/headers/{16 → 24}/timer_wrap.h +7 -4
- package/src/headers/24/timers.h +75 -0
- package/src/headers/24/tlscontext.h +228 -0
- package/src/headers/24/tokens.h +256 -0
- package/src/headers/{14/tracing → 24}/trace_event.h +7 -5
- package/src/headers/24/traced_value.h +129 -0
- package/src/headers/24/tracing_agent.h +43 -0
- package/src/headers/24/transportparams.h +166 -0
- package/src/headers/{16 → 24}/tty_wrap.h +0 -1
- package/src/headers/{18 → 24}/udp_wrap.h +8 -5
- package/src/headers/24/undici_version.h +6 -0
- package/src/headers/{16 → 24}/util-inl.h +267 -131
- package/src/headers/{16 → 24}/util.h +338 -146
- package/src/headers/24/v8-external-memory-accounter.h +60 -0
- package/src/headers/24/v8-fast-api-calls.h +819 -0
- package/src/headers/24/v8-inspector.h +426 -0
- package/src/headers/24/wasi_permission.h +31 -0
- package/src/headers/24/worker_agent.h +40 -0
- package/src/headers/24/worker_inspector.h +124 -0
- package/src/headers/24/worker_permission.h +31 -0
- package/src/headers/24/zlib_version.h +6 -0
- package/dist/bindings/cws_darwin_arm64_node83.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node93.node +0 -0
- package/dist/bindings/cws_darwin_x64_node83.node +0 -0
- package/dist/bindings/cws_darwin_x64_node93.node +0 -0
- package/dist/bindings/cws_linux_arm64_node83.node +0 -0
- package/dist/bindings/cws_linux_arm64_node93.node +0 -0
- package/dist/bindings/cws_linux_x64_node83.node +0 -0
- package/dist/bindings/cws_linux_x64_node93.node +0 -0
- package/src/headers/14/aliased_buffer.h +0 -263
- package/src/headers/14/allocated_buffer-inl.h +0 -110
- package/src/headers/14/allocated_buffer.h +0 -73
- package/src/headers/14/async_wrap.h +0 -230
- package/src/headers/14/base64.h +0 -183
- package/src/headers/14/base_object-inl.h +0 -371
- package/src/headers/14/base_object.h +0 -281
- package/src/headers/14/callback_queue-inl.h +0 -97
- package/src/headers/14/callback_queue.h +0 -78
- package/src/headers/14/debug_utils.h +0 -181
- package/src/headers/14/env.h +0 -1388
- package/src/headers/14/handle_wrap.h +0 -117
- package/src/headers/14/histogram-inl.h +0 -83
- package/src/headers/14/histogram.h +0 -98
- package/src/headers/14/inspector_agent.h +0 -149
- package/src/headers/14/inspector_profiler.h +0 -137
- package/src/headers/14/js_native_api.h +0 -544
- package/src/headers/14/js_native_api_types.h +0 -143
- package/src/headers/14/js_native_api_v8.h +0 -301
- package/src/headers/14/js_native_api_v8_internals.h +0 -38
- package/src/headers/14/json_utils.h +0 -161
- package/src/headers/14/memory_tracker-inl.h +0 -355
- package/src/headers/14/module_wrap.h +0 -99
- package/src/headers/14/node.h +0 -1032
- package/src/headers/14/node_api.h +0 -255
- package/src/headers/14/node_api_types.h +0 -44
- package/src/headers/14/node_binding.h +0 -99
- package/src/headers/14/node_context_data.h +0 -44
- package/src/headers/14/node_contextify.h +0 -161
- package/src/headers/14/node_crypto.h +0 -865
- package/src/headers/14/node_crypto_bio.h +0 -195
- package/src/headers/14/node_crypto_clienthello-inl.h +0 -91
- package/src/headers/14/node_crypto_clienthello.h +0 -132
- package/src/headers/14/node_crypto_common.h +0 -138
- package/src/headers/14/node_crypto_groups.h +0 -415
- package/src/headers/14/node_dtrace.h +0 -86
- package/src/headers/14/node_errors.h +0 -214
- package/src/headers/14/node_file-inl.h +0 -306
- package/src/headers/14/node_file.h +0 -417
- package/src/headers/14/node_http2.h +0 -1191
- package/src/headers/14/node_http_common-inl.h +0 -194
- package/src/headers/14/node_http_common.h +0 -529
- package/src/headers/14/node_i18n.h +0 -144
- package/src/headers/14/node_internals.h +0 -405
- package/src/headers/14/node_mem.h +0 -45
- package/src/headers/14/node_messaging.h +0 -303
- package/src/headers/14/node_metadata.h +0 -109
- package/src/headers/14/node_mutex.h +0 -247
- package/src/headers/14/node_native_module.h +0 -101
- package/src/headers/14/node_native_module_env.h +0 -66
- package/src/headers/14/node_options-inl.h +0 -451
- package/src/headers/14/node_options.h +0 -481
- package/src/headers/14/node_perf.h +0 -181
- package/src/headers/14/node_perf_common.h +0 -97
- package/src/headers/14/node_platform.h +0 -189
- package/src/headers/14/node_process.h +0 -40
- package/src/headers/14/node_report.h +0 -47
- package/src/headers/14/node_revert.h +0 -72
- package/src/headers/14/node_root_certs.h +0 -3458
- package/src/headers/14/node_sockaddr-inl.h +0 -170
- package/src/headers/14/node_sockaddr.h +0 -123
- package/src/headers/14/node_stat_watcher.h +0 -70
- package/src/headers/14/node_union_bytes.h +0 -103
- package/src/headers/14/node_url.h +0 -188
- package/src/headers/14/node_version.h +0 -98
- package/src/headers/14/node_wasi.h +0 -108
- package/src/headers/14/node_win32_etw_provider-inl.h +0 -287
- package/src/headers/14/node_win32_etw_provider.h +0 -99
- package/src/headers/14/node_worker.h +0 -141
- package/src/headers/14/pipe_wrap.h +0 -78
- package/src/headers/14/req_wrap-inl.h +0 -170
- package/src/headers/14/req_wrap.h +0 -77
- package/src/headers/14/stream_base-inl.h +0 -275
- package/src/headers/14/stream_base.h +0 -434
- package/src/headers/14/stream_pipe.h +0 -73
- package/src/headers/14/stream_wrap.h +0 -130
- package/src/headers/14/string_bytes.h +0 -129
- package/src/headers/14/string_decoder.h +0 -50
- package/src/headers/14/string_search.h +0 -638
- package/src/headers/14/tcp_wrap.h +0 -101
- package/src/headers/14/tls_wrap.h +0 -222
- package/src/headers/14/tracing/agent.h +0 -195
- package/src/headers/14/tracing/traced_value.h +0 -70
- package/src/headers/14/tty_wrap.h +0 -64
- package/src/headers/14/udp_wrap.h +0 -227
- package/src/headers/14/util-inl.h +0 -566
- package/src/headers/14/util.h +0 -804
- package/src/headers/14/v8abbr.h +0 -124
- package/src/headers/16/aliased_buffer.h +0 -315
- package/src/headers/16/allocated_buffer-inl.h +0 -110
- package/src/headers/16/allocated_buffer.h +0 -73
- package/src/headers/16/async_wrap-inl.h +0 -94
- package/src/headers/16/base64-inl.h +0 -189
- package/src/headers/16/base64.h +0 -69
- package/src/headers/16/crypto/crypto_aes.h +0 -89
- package/src/headers/16/crypto/crypto_cipher.h +0 -286
- package/src/headers/16/crypto/crypto_common.h +0 -187
- package/src/headers/16/crypto/crypto_dh.h +0 -157
- package/src/headers/16/crypto/crypto_dsa.h +0 -76
- package/src/headers/16/crypto/crypto_ec.h +0 -169
- package/src/headers/16/crypto/crypto_groups.h +0 -415
- package/src/headers/16/crypto/crypto_hash.h +0 -89
- package/src/headers/16/crypto/crypto_hkdf.h +0 -66
- package/src/headers/16/crypto/crypto_hmac.h +0 -94
- package/src/headers/16/crypto/crypto_keygen.h +0 -301
- package/src/headers/16/crypto/crypto_pbkdf2.h +0 -76
- package/src/headers/16/crypto/crypto_random.h +0 -130
- package/src/headers/16/crypto/crypto_rsa.h +0 -141
- package/src/headers/16/crypto/crypto_scrypt.h +0 -87
- package/src/headers/16/crypto/crypto_sig.h +0 -167
- package/src/headers/16/crypto/crypto_spkac.h +0 -20
- package/src/headers/16/crypto/crypto_timing.h +0 -20
- package/src/headers/16/crypto/crypto_x509.h +0 -141
- package/src/headers/16/env.h +0 -1629
- package/src/headers/16/histogram.h +0 -216
- package/src/headers/16/js_native_api.h +0 -561
- package/src/headers/16/js_native_api_v8.h +0 -451
- package/src/headers/16/node.d +0 -315
- package/src/headers/16/node.stp +0 -146
- package/src/headers/16/node_api.h +0 -275
- package/src/headers/16/node_api_internals.h +0 -30
- package/src/headers/16/node_binding.h +0 -99
- package/src/headers/16/node_buffer.h +0 -92
- package/src/headers/16/node_constants.h +0 -84
- package/src/headers/16/node_context_data.h +0 -44
- package/src/headers/16/node_contextify.h +0 -196
- package/src/headers/16/node_dtrace.h +0 -86
- package/src/headers/16/node_external_reference.h +0 -129
- package/src/headers/16/node_main_instance.h +0 -103
- package/src/headers/16/node_native_module.h +0 -101
- package/src/headers/16/node_native_module_env.h +0 -68
- package/src/headers/16/node_platform.h +0 -192
- package/src/headers/16/node_process.h +0 -43
- package/src/headers/16/node_provider.d +0 -80
- package/src/headers/16/node_snapshotable.h +0 -137
- package/src/headers/16/node_union_bytes.h +0 -103
- package/src/headers/16/node_url.h +0 -205
- package/src/headers/16/node_v8.h +0 -41
- package/src/headers/16/node_v8_platform-inl.h +0 -194
- package/src/headers/16/node_wasi.h +0 -108
- package/src/headers/16/node_watchdog.h +0 -152
- package/src/headers/16/node_win32_etw_provider-inl.h +0 -288
- package/src/headers/16/node_win32_etw_provider.h +0 -99
- package/src/headers/16/spawn_sync.h +0 -242
- package/src/headers/16/string_decoder-inl.h +0 -37
- package/src/headers/16/string_search.h +0 -638
- package/src/headers/16/threadpoolwork-inl.h +0 -57
- package/src/headers/16/tracing/node_trace_buffer.h +0 -83
- package/src/headers/16/tracing/node_trace_writer.h +0 -75
- package/src/headers/16/tracing/trace_event.h +0 -720
- package/src/headers/16/tracing/traced_value.h +0 -70
- package/src/headers/16/v8abbr.h +0 -123
- package/src/headers/16/v8ustack.d +0 -695
- package/src/headers/18/aliased_buffer.h +0 -315
- package/src/headers/18/aliased_struct-inl.h +0 -54
- package/src/headers/18/aliased_struct.h +0 -63
- package/src/headers/18/base64-inl.h +0 -189
- package/src/headers/18/base64.h +0 -69
- package/src/headers/18/connect_wrap.h +0 -26
- package/src/headers/18/connection_wrap.h +0 -30
- package/src/headers/18/crypto/crypto_aes.h +0 -89
- package/src/headers/18/crypto/crypto_bio.h +0 -194
- package/src/headers/18/crypto/crypto_clienthello-inl.h +0 -90
- package/src/headers/18/crypto/crypto_common.h +0 -151
- package/src/headers/18/crypto/crypto_groups.h +0 -415
- package/src/headers/18/crypto/crypto_x509.h +0 -143
- package/src/headers/18/debug_utils-inl.h +0 -223
- package/src/headers/18/diagnosticfilename-inl.h +0 -33
- package/src/headers/18/env-inl.h +0 -1308
- package/src/headers/18/env.h +0 -1667
- package/src/headers/18/inspector_io.h +0 -78
- package/src/headers/18/inspector_socket.h +0 -60
- package/src/headers/18/inspector_socket_server.h +0 -110
- package/src/headers/18/js_stream.h +0 -52
- package/src/headers/18/memory_tracker.h +0 -284
- package/src/headers/18/module_wrap.h +0 -116
- package/src/headers/18/node_binding.h +0 -99
- package/src/headers/18/node_context_data.h +0 -44
- package/src/headers/18/node_contextify.h +0 -196
- package/src/headers/18/node_dir.h +0 -52
- package/src/headers/18/node_dtrace.h +0 -86
- package/src/headers/18/node_http2_state.h +0 -149
- package/src/headers/18/node_mem-inl.h +0 -112
- package/src/headers/18/node_native_module.h +0 -109
- package/src/headers/18/node_native_module_env.h +0 -71
- package/src/headers/18/node_object_wrap.h +0 -132
- package/src/headers/18/node_snapshot_builder.h +0 -43
- package/src/headers/18/node_snapshotable.h +0 -130
- package/src/headers/18/node_union_bytes.h +0 -103
- package/src/headers/18/node_url.h +0 -205
- package/src/headers/18/node_v8.h +0 -41
- package/src/headers/18/node_wasi.h +0 -108
- package/src/headers/18/node_win32_etw_provider-inl.h +0 -288
- package/src/headers/18/node_win32_etw_provider.h +0 -99
- package/src/headers/18/string_search.h +0 -638
- package/src/headers/18/tracing/node_trace_buffer.h +0 -83
- package/src/headers/18/tracing/node_trace_writer.h +0 -75
- package/src/headers/18/tracing/trace_event_common.h +0 -1109
- package/src/headers/18/tracing/traced_value.h +0 -70
- package/src/headers/18/v8abbr.h +0 -123
- /package/src/headers/{14 → 22}/aliased_struct-inl.h +0 -0
- /package/src/headers/{14 → 22}/aliased_struct.h +0 -0
- /package/src/headers/{16 → 22}/callback_queue-inl.h +0 -0
- /package/src/headers/{14 → 22}/connect_wrap.h +0 -0
- /package/src/headers/{14 → 22}/connection_wrap.h +0 -0
- /package/src/headers/{14 → 22}/diagnosticfilename-inl.h +0 -0
- /package/src/headers/{18 → 22}/histogram-inl.h +0 -0
- /package/src/headers/{14 → 22}/inspector_io.h +0 -0
- /package/src/headers/{14 → 22}/inspector_socket.h +0 -0
- /package/src/headers/{14 → 22}/inspector_socket_server.h +0 -0
- /package/src/headers/{14 → 22}/js_stream.h +0 -0
- /package/src/headers/{14 → 22}/node_dir.h +0 -0
- /package/src/headers/{14 → 22}/node_mem-inl.h +0 -0
- /package/src/headers/{16 → 22}/node_mem.h +0 -0
- /package/src/headers/{16 → 22}/node_mutex.h +0 -0
- /package/src/headers/{14 → 22}/node_object_wrap.h +0 -0
- /package/src/headers/{16 → 22}/node_process-inl.h +0 -0
- /package/src/headers/{18 → 22}/node_sockaddr-inl.h +0 -0
- /package/src/headers/{18 → 22}/node_wasm_web_api.h +0 -0
- /package/src/headers/{16 → 22}/pipe_wrap.h +0 -0
- /package/src/headers/{18 → 22}/req_wrap.h +0 -0
- /package/src/headers/{18 → 22}/timer_wrap-inl.h +0 -0
- /package/src/headers/{18 → 22}/timer_wrap.h +0 -0
- /package/src/headers/{18 → 22}/tracing/agent.h +0 -0
- /package/src/headers/{14 → 22}/tracing/trace_event_common.h +0 -0
- /package/src/headers/{18 → 22}/tty_wrap.h +0 -0
- /package/src/headers/{16 → 24}/aliased_struct-inl.h +0 -0
- /package/src/headers/{16 → 24}/aliased_struct.h +0 -0
- /package/src/headers/{18 → 24}/callback_queue-inl.h +0 -0
- /package/src/headers/{16 → 24}/connect_wrap.h +0 -0
- /package/src/headers/{16 → 24}/connection_wrap.h +0 -0
- /package/src/headers/{18 → 24}/crypto/crypto_spkac.h +0 -0
- /package/src/headers/{18 → 24}/crypto/crypto_timing.h +0 -0
- /package/src/headers/{16 → 24}/diagnosticfilename-inl.h +0 -0
- /package/src/headers/{16 → 24}/inspector_io.h +0 -0
- /package/src/headers/{16 → 24}/inspector_socket.h +0 -0
- /package/src/headers/{16 → 24}/inspector_socket_server.h +0 -0
- /package/src/headers/{16 → 24}/js_stream.h +0 -0
- /package/src/headers/{16 → 24}/node_dir.h +0 -0
- /package/src/headers/{18 → 24}/node_mem.h +0 -0
- /package/src/headers/{18 → 24}/node_mutex.h +0 -0
- /package/src/headers/{16 → 24}/node_object_wrap.h +0 -0
- /package/src/headers/{18 → 24}/node_process-inl.h +0 -0
- /package/src/headers/{14/tracing → 24}/node_trace_buffer.h +0 -0
- /package/src/headers/{14/tracing → 24}/node_trace_writer.h +0 -0
- /package/src/headers/{18 → 24}/pipe_wrap.h +0 -0
- /package/src/headers/{16/tracing → 24}/trace_event_common.h +0 -0
|
@@ -43,8 +43,8 @@ struct sockaddr;
|
|
|
43
43
|
|
|
44
44
|
namespace node {
|
|
45
45
|
|
|
46
|
-
namespace
|
|
47
|
-
class
|
|
46
|
+
namespace builtins {
|
|
47
|
+
class BuiltinLoader;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
namespace per_process {
|
|
@@ -58,7 +58,7 @@ class Environment;
|
|
|
58
58
|
// Convert a struct sockaddr to a { address: '1.2.3.4', port: 1234 } JS object.
|
|
59
59
|
// Sets address and port properties on the info object and returns it.
|
|
60
60
|
// If |info| is omitted, a new object is returned.
|
|
61
|
-
v8::
|
|
61
|
+
v8::MaybeLocal<v8::Object> AddressToJS(
|
|
62
62
|
Environment* env,
|
|
63
63
|
const sockaddr* addr,
|
|
64
64
|
v8::Local<v8::Object> info = v8::Local<v8::Object>());
|
|
@@ -66,9 +66,8 @@ v8::Local<v8::Object> AddressToJS(
|
|
|
66
66
|
template <typename T, int (*F)(const typename T::HandleType*, sockaddr*, int*)>
|
|
67
67
|
void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
68
68
|
T* wrap;
|
|
69
|
-
ASSIGN_OR_RETURN_UNWRAP(
|
|
70
|
-
|
|
71
|
-
args.GetReturnValue().Set(UV_EBADF));
|
|
69
|
+
ASSIGN_OR_RETURN_UNWRAP(
|
|
70
|
+
&wrap, args.This(), args.GetReturnValue().Set(UV_EBADF));
|
|
72
71
|
CHECK(args[0]->IsObject());
|
|
73
72
|
sockaddr_storage storage;
|
|
74
73
|
int addrlen = sizeof(storage);
|
|
@@ -79,11 +78,30 @@ void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
|
79
78
|
args.GetReturnValue().Set(err);
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
constexpr int kMaxFrameCountForLogging = 10;
|
|
82
|
+
v8::MaybeLocal<v8::StackTrace> GetCurrentStackTrace(
|
|
83
|
+
v8::Isolate* isolate, int frame_count = kMaxFrameCountForLogging);
|
|
84
|
+
|
|
85
|
+
enum class StackTracePrefix {
|
|
86
|
+
kAt, // " at "
|
|
87
|
+
kNumber
|
|
88
|
+
};
|
|
89
|
+
void PrintCurrentStackTrace(v8::Isolate* isolate,
|
|
90
|
+
StackTracePrefix prefix = StackTracePrefix::kAt);
|
|
91
|
+
void PrintStackTrace(v8::Isolate* isolate,
|
|
92
|
+
v8::Local<v8::StackTrace> stack,
|
|
93
|
+
StackTracePrefix prefix = StackTracePrefix::kAt);
|
|
83
94
|
void PrintCaughtException(v8::Isolate* isolate,
|
|
84
95
|
v8::Local<v8::Context> context,
|
|
85
96
|
const v8::TryCatch& try_catch);
|
|
86
|
-
|
|
97
|
+
std::string FormatCaughtException(v8::Isolate* isolate,
|
|
98
|
+
v8::Local<v8::Context> context,
|
|
99
|
+
const v8::TryCatch& try_catch);
|
|
100
|
+
std::string FormatErrorMessage(v8::Isolate* isolate,
|
|
101
|
+
v8::Local<v8::Context> context,
|
|
102
|
+
const std::string& reason,
|
|
103
|
+
v8::Local<v8::Message> message,
|
|
104
|
+
bool add_source_line = true);
|
|
87
105
|
void ResetStdio(); // Safe to call more than once and from signal handlers.
|
|
88
106
|
#ifdef __POSIX__
|
|
89
107
|
void SignalExit(int signal, siginfo_t* info, void* ucontext);
|
|
@@ -92,8 +110,13 @@ void SignalExit(int signal, siginfo_t* info, void* ucontext);
|
|
|
92
110
|
std::string GetProcessTitle(const char* default_title);
|
|
93
111
|
std::string GetHumanReadableProcessName();
|
|
94
112
|
|
|
95
|
-
v8::Maybe<
|
|
96
|
-
|
|
113
|
+
v8::Maybe<void> InitializeBaseContextForSnapshot(
|
|
114
|
+
v8::Local<v8::Context> context);
|
|
115
|
+
v8::Maybe<void> InitializeContextRuntime(v8::Local<v8::Context> context);
|
|
116
|
+
v8::Maybe<void> InitializePrimordials(v8::Local<v8::Context> context,
|
|
117
|
+
IsolateData* isolate_data);
|
|
118
|
+
v8::MaybeLocal<v8::Object> InitializePrivateSymbols(
|
|
119
|
+
v8::Local<v8::Context> context, IsolateData* isolate_data);
|
|
97
120
|
|
|
98
121
|
class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
|
99
122
|
public:
|
|
@@ -102,7 +125,6 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
|
|
102
125
|
void* Allocate(size_t size) override; // Defined in src/node.cc
|
|
103
126
|
void* AllocateUninitialized(size_t size) override;
|
|
104
127
|
void Free(void* data, size_t size) override;
|
|
105
|
-
void* Reallocate(void* data, size_t old_size, size_t size) override;
|
|
106
128
|
virtual void RegisterPointer(void* data, size_t size) {
|
|
107
129
|
total_mem_usage_.fetch_add(size, std::memory_order_relaxed);
|
|
108
130
|
}
|
|
@@ -118,6 +140,10 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
|
|
118
140
|
private:
|
|
119
141
|
uint32_t zero_fill_field_ = 1; // Boolean but exposed as uint32 to JS land.
|
|
120
142
|
std::atomic<size_t> total_mem_usage_ {0};
|
|
143
|
+
|
|
144
|
+
// Delegate to V8's allocator for compatibility with the V8 memory cage.
|
|
145
|
+
std::unique_ptr<v8::ArrayBuffer::Allocator> allocator_{
|
|
146
|
+
v8::ArrayBuffer::Allocator::NewDefaultAllocator()};
|
|
121
147
|
};
|
|
122
148
|
|
|
123
149
|
class DebuggingArrayBufferAllocator final : public NodeArrayBufferAllocator {
|
|
@@ -126,7 +152,6 @@ class DebuggingArrayBufferAllocator final : public NodeArrayBufferAllocator {
|
|
|
126
152
|
void* Allocate(size_t size) override;
|
|
127
153
|
void* AllocateUninitialized(size_t size) override;
|
|
128
154
|
void Free(void* data, size_t size) override;
|
|
129
|
-
void* Reallocate(void* data, size_t old_size, size_t size) override;
|
|
130
155
|
void RegisterPointer(void* data, size_t size) override;
|
|
131
156
|
void UnregisterPointer(void* data, size_t size) override;
|
|
132
157
|
|
|
@@ -171,16 +196,13 @@ static v8::MaybeLocal<v8::Object> New(Environment* env,
|
|
|
171
196
|
char* src = reinterpret_cast<char*>(buf->out());
|
|
172
197
|
const size_t len_in_bytes = buf->length() * sizeof(buf->out()[0]);
|
|
173
198
|
|
|
174
|
-
if (buf->IsAllocated())
|
|
199
|
+
if (buf->IsAllocated()) {
|
|
175
200
|
ret = New(env, src, len_in_bytes);
|
|
176
|
-
|
|
177
|
-
ret = Copy(env, src, len_in_bytes);
|
|
178
|
-
|
|
179
|
-
if (ret.IsEmpty())
|
|
180
|
-
return ret;
|
|
181
|
-
|
|
182
|
-
if (buf->IsAllocated())
|
|
201
|
+
// new always takes ownership of src
|
|
183
202
|
buf->Release();
|
|
203
|
+
} else if (!buf->IsInvalidated()) {
|
|
204
|
+
ret = Copy(env, src, len_in_bytes);
|
|
205
|
+
}
|
|
184
206
|
|
|
185
207
|
return ret;
|
|
186
208
|
}
|
|
@@ -193,7 +215,17 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
|
|
|
193
215
|
const v8::Local<v8::Function> callback,
|
|
194
216
|
int argc,
|
|
195
217
|
v8::Local<v8::Value> argv[],
|
|
196
|
-
async_context asyncContext
|
|
218
|
+
async_context asyncContext,
|
|
219
|
+
v8::Local<v8::Value> context_frame);
|
|
220
|
+
|
|
221
|
+
v8::MaybeLocal<v8::Value> InternalMakeCallback(
|
|
222
|
+
v8::Isolate* isolate,
|
|
223
|
+
v8::Local<v8::Object> recv,
|
|
224
|
+
const v8::Local<v8::Function> callback,
|
|
225
|
+
int argc,
|
|
226
|
+
v8::Local<v8::Value> argv[],
|
|
227
|
+
async_context asyncContext,
|
|
228
|
+
v8::Local<v8::Value> context_frame);
|
|
197
229
|
|
|
198
230
|
v8::MaybeLocal<v8::Value> MakeSyncCallback(v8::Isolate* isolate,
|
|
199
231
|
v8::Local<v8::Object> recv,
|
|
@@ -213,10 +245,13 @@ class InternalCallbackScope {
|
|
|
213
245
|
// compatibility issues, but it shouldn't.)
|
|
214
246
|
kSkipTaskQueues = 2
|
|
215
247
|
};
|
|
216
|
-
InternalCallbackScope(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
248
|
+
InternalCallbackScope(
|
|
249
|
+
Environment* env,
|
|
250
|
+
v8::Local<v8::Object> object,
|
|
251
|
+
const async_context& asyncContext,
|
|
252
|
+
int flags = kNoFlags,
|
|
253
|
+
v8::Local<v8::Value> context_frame = v8::Local<v8::Value>());
|
|
254
|
+
|
|
220
255
|
// Utility that can be used by AsyncWrap classes.
|
|
221
256
|
explicit InternalCallbackScope(AsyncWrap* async_wrap, int flags = 0);
|
|
222
257
|
~InternalCallbackScope();
|
|
@@ -234,6 +269,7 @@ class InternalCallbackScope {
|
|
|
234
269
|
bool failed_ = false;
|
|
235
270
|
bool pushed_ids_ = false;
|
|
236
271
|
bool closed_ = false;
|
|
272
|
+
v8::Global<v8::Value> prior_context_frame_;
|
|
237
273
|
};
|
|
238
274
|
|
|
239
275
|
class DebugSealHandleScope {
|
|
@@ -252,7 +288,8 @@ class DebugSealHandleScope {
|
|
|
252
288
|
|
|
253
289
|
class ThreadPoolWork {
|
|
254
290
|
public:
|
|
255
|
-
explicit inline ThreadPoolWork(Environment* env
|
|
291
|
+
explicit inline ThreadPoolWork(Environment* env, const char* type)
|
|
292
|
+
: env_(env), type_(type) {
|
|
256
293
|
CHECK_NOT_NULL(env);
|
|
257
294
|
}
|
|
258
295
|
inline virtual ~ThreadPoolWork() = default;
|
|
@@ -268,6 +305,7 @@ class ThreadPoolWork {
|
|
|
268
305
|
private:
|
|
269
306
|
Environment* env_;
|
|
270
307
|
uv_work_t work_req_;
|
|
308
|
+
const char* type_;
|
|
271
309
|
};
|
|
272
310
|
|
|
273
311
|
#define TRACING_CATEGORY_NODE "node"
|
|
@@ -283,49 +321,51 @@ class ThreadPoolWork {
|
|
|
283
321
|
|
|
284
322
|
#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
285
323
|
#define NODE_IMPLEMENTS_POSIX_CREDENTIALS 1
|
|
286
|
-
#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
324
|
+
#endif // defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
287
325
|
|
|
288
326
|
namespace credentials {
|
|
289
327
|
bool SafeGetenv(const char* key, std::string* text, Environment* env = nullptr);
|
|
290
328
|
} // namespace credentials
|
|
291
329
|
|
|
330
|
+
void TraceEnvVar(Environment* env, const char* message);
|
|
331
|
+
void TraceEnvVar(Environment* env, const char* message, const char* key);
|
|
332
|
+
void TraceEnvVar(Environment* env,
|
|
333
|
+
const char* message,
|
|
334
|
+
v8::Local<v8::String> key);
|
|
335
|
+
|
|
292
336
|
void DefineZlibConstants(v8::Local<v8::Object> target);
|
|
293
337
|
v8::Isolate* NewIsolate(v8::Isolate::CreateParams* params,
|
|
294
338
|
uv_loop_t* event_loop,
|
|
295
|
-
MultiIsolatePlatform* platform
|
|
339
|
+
MultiIsolatePlatform* platform,
|
|
340
|
+
const SnapshotData* snapshot_data = nullptr,
|
|
341
|
+
const IsolateSettings& settings = {});
|
|
296
342
|
// This overload automatically picks the right 'main_script_id' if no callback
|
|
297
343
|
// was provided by the embedder.
|
|
298
344
|
v8::MaybeLocal<v8::Value> StartExecution(Environment* env,
|
|
299
345
|
StartExecutionCallback cb = nullptr);
|
|
300
|
-
v8::MaybeLocal<v8::Object> GetPerContextExports(
|
|
301
|
-
v8::
|
|
302
|
-
Environment* env,
|
|
303
|
-
const char* id,
|
|
304
|
-
std::vector<v8::Local<v8::String>>* parameters,
|
|
305
|
-
std::vector<v8::Local<v8::Value>>* arguments);
|
|
346
|
+
v8::MaybeLocal<v8::Object> GetPerContextExports(
|
|
347
|
+
v8::Local<v8::Context> context, IsolateData* isolate_data = nullptr);
|
|
306
348
|
void MarkBootstrapComplete(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
307
349
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
350
|
+
class InitializationResultImpl final : public InitializationResult {
|
|
351
|
+
public:
|
|
352
|
+
~InitializationResultImpl() = default;
|
|
353
|
+
int exit_code() const { return static_cast<int>(exit_code_enum()); }
|
|
354
|
+
ExitCode exit_code_enum() const { return exit_code_; }
|
|
355
|
+
bool early_return() const { return early_return_; }
|
|
356
|
+
const std::vector<std::string>& args() const { return args_; }
|
|
357
|
+
const std::vector<std::string>& exec_args() const { return exec_args_; }
|
|
358
|
+
const std::vector<std::string>& errors() const { return errors_; }
|
|
359
|
+
MultiIsolatePlatform* platform() const { return platform_; }
|
|
360
|
+
|
|
361
|
+
ExitCode exit_code_ = ExitCode::kNoFailure;
|
|
362
|
+
std::vector<std::string> args_;
|
|
363
|
+
std::vector<std::string> exec_args_;
|
|
364
|
+
std::vector<std::string> errors_;
|
|
365
|
+
bool early_return_ = false;
|
|
366
|
+
MultiIsolatePlatform* platform_ = nullptr;
|
|
320
367
|
};
|
|
321
368
|
|
|
322
|
-
// TODO(codebytere): eventually document and expose to embedders.
|
|
323
|
-
InitializationResult InitializeOncePerProcess(int argc, char** argv);
|
|
324
|
-
InitializationResult InitializeOncePerProcess(
|
|
325
|
-
int argc,
|
|
326
|
-
char** argv,
|
|
327
|
-
InitializationSettingsFlags flags);
|
|
328
|
-
void TearDownOncePerProcess();
|
|
329
369
|
void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s);
|
|
330
370
|
void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s);
|
|
331
371
|
void SetIsolateCreateParamsForNode(v8::Isolate::CreateParams* params);
|
|
@@ -344,11 +384,12 @@ bool HasSignalJSHandler(int signum);
|
|
|
344
384
|
|
|
345
385
|
#ifdef _WIN32
|
|
346
386
|
typedef SYSTEMTIME TIME_TYPE;
|
|
347
|
-
#else // UNIX,
|
|
387
|
+
#else // UNIX, macOS
|
|
348
388
|
typedef struct tm TIME_TYPE;
|
|
349
389
|
#endif
|
|
350
390
|
|
|
351
391
|
double GetCurrentTimeInMicroseconds();
|
|
392
|
+
int WriteFileSync(const char* path, uv_buf_t* bufs, size_t buf_count);
|
|
352
393
|
int WriteFileSync(const char* path, uv_buf_t buf);
|
|
353
394
|
int WriteFileSync(v8::Isolate* isolate,
|
|
354
395
|
const char* path,
|
|
@@ -378,26 +419,11 @@ class DiagnosticFilename {
|
|
|
378
419
|
};
|
|
379
420
|
|
|
380
421
|
namespace heap {
|
|
381
|
-
|
|
422
|
+
v8::Maybe<void> WriteSnapshot(Environment* env,
|
|
423
|
+
const char* filename,
|
|
424
|
+
v8::HeapProfiler::HeapSnapshotOptions options);
|
|
382
425
|
}
|
|
383
426
|
|
|
384
|
-
class TraceEventScope {
|
|
385
|
-
public:
|
|
386
|
-
TraceEventScope(const char* category,
|
|
387
|
-
const char* name,
|
|
388
|
-
void* id) : category_(category), name_(name), id_(id) {
|
|
389
|
-
TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_, name_, id_);
|
|
390
|
-
}
|
|
391
|
-
~TraceEventScope() {
|
|
392
|
-
TRACE_EVENT_NESTABLE_ASYNC_END0(category_, name_, id_);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
private:
|
|
396
|
-
const char* category_;
|
|
397
|
-
const char* name_;
|
|
398
|
-
void* id_;
|
|
399
|
-
};
|
|
400
|
-
|
|
401
427
|
namespace heap {
|
|
402
428
|
|
|
403
429
|
void DeleteHeapSnapshot(const v8::HeapSnapshot* snapshot);
|
|
@@ -408,12 +434,41 @@ BaseObjectPtr<AsyncWrap> CreateHeapSnapshotStream(
|
|
|
408
434
|
Environment* env, HeapSnapshotPointer&& snapshot);
|
|
409
435
|
} // namespace heap
|
|
410
436
|
|
|
411
|
-
namespace fs {
|
|
412
|
-
std::string Basename(const std::string& str, const std::string& extension);
|
|
413
|
-
} // namespace fs
|
|
414
|
-
|
|
415
437
|
node_module napi_module_to_node_module(const napi_module* mod);
|
|
416
438
|
|
|
439
|
+
std::ostream& operator<<(std::ostream& output, const SnapshotFlags& flags);
|
|
440
|
+
std::ostream& operator<<(std::ostream& output,
|
|
441
|
+
const std::vector<SnapshotIndex>& v);
|
|
442
|
+
std::ostream& operator<<(std::ostream& output,
|
|
443
|
+
const std::vector<std::string>& vec);
|
|
444
|
+
std::ostream& operator<<(std::ostream& output,
|
|
445
|
+
const std::vector<PropInfo>& vec);
|
|
446
|
+
std::ostream& operator<<(std::ostream& output, const PropInfo& d);
|
|
447
|
+
std::ostream& operator<<(std::ostream& output, const EnvSerializeInfo& d);
|
|
448
|
+
std::ostream& operator<<(std::ostream& output,
|
|
449
|
+
const ImmediateInfo::SerializeInfo& d);
|
|
450
|
+
std::ostream& operator<<(std::ostream& output,
|
|
451
|
+
const TickInfo::SerializeInfo& d);
|
|
452
|
+
std::ostream& operator<<(std::ostream& output,
|
|
453
|
+
const AsyncHooks::SerializeInfo& d);
|
|
454
|
+
std::ostream& operator<<(std::ostream& output, const SnapshotMetadata& d);
|
|
455
|
+
|
|
456
|
+
namespace performance {
|
|
457
|
+
std::ostream& operator<<(std::ostream& output,
|
|
458
|
+
const PerformanceState::SerializeInfo& d);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
bool linux_at_secure();
|
|
462
|
+
|
|
463
|
+
namespace heap {
|
|
464
|
+
v8::HeapProfiler::HeapSnapshotOptions GetHeapSnapshotOptions(
|
|
465
|
+
v8::Local<v8::Value> options);
|
|
466
|
+
} // namespace heap
|
|
467
|
+
|
|
468
|
+
enum encoding ParseEncoding(v8::Isolate* isolate,
|
|
469
|
+
v8::Local<v8::Value> encoding_v,
|
|
470
|
+
v8::Local<v8::Value> encoding_id,
|
|
471
|
+
enum encoding default_encoding);
|
|
417
472
|
} // namespace node
|
|
418
473
|
|
|
419
474
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#ifndef SRC_INSPECTOR_NODE_JSON_H_
|
|
2
|
+
#define SRC_INSPECTOR_NODE_JSON_H_
|
|
3
|
+
|
|
4
|
+
#include "node/inspector/protocol/Protocol.h"
|
|
5
|
+
|
|
6
|
+
namespace node {
|
|
7
|
+
namespace inspector {
|
|
8
|
+
|
|
9
|
+
struct JsonUtil {
|
|
10
|
+
// Parse s JSON string into protocol::Value.
|
|
11
|
+
static std::unique_ptr<protocol::Value> ParseJSON(const uint8_t* chars,
|
|
12
|
+
size_t size);
|
|
13
|
+
static std::unique_ptr<protocol::Value> ParseJSON(const uint16_t* chars,
|
|
14
|
+
size_t size);
|
|
15
|
+
|
|
16
|
+
static std::unique_ptr<protocol::Value> parseJSON(const std::string_view);
|
|
17
|
+
static std::unique_ptr<protocol::Value> parseJSON(
|
|
18
|
+
v8_inspector::StringView view);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
} // namespace inspector
|
|
22
|
+
} // namespace node
|
|
23
|
+
|
|
24
|
+
#endif // SRC_INSPECTOR_NODE_JSON_H_
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (C) 2018 Intel Corporation
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"),
|
|
5
|
+
// to deal in the Software without restriction, including without limitation
|
|
6
|
+
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
7
|
+
// and/or sell copies of the Software, and to permit persons to whom
|
|
8
|
+
// the Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included
|
|
11
|
+
// in all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
14
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
16
|
+
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
|
|
17
|
+
// OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
18
|
+
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
|
19
|
+
// OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
|
+
// SPDX-License-Identifier: MIT
|
|
22
|
+
|
|
23
|
+
#ifndef SRC_LARGE_PAGES_NODE_LARGE_PAGE_H_
|
|
24
|
+
#define SRC_LARGE_PAGES_NODE_LARGE_PAGE_H_
|
|
25
|
+
|
|
26
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
27
|
+
|
|
28
|
+
namespace node {
|
|
29
|
+
int MapStaticCodeToLargePages();
|
|
30
|
+
const char* LargePagesError(int status);
|
|
31
|
+
} // namespace node
|
|
32
|
+
|
|
33
|
+
#endif // NODE_WANT_INTERNALS
|
|
34
|
+
#endif // SRC_LARGE_PAGES_NODE_LARGE_PAGE_H_
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#ifndef SRC_NODE_LOCKS_H_
|
|
2
|
+
#define SRC_NODE_LOCKS_H_
|
|
3
|
+
|
|
4
|
+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
+
|
|
6
|
+
#include <deque>
|
|
7
|
+
#include <string>
|
|
8
|
+
#include <unordered_map>
|
|
9
|
+
#include <unordered_set>
|
|
10
|
+
|
|
11
|
+
#include "base_object.h"
|
|
12
|
+
#include "env.h"
|
|
13
|
+
#include "node_mutex.h"
|
|
14
|
+
#include "v8.h"
|
|
15
|
+
|
|
16
|
+
namespace node::worker::locks {
|
|
17
|
+
|
|
18
|
+
class Lock final {
|
|
19
|
+
public:
|
|
20
|
+
enum class Mode { Shared, Exclusive };
|
|
21
|
+
|
|
22
|
+
Lock(Environment* env,
|
|
23
|
+
const std::u16string& name,
|
|
24
|
+
Mode mode,
|
|
25
|
+
const std::string& client_id,
|
|
26
|
+
v8::Local<v8::Promise::Resolver> waiting,
|
|
27
|
+
v8::Local<v8::Promise::Resolver> released);
|
|
28
|
+
~Lock() = default;
|
|
29
|
+
|
|
30
|
+
Lock(const Lock&) = delete;
|
|
31
|
+
Lock& operator=(const Lock&) = delete;
|
|
32
|
+
|
|
33
|
+
// Resource name for this lock as DOMString
|
|
34
|
+
const std::u16string& name() const { return name_; }
|
|
35
|
+
// Lock mode (shared or exclusive).
|
|
36
|
+
Mode mode() const { return mode_; }
|
|
37
|
+
// Client identifier string.
|
|
38
|
+
const std::string& client_id() const { return client_id_; }
|
|
39
|
+
// Environment that owns this lock.
|
|
40
|
+
Environment* env() const { return env_; }
|
|
41
|
+
|
|
42
|
+
// Returns true if this lock was stolen by another request.
|
|
43
|
+
bool is_stolen() const { return stolen_; }
|
|
44
|
+
// Marks this lock as stolen.
|
|
45
|
+
void mark_stolen() { stolen_ = true; }
|
|
46
|
+
|
|
47
|
+
// Promise that resolves when the user callback completes.
|
|
48
|
+
v8::Local<v8::Promise::Resolver> waiting_promise() {
|
|
49
|
+
return waiting_promise_.Get(env_->isolate());
|
|
50
|
+
}
|
|
51
|
+
// Promise that resolves when the lock is finally released.
|
|
52
|
+
v8::Local<v8::Promise::Resolver> released_promise() {
|
|
53
|
+
return released_promise_.Get(env_->isolate());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private:
|
|
57
|
+
Environment* env_;
|
|
58
|
+
std::u16string name_;
|
|
59
|
+
Mode mode_;
|
|
60
|
+
std::string client_id_;
|
|
61
|
+
bool stolen_ = false;
|
|
62
|
+
v8::Global<v8::Promise::Resolver> waiting_promise_;
|
|
63
|
+
v8::Global<v8::Promise::Resolver> released_promise_;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
class LockHolder final : public BaseObject {
|
|
67
|
+
public:
|
|
68
|
+
LockHolder(Environment* env,
|
|
69
|
+
v8::Local<v8::Object> obj,
|
|
70
|
+
std::shared_ptr<Lock> lock)
|
|
71
|
+
: BaseObject(env, obj), lock_(std::move(lock)) {
|
|
72
|
+
MakeWeak();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
~LockHolder() = default;
|
|
76
|
+
|
|
77
|
+
LockHolder(const LockHolder&) = delete;
|
|
78
|
+
LockHolder& operator=(const LockHolder&) = delete;
|
|
79
|
+
|
|
80
|
+
std::shared_ptr<Lock> lock() const { return lock_; }
|
|
81
|
+
|
|
82
|
+
SET_NO_MEMORY_INFO()
|
|
83
|
+
SET_MEMORY_INFO_NAME(LockHolder)
|
|
84
|
+
SET_SELF_SIZE(LockHolder)
|
|
85
|
+
|
|
86
|
+
static BaseObjectPtr<LockHolder> Create(Environment* env,
|
|
87
|
+
std::shared_ptr<Lock> lock);
|
|
88
|
+
|
|
89
|
+
private:
|
|
90
|
+
static v8::Local<v8::FunctionTemplate> GetConstructorTemplate(
|
|
91
|
+
Environment* env);
|
|
92
|
+
|
|
93
|
+
std::shared_ptr<Lock> lock_;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
class LockRequest final {
|
|
97
|
+
public:
|
|
98
|
+
LockRequest(Environment* env,
|
|
99
|
+
v8::Local<v8::Promise::Resolver> waiting,
|
|
100
|
+
v8::Local<v8::Promise::Resolver> released,
|
|
101
|
+
v8::Local<v8::Function> callback,
|
|
102
|
+
const std::u16string& name,
|
|
103
|
+
Lock::Mode mode,
|
|
104
|
+
const std::string& client_id,
|
|
105
|
+
bool steal,
|
|
106
|
+
bool if_available);
|
|
107
|
+
~LockRequest() = default;
|
|
108
|
+
|
|
109
|
+
LockRequest(const LockRequest&) = delete;
|
|
110
|
+
LockRequest& operator=(const LockRequest&) = delete;
|
|
111
|
+
|
|
112
|
+
const std::u16string& name() const { return name_; }
|
|
113
|
+
Lock::Mode mode() const { return mode_; }
|
|
114
|
+
const std::string& client_id() const { return client_id_; }
|
|
115
|
+
bool steal() const { return steal_; }
|
|
116
|
+
// Returns true if this is an ifAvailable request.
|
|
117
|
+
bool if_available() const { return if_available_; }
|
|
118
|
+
Environment* env() const { return env_; }
|
|
119
|
+
|
|
120
|
+
v8::Local<v8::Promise::Resolver> waiting_promise() {
|
|
121
|
+
return waiting_promise_.Get(env_->isolate());
|
|
122
|
+
}
|
|
123
|
+
v8::Local<v8::Promise::Resolver> released_promise() {
|
|
124
|
+
return released_promise_.Get(env_->isolate());
|
|
125
|
+
}
|
|
126
|
+
v8::Local<v8::Function> callback() { return callback_.Get(env_->isolate()); }
|
|
127
|
+
|
|
128
|
+
private:
|
|
129
|
+
Environment* env_;
|
|
130
|
+
std::u16string name_;
|
|
131
|
+
Lock::Mode mode_;
|
|
132
|
+
std::string client_id_;
|
|
133
|
+
bool steal_;
|
|
134
|
+
bool if_available_;
|
|
135
|
+
v8::Global<v8::Promise::Resolver> waiting_promise_;
|
|
136
|
+
v8::Global<v8::Promise::Resolver> released_promise_;
|
|
137
|
+
v8::Global<v8::Function> callback_;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
class LockManager final {
|
|
141
|
+
public:
|
|
142
|
+
static void Request(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
143
|
+
static void Query(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
144
|
+
|
|
145
|
+
void ProcessQueue(Environment* env);
|
|
146
|
+
void CleanupEnvironment(Environment* env);
|
|
147
|
+
|
|
148
|
+
static void OnEnvironmentCleanup(void* arg);
|
|
149
|
+
static LockManager* GetCurrent() { return ¤t_; }
|
|
150
|
+
void ReleaseLockAndProcessQueue(Environment* env,
|
|
151
|
+
std::shared_ptr<Lock> lock,
|
|
152
|
+
v8::Local<v8::Value> result,
|
|
153
|
+
bool was_rejected = false);
|
|
154
|
+
|
|
155
|
+
private:
|
|
156
|
+
LockManager() = default;
|
|
157
|
+
~LockManager() = default;
|
|
158
|
+
|
|
159
|
+
LockManager(const LockManager&) = delete;
|
|
160
|
+
LockManager& operator=(const LockManager&) = delete;
|
|
161
|
+
|
|
162
|
+
bool IsGrantable(const LockRequest* req) const;
|
|
163
|
+
void CleanupStolenLocks(Environment* env);
|
|
164
|
+
void ReleaseLock(Lock* lock);
|
|
165
|
+
void WakeEnvironment(Environment* env);
|
|
166
|
+
|
|
167
|
+
static LockManager current_;
|
|
168
|
+
|
|
169
|
+
mutable Mutex mutex_;
|
|
170
|
+
// All entries for a given Environment* are purged in CleanupEnvironment().
|
|
171
|
+
std::unordered_map<std::u16string, std::deque<std::shared_ptr<Lock>>>
|
|
172
|
+
held_locks_;
|
|
173
|
+
std::deque<std::unique_ptr<LockRequest>> pending_queue_;
|
|
174
|
+
std::unordered_set<Environment*> registered_envs_;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
} // namespace node::worker::locks
|
|
178
|
+
|
|
179
|
+
#endif // NODE_WANT_INTERNALS
|
|
180
|
+
#endif // SRC_NODE_LOCKS_H_
|
|
@@ -7,67 +7,38 @@
|
|
|
7
7
|
#include <memory>
|
|
8
8
|
|
|
9
9
|
#include "node.h"
|
|
10
|
+
#include "node_exit_code.h"
|
|
10
11
|
#include "util.h"
|
|
11
12
|
#include "uv.h"
|
|
12
13
|
#include "v8.h"
|
|
13
14
|
|
|
14
15
|
namespace node {
|
|
15
16
|
|
|
17
|
+
class ExternalReferenceRegistry;
|
|
18
|
+
struct EnvSerializeInfo;
|
|
19
|
+
struct SnapshotData;
|
|
20
|
+
|
|
16
21
|
// TODO(joyeecheung): align this with the Worker/WorkerThreadData class.
|
|
17
22
|
// We may be able to create an abstract class to reuse some of the routines.
|
|
18
23
|
class NodeMainInstance {
|
|
19
24
|
public:
|
|
20
|
-
// To create a main instance that does not own the isolate,
|
|
21
|
-
// The caller needs to do:
|
|
22
|
-
//
|
|
23
|
-
// Isolate* isolate = Isolate::Allocate();
|
|
24
|
-
// platform->RegisterIsolate(isolate, loop);
|
|
25
|
-
// isolate->Initialize(...);
|
|
26
|
-
// isolate->Enter();
|
|
27
|
-
// std::unique_ptr<NodeMainInstance> main_instance =
|
|
28
|
-
// NodeMainInstance::Create(isolate, loop, args, exec_args);
|
|
29
|
-
//
|
|
30
|
-
// When tearing it down:
|
|
31
|
-
//
|
|
32
|
-
// main_instance->Cleanup(); // While the isolate is entered
|
|
33
|
-
// isolate->Exit();
|
|
34
|
-
// isolate->Dispose();
|
|
35
|
-
// platform->UnregisterIsolate(isolate);
|
|
36
|
-
//
|
|
37
|
-
// After calling Dispose() the main_instance is no longer accessible.
|
|
38
|
-
static std::unique_ptr<NodeMainInstance> Create(
|
|
39
|
-
v8::Isolate* isolate,
|
|
40
|
-
uv_loop_t* event_loop,
|
|
41
|
-
MultiIsolatePlatform* platform,
|
|
42
|
-
const std::vector<std::string>& args,
|
|
43
|
-
const std::vector<std::string>& exec_args);
|
|
44
|
-
|
|
45
|
-
void Dispose();
|
|
46
|
-
|
|
47
25
|
// Create a main instance that owns the isolate
|
|
48
|
-
NodeMainInstance(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const std::vector<std::string>& exec_args,
|
|
54
|
-
const std::vector<size_t>* per_isolate_data_indexes = nullptr);
|
|
26
|
+
NodeMainInstance(const SnapshotData* snapshot_data,
|
|
27
|
+
uv_loop_t* event_loop,
|
|
28
|
+
MultiIsolatePlatform* platform,
|
|
29
|
+
const std::vector<std::string>& args,
|
|
30
|
+
const std::vector<std::string>& exec_args);
|
|
55
31
|
~NodeMainInstance();
|
|
56
32
|
|
|
57
33
|
// Start running the Node.js instances, return the exit code when finished.
|
|
58
|
-
|
|
34
|
+
ExitCode Run();
|
|
35
|
+
void Run(ExitCode* exit_code, Environment* env);
|
|
59
36
|
|
|
60
37
|
IsolateData* isolate_data() { return isolate_data_.get(); }
|
|
61
38
|
|
|
62
39
|
DeleteFnPtr<Environment, FreeEnvironment> CreateMainEnvironment(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// If nullptr is returned, the binary is not built with embedded
|
|
66
|
-
// snapshot.
|
|
67
|
-
static const std::vector<size_t>* GetIsolateDataIndexes();
|
|
68
|
-
static v8::StartupData* GetEmbeddedSnapshotBlob();
|
|
40
|
+
ExitCode* exit_code);
|
|
69
41
|
|
|
70
|
-
static const size_t kNodeContextIndex = 0;
|
|
71
42
|
NodeMainInstance(const NodeMainInstance&) = delete;
|
|
72
43
|
NodeMainInstance& operator=(const NodeMainInstance&) = delete;
|
|
73
44
|
NodeMainInstance(NodeMainInstance&&) = delete;
|
|
@@ -86,8 +57,8 @@ class NodeMainInstance {
|
|
|
86
57
|
v8::Isolate* isolate_;
|
|
87
58
|
MultiIsolatePlatform* platform_;
|
|
88
59
|
std::unique_ptr<IsolateData> isolate_data_;
|
|
89
|
-
|
|
90
|
-
|
|
60
|
+
std::unique_ptr<v8::Isolate::CreateParams> isolate_params_;
|
|
61
|
+
const SnapshotData* snapshot_data_ = nullptr;
|
|
91
62
|
};
|
|
92
63
|
|
|
93
64
|
} // namespace node
|