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 6483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6494 } else { | 6494 } else { |
6495 strong_roots_list_ = next; | 6495 strong_roots_list_ = next; |
6496 } | 6496 } |
6497 delete list; | 6497 delete list; |
6498 } else { | 6498 } else { |
6499 prev = list; | 6499 prev = list; |
6500 } | 6500 } |
6501 list = next; | 6501 list = next; |
6502 } | 6502 } |
6503 } | 6503 } |
| 6504 |
| 6505 |
| 6506 bool Heap::GetObjectTypeName(size_t index, const char** object_type, |
| 6507 const char** object_sub_type) { |
| 6508 if (index >= OBJECT_STATS_COUNT) return false; |
| 6509 |
| 6510 switch (static_cast<int>(index)) { |
| 6511 #define COMPARE_AND_RETURN_NAME(name) \ |
| 6512 case name: \ |
| 6513 *object_type = #name; \ |
| 6514 *object_sub_type = ""; \ |
| 6515 return true; |
| 6516 INSTANCE_TYPE_LIST(COMPARE_AND_RETURN_NAME) |
| 6517 #undef COMPARE_AND_RETURN_NAME |
| 6518 #define COMPARE_AND_RETURN_NAME(name) \ |
| 6519 case FIRST_CODE_KIND_SUB_TYPE + Code::name: \ |
| 6520 *object_type = "CODE_TYPE"; \ |
| 6521 *object_sub_type = "CODE_KIND/" #name; \ |
| 6522 return true; |
| 6523 CODE_KIND_LIST(COMPARE_AND_RETURN_NAME) |
| 6524 #undef COMPARE_AND_RETURN_NAME |
| 6525 #define COMPARE_AND_RETURN_NAME(name) \ |
| 6526 case FIRST_FIXED_ARRAY_SUB_TYPE + name: \ |
| 6527 *object_type = "FIXED_ARRAY_TYPE"; \ |
| 6528 *object_sub_type = #name; \ |
| 6529 return true; |
| 6530 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COMPARE_AND_RETURN_NAME) |
| 6531 #undef COMPARE_AND_RETURN_NAME |
| 6532 #define COMPARE_AND_RETURN_NAME(name) \ |
| 6533 case FIRST_CODE_AGE_SUB_TYPE + Code::k##name##CodeAge - Code::kFirstCodeAge: \ |
| 6534 *object_type = "CODE_TYPE"; \ |
| 6535 *object_sub_type = "CODE_AGE/" #name; \ |
| 6536 return true; |
| 6537 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6538 #undef COMPARE_AND_RETURN_NAME |
| 6539 } |
| 6540 return false; |
| 6541 } |
6504 } | 6542 } |
6505 } // namespace v8::internal | 6543 } // namespace v8::internal |
OLD | NEW |