Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: src/execution.cc

Issue 298863011: Merge the classes Debug and Debugger. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename EnterDebugger Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.h ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index f16ee05aca8b9003b9a08f13a3e116f72af6c314..21c9b337c1bce01eeff6d76d1ee69e1d8f17c066 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -104,7 +104,7 @@ MUST_USE_RESULT static MaybeHandle<Object> Invoke(
if (has_exception) {
isolate->ReportPendingMessages();
// Reset stepping state when script exits with uncaught exception.
- if (isolate->debugger()->is_active()) {
+ if (isolate->debug()->is_active()) {
isolate->debug()->ClearStepping();
}
return MaybeHandle<Object>();
@@ -655,60 +655,6 @@ Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
}
-void Execution::DebugBreakHelper(Isolate* isolate) {
- // Just continue if breaks are disabled.
- if (isolate->debug()->disable_break()) return;
-
- // Ignore debug break during bootstrapping.
- if (isolate->bootstrapper()->IsActive()) return;
-
- // Ignore debug break if debugger is not active.
- if (!isolate->debugger()->is_active()) return;
-
- StackLimitCheck check(isolate);
- if (check.HasOverflowed()) return;
-
- { JavaScriptFrameIterator it(isolate);
- ASSERT(!it.done());
- Object* fun = it.frame()->function();
- if (fun && fun->IsJSFunction()) {
- // Don't stop in builtin functions.
- if (JSFunction::cast(fun)->IsBuiltin()) return;
- GlobalObject* global = JSFunction::cast(fun)->context()->global_object();
- // Don't stop in debugger functions.
- if (isolate->debug()->IsDebugGlobal(global)) return;
- }
- }
-
- // Collect the break state before clearing the flags.
- bool debug_command_only = isolate->stack_guard()->CheckDebugCommand() &&
- !isolate->stack_guard()->CheckDebugBreak();
-
- isolate->stack_guard()->ClearDebugBreak();
-
- Execution::ProcessDebugMessages(isolate, debug_command_only);
-}
-
-
-void Execution::ProcessDebugMessages(Isolate* isolate,
- bool debug_command_only) {
- isolate->stack_guard()->ClearDebugCommand();
-
- StackLimitCheck check(isolate);
- if (check.HasOverflowed()) return;
-
- HandleScope scope(isolate);
- // Enter the debugger. Just continue if we fail to enter the debugger.
- EnterDebugger debugger(isolate);
- if (debugger.FailedToEnter()) return;
-
- // Notify the debug event listeners. Indicate auto continue if the break was
- // a debug command break.
- isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(),
- debug_command_only);
-}
-
-
Object* StackGuard::HandleInterrupts() {
bool has_api_interrupt = false;
{
@@ -722,7 +668,7 @@ Object* StackGuard::HandleInterrupts() {
}
if (CheckDebugBreak() || CheckDebugCommand()) {
- Execution::DebugBreakHelper(isolate_);
+ isolate_->debug()->HandleDebugBreak();
}
if (CheckAndClearInterrupt(TERMINATE_EXECUTION, access)) {
« no previous file with comments | « src/execution.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698