From fcfde57806bf6547a45297b7d9ba758225cc005b Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 24 Mar 2020 13:58:12 -0700 Subject: [PATCH] src: avoid using elevated v8 namespaces in node_perf.h Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/32468 Reviewed-By: Anna Henningsen --- src/node_perf.h | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/node_perf.h b/src/node_perf.h index ac65533a772e36..a8a913bddeaad0 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -19,13 +19,6 @@ class Environment; namespace performance { -using v8::FunctionCallbackInfo; -using v8::GCType; -using v8::GCCallbackFlags; -using v8::Local; -using v8::Object; -using v8::Value; - extern const uint64_t timeOrigin; static inline const char* GetPerformanceMilestoneName( @@ -60,9 +53,9 @@ class PerformanceEntry { public: static void Notify(Environment* env, PerformanceEntryType type, - Local object); + v8::Local object); - static void New(const FunctionCallbackInfo& args); + static void New(const v8::FunctionCallbackInfo& args); PerformanceEntry(Environment* env, const char* name, @@ -76,7 +69,7 @@ class PerformanceEntry { virtual ~PerformanceEntry() = default; - virtual v8::MaybeLocal ToObject() const; + virtual v8::MaybeLocal ToObject() const; Environment* env() const { return env_; } @@ -105,27 +98,27 @@ class PerformanceEntry { }; enum PerformanceGCKind { - NODE_PERFORMANCE_GC_MAJOR = GCType::kGCTypeMarkSweepCompact, - NODE_PERFORMANCE_GC_MINOR = GCType::kGCTypeScavenge, - NODE_PERFORMANCE_GC_INCREMENTAL = GCType::kGCTypeIncrementalMarking, - NODE_PERFORMANCE_GC_WEAKCB = GCType::kGCTypeProcessWeakCallbacks + NODE_PERFORMANCE_GC_MAJOR = v8::GCType::kGCTypeMarkSweepCompact, + NODE_PERFORMANCE_GC_MINOR = v8::GCType::kGCTypeScavenge, + NODE_PERFORMANCE_GC_INCREMENTAL = v8::GCType::kGCTypeIncrementalMarking, + NODE_PERFORMANCE_GC_WEAKCB = v8::GCType::kGCTypeProcessWeakCallbacks }; enum PerformanceGCFlags { NODE_PERFORMANCE_GC_FLAGS_NO = - GCCallbackFlags::kNoGCCallbackFlags, + v8::GCCallbackFlags::kNoGCCallbackFlags, NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED = - GCCallbackFlags::kGCCallbackFlagConstructRetainedObjectInfos, + v8::GCCallbackFlags::kGCCallbackFlagConstructRetainedObjectInfos, NODE_PERFORMANCE_GC_FLAGS_FORCED = - GCCallbackFlags::kGCCallbackFlagForced, + v8::GCCallbackFlags::kGCCallbackFlagForced, NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING = - GCCallbackFlags::kGCCallbackFlagSynchronousPhantomCallbackProcessing, + v8::GCCallbackFlags::kGCCallbackFlagSynchronousPhantomCallbackProcessing, NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE = - GCCallbackFlags::kGCCallbackFlagCollectAllAvailableGarbage, + v8::GCCallbackFlags::kGCCallbackFlagCollectAllAvailableGarbage, NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY = - GCCallbackFlags::kGCCallbackFlagCollectAllExternalMemory, + v8::GCCallbackFlags::kGCCallbackFlagCollectAllExternalMemory, NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE = - GCCallbackFlags::kGCCallbackScheduleIdleGarbageCollection + v8::GCCallbackFlags::kGCCallbackScheduleIdleGarbageCollection }; class GCPerformanceEntry : public PerformanceEntry { @@ -150,7 +143,7 @@ class GCPerformanceEntry : public PerformanceEntry { class ELDHistogram : public HandleWrap, public Histogram { public: ELDHistogram(Environment* env, - Local wrap, + v8::Local wrap, int32_t resolution); bool RecordDelta();