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

Unified Diff: src/heap/heap.cc

Issue 1388133002: Revert of Changed scavenge GC to collect unmodified references (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/global-handles.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index d71e3951f5ac16391231198ce68bb5164ddc4c17..0144262863b161ae31557b183370a13d0eca1ce1 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1240,10 +1240,7 @@
GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL);
VMState<EXTERNAL> state(isolate_);
HandleScope handle_scope(isolate_);
- if (!(FLAG_scavenge_reclaim_unmodified_objects &&
- (gc_type == kGCTypeScavenge))) {
- CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags);
- }
+ CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags);
}
}
@@ -1328,10 +1325,7 @@
GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL);
VMState<EXTERNAL> state(isolate_);
HandleScope handle_scope(isolate_);
- if (!(FLAG_scavenge_reclaim_unmodified_objects &&
- (gc_type == kGCTypeScavenge))) {
- CallGCEpilogueCallbacks(gc_type, gc_callback_flags);
- }
+ CallGCEpilogueCallbacks(gc_type, gc_callback_flags);
}
}
@@ -1488,22 +1482,6 @@
static bool IsUnscavengedHeapObject(Heap* heap, Object** p) {
return heap->InNewSpace(*p) &&
!HeapObject::cast(*p)->map_word().IsForwardingAddress();
-}
-
-
-static bool IsUnmodifiedHeapObject(Object** p) {
- Object* object = *p;
- DCHECK(object->IsHeapObject());
- HeapObject* heap_object = HeapObject::cast(object);
- if (!object->IsJSObject()) return false;
- Object* obj_constructor = (JSObject::cast(object))->map()->GetConstructor();
- if (!obj_constructor->IsJSFunction()) return false;
- JSFunction* constructor = JSFunction::cast(obj_constructor);
- if (constructor != nullptr &&
- constructor->initial_map() == heap_object->map()) {
- return true;
- }
- return false;
}
@@ -1625,12 +1603,6 @@
promotion_queue_.Initialize();
ScavengeVisitor scavenge_visitor(this);
-
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- isolate()->global_handles()->IdentifyWeakUnmodifiedObjects(
- &IsUnmodifiedHeapObject);
- }
-
{
// Copy roots.
GCTracer::Scope gc_scope(tracer(), GCTracer::Scope::SCAVENGER_ROOTS);
@@ -1669,14 +1641,7 @@
new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
}
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- isolate()->global_handles()->MarkNewSpaceWeakUnmodifiedObjectsPending(
- &IsUnscavengedHeapObject);
-
- isolate()->global_handles()->IterateNewSpaceWeakUnmodifiedRoots(
- &scavenge_visitor);
- new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
- } else {
+ {
GCTracer::Scope gc_scope(tracer(),
GCTracer::Scope::SCAVENGER_OBJECT_GROUPS);
while (isolate()->global_handles()->IterateObjectGroups(
@@ -1685,14 +1650,14 @@
}
isolate()->global_handles()->RemoveObjectGroups();
isolate()->global_handles()->RemoveImplicitRefGroups();
-
- isolate()->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
- &IsUnscavengedHeapObject);
-
- isolate()->global_handles()->IterateNewSpaceWeakIndependentRoots(
- &scavenge_visitor);
- new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
- }
+ }
+
+ isolate()->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
+ &IsUnscavengedHeapObject);
+
+ isolate()->global_handles()->IterateNewSpaceWeakIndependentRoots(
+ &scavenge_visitor);
+ new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
UpdateNewSpaceReferencesInExternalStringTable(
&UpdateNewSpaceReferenceInExternalStringTableEntry);
« no previous file with comments | « src/global-handles.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698