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

Unified Diff: src/debug/debug.cc

Issue 2685163006: [inspector] migrate set/remove BreakPoint to debug-interface.h (Closed)
Patch Set: added comment about inlined jsframe index Created 3 years, 10 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/compiler/wasm-compiler.cc ('k') | src/debug/debug-interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 84a16754e1d8c453dd5930addcefbb15a43df9c2..497a69456035dfd29d694c85ed46f36615f5c6a9 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -15,6 +15,7 @@
#include "src/compiler-dispatcher/optimizing-compile-dispatcher.h"
#include "src/compiler.h"
#include "src/debug/debug-evaluate.h"
+#include "src/debug/debug-frames.h"
#include "src/debug/liveedit.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
@@ -627,14 +628,32 @@ MaybeHandle<Object> Debug::CallFunction(const char* name, int argc,
// Check whether a single break point object is triggered.
bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
- Factory* factory = isolate_->factory();
- HandleScope scope(isolate_);
+ if (break_point_object->IsBreakPoint()) {
+ Handle<BreakPoint> break_point =
+ Handle<BreakPoint>::cast(break_point_object);
+ if (!break_point->condition()->length()) return true;
+ Handle<String> condition(break_point->condition());
+ Handle<Object> result;
+ // Since we call CheckBreakpoint only for deoptimized frame on top of stack,
+ // we can use 0 as index of inlined frame.
+ if (!DebugEvaluate::Local(isolate_, break_frame_id(),
+ /* inlined_jsframe_index */ 0, condition, false)
+ .ToHandle(&result)) {
+ if (isolate_->has_pending_exception()) {
+ isolate_->clear_pending_exception();
+ }
+ return false;
+ }
+ return result->IsTrue(isolate_);
+ }
+ // TODO(yangguo): remove code below with mirrors API.
// Ignore check if break point object is not a JSObject.
if (!break_point_object->IsJSObject()) return true;
// Get the break id as an object.
- Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id());
+ Handle<Object> break_id =
+ isolate_->factory()->NewNumberFromInt(Debug::break_id());
// Call IsBreakPointTriggered.
Handle<Object> argv[] = { break_id, break_point_object };
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/debug/debug-interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698