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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 | 1217 |
1218 for (NodeIterator it(this); !it.done(); it.Advance()) { | 1218 for (NodeIterator it(this); !it.done(); it.Advance()) { |
1219 total++; | 1219 total++; |
1220 if (it.node()->state() == Node::WEAK) weak++; | 1220 if (it.node()->state() == Node::WEAK) weak++; |
1221 if (it.node()->state() == Node::PENDING) pending++; | 1221 if (it.node()->state() == Node::PENDING) pending++; |
1222 if (it.node()->state() == Node::NEAR_DEATH) near_death++; | 1222 if (it.node()->state() == Node::NEAR_DEATH) near_death++; |
1223 if (it.node()->state() == Node::FREE) destroyed++; | 1223 if (it.node()->state() == Node::FREE) destroyed++; |
1224 } | 1224 } |
1225 | 1225 |
1226 PrintF("Global Handle Statistics:\n"); | 1226 PrintF("Global Handle Statistics:\n"); |
1227 PrintF(" allocated memory = %" V8_PTR_PREFIX "dB\n", sizeof(Node) * total); | 1227 PrintF(" allocated memory = %" V8_SIZET_PREFIX V8_PTR_PREFIX "dB\n", |
| 1228 total * sizeof(Node)); |
1228 PrintF(" # weak = %d\n", weak); | 1229 PrintF(" # weak = %d\n", weak); |
1229 PrintF(" # pending = %d\n", pending); | 1230 PrintF(" # pending = %d\n", pending); |
1230 PrintF(" # near_death = %d\n", near_death); | 1231 PrintF(" # near_death = %d\n", near_death); |
1231 PrintF(" # free = %d\n", destroyed); | 1232 PrintF(" # free = %d\n", destroyed); |
1232 PrintF(" # total = %d\n", total); | 1233 PrintF(" # total = %d\n", total); |
1233 } | 1234 } |
1234 | 1235 |
1235 | 1236 |
1236 void GlobalHandles::Print() { | 1237 void GlobalHandles::Print() { |
1237 PrintF("Global handles:\n"); | 1238 PrintF("Global handles:\n"); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 blocks_[block][offset] = object; | 1483 blocks_[block][offset] = object; |
1483 if (isolate->heap()->InNewSpace(object)) { | 1484 if (isolate->heap()->InNewSpace(object)) { |
1484 new_space_indices_.Add(size_); | 1485 new_space_indices_.Add(size_); |
1485 } | 1486 } |
1486 *index = size_++; | 1487 *index = size_++; |
1487 } | 1488 } |
1488 | 1489 |
1489 | 1490 |
1490 } // namespace internal | 1491 } // namespace internal |
1491 } // namespace v8 | 1492 } // namespace v8 |
OLD | NEW |