Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: src/heap/heap.h

Issue 2256853003: [heap] Introduce hard limit for external memory (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/globals.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 void RememberUnmappedPage(Address page, bool compacted); 834 void RememberUnmappedPage(Address page, bool compacted);
835 835
836 // Global inline caching age: it is incremented on some GCs after context 836 // Global inline caching age: it is incremented on some GCs after context
837 // disposal. We use it to flush inline caches. 837 // disposal. We use it to flush inline caches.
838 int global_ic_age() { return global_ic_age_; } 838 int global_ic_age() { return global_ic_age_; }
839 839
840 void AgeInlineCaches() { 840 void AgeInlineCaches() {
841 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; 841 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax;
842 } 842 }
843 843
844 int64_t external_memory_hard_limit() { return MaxOldGenerationSize() / 2; }
845
844 int64_t external_memory() { return external_memory_; } 846 int64_t external_memory() { return external_memory_; }
845 void update_external_memory(int64_t delta) { external_memory_ += delta; } 847 void update_external_memory(int64_t delta) { external_memory_ += delta; }
846 848
847 void update_external_memory_concurrently_freed(intptr_t freed) { 849 void update_external_memory_concurrently_freed(intptr_t freed) {
848 external_memory_concurrently_freed_.Increment(freed); 850 external_memory_concurrently_freed_.Increment(freed);
849 } 851 }
850 852
851 void account_external_memory_concurrently_freed() { 853 void account_external_memory_concurrently_freed() {
852 external_memory_ -= external_memory_concurrently_freed_.Value(); 854 external_memory_ -= external_memory_concurrently_freed_.Value();
853 external_memory_concurrently_freed_.SetValue(0); 855 external_memory_concurrently_freed_.SetValue(0);
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 friend class LargeObjectSpace; 2729 friend class LargeObjectSpace;
2728 friend class NewSpace; 2730 friend class NewSpace;
2729 friend class PagedSpace; 2731 friend class PagedSpace;
2730 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2732 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2731 }; 2733 };
2732 2734
2733 } // namespace internal 2735 } // namespace internal
2734 } // namespace v8 2736 } // namespace v8
2735 2737
2736 #endif // V8_HEAP_HEAP_H_ 2738 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698