diff options
author | Juan José Arboleda <soyjuanarbol@gmail.com> | 2021-05-24 06:52:52 +0300 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2021-05-31 22:34:55 +0300 |
commit | 36d4a4331d392072a5c8f19e6a10f466ff55a01f (patch) | |
tree | be59d6d6db0a9a2a6a05e52988172a94ce3434a1 /src | |
parent | 0c063a1258b14fabc84bdfae71cb1806372427f0 (diff) |
src: remove redundant v8 namespaces in `env.cc`
PR-URL: https://github.com/nodejs/node/pull/38792
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/env.cc | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/env.cc b/src/env.cc index 4ee4b675d87..0952d863b7a 100644 --- a/src/env.cc +++ b/src/env.cc @@ -31,12 +31,14 @@ namespace node { using errors::TryCatchScope; +using v8::Array; using v8::Boolean; using v8::Context; using v8::EmbedderGraph; using v8::Function; using v8::FunctionTemplate; using v8::HandleScope; +using v8::HeapSpaceStatistics; using v8::Integer; using v8::Isolate; using v8::Local; @@ -1013,11 +1015,11 @@ void Environment::CollectUVExceptionInfo(Local<Value> object, syscall, message, path, dest); } -ImmediateInfo::ImmediateInfo(v8::Isolate* isolate, const SerializeInfo* info) +ImmediateInfo::ImmediateInfo(Isolate* isolate, const SerializeInfo* info) : fields_(isolate, kFieldsCount, MAYBE_FIELD_PTR(info, fields)) {} ImmediateInfo::SerializeInfo ImmediateInfo::Serialize( - v8::Local<v8::Context> context, v8::SnapshotCreator* creator) { + Local<Context> context, SnapshotCreator* creator) { return {fields_.Serialize(context, creator)}; } @@ -1035,8 +1037,8 @@ void ImmediateInfo::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackField("fields", fields_); } -TickInfo::SerializeInfo TickInfo::Serialize(v8::Local<v8::Context> context, - v8::SnapshotCreator* creator) { +TickInfo::SerializeInfo TickInfo::Serialize(Local<Context> context, + SnapshotCreator* creator) { return {fields_.Serialize(context, creator)}; } @@ -1054,17 +1056,17 @@ void TickInfo::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackField("fields", fields_); } -TickInfo::TickInfo(v8::Isolate* isolate, const SerializeInfo* info) +TickInfo::TickInfo(Isolate* isolate, const SerializeInfo* info) : fields_( isolate, kFieldsCount, info == nullptr ? nullptr : &(info->fields)) {} -AsyncHooks::AsyncHooks(v8::Isolate* isolate, const SerializeInfo* info) +AsyncHooks::AsyncHooks(Isolate* isolate, const SerializeInfo* info) : async_ids_stack_(isolate, 16 * 2, MAYBE_FIELD_PTR(info, async_ids_stack)), fields_(isolate, kFieldsCount, MAYBE_FIELD_PTR(info, fields)), async_id_fields_( isolate, kUidFieldsCount, MAYBE_FIELD_PTR(info, async_id_fields)), info_(info) { - v8::HandleScope handle_scope(isolate); + HandleScope handle_scope(isolate); if (info == nullptr) { clear_async_id_stack(); @@ -1092,21 +1094,18 @@ void AsyncHooks::Deserialize(Local<Context> context) { fields_.Deserialize(context); async_id_fields_.Deserialize(context); if (info_->js_execution_async_resources != 0) { - v8::Local<v8::Array> arr = context - ->GetDataFromSnapshotOnce<v8::Array>( - info_->js_execution_async_resources) - .ToLocalChecked(); + Local<Array> arr = context->GetDataFromSnapshotOnce<Array>( + info_->js_execution_async_resources) + .ToLocalChecked(); js_execution_async_resources_.Reset(context->GetIsolate(), arr); } native_execution_async_resources_.resize( info_->native_execution_async_resources.size()); for (size_t i = 0; i < info_->native_execution_async_resources.size(); ++i) { - v8::Local<v8::Object> obj = - context - ->GetDataFromSnapshotOnce<v8::Object>( - info_->native_execution_async_resources[i]) - .ToLocalChecked(); + Local<Object> obj = context->GetDataFromSnapshotOnce<Object>( + info_->native_execution_async_resources[i]) + .ToLocalChecked(); native_execution_async_resources_[i].Reset(context->GetIsolate(), obj); } info_ = nullptr; @@ -1523,7 +1522,7 @@ size_t Environment::NearHeapLimitCallback(void* data, size_t young_gen_size = 0; size_t old_gen_size = 0; - v8::HeapSpaceStatistics stats; + HeapSpaceStatistics stats; size_t num_heap_spaces = env->isolate()->NumberOfHeapSpaces(); for (size_t i = 0; i < num_heap_spaces; ++i) { env->isolate()->GetHeapSpaceStatistics(&stats, i); |