OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 6421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6432 static_cast<int>(object_sizes_[index])); \ | 6432 static_cast<int>(object_sizes_[index])); \ |
6433 counters->size_of_CODE_AGE_##name()->Decrement( \ | 6433 counters->size_of_CODE_AGE_##name()->Decrement( \ |
6434 static_cast<int>(object_sizes_last_time_[index])); | 6434 static_cast<int>(object_sizes_last_time_[index])); |
6435 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6435 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6436 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6436 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6437 | 6437 |
6438 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6438 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6439 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6439 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6440 ClearObjectStats(); | 6440 ClearObjectStats(); |
6441 } | 6441 } |
6442 | |
6443 | |
6444 const char* Heap::GetObjectTypeName(size_t index) { | |
6445 if (index > OBJECT_STATS_COUNT) | |
ulan
2015/05/06 12:46:02
index >= OBJECT_STATS_COUNT
ssid
2015/05/07 13:53:03
Done.
| |
6446 return nullptr; | |
6447 | |
6448 switch (static_cast<int>(index)) { | |
6449 #define ADJUST_LAST_TIME_OBJECT_COUNT(name) \ | |
ulan
2015/05/06 12:46:02
The name "ADJUST_LAST_TIME_OBJECT_COUNT" is confus
ssid
2015/05/07 13:53:03
Done.
| |
6450 case name: \ | |
6451 return #name; | |
6452 INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | |
6453 #undef ADJUST_LAST_TIME_OBJECT_COUNT | |
6454 #define ADJUST_LAST_TIME_OBJECT_COUNT(name) \ | |
6455 case FIRST_CODE_KIND_SUB_TYPE + Code::name: \ | |
6456 return "CODE_TYPE_" #name; | |
6457 CODE_KIND_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | |
6458 #undef ADJUST_LAST_TIME_OBJECT_COUNT | |
6459 #define ADJUST_LAST_TIME_OBJECT_COUNT(name) \ | |
6460 case FIRST_FIXED_ARRAY_SUB_TYPE + name: \ | |
6461 return "FIXED_ARRAY_" #name; | |
6462 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | |
6463 #undef ADJUST_LAST_TIME_OBJECT_COUNT | |
6464 #define ADJUST_LAST_TIME_OBJECT_COUNT(name) \ | |
6465 case FIRST_CODE_AGE_SUB_TYPE + Code::k##name##CodeAge - Code::kFirstCodeAge: \ | |
6466 return "CODE_AGE_" #name; | |
6467 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | |
6468 #undef ADJUST_LAST_TIME_OBJECT_COUNT | |
6469 } | |
6470 return nullptr; | |
6471 } | |
6442 } | 6472 } |
6443 } // namespace v8::internal | 6473 } // namespace v8::internal |
OLD | NEW |