| 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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 Heap* heap = object->GetHeap(); | 1745 Heap* heap = object->GetHeap(); |
| 1746 if (object->IsJSFunction()) return heap->closure_string(); | 1746 if (object->IsJSFunction()) return heap->closure_string(); |
| 1747 String* constructor_name = object->constructor_name(); | 1747 String* constructor_name = object->constructor_name(); |
| 1748 if (constructor_name == heap->Object_string()) { | 1748 if (constructor_name == heap->Object_string()) { |
| 1749 // Look up an immediate "constructor" property, if it is a function, | 1749 // Look up an immediate "constructor" property, if it is a function, |
| 1750 // return its name. This is for instances of binding objects, which | 1750 // return its name. This is for instances of binding objects, which |
| 1751 // have prototype constructor type "Object". | 1751 // have prototype constructor type "Object". |
| 1752 Object* constructor_prop = NULL; | 1752 Object* constructor_prop = NULL; |
| 1753 Isolate* isolate = heap->isolate(); | 1753 Isolate* isolate = heap->isolate(); |
| 1754 LookupResult result(isolate); | 1754 LookupResult result(isolate); |
| 1755 object->LocalLookupRealNamedProperty( | 1755 object->LookupOwnRealNamedProperty( |
| 1756 isolate->factory()->constructor_string(), &result); | 1756 isolate->factory()->constructor_string(), &result); |
| 1757 if (!result.IsFound()) return object->constructor_name(); | 1757 if (!result.IsFound()) return object->constructor_name(); |
| 1758 | 1758 |
| 1759 constructor_prop = result.GetLazyValue(); | 1759 constructor_prop = result.GetLazyValue(); |
| 1760 if (constructor_prop->IsJSFunction()) { | 1760 if (constructor_prop->IsJSFunction()) { |
| 1761 Object* maybe_name = | 1761 Object* maybe_name = |
| 1762 JSFunction::cast(constructor_prop)->shared()->name(); | 1762 JSFunction::cast(constructor_prop)->shared()->name(); |
| 1763 if (maybe_name->IsString()) { | 1763 if (maybe_name->IsString()) { |
| 1764 String* name = String::cast(maybe_name); | 1764 String* name = String::cast(maybe_name); |
| 1765 if (name->length() > 0) return name; | 1765 if (name->length() > 0) return name; |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3149 writer_->AddString("\"<dummy>\""); | 3149 writer_->AddString("\"<dummy>\""); |
| 3150 for (int i = 1; i < sorted_strings.length(); ++i) { | 3150 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3151 writer_->AddCharacter(','); | 3151 writer_->AddCharacter(','); |
| 3152 SerializeString(sorted_strings[i]); | 3152 SerializeString(sorted_strings[i]); |
| 3153 if (writer_->aborted()) return; | 3153 if (writer_->aborted()) return; |
| 3154 } | 3154 } |
| 3155 } | 3155 } |
| 3156 | 3156 |
| 3157 | 3157 |
| 3158 } } // namespace v8::internal | 3158 } } // namespace v8::internal |
| OLD | NEW |