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

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

Issue 1225733002: Reland concurrent sweeping of code space. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/frames.cc ('k') | src/heap/mark-compact.h » ('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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 case LO_SPACE: 502 case LO_SPACE:
503 return "large_object_space"; 503 return "large_object_space";
504 default: 504 default:
505 UNREACHABLE(); 505 UNREACHABLE();
506 } 506 }
507 return nullptr; 507 return nullptr;
508 } 508 }
509 509
510 510
511 void Heap::ClearAllICsByKind(Code::Kind kind) { 511 void Heap::ClearAllICsByKind(Code::Kind kind) {
512 // If concurrent sweeping is in progress, we have to wait for the sweeper
513 // threads before we iterate the heap.
514 if (mark_compact_collector()->sweeping_in_progress()) {
515 mark_compact_collector()->EnsureSweepingCompleted();
516 }
517 // TODO(mvstanton): Do not iterate the heap.
512 HeapObjectIterator it(code_space()); 518 HeapObjectIterator it(code_space());
513 519
514 for (Object* object = it.Next(); object != NULL; object = it.Next()) { 520 for (Object* object = it.Next(); object != NULL; object = it.Next()) {
515 Code* code = Code::cast(object); 521 Code* code = Code::cast(object);
516 Code::Kind current_kind = code->kind(); 522 Code::Kind current_kind = code->kind();
517 if (current_kind == Code::FUNCTION || 523 if (current_kind == Code::FUNCTION ||
518 current_kind == Code::OPTIMIZED_FUNCTION) { 524 current_kind == Code::OPTIMIZED_FUNCTION) {
519 code->ClearInlineCaches(kind); 525 code->ClearInlineCaches(kind);
520 } 526 }
521 } 527 }
(...skipping 4628 matching lines...) Expand 10 before | Expand all | Expand 10 after
5150 5156
5151 new_space_.Verify(); 5157 new_space_.Verify();
5152 5158
5153 old_space_->Verify(&visitor); 5159 old_space_->Verify(&visitor);
5154 map_space_->Verify(&visitor); 5160 map_space_->Verify(&visitor);
5155 5161
5156 VerifyPointersVisitor no_dirty_regions_visitor; 5162 VerifyPointersVisitor no_dirty_regions_visitor;
5157 code_space_->Verify(&no_dirty_regions_visitor); 5163 code_space_->Verify(&no_dirty_regions_visitor);
5158 5164
5159 lo_space_->Verify(); 5165 lo_space_->Verify();
5166
5167 mark_compact_collector_.VerifyWeakEmbeddedObjectsInCode();
5168 if (FLAG_omit_map_checks_for_leaf_maps) {
5169 mark_compact_collector_.VerifyOmittedMapChecks();
5170 }
5160 } 5171 }
5161 #endif 5172 #endif
5162 5173
5163 5174
5164 void Heap::ZapFromSpace() { 5175 void Heap::ZapFromSpace() {
5165 if (!new_space_.IsFromSpaceCommitted()) return; 5176 if (!new_space_.IsFromSpaceCommitted()) return;
5166 NewSpacePageIterator it(new_space_.FromSpaceStart(), 5177 NewSpacePageIterator it(new_space_.FromSpaceStart(),
5167 new_space_.FromSpaceEnd()); 5178 new_space_.FromSpaceEnd());
5168 while (it.has_next()) { 5179 while (it.has_next()) {
5169 NewSpacePage* page = it.next(); 5180 NewSpacePage* page = it.next();
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
6887 *object_type = "CODE_TYPE"; \ 6898 *object_type = "CODE_TYPE"; \
6888 *object_sub_type = "CODE_AGE/" #name; \ 6899 *object_sub_type = "CODE_AGE/" #name; \
6889 return true; 6900 return true;
6890 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6901 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6891 #undef COMPARE_AND_RETURN_NAME 6902 #undef COMPARE_AND_RETURN_NAME
6892 } 6903 }
6893 return false; 6904 return false;
6894 } 6905 }
6895 } // namespace internal 6906 } // namespace internal
6896 } // namespace v8 6907 } // namespace v8
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698