Skip to content

Commit

Permalink
src: remove virtually unused ExecScope
Browse files Browse the repository at this point in the history
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 Sep 20, 2017
1 parent a47fe69 commit f60a2aa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
20 changes: 0 additions & 20 deletions src/env-inl.h
Expand Up @@ -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_++;
Expand Down
19 changes: 0 additions & 19 deletions src/env.h
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/node.cc
Expand Up @@ -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);
Expand Down

0 comments on commit f60a2aa

Please sign in to comment.