Reland "Postpone termination exceptions in debug scope."
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 8 Jul 2014 06:57:17 +0000 (06:57 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 8 Jul 2014 06:57:17 +0000 (06:57 +0000)
BUG=v8:3408
LOG=Y
R=yurys@chromium.org

Review URL: https://codereview.chromium.org/364813002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22262 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/debug.cc
src/debug.h
test/cctest/test-debug.cc

index 0a02adc..9d1f2af 100644 (file)
@@ -3104,9 +3104,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 25be495..d7aa050 100644 (file)
@@ -705,6 +705,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 69e0a2e..eed39a1 100644 (file)
@@ -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());
 }