Skip to content

Commit a564c1e

Browse files
committed
src: remove virtually unused ExecScope
PR-URL: nodejs#14697 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 64616bb commit a564c1e

3 files changed

Lines changed: 2 additions & 40 deletions

File tree

src/env-inl.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,6 @@ inline Environment::AsyncHooks::InitScope::~InitScope() {
194194
env_->async_hooks()->pop_ids(uid_fields_ref_[AsyncHooks::kCurrentAsyncId]);
195195
}
196196

197-
inline Environment::AsyncHooks::ExecScope::ExecScope(
198-
Environment* env, double async_id, double trigger_id)
199-
: env_(env),
200-
async_id_(async_id),
201-
disposed_(false) {
202-
CHECK_GE(async_id, -1);
203-
CHECK_GE(trigger_id, -1);
204-
env->async_hooks()->push_ids(async_id, trigger_id);
205-
}
206-
207-
inline Environment::AsyncHooks::ExecScope::~ExecScope() {
208-
if (disposed_) return;
209-
Dispose();
210-
}
211-
212-
inline void Environment::AsyncHooks::ExecScope::Dispose() {
213-
disposed_ = true;
214-
env_->async_hooks()->pop_ids(async_id_);
215-
}
216-
217197
inline Environment::AsyncCallbackScope::AsyncCallbackScope(Environment* env)
218198
: env_(env) {
219199
env_->makecallback_cntr_++;

src/env.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -421,25 +421,6 @@ class Environment {
421421
DISALLOW_COPY_AND_ASSIGN(InitScope);
422422
};
423423

424-
// Used to manage the stack of async and trigger ids as calls are made into
425-
// JS. Mainly used in MakeCallback().
426-
class ExecScope {
427-
public:
428-
ExecScope() = delete;
429-
explicit ExecScope(Environment* env, double async_id, double trigger_id);
430-
~ExecScope();
431-
void Dispose();
432-
433-
private:
434-
Environment* env_;
435-
double async_id_;
436-
// Manually track if the destructor has run so it isn't accidentally run
437-
// twice on RAII cleanup.
438-
bool disposed_;
439-
440-
DISALLOW_COPY_AND_ASSIGN(ExecScope);
441-
};
442-
443424
private:
444425
friend class Environment; // So we can call the constructor.
445426
inline explicit AsyncHooks(v8::Isolate* isolate);

src/node.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4692,8 +4692,9 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
46924692

46934693
{
46944694
Environment::AsyncCallbackScope callback_scope(&env);
4695-
Environment::AsyncHooks::ExecScope exec_scope(&env, 1, 0);
4695+
env.async_hooks()->push_ids(1, 0);
46964696
LoadEnvironment(&env);
4697+
env.async_hooks()->pop_ids(1);
46974698
}
46984699

46994700
env.set_trace_sync_io(trace_sync_io);

0 commit comments

Comments
 (0)