OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 | 1411 |
1412 #define SYMBOL_INDEX_DECLARATION(name, str) k##name##RootIndex, | 1412 #define SYMBOL_INDEX_DECLARATION(name, str) k##name##RootIndex, |
1413 SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) | 1413 SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) |
1414 #undef SYMBOL_DECLARATION | 1414 #undef SYMBOL_DECLARATION |
1415 | 1415 |
1416 kSymbolTableRootIndex, | 1416 kSymbolTableRootIndex, |
1417 kStrongRootListLength = kSymbolTableRootIndex, | 1417 kStrongRootListLength = kSymbolTableRootIndex, |
1418 kRootListLength | 1418 kRootListLength |
1419 }; | 1419 }; |
1420 | 1420 |
| 1421 STATIC_CHECK(kUndefinedValueRootIndex == Internals::kUndefinedValueRootIndex); |
| 1422 STATIC_CHECK(kNullValueRootIndex == Internals::kNullValueRootIndex); |
| 1423 STATIC_CHECK(kTrueValueRootIndex == Internals::kTrueValueRootIndex); |
| 1424 STATIC_CHECK(kFalseValueRootIndex == Internals::kFalseValueRootIndex); |
| 1425 |
1421 MUST_USE_RESULT MaybeObject* NumberToString( | 1426 MUST_USE_RESULT MaybeObject* NumberToString( |
1422 Object* number, bool check_number_string_cache = true); | 1427 Object* number, bool check_number_string_cache = true); |
1423 MUST_USE_RESULT MaybeObject* Uint32ToString( | 1428 MUST_USE_RESULT MaybeObject* Uint32ToString( |
1424 uint32_t value, bool check_number_string_cache = true); | 1429 uint32_t value, bool check_number_string_cache = true); |
1425 | 1430 |
1426 Map* MapForExternalArrayType(ExternalArrayType array_type); | 1431 Map* MapForExternalArrayType(ExternalArrayType array_type); |
1427 RootListIndex RootIndexForExternalArrayType( | 1432 RootListIndex RootIndexForExternalArrayType( |
1428 ExternalArrayType array_type); | 1433 ExternalArrayType array_type); |
1429 | 1434 |
1430 void RecordStats(HeapStats* stats, bool take_snapshot = false); | 1435 void RecordStats(HeapStats* stats, bool take_snapshot = false); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 ++global_ic_age_; | 1610 ++global_ic_age_; |
1606 } | 1611 } |
1607 | 1612 |
1608 private: | 1613 private: |
1609 Heap(); | 1614 Heap(); |
1610 | 1615 |
1611 // This can be calculated directly from a pointer to the heap; however, it is | 1616 // This can be calculated directly from a pointer to the heap; however, it is |
1612 // more expedient to get at the isolate directly from within Heap methods. | 1617 // more expedient to get at the isolate directly from within Heap methods. |
1613 Isolate* isolate_; | 1618 Isolate* isolate_; |
1614 | 1619 |
| 1620 Object* roots_[kRootListLength]; |
| 1621 |
1615 intptr_t code_range_size_; | 1622 intptr_t code_range_size_; |
1616 int reserved_semispace_size_; | 1623 int reserved_semispace_size_; |
1617 int max_semispace_size_; | 1624 int max_semispace_size_; |
1618 int initial_semispace_size_; | 1625 int initial_semispace_size_; |
1619 intptr_t max_old_generation_size_; | 1626 intptr_t max_old_generation_size_; |
1620 intptr_t max_executable_size_; | 1627 intptr_t max_executable_size_; |
1621 | 1628 |
1622 // For keeping track of how much data has survived | 1629 // For keeping track of how much data has survived |
1623 // scavenge since last new space expansion. | 1630 // scavenge since last new space expansion. |
1624 int survived_since_last_expansion_; | 1631 int survived_since_last_expansion_; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 // by global handles | 1727 // by global handles |
1721 intptr_t amount_of_external_allocated_memory_; | 1728 intptr_t amount_of_external_allocated_memory_; |
1722 | 1729 |
1723 // Caches the amount of external memory registered at the last global gc. | 1730 // Caches the amount of external memory registered at the last global gc. |
1724 intptr_t amount_of_external_allocated_memory_at_last_global_gc_; | 1731 intptr_t amount_of_external_allocated_memory_at_last_global_gc_; |
1725 | 1732 |
1726 // Indicates that an allocation has failed in the old generation since the | 1733 // Indicates that an allocation has failed in the old generation since the |
1727 // last GC. | 1734 // last GC. |
1728 int old_gen_exhausted_; | 1735 int old_gen_exhausted_; |
1729 | 1736 |
1730 Object* roots_[kRootListLength]; | |
1731 | |
1732 Object* global_contexts_list_; | 1737 Object* global_contexts_list_; |
1733 | 1738 |
1734 StoreBufferRebuilder store_buffer_rebuilder_; | 1739 StoreBufferRebuilder store_buffer_rebuilder_; |
1735 | 1740 |
1736 struct StringTypeTable { | 1741 struct StringTypeTable { |
1737 InstanceType type; | 1742 InstanceType type; |
1738 int size; | 1743 int size; |
1739 RootListIndex index; | 1744 RootListIndex index; |
1740 }; | 1745 }; |
1741 | 1746 |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2718 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2714 | 2719 |
2715 private: | 2720 private: |
2716 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2721 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2717 }; | 2722 }; |
2718 #endif // DEBUG || LIVE_OBJECT_LIST | 2723 #endif // DEBUG || LIVE_OBJECT_LIST |
2719 | 2724 |
2720 } } // namespace v8::internal | 2725 } } // namespace v8::internal |
2721 | 2726 |
2722 #endif // V8_HEAP_H_ | 2727 #endif // V8_HEAP_H_ |
OLD | NEW |