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

Side by Side Diff: src/debug.cc

Issue 304453003: Actually fix the memory leak in debugger wrt promises. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "api.h" 7 #include "api.h"
8 #include "arguments.h" 8 #include "arguments.h"
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 800
801 debug_context_ = Handle<Context>::cast( 801 debug_context_ = Handle<Context>::cast(
802 isolate_->global_handles()->Create(*context)); 802 isolate_->global_handles()->Create(*context));
803 return true; 803 return true;
804 } 804 }
805 805
806 806
807 void Debug::Unload() { 807 void Debug::Unload() {
808 ClearAllBreakPoints(); 808 ClearAllBreakPoints();
809 809
810 // Match unmatched PromiseHandlePrologue calls.
811 while (thread_local_.promise_on_stack_) PromiseHandleEpilogue();
812
810 // Return debugger is not loaded. 813 // Return debugger is not loaded.
811 if (!IsLoaded()) return; 814 if (!IsLoaded()) return;
812 815
813 // Clear the script cache. 816 // Clear the script cache.
814 DestroyScriptCache(); 817 DestroyScriptCache();
815 818
816 // Match unmatched PromiseHandlePrologue calls.
817 while (thread_local_.promise_on_stack_) PromiseHandleEpilogue();
818
819 // Clear debugger context global handle. 819 // Clear debugger context global handle.
820 GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location()); 820 GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location());
821 debug_context_ = Handle<Context>(); 821 debug_context_ = Handle<Context>();
822 } 822 }
823 823
824 824
825 Object* Debug::Break(Arguments args) { 825 Object* Debug::Break(Arguments args) {
826 Heap* heap = isolate_->heap(); 826 Heap* heap = isolate_->heap();
827 HandleScope scope(isolate_); 827 HandleScope scope(isolate_);
828 ASSERT(args.length() == 0); 828 ASSERT(args.length() == 0);
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after
3543 logger_->DebugEvent("Put", message.text()); 3543 logger_->DebugEvent("Put", message.text());
3544 } 3544 }
3545 3545
3546 3546
3547 void LockingCommandMessageQueue::Clear() { 3547 void LockingCommandMessageQueue::Clear() {
3548 LockGuard<Mutex> lock_guard(&mutex_); 3548 LockGuard<Mutex> lock_guard(&mutex_);
3549 queue_.Clear(); 3549 queue_.Clear();
3550 } 3550 }
3551 3551
3552 } } // namespace v8::internal 3552 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698