| 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 "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" |
| 11 #include "src/conversions.h" | 11 #include "src/conversions.h" |
| 12 #include "src/debug.h" | 12 #include "src/debug.h" |
| 13 #include "src/heap-profiler.h" | 13 #include "src/heap-profiler.h" |
| 14 #include "src/prototype-iterator.h" |
| 14 #include "src/types.h" | 15 #include "src/types.h" |
| 15 | 16 |
| 16 namespace v8 { | 17 namespace v8 { |
| 17 namespace internal { | 18 namespace internal { |
| 18 | 19 |
| 19 | 20 |
| 20 HeapGraphEdge::HeapGraphEdge(Type type, const char* name, int from, int to) | 21 HeapGraphEdge::HeapGraphEdge(Type type, const char* name, int from, int to) |
| 21 : type_(type), | 22 : type_(type), |
| 22 from_index_(from), | 23 from_index_(from), |
| 23 to_index_(to), | 24 to_index_(to), |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 | 1154 |
| 1154 | 1155 |
| 1155 void V8HeapExplorer::ExtractJSObjectReferences( | 1156 void V8HeapExplorer::ExtractJSObjectReferences( |
| 1156 int entry, JSObject* js_obj) { | 1157 int entry, JSObject* js_obj) { |
| 1157 HeapObject* obj = js_obj; | 1158 HeapObject* obj = js_obj; |
| 1158 ExtractClosureReferences(js_obj, entry); | 1159 ExtractClosureReferences(js_obj, entry); |
| 1159 ExtractPropertyReferences(js_obj, entry); | 1160 ExtractPropertyReferences(js_obj, entry); |
| 1160 ExtractElementReferences(js_obj, entry); | 1161 ExtractElementReferences(js_obj, entry); |
| 1161 ExtractInternalReferences(js_obj, entry); | 1162 ExtractInternalReferences(js_obj, entry); |
| 1162 SetPropertyReference( | 1163 SetPropertyReference( |
| 1163 obj, entry, heap_->proto_string(), js_obj->GetPrototype()); | 1164 obj, entry, heap_->proto_string(), SAFE_GET_PROTOTYPE_FAST(js_obj)); |
| 1164 if (obj->IsJSFunction()) { | 1165 if (obj->IsJSFunction()) { |
| 1165 JSFunction* js_fun = JSFunction::cast(js_obj); | 1166 JSFunction* js_fun = JSFunction::cast(js_obj); |
| 1166 Object* proto_or_map = js_fun->prototype_or_initial_map(); | 1167 Object* proto_or_map = js_fun->prototype_or_initial_map(); |
| 1167 if (!proto_or_map->IsTheHole()) { | 1168 if (!proto_or_map->IsTheHole()) { |
| 1168 if (!proto_or_map->IsMap()) { | 1169 if (!proto_or_map->IsMap()) { |
| 1169 SetPropertyReference( | 1170 SetPropertyReference( |
| 1170 obj, entry, | 1171 obj, entry, |
| 1171 heap_->prototype_string(), proto_or_map, | 1172 heap_->prototype_string(), proto_or_map, |
| 1172 NULL, | 1173 NULL, |
| 1173 JSFunction::kPrototypeOrInitialMapOffset); | 1174 JSFunction::kPrototypeOrInitialMapOffset); |
| (...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3171 writer_->AddString("\"<dummy>\""); | 3172 writer_->AddString("\"<dummy>\""); |
| 3172 for (int i = 1; i < sorted_strings.length(); ++i) { | 3173 for (int i = 1; i < sorted_strings.length(); ++i) { |
| 3173 writer_->AddCharacter(','); | 3174 writer_->AddCharacter(','); |
| 3174 SerializeString(sorted_strings[i]); | 3175 SerializeString(sorted_strings[i]); |
| 3175 if (writer_->aborted()) return; | 3176 if (writer_->aborted()) return; |
| 3176 } | 3177 } |
| 3177 } | 3178 } |
| 3178 | 3179 |
| 3179 | 3180 |
| 3180 } } // namespace v8::internal | 3181 } } // namespace v8::internal |
| OLD | NEW |