Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index c2a2707602e88eb60d3d7db3921796d66f0ef3aa..b96c3d224d6dce1eba67354ca6a3e46146163814 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -2006,7 +2006,6 @@ class ScavengingVisitor : public StaticVisitorBase { |
private: |
enum ObjectContents { DATA_OBJECT, POINTER_OBJECT }; |
- enum SizeRestriction { SMALL, UNKNOWN_SIZE }; |
static void RecordCopiedObject(Heap* heap, HeapObject* obj) { |
bool should_record = false; |
@@ -2058,15 +2057,12 @@ class ScavengingVisitor : public StaticVisitorBase { |
} |
- template<ObjectContents object_contents, |
- SizeRestriction size_restriction, |
- int alignment> |
+ template<ObjectContents object_contents, int alignment> |
static inline void EvacuateObject(Map* map, |
HeapObject** slot, |
HeapObject* object, |
int object_size) { |
- SLOW_ASSERT((size_restriction != SMALL) || |
- (object_size <= Page::kMaxNonCodeHeapObjectSize)); |
+ SLOW_ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); |
SLOW_ASSERT(object->Size() == object_size); |
int allocation_size = object_size; |
@@ -2079,17 +2075,11 @@ class ScavengingVisitor : public StaticVisitorBase { |
if (heap->ShouldBePromoted(object->address(), object_size)) { |
MaybeObject* maybe_result; |
- if ((size_restriction != SMALL) && |
- (allocation_size > Page::kMaxNonCodeHeapObjectSize)) { |
- maybe_result = heap->lo_space()->AllocateRaw(allocation_size, |
- NOT_EXECUTABLE); |
+ if (object_contents == DATA_OBJECT) { |
+ maybe_result = heap->old_data_space()->AllocateRaw(allocation_size); |
} else { |
- if (object_contents == DATA_OBJECT) { |
- maybe_result = heap->old_data_space()->AllocateRaw(allocation_size); |
- } else { |
- maybe_result = |
- heap->old_pointer_space()->AllocateRaw(allocation_size); |
- } |
+ maybe_result = |
+ heap->old_pointer_space()->AllocateRaw(allocation_size); |
} |
Object* result = NULL; // Initialization to please compiler. |
@@ -2163,10 +2153,8 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject** slot, |
HeapObject* object) { |
int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); |
- EvacuateObject<POINTER_OBJECT, UNKNOWN_SIZE, kObjectAlignment>(map, |
- slot, |
- object, |
- object_size); |
+ EvacuateObject<POINTER_OBJECT, kObjectAlignment>( |
+ map, slot, object, object_size); |
} |
@@ -2175,11 +2163,8 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* object) { |
int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
int object_size = FixedDoubleArray::SizeFor(length); |
- EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kDoubleAlignment>( |
- map, |
- slot, |
- object, |
- object_size); |
+ EvacuateObject<DATA_OBJECT, kDoubleAlignment>( |
+ map, slot, object, object_size); |
} |
@@ -2187,7 +2172,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject** slot, |
HeapObject* object) { |
int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
- EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kObjectAlignment>( |
+ EvacuateObject<DATA_OBJECT, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2197,7 +2182,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* object) { |
int object_size = SeqOneByteString::cast(object)-> |
SeqOneByteStringSize(map->instance_type()); |
- EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kObjectAlignment>( |
+ EvacuateObject<DATA_OBJECT, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2207,7 +2192,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* object) { |
int object_size = SeqTwoByteString::cast(object)-> |
SeqTwoByteStringSize(map->instance_type()); |
- EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kObjectAlignment>( |
+ EvacuateObject<DATA_OBJECT, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2251,7 +2236,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
} |
int object_size = ConsString::kSize; |
- EvacuateObject<POINTER_OBJECT, SMALL, kObjectAlignment>( |
+ EvacuateObject<POINTER_OBJECT, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2262,7 +2247,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
static inline void VisitSpecialized(Map* map, |
HeapObject** slot, |
HeapObject* object) { |
- EvacuateObject<object_contents, SMALL, kObjectAlignment>( |
+ EvacuateObject<object_contents, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2270,7 +2255,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject** slot, |
HeapObject* object) { |
int object_size = map->instance_size(); |
- EvacuateObject<object_contents, SMALL, kObjectAlignment>( |
+ EvacuateObject<object_contents, kObjectAlignment>( |
map, slot, object, object_size); |
} |
}; |