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

Unified Diff: src/heap/mark-compact.cc

Issue 1257653011: Filter out recorded slots of deoptimized code objects directly after deoptimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 878efd639e192c04147f8c583e045c90999b4fa7..f269cda6ffde716c9ef98d3526ea0af2b0a2a86b 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -293,8 +293,6 @@ void MarkCompactCollector::ClearInvalidSlotsBufferEntries(PagedSpace* space) {
void MarkCompactCollector::ClearInvalidStoreAndSlotsBufferEntries() {
heap_->store_buffer()->ClearInvalidStoreBufferEntries();
- RemoveDeoptimizedCodeSlots();
-
ClearInvalidSlotsBufferEntries(heap_->old_space());
ClearInvalidSlotsBufferEntries(heap_->code_space());
ClearInvalidSlotsBufferEntries(heap_->map_space());
@@ -769,7 +767,6 @@ void MarkCompactCollector::AbortCompaction() {
}
compacting_ = false;
evacuation_candidates_.Rewind(0);
- invalidated_code_.Rewind(0);
}
DCHECK_EQ(0, evacuation_candidates_.length());
}
@@ -3593,7 +3590,11 @@ void MarkCompactCollector::InvalidateCode(Code* code) {
MarkBit mark_bit = Marking::MarkBitFrom(code);
if (Marking::IsWhite(mark_bit)) return;
- invalidated_code_.Add(code);
+ // Ignore all slots that might have been recorded in the body of the
+ // deoptimized code object. Assumption: no slots will be recorded for
+ // this object after invalidating it.
+ RemoveObjectSlots(code->instruction_start(),
+ code->address() + code->Size());
}
}
@@ -3604,42 +3605,6 @@ bool MarkCompactCollector::WillBeDeoptimized(Code* code) {
}
-void MarkCompactCollector::RemoveDeoptimizedCodeSlots() {
- int length = invalidated_code_.length();
- for (int i = 0; i < length; i++) {
- Code* code = invalidated_code_[i];
- Page* p = Page::FromAddress(code->address());
- if (!p->IsEvacuationCandidate() &&
- !p->IsFlagSet(Page::RESCAN_ON_EVACUATION)) {
- // Ignore all slots that might have been recorded in the body of the
- // deoptimized code object.
- RemoveObjectSlots(code->instruction_start(),
- code->address() + code->Size());
- }
- }
-}
-
-
-void MarkCompactCollector::RemoveDeadInvalidatedCode() {
- int length = invalidated_code_.length();
- for (int i = 0; i < length; i++) {
- if (!IsMarked(invalidated_code_[i])) invalidated_code_[i] = NULL;
- }
-}
-
-
-void MarkCompactCollector::ProcessInvalidatedCode(ObjectVisitor* visitor) {
- int length = invalidated_code_.length();
- for (int i = 0; i < length; i++) {
- Code* code = invalidated_code_[i];
- if (code != NULL) {
- code->Iterate(visitor);
- }
- }
- invalidated_code_.Rewind(0);
-}
-
-
void MarkCompactCollector::RemoveObjectSlots(Address start_slot,
Address end_slot) {
// Remove entries by replacing them with an old-space slot containing a smi
@@ -3801,10 +3766,6 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
EvacuationWeakObjectRetainer evacuation_object_retainer;
heap()->ProcessAllWeakReferences(&evacuation_object_retainer);
- // Visit invalidated code (we ignored all slots on it) and clear mark-bits
- // under it.
- ProcessInvalidatedCode(&updating_visitor);
-
heap_->isolate()->inner_pointer_to_code_cache()->Flush();
slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_);
@@ -4434,8 +4395,6 @@ void MarkCompactCollector::SweepSpaces() {
}
}
- RemoveDeadInvalidatedCode();
-
EvacuateNewSpaceAndCandidates();
heap()->FreeDeadArrayBuffers(false);
« no previous file with comments | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698