OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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/global-handles.h" | 5 #include "src/global-handles.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 #include "src/vm-state-inl.h" | 9 #include "src/vm-state-inl.h" |
10 | 10 |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 void ObjectGroupsTracer::PrintInternalFields(JSObject* js_object) { | 881 void ObjectGroupsTracer::PrintInternalFields(JSObject* js_object) { |
882 for (int i = 0; i < js_object->GetInternalFieldCount(); ++i) { | 882 for (int i = 0; i < js_object->GetInternalFieldCount(); ++i) { |
883 if (i != 0) { | 883 if (i != 0) { |
884 PrintF(", "); | 884 PrintF(", "); |
885 } | 885 } |
886 PrintF("%p", js_object->GetInternalField(i)); | 886 PrintF("%p", js_object->GetInternalField(i)); |
887 } | 887 } |
888 } | 888 } |
889 | 889 |
890 void ObjectGroupsTracer::PrintObjectGroup(ObjectGroup* group) { | 890 void ObjectGroupsTracer::PrintObjectGroup(ObjectGroup* group) { |
891 PrintIsolate(isolate_, "ObjectGroup (size: %" PRIuS ")\n", group->length); | 891 PrintIsolate(isolate_, "ObjectGroup (size: %lu)\n", group->length); |
892 Object*** objects = group->objects; | 892 Object*** objects = group->objects; |
893 | 893 |
894 for (size_t i = 0; i < group->length; ++i) { | 894 for (size_t i = 0; i < group->length; ++i) { |
895 PrintIsolate(isolate_, " - Member: "); | 895 PrintIsolate(isolate_, " - Member: "); |
896 PrintObject(*objects[i]); | 896 PrintObject(*objects[i]); |
897 } | 897 } |
898 } | 898 } |
899 | 899 |
900 void ObjectGroupsTracer::PrintImplicitRefGroup(ImplicitRefGroup* group) { | 900 void ObjectGroupsTracer::PrintImplicitRefGroup(ImplicitRefGroup* group) { |
901 PrintIsolate(isolate_, "ImplicitRefGroup (children count: %" PRIuS ")\n", | 901 PrintIsolate(isolate_, "ImplicitRefGroup (children count: %lu)\n", |
902 group->length); | 902 group->length); |
903 PrintIsolate(isolate_, " - Parent: "); | 903 PrintIsolate(isolate_, " - Parent: "); |
904 PrintObject(*(group->parent)); | 904 PrintObject(*(group->parent)); |
905 | 905 |
906 Object*** children = group->children; | 906 Object*** children = group->children; |
907 for (size_t i = 0; i < group->length; ++i) { | 907 for (size_t i = 0; i < group->length; ++i) { |
908 PrintIsolate(isolate_, " - Child: "); | 908 PrintIsolate(isolate_, " - Child: "); |
909 PrintObject(*children[i]); | 909 PrintObject(*children[i]); |
910 } | 910 } |
911 } | 911 } |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 | 1216 |
1217 for (NodeIterator it(this); !it.done(); it.Advance()) { | 1217 for (NodeIterator it(this); !it.done(); it.Advance()) { |
1218 total++; | 1218 total++; |
1219 if (it.node()->state() == Node::WEAK) weak++; | 1219 if (it.node()->state() == Node::WEAK) weak++; |
1220 if (it.node()->state() == Node::PENDING) pending++; | 1220 if (it.node()->state() == Node::PENDING) pending++; |
1221 if (it.node()->state() == Node::NEAR_DEATH) near_death++; | 1221 if (it.node()->state() == Node::NEAR_DEATH) near_death++; |
1222 if (it.node()->state() == Node::FREE) destroyed++; | 1222 if (it.node()->state() == Node::FREE) destroyed++; |
1223 } | 1223 } |
1224 | 1224 |
1225 PrintF("Global Handle Statistics:\n"); | 1225 PrintF("Global Handle Statistics:\n"); |
1226 PrintF(" allocated memory = %" PRIuS "B\n", total * sizeof(Node)); | 1226 PrintF(" allocated memory = %" V8_SIZET_PREFIX V8_PTR_PREFIX "dB\n", |
| 1227 total * sizeof(Node)); |
1227 PrintF(" # weak = %d\n", weak); | 1228 PrintF(" # weak = %d\n", weak); |
1228 PrintF(" # pending = %d\n", pending); | 1229 PrintF(" # pending = %d\n", pending); |
1229 PrintF(" # near_death = %d\n", near_death); | 1230 PrintF(" # near_death = %d\n", near_death); |
1230 PrintF(" # free = %d\n", destroyed); | 1231 PrintF(" # free = %d\n", destroyed); |
1231 PrintF(" # total = %d\n", total); | 1232 PrintF(" # total = %d\n", total); |
1232 } | 1233 } |
1233 | 1234 |
1234 | 1235 |
1235 void GlobalHandles::Print() { | 1236 void GlobalHandles::Print() { |
1236 PrintF("Global handles:\n"); | 1237 PrintF("Global handles:\n"); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 blocks_[block][offset] = object; | 1482 blocks_[block][offset] = object; |
1482 if (isolate->heap()->InNewSpace(object)) { | 1483 if (isolate->heap()->InNewSpace(object)) { |
1483 new_space_indices_.Add(size_); | 1484 new_space_indices_.Add(size_); |
1484 } | 1485 } |
1485 *index = size_++; | 1486 *index = size_++; |
1486 } | 1487 } |
1487 | 1488 |
1488 | 1489 |
1489 } // namespace internal | 1490 } // namespace internal |
1490 } // namespace v8 | 1491 } // namespace v8 |
OLD | NEW |