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

Unified Diff: src/heap/objects-visiting-inl.h

Issue 1488593003: Optimize clearing of map transitions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment Created 5 years 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/objects-visiting.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
index fab6b802150e571af2e8126b8c0cd859e29070b3..8e96f339bdca230bb9f088d49a8a58673b30b654 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -359,9 +359,17 @@ void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map,
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitTransitionArray(
Map* map, HeapObject* object) {
- typedef FlexibleBodyVisitor<StaticVisitor, TransitionArray::BodyDescriptor,
- int> TransitionArrayBodyVisitor;
TransitionArray* array = TransitionArray::cast(object);
+ Heap* heap = array->GetHeap();
+ // Visit strong references.
+ if (array->HasPrototypeTransitions()) {
+ StaticVisitor::VisitPointer(heap, array,
+ array->GetPrototypeTransitionsSlot());
+ }
+ int num_transitions = TransitionArray::NumberOfTransitions(array);
+ for (int i = 0; i < num_transitions; ++i) {
+ StaticVisitor::VisitPointer(heap, array, array->GetKeySlot(i));
+ }
// Enqueue the array in linked list of encountered transition arrays if it is
// not already in the list.
if (array->next_link()->IsUndefined()) {
@@ -370,8 +378,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitTransitionArray(
UPDATE_WEAK_WRITE_BARRIER);
heap->set_encountered_transition_arrays(array);
}
- // TODO(ulan): Move MarkTransitionArray logic here.
- TransitionArrayBodyVisitor::Visit(map, object);
}
@@ -540,11 +546,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray(
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap,
Map* map) {
- Object* raw_transitions = map->raw_transitions();
- if (TransitionArray::IsFullTransitionArray(raw_transitions)) {
- MarkTransitionArray(heap, TransitionArray::cast(raw_transitions));
- }
-
// Since descriptor arrays are potentially shared, ensure that only the
// descriptors that belong to this map are marked. The first time a non-empty
// descriptor array is marked, its header is also visited. The slot holding
@@ -578,23 +579,6 @@ void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap,
template <typename StaticVisitor>
-void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray(
- Heap* heap, TransitionArray* transitions) {
- if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return;
-
- if (transitions->HasPrototypeTransitions()) {
- StaticVisitor::VisitPointer(heap, transitions,
- transitions->GetPrototypeTransitionsSlot());
- }
-
- int num_transitions = TransitionArray::NumberOfTransitions(transitions);
- for (int i = 0; i < num_transitions; ++i) {
- StaticVisitor::VisitPointer(heap, transitions, transitions->GetKeySlot(i));
- }
-}
-
-
-template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::MarkOptimizedCodeMap(
Heap* heap, FixedArray* code_map) {
if (!StaticVisitor::MarkObjectWithoutPush(heap, code_map)) return;
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698