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

Unified Diff: src/heap/heap.cc

Issue 1863983002: 🏄 [heap] Add page evacuation mode for new->old (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase on master Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 5232ba1649c326afa88be54de16acd211b935fc0..e3e386b78525f28a0d210259e2297cfa9df12792 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -6219,7 +6219,7 @@ void DescriptorLookupCache::Clear() {
for (int index = 0; index < kLength; index++) keys_[index].source = NULL;
}
-
+template <Heap::ExternalStringTable::CleanupMode mode>
void Heap::ExternalStringTable::CleanUp() {
int last = 0;
for (int i = 0; i < new_space_strings_.length(); ++i) {
@@ -6236,17 +6236,19 @@ void Heap::ExternalStringTable::CleanUp() {
new_space_strings_.Rewind(last);
new_space_strings_.Trim();
- last = 0;
- for (int i = 0; i < old_space_strings_.length(); ++i) {
- if (old_space_strings_[i] == heap_->the_hole_value()) {
- continue;
+ if (mode == CleanupMode::kFull) {
+ last = 0;
+ for (int i = 0; i < old_space_strings_.length(); ++i) {
+ if (old_space_strings_[i] == heap_->the_hole_value()) {
+ continue;
+ }
+ DCHECK(old_space_strings_[i]->IsExternalString());
+ DCHECK(!heap_->InNewSpace(old_space_strings_[i]));
+ old_space_strings_[last++] = old_space_strings_[i];
}
- DCHECK(old_space_strings_[i]->IsExternalString());
- DCHECK(!heap_->InNewSpace(old_space_strings_[i]));
- old_space_strings_[last++] = old_space_strings_[i];
+ old_space_strings_.Rewind(last);
+ old_space_strings_.Trim();
}
- old_space_strings_.Rewind(last);
- old_space_strings_.Trim();
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
Verify();
@@ -6254,6 +6256,10 @@ void Heap::ExternalStringTable::CleanUp() {
#endif
}
+template void Heap::ExternalStringTable::CleanUp<
+ Heap::ExternalStringTable::CleanupMode::kFull>();
+template void Heap::ExternalStringTable::CleanUp<
+ Heap::ExternalStringTable::CleanupMode::kPromoteOnly>();
void Heap::ExternalStringTable::TearDown() {
for (int i = 0; i < new_space_strings_.length(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698