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

Unified Diff: src/debug.cc

Issue 998253006: two pass phantom collection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix debugger Created 5 years, 9 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.h ('k') | src/global-handles.h » ('j') | no next file with comments »
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 7f96ddc4ad4dcff1014f5cd81ead1add60a746ab..ee5b29754277c349b8b7d503cac664474b131dd7 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -593,9 +593,10 @@ void ScriptCache::HandleWeakScript(
void Debug::HandlePhantomDebugInfo(
- const v8::PhantomCallbackData<DebugInfoListNode>& data) {
- Debug* debug = reinterpret_cast<Isolate*>(data.GetIsolate())->debug();
+ const v8::WeakCallbackInfo<DebugInfoListNode>& data) {
DebugInfoListNode* node = data.GetParameter();
+ node->ClearInfo();
+ Debug* debug = reinterpret_cast<Isolate*>(data.GetIsolate())->debug();
debug->RemoveDebugInfo(node);
#ifdef DEBUG
for (DebugInfoListNode* n = debug->debug_info_list_;
@@ -610,17 +611,20 @@ void Debug::HandlePhantomDebugInfo(
DebugInfoListNode::DebugInfoListNode(DebugInfo* debug_info): next_(NULL) {
// Globalize the request debug info object and make it weak.
GlobalHandles* global_handles = debug_info->GetIsolate()->global_handles();
- debug_info_ = Handle<DebugInfo>::cast(global_handles->Create(debug_info));
- typedef PhantomCallbackData<void>::Callback Callback;
+ debug_info_ =
+ Handle<DebugInfo>::cast(global_handles->Create(debug_info)).location();
+ typedef WeakCallbackInfo<void>::Callback Callback;
GlobalHandles::MakeWeak(
- reinterpret_cast<Object**>(debug_info_.location()), this,
+ reinterpret_cast<Object**>(debug_info_), this,
reinterpret_cast<Callback>(Debug::HandlePhantomDebugInfo),
v8::WeakCallbackType::kParameter);
}
-DebugInfoListNode::~DebugInfoListNode() {
- GlobalHandles::Destroy(reinterpret_cast<Object**>(debug_info_.location()));
+void DebugInfoListNode::ClearInfo() {
+ if (debug_info_ == nullptr) return;
+ GlobalHandles::Destroy(reinterpret_cast<Object**>(debug_info_));
+ debug_info_ = nullptr;
}
« no previous file with comments | « src/debug.h ('k') | src/global-handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698