| 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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1468 |
| 1469 // Attempt to find the number in a small cache. If we finds it, return | 1469 // Attempt to find the number in a small cache. If we finds it, return |
| 1470 // the string representation of the number. Otherwise return undefined. | 1470 // the string representation of the number. Otherwise return undefined. |
| 1471 Object* GetNumberStringCache(Object* number); | 1471 Object* GetNumberStringCache(Object* number); |
| 1472 | 1472 |
| 1473 // Update the cache with a new number-string pair. | 1473 // Update the cache with a new number-string pair. |
| 1474 void SetNumberStringCache(Object* number, String* str); | 1474 void SetNumberStringCache(Object* number, String* str); |
| 1475 | 1475 |
| 1476 // Adjusts the amount of registered external memory. | 1476 // Adjusts the amount of registered external memory. |
| 1477 // Returns the adjusted value. | 1477 // Returns the adjusted value. |
| 1478 inline intptr_t AdjustAmountOfExternalAllocatedMemory( | 1478 inline int64_t AdjustAmountOfExternalAllocatedMemory( |
| 1479 intptr_t change_in_bytes); | 1479 int64_t change_in_bytes); |
| 1480 | 1480 |
| 1481 // This is only needed for testing high promotion mode. | 1481 // This is only needed for testing high promotion mode. |
| 1482 void SetNewSpaceHighPromotionModeActive(bool mode) { | 1482 void SetNewSpaceHighPromotionModeActive(bool mode) { |
| 1483 new_space_high_promotion_mode_active_ = mode; | 1483 new_space_high_promotion_mode_active_ = mode; |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 // Returns the allocation mode (pre-tenuring) based on observed promotion | 1486 // Returns the allocation mode (pre-tenuring) based on observed promotion |
| 1487 // rates of previous collections. | 1487 // rates of previous collections. |
| 1488 inline PretenureFlag GetPretenureMode() { | 1488 inline PretenureFlag GetPretenureMode() { |
| 1489 return FLAG_pretenuring && new_space_high_promotion_mode_active_ | 1489 return FLAG_pretenuring && new_space_high_promotion_mode_active_ |
| 1490 ? TENURED : NOT_TENURED; | 1490 ? TENURED : NOT_TENURED; |
| 1491 } | 1491 } |
| 1492 | 1492 |
| 1493 inline Address* NewSpaceHighPromotionModeActiveAddress() { | 1493 inline Address* NewSpaceHighPromotionModeActiveAddress() { |
| 1494 return reinterpret_cast<Address*>(&new_space_high_promotion_mode_active_); | 1494 return reinterpret_cast<Address*>(&new_space_high_promotion_mode_active_); |
| 1495 } | 1495 } |
| 1496 | 1496 |
| 1497 inline intptr_t PromotedTotalSize() { | 1497 inline intptr_t PromotedTotalSize() { |
| 1498 return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); | 1498 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); |
| 1499 if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt); |
| 1500 if (total < 0) return 0; |
| 1501 return static_cast<intptr_t>(total); |
| 1499 } | 1502 } |
| 1500 | 1503 |
| 1501 inline intptr_t OldGenerationSpaceAvailable() { | 1504 inline intptr_t OldGenerationSpaceAvailable() { |
| 1502 return old_generation_allocation_limit_ - PromotedTotalSize(); | 1505 return old_generation_allocation_limit_ - PromotedTotalSize(); |
| 1503 } | 1506 } |
| 1504 | 1507 |
| 1505 inline intptr_t OldGenerationCapacityAvailable() { | 1508 inline intptr_t OldGenerationCapacityAvailable() { |
| 1506 return max_old_generation_size_ - PromotedTotalSize(); | 1509 return max_old_generation_size_ - PromotedTotalSize(); |
| 1507 } | 1510 } |
| 1508 | 1511 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 int global_ic_age() { | 1776 int global_ic_age() { |
| 1774 return global_ic_age_; | 1777 return global_ic_age_; |
| 1775 } | 1778 } |
| 1776 | 1779 |
| 1777 void AgeInlineCaches() { | 1780 void AgeInlineCaches() { |
| 1778 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; | 1781 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
| 1779 } | 1782 } |
| 1780 | 1783 |
| 1781 bool flush_monomorphic_ics() { return flush_monomorphic_ics_; } | 1784 bool flush_monomorphic_ics() { return flush_monomorphic_ics_; } |
| 1782 | 1785 |
| 1783 intptr_t amount_of_external_allocated_memory() { | 1786 int64_t amount_of_external_allocated_memory() { |
| 1784 return amount_of_external_allocated_memory_; | 1787 return amount_of_external_allocated_memory_; |
| 1785 } | 1788 } |
| 1786 | 1789 |
| 1787 // ObjectStats are kept in two arrays, counts and sizes. Related stats are | 1790 // ObjectStats are kept in two arrays, counts and sizes. Related stats are |
| 1788 // stored in a contiguous linear buffer. Stats groups are stored one after | 1791 // stored in a contiguous linear buffer. Stats groups are stored one after |
| 1789 // another. | 1792 // another. |
| 1790 enum { | 1793 enum { |
| 1791 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | 1794 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, |
| 1792 FIRST_FIXED_ARRAY_SUB_TYPE = | 1795 FIRST_FIXED_ARRAY_SUB_TYPE = |
| 1793 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, | 1796 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 OldSpace* old_data_space_; | 1902 OldSpace* old_data_space_; |
| 1900 OldSpace* code_space_; | 1903 OldSpace* code_space_; |
| 1901 MapSpace* map_space_; | 1904 MapSpace* map_space_; |
| 1902 CellSpace* cell_space_; | 1905 CellSpace* cell_space_; |
| 1903 PropertyCellSpace* property_cell_space_; | 1906 PropertyCellSpace* property_cell_space_; |
| 1904 LargeObjectSpace* lo_space_; | 1907 LargeObjectSpace* lo_space_; |
| 1905 HeapState gc_state_; | 1908 HeapState gc_state_; |
| 1906 int gc_post_processing_depth_; | 1909 int gc_post_processing_depth_; |
| 1907 | 1910 |
| 1908 // Returns the amount of external memory registered since last global gc. | 1911 // Returns the amount of external memory registered since last global gc. |
| 1909 intptr_t PromotedExternalMemorySize(); | 1912 int64_t PromotedExternalMemorySize(); |
| 1910 | 1913 |
| 1911 unsigned int ms_count_; // how many mark-sweep collections happened | 1914 unsigned int ms_count_; // how many mark-sweep collections happened |
| 1912 unsigned int gc_count_; // how many gc happened | 1915 unsigned int gc_count_; // how many gc happened |
| 1913 | 1916 |
| 1914 // For post mortem debugging. | 1917 // For post mortem debugging. |
| 1915 static const int kRememberedUnmappedPages = 128; | 1918 static const int kRememberedUnmappedPages = 128; |
| 1916 int remembered_unmapped_pages_index_; | 1919 int remembered_unmapped_pages_index_; |
| 1917 Address remembered_unmapped_pages_[kRememberedUnmappedPages]; | 1920 Address remembered_unmapped_pages_[kRememberedUnmappedPages]; |
| 1918 | 1921 |
| 1919 // Total length of the strings we failed to flatten since the last GC. | 1922 // Total length of the strings we failed to flatten since the last GC. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 | 1956 |
| 1954 // Used to adjust the limits that control the timing of the next GC. | 1957 // Used to adjust the limits that control the timing of the next GC. |
| 1955 intptr_t size_of_old_gen_at_last_old_space_gc_; | 1958 intptr_t size_of_old_gen_at_last_old_space_gc_; |
| 1956 | 1959 |
| 1957 // Limit on the amount of externally allocated memory allowed | 1960 // Limit on the amount of externally allocated memory allowed |
| 1958 // between global GCs. If reached a global GC is forced. | 1961 // between global GCs. If reached a global GC is forced. |
| 1959 intptr_t external_allocation_limit_; | 1962 intptr_t external_allocation_limit_; |
| 1960 | 1963 |
| 1961 // The amount of external memory registered through the API kept alive | 1964 // The amount of external memory registered through the API kept alive |
| 1962 // by global handles | 1965 // by global handles |
| 1963 intptr_t amount_of_external_allocated_memory_; | 1966 int64_t amount_of_external_allocated_memory_; |
| 1964 | 1967 |
| 1965 // Caches the amount of external memory registered at the last global gc. | 1968 // Caches the amount of external memory registered at the last global gc. |
| 1966 intptr_t amount_of_external_allocated_memory_at_last_global_gc_; | 1969 int64_t amount_of_external_allocated_memory_at_last_global_gc_; |
| 1967 | 1970 |
| 1968 // Indicates that an allocation has failed in the old generation since the | 1971 // Indicates that an allocation has failed in the old generation since the |
| 1969 // last GC. | 1972 // last GC. |
| 1970 bool old_gen_exhausted_; | 1973 bool old_gen_exhausted_; |
| 1971 | 1974 |
| 1972 // Indicates that inline bump-pointer allocation has been globally disabled | 1975 // Indicates that inline bump-pointer allocation has been globally disabled |
| 1973 // for all spaces. This is used to disable allocations in generated code. | 1976 // for all spaces. This is used to disable allocations in generated code. |
| 1974 bool inline_allocation_disabled_; | 1977 bool inline_allocation_disabled_; |
| 1975 | 1978 |
| 1976 // Weak list heads, threaded through the objects. | 1979 // Weak list heads, threaded through the objects. |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3081 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3084 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 3082 | 3085 |
| 3083 private: | 3086 private: |
| 3084 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3087 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 3085 }; | 3088 }; |
| 3086 #endif // DEBUG | 3089 #endif // DEBUG |
| 3087 | 3090 |
| 3088 } } // namespace v8::internal | 3091 } } // namespace v8::internal |
| 3089 | 3092 |
| 3090 #endif // V8_HEAP_H_ | 3093 #endif // V8_HEAP_H_ |
| OLD | NEW |