Skip to content
Permalink
Browse files

src: remove virtually unused ExecScope

PR-URL: #14697
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
addaleax authored and jasnell committed Aug 8, 2017
1 parent a47fe69 commit f60a2aa982702ee82e17e48bbd07ae198a3b6cc8
Showing with 2 additions and 40 deletions.
  1. +0 −20 src/env-inl.h
  2. +0 −19 src/env.h
  3. +2 −1 src/node.cc
@@ -190,26 +190,6 @@ inline Environment::AsyncHooks::InitScope::~InitScope() {
env_->async_hooks()->pop_ids(uid_fields_ref_[AsyncHooks::kCurrentAsyncId]);
}

inline Environment::AsyncHooks::ExecScope::ExecScope(
Environment* env, double async_id, double trigger_id)
: env_(env),
async_id_(async_id),
disposed_(false) {
CHECK_GE(async_id, -1);
CHECK_GE(trigger_id, -1);
env->async_hooks()->push_ids(async_id, trigger_id);
}

inline Environment::AsyncHooks::ExecScope::~ExecScope() {
if (disposed_) return;
Dispose();
}

inline void Environment::AsyncHooks::ExecScope::Dispose() {
disposed_ = true;
env_->async_hooks()->pop_ids(async_id_);
}

inline Environment::AsyncCallbackScope::AsyncCallbackScope(Environment* env)
: env_(env) {
env_->makecallback_cntr_++;
@@ -416,25 +416,6 @@ class Environment {
DISALLOW_COPY_AND_ASSIGN(InitScope);
};

// Used to manage the stack of async and trigger ids as calls are made into
// JS. Mainly used in MakeCallback().
class ExecScope {
public:
ExecScope() = delete;
explicit ExecScope(Environment* env, double async_id, double trigger_id);
~ExecScope();
void Dispose();

private:
Environment* env_;
double async_id_;
// Manually track if the destructor has run so it isn't accidentally run
// twice on RAII cleanup.
bool disposed_;

DISALLOW_COPY_AND_ASSIGN(ExecScope);
};

private:
friend class Environment; // So we can call the constructor.
inline explicit AsyncHooks(v8::Isolate* isolate);
@@ -4590,8 +4590,9 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,

{
Environment::AsyncCallbackScope callback_scope(&env);
Environment::AsyncHooks::ExecScope exec_scope(&env, 1, 0);
env.async_hooks()->push_ids(1, 0);
LoadEnvironment(&env);
env.async_hooks()->pop_ids(1);
}

env.set_trace_sync_io(trace_sync_io);

0 comments on commit f60a2aa

Please sign in to comment.
You can’t perform that action at this time.