OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2159 int length = js_obj->GetInternalFieldCount(); | 2159 int length = js_obj->GetInternalFieldCount(); |
2160 for (int i = 0; i < length; ++i) { | 2160 for (int i = 0; i < length; ++i) { |
2161 Object* o = js_obj->GetInternalField(i); | 2161 Object* o = js_obj->GetInternalField(i); |
2162 SetInternalReference( | 2162 SetInternalReference( |
2163 js_obj, entry, i, o, js_obj->GetInternalFieldOffset(i)); | 2163 js_obj, entry, i, o, js_obj->GetInternalFieldOffset(i)); |
2164 } | 2164 } |
2165 } | 2165 } |
2166 | 2166 |
2167 | 2167 |
2168 String* V8HeapExplorer::GetConstructorName(JSObject* object) { | 2168 String* V8HeapExplorer::GetConstructorName(JSObject* object) { |
2169 if (object->IsJSFunction()) return HEAP->closure_symbol(); | 2169 Heap* heap = object->GetHeap(); |
| 2170 if (object->IsJSFunction()) return heap->closure_symbol(); |
2170 String* constructor_name = object->constructor_name(); | 2171 String* constructor_name = object->constructor_name(); |
2171 if (constructor_name == HEAP->Object_symbol()) { | 2172 if (constructor_name == heap->Object_symbol()) { |
2172 // Look up an immediate "constructor" property, if it is a function, | 2173 // Look up an immediate "constructor" property, if it is a function, |
2173 // return its name. This is for instances of binding objects, which | 2174 // return its name. This is for instances of binding objects, which |
2174 // have prototype constructor type "Object". | 2175 // have prototype constructor type "Object". |
2175 Object* constructor_prop = NULL; | 2176 Object* constructor_prop = NULL; |
2176 LookupResult result; | 2177 LookupResult result(heap->isolate()); |
2177 object->LocalLookupRealNamedProperty(HEAP->constructor_symbol(), &result); | 2178 object->LocalLookupRealNamedProperty(heap->constructor_symbol(), &result); |
2178 if (result.IsProperty()) { | 2179 if (result.IsProperty()) { |
2179 constructor_prop = result.GetLazyValue(); | 2180 constructor_prop = result.GetLazyValue(); |
2180 } | 2181 } |
2181 if (constructor_prop->IsJSFunction()) { | 2182 if (constructor_prop->IsJSFunction()) { |
2182 Object* maybe_name = JSFunction::cast(constructor_prop)->shared()->name(); | 2183 Object* maybe_name = JSFunction::cast(constructor_prop)->shared()->name(); |
2183 if (maybe_name->IsString()) { | 2184 if (maybe_name->IsString()) { |
2184 String* name = String::cast(maybe_name); | 2185 String* name = String::cast(maybe_name); |
2185 if (name->length() > 0) return name; | 2186 if (name->length() > 0) return name; |
2186 } | 2187 } |
2187 } | 2188 } |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3395 | 3396 |
3396 | 3397 |
3397 void HeapSnapshotJSONSerializer::SortHashMap( | 3398 void HeapSnapshotJSONSerializer::SortHashMap( |
3398 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3399 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
3399 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3400 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
3400 sorted_entries->Add(p); | 3401 sorted_entries->Add(p); |
3401 sorted_entries->Sort(SortUsingEntryValue); | 3402 sorted_entries->Sort(SortUsingEntryValue); |
3402 } | 3403 } |
3403 | 3404 |
3404 } } // namespace v8::internal | 3405 } } // namespace v8::internal |
OLD | NEW |