Reviewers: yurys_ooo,

Message:
Second attempt. The second patch set contains the fix.

Description:
Reland "Postpone termination exceptions in debug scope."

BUG=v8:3408
LOG=Y

Please review this at https://codereview.chromium.org/364813002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+9, -6 lines):
  M src/debug.h
  M src/debug.cc
  M test/cctest/test-debug.cc


Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index b19b47e4fa26df3cab0f2ab6901b42f3d7c0f654..01412a12d228c499629802f0ca554096761b6802 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -3074,9 +3074,12 @@ void Debug::ProcessDebugMessages(bool debug_command_only) {
 }


-DebugScope::DebugScope(Debug* debug) : debug_(debug),
-                                       prev_(debug->debugger_entry()),
-                                       save_(debug_->isolate_) {
+DebugScope::DebugScope(Debug* debug)
+    : debug_(debug),
+      prev_(debug->debugger_entry()),
+      save_(debug_->isolate_),
+      no_termination_exceptons_(debug_->isolate_,
+                                StackGuard::TERMINATE_EXECUTION) {
   // Link recursive debugger entry.
   debug_->thread_local_.current_debug_scope_ = this;

Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index f5a19d116e67eded144057427b2773f180c65480..480a65a220b3d32aa35b2eb57e0f822f69ef0e2c 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -702,6 +702,7 @@ class DebugScope BASE_EMBEDDED {
   int break_id_;                   // Previous break id.
   bool failed_;                    // Did the debug context fail to load?
   SaveContext save_;               // Saves previous context.
+  PostponeInterruptsScope no_termination_exceptons_;
 };


Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 69e0a2e02cbbf4402fb765aecd64d0e7349f28a6..eed39a1cabd5b3eb83f383299171d48186a8cb73 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7374,9 +7374,6 @@ static void DebugBreakTriggerTerminate(
   // Wait for at most 2 seconds for the terminate request.
CHECK(terminate_fired_semaphore.WaitFor(v8::base::TimeDelta::FromSeconds(2)));
   terminate_already_fired = true;
-  v8::internal::Isolate* isolate =
- v8::Utils::OpenHandle(*event_details.GetEventContext())->GetIsolate();
-  CHECK(isolate->stack_guard()->CheckTerminateExecution());
 }


@@ -7403,6 +7400,8 @@ TEST(DebugBreakOffThreadTerminate) {
   v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate);
   TerminationThread terminator(isolate);
   terminator.Start();
+  v8::TryCatch try_catch;
   v8::Debug::DebugBreak(isolate);
   CompileRun("while (true);");
+  CHECK(try_catch.HasTerminated());
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to