From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Rose <japthorp@slack-corp.com>
Date: Mon, 9 May 2022 17:09:21 -0700
Subject: Revert "[runtime] DHCECK terminating exception in Microtasks"

This reverts commit bccb536c98181e8a6e9cf0b6342311adbbf61aca.

diff --git a/src/builtins/builtins-microtask-queue-gen.cc b/src/builtins/builtins-microtask-queue-gen.cc
index ca4b1dc557f573bfcde200201cbd2f05e3c6b530..9edc8ce00c524a63cb23911a474f1904af5d71f7 100644
--- a/src/builtins/builtins-microtask-queue-gen.cc
+++ b/src/builtins/builtins-microtask-queue-gen.cc
@@ -118,7 +118,6 @@ void MicrotaskQueueBuiltinsAssembler::PrepareForContext(
 void MicrotaskQueueBuiltinsAssembler::RunSingleMicrotask(
     TNode<Context> current_context, TNode<Microtask> microtask) {
   CSA_DCHECK(this, TaggedIsNotSmi(microtask));
-  CSA_DCHECK(this, Word32BinaryNot(IsExecutionTerminating()));
 
   StoreRoot(RootIndex::kCurrentMicrotask, microtask);
   TNode<IntPtrT> saved_entered_context_count = GetEnteredContextCount();
diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc
index d35929d7f2155af23320aa70fe5cdff178fe6fc7..007284be5a29ae6e30c9c13b1ed0e41ce8e7a4c4 100644
--- a/src/codegen/code-stub-assembler.cc
+++ b/src/codegen/code-stub-assembler.cc
@@ -6142,12 +6142,6 @@ void CodeStubAssembler::SetPendingMessage(TNode<HeapObject> message) {
   StoreFullTaggedNoWriteBarrier(pending_message, message);
 }
 
-TNode<BoolT> CodeStubAssembler::IsExecutionTerminating() {
-  TNode<HeapObject> pending_message = GetPendingMessage();
-  return TaggedEqual(pending_message,
-                     LoadRoot(RootIndex::kTerminationException));
-}
-
 TNode<BoolT> CodeStubAssembler::InstanceTypeEqual(TNode<Int32T> instance_type,
                                                   int type) {
   return Word32Equal(instance_type, Int32Constant(type));
diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h
index 2b469c5e351debf1b684c003f0c256497709ccf6..c5bbe11ae949a076d9b51efbd8a845c8a05c7653 100644
--- a/src/codegen/code-stub-assembler.h
+++ b/src/codegen/code-stub-assembler.h
@@ -2513,7 +2513,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
 
   TNode<HeapObject> GetPendingMessage();
   void SetPendingMessage(TNode<HeapObject> message);
-  TNode<BoolT> IsExecutionTerminating();
 
   // Type checks.
   // Check whether the map is for an object with special properties, such as a
diff --git a/src/execution/microtask-queue.cc b/src/execution/microtask-queue.cc
index 2bea5d45bb0605877ad430882c914dddeb2c51c5..12a626900d0295be0b250cd6d4692ab4e329c681 100644
--- a/src/execution/microtask-queue.cc
+++ b/src/execution/microtask-queue.cc
@@ -179,8 +179,6 @@ int MicrotaskQueue::RunMicrotasks(Isolate* isolate) {
                      processed_microtask_count);
   }
 
-  DCHECK_IMPLIES(isolate->has_scheduled_exception(),
-                 maybe_result.is_null() && maybe_exception.is_null());
   // If execution is terminating, clean up and propagate that to TryCatch scope.
   if (maybe_result.is_null() && maybe_exception.is_null()) {
     delete[] ring_buffer_;
