src: remove virtually unused ExecScope

PR-URL: https://github.com/nodejs/node/pull/14697
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Anna Henningsen authored and James M Snell committed 2017-09-20 09:32:33 -07:00
1 parent a47fe692b1
commit f60a2aa982
3 files changed
+2 -40

No files matched your search

-20
View File
@@ -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_++;
-19
View File
@@ -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);
+2 -1
View File
@@ -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);