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/debug.cc

Issue 296953005: Fix leak in debug mirror cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | src/debug-debugger.js » ('j') | src/debug-debugger.js » ('J')
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 8956e92c7d9628343dedd1721a637de53cb8719e..900821beaf0471fee3f0f5bb68ba9dfcb866e4ea 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -3139,22 +3139,23 @@ void Debugger::SetMessageHandler(v8::Debug::MessageHandler handler) {
void Debugger::UpdateState() {
+ Debug* debug = isolate_->debug();
bool activate = message_handler_ != NULL ||
!event_listener_.is_null() ||
- isolate_->debug()->InDebugger();
+ debug->InDebugger();
if (!is_active_ && activate) {
// Note that the debug context could have already been loaded to
// bootstrap test cases.
isolate_->compilation_cache()->Disable();
- activate = isolate_->debug()->Load();
- } else if (is_active_ && !activate) {
+ activate = debug->Load();
+ } else if (debug->IsLoaded() && !activate) {
isolate_->compilation_cache()->Enable();
- isolate_->debug()->ClearAllBreakPoints();
- isolate_->debug()->Unload();
+ debug->ClearAllBreakPoints();
+ debug->Unload();
}
is_active_ = activate;
// At this point the debug context is loaded iff the debugger is active.
- ASSERT(isolate_->debug()->IsLoaded() == is_active_);
+ ASSERT(debug->IsLoaded() == is_active_);
}
@@ -3271,22 +3272,9 @@ EnterDebugger::~EnterDebugger() {
// JavaScript. This can happen if the v8::Debug::Call is used in which
// case the exception should end up in the calling code.
if (!isolate_->has_pending_exception()) {
- // Try to avoid any pending debug break breaking in the clear mirror
- // cache JavaScript code.
- if (isolate_->stack_guard()->CheckDebugBreak()) {
- debug->set_has_pending_interrupt(true);
- isolate_->stack_guard()->ClearDebugBreak();
- }
debug->ClearMirrorCache();
}
- // Request debug break when leaving the last debugger entry
- // if one was recorded while debugging.
- if (debug->has_pending_interrupt()) {
- debug->set_has_pending_interrupt(false);
- isolate_->stack_guard()->RequestDebugBreak();
- }
-
// If there are commands in the queue when leaving the debugger request
// that these commands are processed.
if (isolate_->debugger()->HasCommands()) {
« no previous file with comments | « no previous file | src/debug-debugger.js » ('j') | src/debug-debugger.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698