Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 committed Sep 14, 2017
commit 4262fadbf7c3f2ed0d83690c013862df02f0c3a0
20 changes: 0 additions & 20 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,26 +194,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
Original file line number Diff line number Diff line change
Expand Up @@ -421,25 +421,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
Original file line number Diff line number Diff line change
Expand Up @@ -4692,8 +4692,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