Skip to content

Commit f60a2aa

Browse files
addaleaxjasnell
authored andcommitted
src: remove virtually unused ExecScope
PR-URL: #14697 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a47fe69 commit f60a2aa

File tree

3 files changed

+2
-40
lines changed

3 files changed

+2
-40
lines changed

src/env-inl.h

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

193-
inline Environment::AsyncHooks::ExecScope::ExecScope(
194-
Environment* env, double async_id, double trigger_id)
195-
: env_(env),
196-
async_id_(async_id),
197-
disposed_(false) {
198-
CHECK_GE(async_id, -1);
199-
CHECK_GE(trigger_id, -1);
200-
env->async_hooks()->push_ids(async_id, trigger_id);
201-
}
202-
203-
inline Environment::AsyncHooks::ExecScope::~ExecScope() {
204-
if (disposed_) return;
205-
Dispose();
206-
}
207-
208-
inline void Environment::AsyncHooks::ExecScope::Dispose() {
209-
disposed_ = true;
210-
env_->async_hooks()->pop_ids(async_id_);
211-
}
212-
213193
inline Environment::AsyncCallbackScope::AsyncCallbackScope(Environment* env)
214194
: env_(env) {
215195
env_->makecallback_cntr_++;

src/env.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -416,25 +416,6 @@ class Environment {
416416
DISALLOW_COPY_AND_ASSIGN(InitScope);
417417
};
418418

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

src/node.cc

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

45914591
{
45924592
Environment::AsyncCallbackScope callback_scope(&env);
4593-
Environment::AsyncHooks::ExecScope exec_scope(&env, 1, 0);
4593+
env.async_hooks()->push_ids(1, 0);
45944594
LoadEnvironment(&env);
4595+
env.async_hooks()->pop_ids(1);
45954596
}
45964597

45974598
env.set_trace_sync_io(trace_sync_io);

0 commit comments

Comments
 (0)