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

Unified Diff: src/profile-generator.cc

Issue 10096016: Remove Debug object from the user roots in heap profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments. Created 8 years, 8 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
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index ec08f8dca806b0f34985ca4dbd859b8e464ce9eb..9c50383e8ec3feb8282874cc742271a05c8d499f 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -34,6 +34,7 @@
#include "scopeinfo.h"
#include "unicode.h"
#include "zone-inl.h"
+#include "debug.h"
namespace v8 {
namespace internal {
@@ -1986,7 +1987,15 @@ void V8HeapExplorer::ExtractReferences(HeapObject* obj) {
// We use JSGlobalProxy because this is what embedder (e.g. browser)
// uses for the global object.
JSGlobalProxy* proxy = JSGlobalProxy::cast(obj);
- SetWindowReference(proxy->map()->prototype());
+ Object* object = proxy->map()->prototype();
+ bool is_debug_object = false;
+#ifdef ENABLE_DEBUGGER_SUPPORT
+ is_debug_object = object->IsGlobalObject() &&
+ Isolate::Current()->debug()->IsDebugGlobal(GlobalObject::cast(object));
+#endif
+ if (!is_debug_object) {
+ SetUserGlobalReference(object);
+ }
} else if (obj->IsJSObject()) {
JSObject* js_obj = JSObject::cast(obj);
ExtractClosureReferences(js_obj, entry);
@@ -2631,7 +2640,7 @@ void V8HeapExplorer::SetRootGcRootsReference() {
}
-void V8HeapExplorer::SetWindowReference(Object* child_obj) {
+void V8HeapExplorer::SetUserGlobalReference(Object* child_obj) {
HeapEntry* child_entry = GetEntry(child_obj);
ASSERT(child_entry != NULL);
filler_->SetNamedAutoIndexReference(

Powered by Google App Engine
This is Rietveld 408576698