Index: src/heap/scavenger.cc |
diff --git a/src/heap/scavenger.cc b/src/heap/scavenger.cc |
index 59d04300e6f204cde5688d702c3256166eb8480f..7b0fec9d6bac85a7350f7d7c747a19293b235510 100644 |
--- a/src/heap/scavenger.cc |
+++ b/src/heap/scavenger.cc |
@@ -22,7 +22,7 @@ enum LoggingAndProfiling { |
enum MarksHandling { TRANSFER_MARKS, IGNORE_MARKS }; |
-template <MarksHandling marks_handling, PromotionMode promotion_mode, |
+template <MarksHandling marks_handling, |
LoggingAndProfiling logging_and_profiling_mode> |
class ScavengingVisitor : public StaticVisitorBase { |
public: |
@@ -206,8 +206,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
SLOW_DCHECK(object->Size() == object_size); |
Heap* heap = map->GetHeap(); |
- if (!heap->ShouldBePromoted<promotion_mode>(object->address(), |
- object_size)) { |
+ if (!heap->ShouldBePromoted(object->address(), object_size)) { |
// A semi-space copy may fail due to fragmentation. In that case, we |
// try to promote the object. |
if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) { |
@@ -219,9 +218,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
object_size)) { |
return; |
} |
- if (promotion_mode == PROMOTE_MARKED) { |
- FatalProcessOutOfMemory("Scavenger: promoting marked\n"); |
- } |
+ |
// If promotion failed, we try to copy the object to the other semi-space |
if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) return; |
@@ -358,21 +355,19 @@ class ScavengingVisitor : public StaticVisitorBase { |
static VisitorDispatchTable<ScavengingCallback> table_; |
}; |
-template <MarksHandling marks_handling, PromotionMode promotion_mode, |
+template <MarksHandling marks_handling, |
LoggingAndProfiling logging_and_profiling_mode> |
-VisitorDispatchTable<ScavengingCallback> ScavengingVisitor< |
- marks_handling, promotion_mode, logging_and_profiling_mode>::table_; |
+VisitorDispatchTable<ScavengingCallback> |
+ ScavengingVisitor<marks_handling, logging_and_profiling_mode>::table_; |
// static |
void Scavenger::Initialize() { |
- ScavengingVisitor<TRANSFER_MARKS, PROMOTE_MARKED, |
+ ScavengingVisitor<TRANSFER_MARKS, |
LOGGING_AND_PROFILING_DISABLED>::Initialize(); |
- ScavengingVisitor<IGNORE_MARKS, DEFAULT_PROMOTION, |
- LOGGING_AND_PROFILING_DISABLED>::Initialize(); |
- ScavengingVisitor<TRANSFER_MARKS, PROMOTE_MARKED, |
- LOGGING_AND_PROFILING_ENABLED>::Initialize(); |
- ScavengingVisitor<IGNORE_MARKS, DEFAULT_PROMOTION, |
+ ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize(); |
+ ScavengingVisitor<TRANSFER_MARKS, |
LOGGING_AND_PROFILING_ENABLED>::Initialize(); |
+ ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize(); |
} |
@@ -397,21 +392,21 @@ void Scavenger::SelectScavengingVisitorsTable() { |
if (!heap()->incremental_marking()->IsMarking()) { |
if (!logging_and_profiling) { |
scavenging_visitors_table_.CopyFrom( |
- ScavengingVisitor<IGNORE_MARKS, DEFAULT_PROMOTION, |
+ ScavengingVisitor<IGNORE_MARKS, |
LOGGING_AND_PROFILING_DISABLED>::GetTable()); |
} else { |
scavenging_visitors_table_.CopyFrom( |
- ScavengingVisitor<IGNORE_MARKS, DEFAULT_PROMOTION, |
+ ScavengingVisitor<IGNORE_MARKS, |
LOGGING_AND_PROFILING_ENABLED>::GetTable()); |
} |
} else { |
if (!logging_and_profiling) { |
scavenging_visitors_table_.CopyFrom( |
- ScavengingVisitor<TRANSFER_MARKS, PROMOTE_MARKED, |
+ ScavengingVisitor<TRANSFER_MARKS, |
LOGGING_AND_PROFILING_DISABLED>::GetTable()); |
} else { |
scavenging_visitors_table_.CopyFrom( |
- ScavengingVisitor<TRANSFER_MARKS, PROMOTE_MARKED, |
+ ScavengingVisitor<TRANSFER_MARKS, |
LOGGING_AND_PROFILING_ENABLED>::GetTable()); |
} |