OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "heap-snapshot-generator-inl.h" | 7 #include "heap-snapshot-generator-inl.h" |
8 | 8 |
9 #include "allocation-tracker.h" | 9 #include "allocation-tracker.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 | 1733 |
1734 String* V8HeapExplorer::GetConstructorName(JSObject* object) { | 1734 String* V8HeapExplorer::GetConstructorName(JSObject* object) { |
1735 Heap* heap = object->GetHeap(); | 1735 Heap* heap = object->GetHeap(); |
1736 if (object->IsJSFunction()) return heap->closure_string(); | 1736 if (object->IsJSFunction()) return heap->closure_string(); |
1737 String* constructor_name = object->constructor_name(); | 1737 String* constructor_name = object->constructor_name(); |
1738 if (constructor_name == heap->Object_string()) { | 1738 if (constructor_name == heap->Object_string()) { |
1739 // Look up an immediate "constructor" property, if it is a function, | 1739 // Look up an immediate "constructor" property, if it is a function, |
1740 // return its name. This is for instances of binding objects, which | 1740 // return its name. This is for instances of binding objects, which |
1741 // have prototype constructor type "Object". | 1741 // have prototype constructor type "Object". |
1742 Object* constructor_prop = NULL; | 1742 Object* constructor_prop = NULL; |
1743 LookupResult result(heap->isolate()); | 1743 Isolate* isolate = heap->isolate(); |
1744 object->LocalLookupRealNamedProperty(heap->constructor_string(), &result); | 1744 LookupResult result(isolate); |
| 1745 object->LocalLookupRealNamedProperty( |
| 1746 isolate->factory()->constructor_string(), &result); |
1745 if (!result.IsFound()) return object->constructor_name(); | 1747 if (!result.IsFound()) return object->constructor_name(); |
1746 | 1748 |
1747 constructor_prop = result.GetLazyValue(); | 1749 constructor_prop = result.GetLazyValue(); |
1748 if (constructor_prop->IsJSFunction()) { | 1750 if (constructor_prop->IsJSFunction()) { |
1749 Object* maybe_name = | 1751 Object* maybe_name = |
1750 JSFunction::cast(constructor_prop)->shared()->name(); | 1752 JSFunction::cast(constructor_prop)->shared()->name(); |
1751 if (maybe_name->IsString()) { | 1753 if (maybe_name->IsString()) { |
1752 String* name = String::cast(maybe_name); | 1754 String* name = String::cast(maybe_name); |
1753 if (name->length() > 0) return name; | 1755 if (name->length() > 0) return name; |
1754 } | 1756 } |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3137 writer_->AddString("\"<dummy>\""); | 3139 writer_->AddString("\"<dummy>\""); |
3138 for (int i = 1; i < sorted_strings.length(); ++i) { | 3140 for (int i = 1; i < sorted_strings.length(); ++i) { |
3139 writer_->AddCharacter(','); | 3141 writer_->AddCharacter(','); |
3140 SerializeString(sorted_strings[i]); | 3142 SerializeString(sorted_strings[i]); |
3141 if (writer_->aborted()) return; | 3143 if (writer_->aborted()) return; |
3142 } | 3144 } |
3143 } | 3145 } |
3144 | 3146 |
3145 | 3147 |
3146 } } // namespace v8::internal | 3148 } } // namespace v8::internal |
OLD | NEW |