From bfcf5b01bb4112b833a936a8266879b58ed391db Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Sun, 13 May 2018 19:33:22 +0200 Subject: [PATCH] src: remove tick_info->has_thrown This is no longer necessary in the only place it was used (timers). PR-URL: https://github.com/nodejs/node/pull/20894 Fixes: https://github.com/nodejs/node/issues/10154 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Matteo Collina Reviewed-By: Jeremiah Senkpiel Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Gus Caplan --- src/callback_scope.cc | 5 ----- src/env-inl.h | 8 -------- src/env.h | 3 --- 3 files changed, 16 deletions(-) diff --git a/src/callback_scope.cc b/src/callback_scope.cc index feb7e23b6e5f84..7929fd67d7667e 100644 --- a/src/callback_scope.cc +++ b/src/callback_scope.cc @@ -59,10 +59,6 @@ InternalCallbackScope::InternalCallbackScope(Environment* env, AsyncWrap::EmitBefore(env, asyncContext.async_id); } - if (!IsInnerMakeCallback()) { - env->tick_info()->set_has_thrown(false); - } - env->async_hooks()->push_async_ids(async_context_.async_id, async_context_.trigger_async_id); pushed_ids_ = true; @@ -118,7 +114,6 @@ void InternalCallbackScope::Close() { if (!env_->can_call_into_js()) return; if (env_->tick_callback_function()->Call(process, 0, nullptr).IsEmpty()) { - env_->tick_info()->set_has_thrown(true); failed_ = true; } } diff --git a/src/env-inl.h b/src/env-inl.h index 40fa5dfa6857a1..8086103b1d47fb 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -269,10 +269,6 @@ inline bool Environment::TickInfo::has_scheduled() const { return fields_[kHasScheduled] == 1; } -inline bool Environment::TickInfo::has_thrown() const { - return fields_[kHasThrown] == 1; -} - inline bool Environment::TickInfo::has_promise_rejections() const { return fields_[kHasPromiseRejections] == 1; } @@ -281,10 +277,6 @@ inline void Environment::TickInfo::promise_rejections_toggle_on() { fields_[kHasPromiseRejections] = 1; } -inline void Environment::TickInfo::set_has_thrown(bool state) { - fields_[kHasThrown] = state ? 1 : 0; -} - inline void Environment::AssignToContext(v8::Local context, const ContextInfo& info) { context->SetAlignedPointerInEmbedderData( diff --git a/src/env.h b/src/env.h index 8f4c5ea1a6916e..3d047166b2b110 100644 --- a/src/env.h +++ b/src/env.h @@ -551,10 +551,8 @@ class Environment { inline AliasedBuffer& fields(); inline bool has_scheduled() const; inline bool has_promise_rejections() const; - inline bool has_thrown() const; inline void promise_rejections_toggle_on(); - inline void set_has_thrown(bool state); private: friend class Environment; // So we can call the constructor. @@ -563,7 +561,6 @@ class Environment { enum Fields { kHasScheduled, kHasPromiseRejections, - kHasThrown, kFieldsCount };