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

Unified Diff: src/debug.cc

Issue 781623004: [V8] Report v8::AfterCompile and v8::CompileError to listener on pause (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/debug.h ('k') | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index d8844cc414e3f03c64f803dac22fdfaa8c5a003f..ce77219639d5f3aca9c9b36804d1474b5c39b0ad 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -2481,9 +2481,8 @@ void Debug::RecordEvalCaller(Handle<Script> script) {
MaybeHandle<Object> Debug::MakeJSObject(const char* constructor_name,
int argc,
Handle<Object> argv[]) {
- AssertDebugContext();
// Create the execution state object.
- Handle<GlobalObject> global(isolate_->global_object());
+ Handle<GlobalObject> global = in_debug_scope() ? Handle<GlobalObject>(debug_context()->global_object()) : Handle<GlobalObject>(isolate_->global_object());
yurys 2014/12/08 07:19:28 This way we will create debugger objects in the us
kozy 2014/12/08 14:19:30 Done.
Handle<Object> constructor = Object::GetProperty(
isolate_, global, constructor_name).ToHandleChecked();
DCHECK(constructor->IsJSFunction());
@@ -2630,8 +2629,12 @@ void Debug::OnException(Handle<Object> exception, bool uncaught,
void Debug::OnCompileError(Handle<Script> script) {
- // No more to do if not debugging.
- if (in_debug_scope() || ignore_events()) return;
+ if (ignore_events()) return;
+
+ if (in_debug_scope()) {
+ ProcessCompileEventInDebugScope(v8::CompileError, script);
+ return;
+ }
HandleScope scope(isolate_);
DebugScope debug_scope(this);
@@ -2692,8 +2695,12 @@ void Debug::OnAfterCompile(Handle<Script> script) {
// Add the newly compiled script to the script cache.
if (script_cache_ != NULL) script_cache_->Add(script);
- // No more to do if not debugging.
- if (in_debug_scope() || ignore_events()) return;
+ if (ignore_events()) return;
+
+ if (in_debug_scope()) {
+ ProcessCompileEventInDebugScope(v8::AfterCompile, script);
+ return;
+ }
HandleScope scope(isolate_);
DebugScope debug_scope(this);
@@ -2848,6 +2855,23 @@ void Debug::CallEventCallback(v8::DebugEvent event,
}
+void Debug::ProcessCompileEventInDebugScope(v8::DebugEvent event,
+ Handle<Script> script) {
+ if (event_listener_.is_null()) return;
yurys 2014/12/08 10:55:51 I believe you can reenter debug context here if it
kozy 2014/12/08 14:19:30 Done.
+
+ Handle<Object> event_data;
+ // Bail out and don't call debugger if exception.
+ if (!MakeCompileEvent(script, event).ToHandle(&event_data)) return;
+
+ // Create the execution state.
+ Handle<Object> exec_state;
+ // Bail out and don't call debugger if exception.
+ if (!MakeExecutionState().ToHandle(&exec_state)) return;
+
+ CallEventCallback(event, exec_state, event_data, NULL);
+}
+
+
Handle<Context> Debug::GetDebugContext() {
DebugScope debug_scope(this);
// The global handle may be destroyed soon after. Return it reboxed.
« no previous file with comments | « src/debug.h ('k') | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698