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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 | 798 |
799 // Global inline caching age: it is incremented on some GCs after context | 799 // Global inline caching age: it is incremented on some GCs after context |
800 // disposal. We use it to flush inline caches. | 800 // disposal. We use it to flush inline caches. |
801 int global_ic_age() { return global_ic_age_; } | 801 int global_ic_age() { return global_ic_age_; } |
802 | 802 |
803 void AgeInlineCaches() { | 803 void AgeInlineCaches() { |
804 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; | 804 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
805 } | 805 } |
806 | 806 |
807 int64_t amount_of_external_allocated_memory() { | 807 int64_t amount_of_external_allocated_memory() { |
808 return amount_of_external_allocated_memory_; | 808 return amount_of_external_allocated_memory_.Value(); |
809 } | 809 } |
810 | 810 |
811 void update_amount_of_external_allocated_memory(int64_t delta) { | 811 void update_amount_of_external_allocated_memory(int64_t delta) { |
812 amount_of_external_allocated_memory_ += delta; | 812 amount_of_external_allocated_memory_.Increment(delta); |
813 } | 813 } |
814 | 814 |
815 void DeoptMarkedAllocationSites(); | 815 void DeoptMarkedAllocationSites(); |
816 | 816 |
817 bool DeoptMaybeTenuredAllocationSites() { | 817 bool DeoptMaybeTenuredAllocationSites() { |
818 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; | 818 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; |
819 } | 819 } |
820 | 820 |
821 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, | 821 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, |
822 Handle<DependentCode> dep); | 822 Handle<DependentCode> dep); |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 MUST_USE_RESULT AllocationResult InternalizeStringWithKey(HashTableKey* key); | 1967 MUST_USE_RESULT AllocationResult InternalizeStringWithKey(HashTableKey* key); |
1968 | 1968 |
1969 MUST_USE_RESULT AllocationResult InternalizeString(String* str); | 1969 MUST_USE_RESULT AllocationResult InternalizeString(String* str); |
1970 | 1970 |
1971 // =========================================================================== | 1971 // =========================================================================== |
1972 | 1972 |
1973 void set_force_oom(bool value) { force_oom_ = value; } | 1973 void set_force_oom(bool value) { force_oom_ = value; } |
1974 | 1974 |
1975 // The amount of external memory registered through the API kept alive | 1975 // The amount of external memory registered through the API kept alive |
1976 // by global handles | 1976 // by global handles |
1977 int64_t amount_of_external_allocated_memory_; | 1977 base::AtomicNumber<intptr_t> amount_of_external_allocated_memory_; |
1978 | 1978 |
1979 // Caches the amount of external memory registered at the last global gc. | 1979 // Caches the amount of external memory registered at the last global gc. |
1980 int64_t amount_of_external_allocated_memory_at_last_global_gc_; | 1980 intptr_t amount_of_external_allocated_memory_at_last_global_gc_; |
1981 | 1981 |
1982 // This can be calculated directly from a pointer to the heap; however, it is | 1982 // This can be calculated directly from a pointer to the heap; however, it is |
1983 // more expedient to get at the isolate directly from within Heap methods. | 1983 // more expedient to get at the isolate directly from within Heap methods. |
1984 Isolate* isolate_; | 1984 Isolate* isolate_; |
1985 | 1985 |
1986 Object* roots_[kRootListLength]; | 1986 Object* roots_[kRootListLength]; |
1987 | 1987 |
1988 size_t code_range_size_; | 1988 size_t code_range_size_; |
1989 int max_semi_space_size_; | 1989 int max_semi_space_size_; |
1990 int initial_semispace_size_; | 1990 int initial_semispace_size_; |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 friend class LargeObjectSpace; | 2644 friend class LargeObjectSpace; |
2645 friend class NewSpace; | 2645 friend class NewSpace; |
2646 friend class PagedSpace; | 2646 friend class PagedSpace; |
2647 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2647 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2648 }; | 2648 }; |
2649 | 2649 |
2650 } // namespace internal | 2650 } // namespace internal |
2651 } // namespace v8 | 2651 } // namespace v8 |
2652 | 2652 |
2653 #endif // V8_HEAP_HEAP_H_ | 2653 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |