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

Unified Diff: src/api.cc

Issue 2633803002: [inspector] implemented blackboxing inside v8 (Closed)
Patch Set: addressed comments Created 3 years, 11 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 | « no previous file | src/debug/debug.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index d784673d7f87a4eafccb29dda438a39f8671ed84..d8ead6c6566ee0ec36964b54091c9f80fbae81a0 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -9034,11 +9034,17 @@ void debug::PrepareStep(Isolate* v8_isolate, StepAction action) {
isolate->debug()->PrepareStep(static_cast<i::StepAction>(action));
}
-void debug::ClearStepping(Isolate* v8_isolate) {
+bool debug::HasNonBlackboxedFrameOnStack(Isolate* v8_isolate) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
- // Clear all current stepping setup.
- isolate->debug()->ClearStepping();
+ i::HandleScope scope(isolate);
+ for (i::StackTraceFrameIterator it(isolate); !it.done(); it.Advance()) {
+ if (!it.is_javascript()) continue;
+ i::Handle<i::SharedFunctionInfo> shared(
+ it.javascript_frame()->function()->shared());
+ if (!isolate->debug()->IsBlackboxed(shared)) return true;
+ }
+ return false;
}
v8::Isolate* debug::Script::GetIsolate() const {
@@ -9313,11 +9319,22 @@ MaybeLocal<UnboundScript> debug::CompileInspectorScript(Isolate* v8_isolate,
RETURN_ESCAPED(ToApiHandle<UnboundScript>(result));
}
-void debug::SetDebugEventListener(Isolate* v8_isolate,
- debug::DebugEventListener* listener) {
+void debug::SetDebugDelegate(Isolate* v8_isolate,
+ debug::DebugDelegate* delegate) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
- isolate->debug()->SetDebugEventListener(listener);
+ isolate->debug()->SetDebugDelegate(delegate);
+}
+
+void debug::ResetBlackboxedStateCache(Isolate* v8_isolate,
+ v8::Local<debug::Script> script) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
+ ENTER_V8(isolate);
+ i::DisallowHeapAllocation no_gc;
+ i::SharedFunctionInfo::ScriptIterator iter(Utils::OpenHandle(*script));
+ while (i::SharedFunctionInfo* info = iter.Next()) {
+ info->set_computed_debug_is_blackboxed(false);
+ }
}
Local<String> CpuProfileNode::GetFunctionName() const {
« no previous file with comments | « no previous file | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698