diff options
39 files changed, 176 insertions, 29 deletions
diff --git a/src/async_wrap.h b/src/async_wrap.h index f748dc801da..fed05ab021b 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -174,7 +174,7 @@ class AsyncWrap : public BaseObject { v8::Local<v8::Value>* argv); virtual std::string diagnostic_name() const; - std::string MemoryInfoName() const override; + virtual std::string MemoryInfoName() const; static void WeakCallback(const v8::WeakCallbackInfo<DestroyParam> &info); diff --git a/src/base_object.h b/src/base_object.h index e0f3f27950e..64a23714338 100644 --- a/src/base_object.h +++ b/src/base_object.h @@ -33,6 +33,11 @@ namespace node { class Environment; +#define ADD_MEMORY_INFO_NAME(name) \ + std::string MemoryInfoName() const override { \ + return #name; \ + } + class BaseObject : public MemoryRetainer { public: // Associates this object with `object`. It uses the 0th internal field for diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 604213a2c65..53d7a724426 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -127,6 +127,7 @@ struct node_ares_task : public MemoryRetainer { uv_poll_t poll_watcher; void MemoryInfo(MemoryTracker* tracker) const override; + ADD_MEMORY_INFO_NAME(node_ares_task) }; struct TaskHash { @@ -173,9 +174,11 @@ class ChannelWrap : public AsyncWrap { tracker->TrackThis(this); if (timer_handle_ != nullptr) tracker->TrackFieldWithSize("timer handle", sizeof(*timer_handle_)); - tracker->TrackField("task list", task_list_); + tracker->TrackField("node_ares_task_list", task_list_); } + ADD_MEMORY_INFO_NAME(ChannelWrap) + static void AresTimeout(uv_timer_t* handle); private: @@ -225,6 +228,8 @@ class GetAddrInfoReqWrap : public ReqWrap<uv_getaddrinfo_t> { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(GetAddrInfoReqWrap) + bool verbatim() const { return verbatim_; } private: @@ -246,6 +251,8 @@ class GetNameInfoReqWrap : public ReqWrap<uv_getnameinfo_t> { void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackThis(this); } + + ADD_MEMORY_INFO_NAME(GetNameInfoReqWrap) }; GetNameInfoReqWrap::GetNameInfoReqWrap(Environment* env, @@ -1178,6 +1185,8 @@ class QueryAnyWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryAnyWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1357,6 +1366,8 @@ class QueryAWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryAWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1403,6 +1414,8 @@ class QueryAaaaWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryAaaaWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1449,6 +1462,8 @@ class QueryCnameWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryCnameWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1482,6 +1497,8 @@ class QueryMxWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryMxWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1515,6 +1532,8 @@ class QueryNsWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryNsWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1548,6 +1567,8 @@ class QueryTxtWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryTxtWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1580,6 +1601,8 @@ class QuerySrvWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QuerySrvWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1611,6 +1634,8 @@ class QueryPtrWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryPtrWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1644,6 +1669,8 @@ class QueryNaptrWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QueryNaptrWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1676,6 +1703,8 @@ class QuerySoaWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(QuerySoaWrap) + protected: void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); @@ -1757,6 +1786,8 @@ class GetHostByAddrWrap: public QueryWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(GetHostByAddrWrap) + protected: void Parse(struct hostent* host) override { HandleScope handle_scope(env()->isolate()); diff --git a/src/connect_wrap.h b/src/connect_wrap.h index 587e4c6b059..2370157eaa2 100644 --- a/src/connect_wrap.h +++ b/src/connect_wrap.h @@ -19,6 +19,8 @@ class ConnectWrap : public ReqWrap<uv_connect_t> { void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackThis(this); } + + ADD_MEMORY_INFO_NAME(ConnectWrap) }; } // namespace node diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 7587ace8e3c..e0cdab4d3e2 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -61,6 +61,8 @@ class FSEventWrap: public HandleWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(FSEventWrap) + private: static const encoding kDefaultEncoding = UTF8; diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index a8e2e8ecafe..4e95598d3a0 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -109,6 +109,8 @@ class JSBindingsConnection : public AsyncWrap { tracker->TrackFieldWithSize("session", sizeof(*session_)); } + ADD_MEMORY_INFO_NAME(JSBindingsConnection) + private: std::unique_ptr<InspectorSession> session_; Persistent<Function> callback_; diff --git a/src/js_stream.h b/src/js_stream.h index f3406ae83ee..05fb688f2f4 100644 --- a/src/js_stream.h +++ b/src/js_stream.h @@ -31,6 +31,8 @@ class JSStream : public AsyncWrap, public StreamBase { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(JSStream) + protected: JSStream(Environment* env, v8::Local<v8::Object> obj); diff --git a/src/module_wrap.h b/src/module_wrap.h index 2d6f5c49d88..3e19b6c9eb3 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -39,6 +39,8 @@ class ModuleWrap : public BaseObject { tracker->TrackField("resolve_cache", resolve_cache_); } + ADD_MEMORY_INFO_NAME(ModuleWrap) + private: ModuleWrap(Environment* env, v8::Local<v8::Object> object, diff --git a/src/node_contextify.cc b/src/node_contextify.cc index e4b4fef3dca..74b7c594d5f 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -592,6 +592,8 @@ class ContextifyScript : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(ContextifyScript) + public: static void Init(Environment* env, Local<Object> target) { HandleScope scope(env->isolate()); diff --git a/src/node_crypto.h b/src/node_crypto.h index 7df2660c779..ee069c9cf79 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -109,6 +109,8 @@ class SecureContext : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(SecureContext) + SSLCtxPointer ctx_; X509Pointer cert_; X509Pointer issuer_; @@ -345,6 +347,8 @@ class CipherBase : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(CipherBase) + protected: enum CipherKind { kCipher, @@ -419,6 +423,8 @@ class Hmac : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(Hmac) + protected: void HmacInit(const char* hash_type, const char* key, int key_len); bool HmacUpdate(const char* data, int len); @@ -446,6 +452,8 @@ class Hash : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(Hash) + bool HashInit(const char* hash_type); bool HashUpdate(const char* data, int len); @@ -489,6 +497,8 @@ class SignBase : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(SignBase) + protected: void CheckThrow(Error error); @@ -605,6 +615,8 @@ class DiffieHellman : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(DiffieHellman) + private: static void GetField(const v8::FunctionCallbackInfo<v8::Value>& args, const BIGNUM* (*get_field)(const DH*), @@ -634,6 +646,8 @@ class ECDH : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(ECDH) + protected: ECDH(Environment* env, v8::Local<v8::Object> wrap, ECKeyPointer&& key) : BaseObject(env, wrap), diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index dea010fa015..b4aa85f8fa3 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -115,6 +115,8 @@ class NodeBIO : public MemoryRetainer { tracker->TrackFieldWithSize("buffer", length_); } + ADD_MEMORY_INFO_NAME(NodeBIO) + private: static int New(BIO* bio); static int Free(BIO* bio); diff --git a/src/node_file.h b/src/node_file.h index 141d1d42d74..73202d9c446 100644 --- a/src/node_file.h +++ b/src/node_file.h @@ -99,6 +99,8 @@ class FSReqWrap : public FSReqBase { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(FSReqWrap) + private: DISALLOW_COPY_AND_ASSIGN(FSReqWrap); }; @@ -162,6 +164,8 @@ class FSReqPromise : public FSReqBase { tracker->TrackField("stats_field_array", stats_field_array_); } + ADD_MEMORY_INFO_NAME(FSReqPromise) + private: bool finished_ = false; AliasedBuffer<NativeT, V8T> stats_field_array_; @@ -201,6 +205,8 @@ class FileHandleReadWrap : public ReqWrap<uv_fs_t> { tracker->TrackField("buffer", buffer_); } + ADD_MEMORY_INFO_NAME(FileHandleReadWrap) + private: FileHandle* file_handle_; uv_buf_t buffer_; @@ -252,6 +258,8 @@ class FileHandle : public AsyncWrap, public StreamBase { tracker->TrackField("current_read", current_read_); } + ADD_MEMORY_INFO_NAME(FileHandle) + private: // Synchronous close that emits a warning void Close(); @@ -284,6 +292,8 @@ class FileHandle : public AsyncWrap, public StreamBase { tracker->TrackField("ref", ref_); } + ADD_MEMORY_INFO_NAME(CloseReq) + void Resolve(); void Reject(Local<Value> reason); diff --git a/src/node_http2.h b/src/node_http2.h index a30ee581751..d7f8d9acae9 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -575,6 +575,8 @@ class Http2Stream : public AsyncWrap, tracker->TrackField("queue", queue_); } + ADD_MEMORY_INFO_NAME(Http2Stream) + std::string diagnostic_name() const override; // JavaScript API @@ -761,6 +763,8 @@ class Http2Session : public AsyncWrap, public StreamListener { pending_rst_streams_.size() * sizeof(int32_t)); } + ADD_MEMORY_INFO_NAME(Http2Session) + std::string diagnostic_name() const override; // Schedule an RstStream for after the current write finishes. @@ -1081,6 +1085,8 @@ class Http2Session::Http2Ping : public AsyncWrap { tracker->TrackField("session", session_); } + ADD_MEMORY_INFO_NAME(Http2Ping) + void Send(uint8_t* payload); void Done(bool ack, const uint8_t* payload = nullptr); @@ -1104,6 +1110,8 @@ class Http2Session::Http2Settings : public AsyncWrap { tracker->TrackField("session", session_); } + ADD_MEMORY_INFO_NAME(Http2Settings) + void Send(); void Done(bool ack); diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index e8fc1f22e49..318ad0b8e6b 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -160,6 +160,7 @@ class Parser : public AsyncWrap, public StreamListener { tracker->TrackField("current_buffer", current_buffer_); } + ADD_MEMORY_INFO_NAME(Parser) int on_message_begin() { num_fields_ = num_values_ = 0; diff --git a/src/node_i18n.cc b/src/node_i18n.cc index 288ad77f619..45871f3d3ed 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -254,6 +254,8 @@ class ConverterObject : public BaseObject, Converter { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(ConverterObject) + protected: ConverterObject(Environment* env, v8::Local<v8::Object> wrap, diff --git a/src/node_messaging.h b/src/node_messaging.h index da10300aedb..b7fd392ccc6 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -57,6 +57,8 @@ class Message : public MemoryRetainer { void MemoryInfo(MemoryTracker* tracker) const override; + ADD_MEMORY_INFO_NAME(Message) + private: MallocedBuffer<char> main_message_buf_; std::vector<MallocedBuffer<char>> array_buffer_contents_; @@ -98,6 +100,8 @@ class MessagePortData : public MemoryRetainer { void MemoryInfo(MemoryTracker* tracker) const override; + ADD_MEMORY_INFO_NAME(MessagePortData) + private: // After disentangling this message port, the owner handle (if any) // is asynchronously triggered, so that it can close down naturally. @@ -187,6 +191,8 @@ class MessagePort : public HandleWrap { tracker->TrackField("data", data_); } + ADD_MEMORY_INFO_NAME(MessagePort) + private: void OnClose() override; void OnMessage(); diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 4b2cc60b3f7..5de0ddd8190 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -57,6 +57,8 @@ class SerializerContext : public BaseObject, tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(SerializerContext) + private: ValueSerializer serializer_; }; @@ -86,6 +88,8 @@ class DeserializerContext : public BaseObject, tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(DeserializerContext) + private: const uint8_t* data_; const size_t length_; diff --git a/src/node_stat_watcher.h b/src/node_stat_watcher.h index baf6bdc14ee..33c90ad3cde 100644 --- a/src/node_stat_watcher.h +++ b/src/node_stat_watcher.h @@ -48,6 +48,8 @@ class StatWatcher : public HandleWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(StatWatcher) + private: static void Callback(uv_fs_poll_t* handle, int status, diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index a2f42249483..684ea41a66c 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -32,6 +32,8 @@ class NodeCategorySet : public BaseObject { tracker->TrackField("categories", categories_); } + ADD_MEMORY_INFO_NAME(NodeCategorySet) + private: NodeCategorySet(Environment* env, Local<Object> wrap, diff --git a/src/node_worker.h b/src/node_worker.h index bd737d4800f..33df36e04ce 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -33,6 +33,9 @@ class Worker : public AsyncWrap { tracker->TrackField("parent_port", parent_port_); } + + ADD_MEMORY_INFO_NAME(Worker) + bool is_stopped() const; static void New(const v8::FunctionCallbackInfo<v8::Value>& args); diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 031666e19ad..774d319249c 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -653,6 +653,9 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork { zlib_memory_ + unreported_allocations_); } + + ADD_MEMORY_INFO_NAME(ZCtx) + private: void Ref() { if (++refs_ == 1) { diff --git a/src/pipe_wrap.h b/src/pipe_wrap.h index 9ed4f153ae5..7faf5145abd 100644 --- a/src/pipe_wrap.h +++ b/src/pipe_wrap.h @@ -49,6 +49,8 @@ class PipeWrap : public ConnectionWrap<PipeWrap, uv_pipe_t> { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(PipeWrap) + private: PipeWrap(Environment* env, v8::Local<v8::Object> object, diff --git a/src/process_wrap.cc b/src/process_wrap.cc index b9a20c34a77..b54e17f2119 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -70,6 +70,8 @@ class ProcessWrap : public HandleWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(ProcessWrap) + private: static void New(const FunctionCallbackInfo<Value>& args) { // This constructor should not be exposed to public javascript. diff --git a/src/sharedarraybuffer_metadata.cc b/src/sharedarraybuffer_metadata.cc index 95fed87c8d4..3d5b96051ea 100644 --- a/src/sharedarraybuffer_metadata.cc +++ b/src/sharedarraybuffer_metadata.cc @@ -51,6 +51,8 @@ class SABLifetimePartner : public BaseObject { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(SABLifetimePartner) + SharedArrayBufferMetadataReference reference; }; diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 5568d22e4c6..463a8a50d5e 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -64,6 +64,8 @@ class SignalWrap : public HandleWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(SignalWrap) + private: static void New(const FunctionCallbackInfo<Value>& args) { // This constructor should not be exposed to public javascript. diff --git a/src/stream_base.h b/src/stream_base.h index bbb20e52e1a..05c2a962362 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -350,6 +350,8 @@ class SimpleShutdownWrap : public ShutdownWrap, public OtherBase { void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackThis(this); } + + ADD_MEMORY_INFO_NAME(SimpleShutdownWrap) }; template <typename OtherBase> @@ -364,6 +366,9 @@ class SimpleWriteWrap : public WriteWrap, public OtherBase { tracker->TrackThis(this); tracker->TrackFieldWithSize("storage", StorageSize()); } + + + ADD_MEMORY_INFO_NAME(SimpleWriteWrap) }; } // namespace node diff --git a/src/stream_pipe.h b/src/stream_pipe.h index 36a0b1dc081..c76afac4168 100644 --- a/src/stream_pipe.h +++ b/src/stream_pipe.h @@ -22,6 +22,8 @@ class StreamPipe : public AsyncWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(StreamPipe) + private: inline StreamBase* source(); inline StreamBase* sink(); diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index d6ca9306099..829c1b22bf3 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -48,6 +48,17 @@ class TCPWrap : public ConnectionWrap<TCPWrap, uv_tcp_t> { tracker->TrackThis(this); } + std::string MemoryInfoName() const override { + switch (provider_type()) { + case ProviderType::PROVIDER_TCPWRAP: + return "TCPSocketWrap"; + case ProviderType::PROVIDER_TCPSERVERWRAP: + return "TCPServerWrap"; + default: + UNREACHABLE(); + } + } + private: typedef uv_tcp_t HandleType; diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 5f4fd3f7073..aea8568b11b 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -78,6 +78,8 @@ class TLSWrap : public AsyncWrap, void MemoryInfo(MemoryTracker* tracker) const override; + ADD_MEMORY_INFO_NAME(TLSWrap) + protected: inline StreamBase* underlying_stream() { return static_cast<StreamBase*>(stream_); diff --git a/src/tty_wrap.h b/src/tty_wrap.h index cca5650ddb3..45357cfa463 100644 --- a/src/tty_wrap.h +++ b/src/tty_wrap.h @@ -42,6 +42,8 @@ class TTYWrap : public LibuvStreamWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(TTYWrap) + private: TTYWrap(Environment* env, v8::Local<v8::Object> object, diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index e5243319a55..2ef5c613587 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -60,6 +60,8 @@ class SendWrap : public ReqWrap<uv_udp_send_t> { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(SendWrap) + private: const bool have_callback_; }; diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 3792bcc459d..ca048f5aef9 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -68,6 +68,8 @@ class UDPWrap: public HandleWrap { tracker->TrackThis(this); } + ADD_MEMORY_INFO_NAME(UDPWrap) + private: typedef uv_udp_t HandleType; diff --git a/test/parallel/test-heapdump-dns.js b/test/parallel/test-heapdump-dns.js index 011503f5874..00ca54917f5 100644 --- a/test/parallel/test-heapdump-dns.js +++ b/test/parallel/test-heapdump-dns.js @@ -3,14 +3,15 @@ require('../common'); const { validateSnapshotNodes } = require('../common/heap'); -validateSnapshotNodes('DNSCHANNEL', []); +validateSnapshotNodes('ChannelWrap', []); const dns = require('dns'); -validateSnapshotNodes('DNSCHANNEL', [{}]); +validateSnapshotNodes('ChannelWrap', [{}]); dns.resolve('localhost', () => {}); -validateSnapshotNodes('DNSCHANNEL', [ +validateSnapshotNodes('ChannelWrap', [ { children: [ - { name: 'task list' }, + { name: 'node_ares_task_list' }, + // `Node / ChannelWrap` (C++) -> `ChannelWrap` (JS) { name: 'ChannelWrap' } ] } diff --git a/test/parallel/test-heapdump-fs-promise.js b/test/parallel/test-heapdump-fs-promise.js index be44b3d8731..855b135f6ae 100644 --- a/test/parallel/test-heapdump-fs-promise.js +++ b/test/parallel/test-heapdump-fs-promise.js @@ -4,9 +4,9 @@ require('../common'); const { validateSnapshotNodes } = require('../common/heap'); const fs = require('fs').promises; -validateSnapshotNodes('FSREQPROMISE', []); +validateSnapshotNodes('FSReqPromise', []); fs.stat(__filename); -validateSnapshotNodes('FSREQPROMISE', [ +validateSnapshotNodes('FSReqPromise', [ { children: [ { name: 'FSReqPromise' }, diff --git a/test/parallel/test-heapdump-http2.js b/test/parallel/test-heapdump-http2.js index 19a70d8c44b..cbc1209ab05 100644 --- a/test/parallel/test-heapdump-http2.js +++ b/test/parallel/test-heapdump-http2.js @@ -8,8 +8,8 @@ if (!common.hasCrypto) { const state = recordState(); - state.validateSnapshotNodes('HTTP2SESSION', []); - state.validateSnapshotNodes('HTTP2STREAM', []); + state.validateSnapshotNodes('Http2Session', []); + state.validateSnapshotNodes('Http2Stream', []); } const server = http2.createServer(); @@ -22,42 +22,48 @@ server.listen(0, () => { req.on('response', common.mustCall(() => { const state = recordState(); - state.validateSnapshotNodes('HTTP2STREAM', [ + + // `Node / Http2Stream` (C++) -> Http2Stream (JS) + state.validateSnapshotNodes('Http2Stream', [ { children: [ { name: 'Http2Stream' } ] }, ], { loose: true }); - state.validateSnapshotNodes('FILEHANDLE', [ + + // `Node / FileHandle` (C++) -> FileHandle (JS) + state.validateSnapshotNodes('FileHandle', [ { children: [ { name: 'FileHandle' } ] } ]); - state.validateSnapshotNodes('TCPWRAP', [ + state.validateSnapshotNodes('TCPSocketWrap', [ { children: [ { name: 'TCP' } ] } ], { loose: true }); - state.validateSnapshotNodes('TCPSERVERWRAP', [ + state.validateSnapshotNodes('TCPServerWrap', [ { children: [ { name: 'TCP' } ] } ], { loose: true }); - state.validateSnapshotNodes('STREAMPIPE', [ + // `Node / StreamPipe` (C++) -> StreamPipe (JS) + state.validateSnapshotNodes('StreamPipe', [ { children: [ { name: 'StreamPipe' } ] } ]); - state.validateSnapshotNodes('HTTP2SESSION', [ + // `Node / Http2Session` (C++) -> Http2Session (JS) + state.validateSnapshotNodes('Http2Session', [ { children: [ { name: 'Http2Session' }, diff --git a/test/parallel/test-heapdump-inspector.js b/test/parallel/test-heapdump-inspector.js index 355b8d0d0a1..08fc6703d87 100644 --- a/test/parallel/test-heapdump-inspector.js +++ b/test/parallel/test-heapdump-inspector.js @@ -8,9 +8,9 @@ const { validateSnapshotNodes } = require('../common/heap'); const inspector = require('inspector'); const session = new inspector.Session(); -validateSnapshotNodes('INSPECTORJSBINDING', []); +validateSnapshotNodes('JSBindingsConnection', []); session.connect(); -validateSnapshotNodes('INSPECTORJSBINDING', [ +validateSnapshotNodes('JSBindingsConnection', [ { children: [ { name: 'session' }, diff --git a/test/parallel/test-heapdump-tls.js b/test/parallel/test-heapdump-tls.js index be14b7b5f7c..90b2d8dc952 100644 --- a/test/parallel/test-heapdump-tls.js +++ b/test/parallel/test-heapdump-tls.js @@ -9,7 +9,7 @@ const { validateSnapshotNodes } = require('../common/heap'); const net = require('net'); const tls = require('tls'); -validateSnapshotNodes('TLSWRAP', []); +validateSnapshotNodes('TLSWrap', []); const server = net.createServer(common.mustCall((c) => { c.end(); @@ -21,11 +21,12 @@ const server = net.createServer(common.mustCall((c) => { })); c.write('hello'); - validateSnapshotNodes('TLSWRAP', [ + validateSnapshotNodes('TLSWrap', [ { children: [ - { name: 'enc_out' }, - { name: 'enc_in' }, + { name: 'NodeBIO' }, + { name: 'NodeBIO' }, + // `Node / TLSWrap` (C++) -> `TLSWrap` (JS) { name: 'TLSWrap' } ] } diff --git a/test/parallel/test-heapdump-worker.js b/test/parallel/test-heapdump-worker.js index 68d2ccd1abb..b7b5c2f7567 100644 --- a/test/parallel/test-heapdump-worker.js +++ b/test/parallel/test-heapdump-worker.js @@ -4,22 +4,22 @@ require('../common'); const { validateSnapshotNodes } = require('../common/heap'); const { Worker } = require('worker_threads'); -validateSnapshotNodes('WORKER', []); +validateSnapshotNodes('Worker', []); const worker = new Worker('setInterval(() => {}, 100);', { eval: true }); -validateSnapshotNodes('WORKER', [ +validateSnapshotNodes('Worker', [ { children: [ { name: 'thread_exit_async' }, { name: 'env' }, - { name: 'MESSAGEPORT' }, + { name: 'MessagePort' }, { name: 'Worker' } ] } ]); -validateSnapshotNodes('MESSAGEPORT', [ +validateSnapshotNodes('MessagePort', [ { children: [ - { name: 'data' }, + { name: 'MessagePortData' }, { name: 'MessagePort' } ] } diff --git a/test/parallel/test-heapdump-zlib.js b/test/parallel/test-heapdump-zlib.js index 7a749902f5a..936e3a1a500 100644 --- a/test/parallel/test-heapdump-zlib.js +++ b/test/parallel/test-heapdump-zlib.js @@ -4,10 +4,10 @@ require('../common'); const { validateSnapshotNodes } = require('../common/heap'); const zlib = require('zlib'); -validateSnapshotNodes('ZLIB', []); +validateSnapshotNodes('ZCtx', []); // eslint-disable-next-line no-unused-vars const gunzip = zlib.createGunzip(); -validateSnapshotNodes('ZLIB', [ +validateSnapshotNodes('ZCtx', [ { children: [ { name: 'Zlib' }, |