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

Unified Diff: src/debug/debug.cc

Issue 2702343003: [Debugger] Add a ReturnValueScope to correctly handle return values in nested debug breaks. (Closed)
Patch Set: Moves handle scope to Runtime_DebugBreak. 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/debug/debug.h ('k') | src/runtime/runtime-debug.cc » ('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..36e508321725166ba95c94c47daa2c45ca3251c3 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -481,8 +481,6 @@ void Debug::Unload() {
}
void Debug::Break(JavaScriptFrame* frame) {
- HandleScope scope(isolate_);
-
// Initialize LiveEdit.
LiveEdit::InitializeThreadLocal(this);
@@ -2206,7 +2204,6 @@ DebugScope::DebugScope(Debug* debug)
// Store the previous break id, frame id and return value.
break_id_ = debug_->break_id();
break_frame_id_ = debug_->break_frame_id();
- return_value_ = handle(debug_->return_value(), isolate());
// Create the new break info. If there is no proper frames there is no break
// frame id.
@@ -2232,11 +2229,18 @@ DebugScope::~DebugScope() {
// Restore to the previous break state.
debug_->thread_local_.break_frame_id_ = break_frame_id_;
debug_->thread_local_.break_id_ = break_id_;
- debug_->thread_local_.return_value_ = *return_value_;
debug_->UpdateState();
}
+ReturnValueScope::ReturnValueScope(Debug* debug) : debug_(debug) {
+ return_value_ = debug_->return_value_handle();
+}
+
+ReturnValueScope::~ReturnValueScope() {
+ debug_->set_return_value(*return_value_);
+}
+
bool Debug::PerformSideEffectCheck(Handle<JSFunction> function) {
DCHECK(isolate_->needs_side_effect_check());
DisallowJavascriptExecution no_js(isolate_);
« no previous file with comments | « src/debug/debug.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698