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

Unified Diff: src/profiler/heap-snapshot-generator.cc

Issue 1435273002: Fix name shown by devtools for subclasses. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/profiler/heap-snapshot-generator.cc
diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc
index 2268db223f27a9083f06105154a7e02f3bd5449e..4d18d5cd836ff9d478396c08dacc14a5d4c032ac 100644
--- a/src/profiler/heap-snapshot-generator.cc
+++ b/src/profiler/heap-snapshot-generator.cc
@@ -1739,14 +1739,11 @@ void V8HeapExplorer::ExtractInternalReferences(JSObject* js_obj, int entry) {
String* V8HeapExplorer::GetConstructorName(JSObject* object) {
- Heap* heap = object->GetHeap();
- if (object->IsJSFunction()) return heap->closure_string();
- String* constructor_name = object->constructor_name();
- if (constructor_name == heap->Object_string()) {
- // TODO(verwaest): Try to get object.constructor.name in this case.
- // This requires handlification of the V8HeapExplorer.
- }
- return object->constructor_name();
+ Isolate* isolate = object->GetIsolate();
+ if (object->IsJSFunction()) return isolate->heap()->closure_string();
+ DisallowHeapAllocation no_gc;
+ HandleScope scope(isolate);
+ return *JSReceiver::GetConstructorName(handle(object, isolate));
}

Powered by Google App Engine
This is Rietveld 408576698