diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 80419405ba78e8..8d7ada213d5611 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -46,8 +46,8 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const { } -inline int64_t AsyncWrap::get_uid() const { - return uid_; +inline double AsyncWrap::get_id() const { + return id_; } diff --git a/src/async-wrap.cc b/src/async-wrap.cc index bc3e049d262c81..71f09ba1603494 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -220,7 +220,7 @@ void AsyncWrap::DestroyIdsCb(uv_idle_t* handle) { TryCatch try_catch(env->isolate()); - std::vector destroy_ids_list; + std::vector destroy_ids_list; destroy_ids_list.swap(*env->destroy_ids_list()); for (auto current_id : destroy_ids_list) { // Want each callback to be cleaned up after itself, instead of cleaning @@ -255,7 +255,7 @@ AsyncWrap::AsyncWrap(Environment* env, ProviderType provider, AsyncWrap* parent) : BaseObject(env, object), bits_(static_cast(provider) << 1), - uid_(env->get_async_wrap_uid()) { + id_(env->get_async_wrap_uid()) { CHECK_NE(provider, PROVIDER_NONE); CHECK_GE(object->InternalFieldCount(), 1); @@ -277,14 +277,14 @@ AsyncWrap::AsyncWrap(Environment* env, HandleScope scope(env->isolate()); Local argv[] = { - Number::New(env->isolate(), get_uid()), + Number::New(env->isolate(), get_id()), Int32::New(env->isolate(), provider), Null(env->isolate()), Null(env->isolate()) }; if (parent != nullptr) { - argv[2] = Number::New(env->isolate(), parent->get_uid()); + argv[2] = Number::New(env->isolate(), parent->get_id()); argv[3] = parent->object(); } @@ -309,7 +309,7 @@ AsyncWrap::~AsyncWrap() { if (env()->destroy_ids_list()->empty()) uv_idle_start(env()->destroy_ids_idle_handle(), DestroyIdsCb); - env()->destroy_ids_list()->push_back(get_uid()); + env()->destroy_ids_list()->push_back(get_id()); } @@ -320,7 +320,7 @@ Local AsyncWrap::MakeCallback(const Local cb, Local pre_fn = env()->async_hooks_pre_function(); Local post_fn = env()->async_hooks_post_function(); - Local uid = Number::New(env()->isolate(), get_uid()); + Local uid = Number::New(env()->isolate(), get_id()); Local context = object(); Local domain; bool has_domain = false; diff --git a/src/async-wrap.h b/src/async-wrap.h index a044a01863202d..8483685c2274b2 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -86,7 +86,7 @@ class AsyncWrap : public BaseObject { inline ProviderType provider_type() const; - inline int64_t get_uid() const; + inline double get_id() const; // Only call these within a valid HandleScope. v8::Local MakeCallback(const v8::Local cb, @@ -109,7 +109,7 @@ class AsyncWrap : public BaseObject { // expected the context object will receive a _asyncQueue object property // that will be used to call pre/post in MakeCallback. uint32_t bits_; - const int64_t uid_; + const double id_; }; void LoadAsyncWrapperInfo(Environment* env); diff --git a/src/env-inl.h b/src/env-inl.h index 449ba14bc8fae9..d0dd2047bd0ce8 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -192,7 +192,7 @@ inline Environment::Environment(IsolateData* isolate_data, printed_error_(false), trace_sync_io_(false), makecallback_cntr_(0), - async_wrap_uid_(0), + async_wrap_id_(0), #if HAVE_INSPECTOR inspector_agent_(this), #endif @@ -320,11 +320,11 @@ inline void Environment::set_trace_sync_io(bool value) { trace_sync_io_ = value; } -inline int64_t Environment::get_async_wrap_uid() { - return ++async_wrap_uid_; +inline double Environment::get_async_wrap_uid() { + return ++async_wrap_id_; } -inline std::vector* Environment::destroy_ids_list() { +inline std::vector* Environment::destroy_ids_list() { return &destroy_ids_list_; } diff --git a/src/env.h b/src/env.h index 022818fc9b647b..85327a74f531f8 100644 --- a/src/env.h +++ b/src/env.h @@ -488,10 +488,10 @@ class Environment { void PrintSyncTrace() const; inline void set_trace_sync_io(bool value); - inline int64_t get_async_wrap_uid(); + inline double get_async_wrap_uid(); // List of id's that have been destroyed and need the destroy() cb called. - inline std::vector* destroy_ids_list(); + inline std::vector* destroy_ids_list(); inline double* heap_statistics_buffer() const; inline void set_heap_statistics_buffer(double* pointer); @@ -596,8 +596,8 @@ class Environment { bool printed_error_; bool trace_sync_io_; size_t makecallback_cntr_; - int64_t async_wrap_uid_; - std::vector destroy_ids_list_; + double async_wrap_id_; + std::vector destroy_ids_list_; #if HAVE_INSPECTOR inspector::Agent inspector_agent_; #endif