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

Side by Side Diff: src/heap-snapshot-generator.cc

Issue 480823004: Get rid of GetLazyValue and clients. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/heap-snapshot-generator-inl.h" 7 #include "src/heap-snapshot-generator-inl.h"
8 8
9 #include "src/allocation-tracker.h" 9 #include "src/allocation-tracker.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 js_obj, entry, i, o, js_obj->GetInternalFieldOffset(i)); 1779 js_obj, entry, i, o, js_obj->GetInternalFieldOffset(i));
1780 } 1780 }
1781 } 1781 }
1782 1782
1783 1783
1784 String* V8HeapExplorer::GetConstructorName(JSObject* object) { 1784 String* V8HeapExplorer::GetConstructorName(JSObject* object) {
1785 Heap* heap = object->GetHeap(); 1785 Heap* heap = object->GetHeap();
1786 if (object->IsJSFunction()) return heap->closure_string(); 1786 if (object->IsJSFunction()) return heap->closure_string();
1787 String* constructor_name = object->constructor_name(); 1787 String* constructor_name = object->constructor_name();
1788 if (constructor_name == heap->Object_string()) { 1788 if (constructor_name == heap->Object_string()) {
1789 // Look up an immediate "constructor" property, if it is a function, 1789 // TODO(verwaest): Try to get object.constructor.name in this case.
1790 // return its name. This is for instances of binding objects, which 1790 // This requires handlification of the V8HeapExplorer.
1791 // have prototype constructor type "Object".
1792 Object* constructor_prop = NULL;
1793 Isolate* isolate = heap->isolate();
1794 LookupResult result(isolate);
1795 object->LookupOwnRealNamedProperty(
1796 isolate->factory()->constructor_string(), &result);
1797 if (!result.IsFound()) return object->constructor_name();
1798
1799 constructor_prop = result.GetLazyValue();
1800 if (constructor_prop->IsJSFunction()) {
1801 Object* maybe_name =
1802 JSFunction::cast(constructor_prop)->shared()->name();
1803 if (maybe_name->IsString()) {
1804 String* name = String::cast(maybe_name);
1805 if (name->length() > 0) return name;
1806 }
1807 }
1808 } 1791 }
1809 return object->constructor_name(); 1792 return object->constructor_name();
1810 } 1793 }
1811 1794
1812 1795
1813 HeapEntry* V8HeapExplorer::GetEntry(Object* obj) { 1796 HeapEntry* V8HeapExplorer::GetEntry(Object* obj) {
1814 if (!obj->IsHeapObject()) return NULL; 1797 if (!obj->IsHeapObject()) return NULL;
1815 return filler_->FindOrAddEntry(obj, this); 1798 return filler_->FindOrAddEntry(obj, this);
1816 } 1799 }
1817 1800
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 writer_->AddString("\"<dummy>\""); 3167 writer_->AddString("\"<dummy>\"");
3185 for (int i = 1; i < sorted_strings.length(); ++i) { 3168 for (int i = 1; i < sorted_strings.length(); ++i) {
3186 writer_->AddCharacter(','); 3169 writer_->AddCharacter(',');
3187 SerializeString(sorted_strings[i]); 3170 SerializeString(sorted_strings[i]);
3188 if (writer_->aborted()) return; 3171 if (writer_->aborted()) return;
3189 } 3172 }
3190 } 3173 }
3191 3174
3192 3175
3193 } } // namespace v8::internal 3176 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698