Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 53088e289f4979a49e610a1d7c0ee1200a8736e2..c2a2707602e88eb60d3d7db3921796d66f0ef3aa 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -1014,8 +1014,6 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, |
} |
gc_post_processing_depth_--; |
- isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); |
- |
// Update relocatables. |
Relocatable::PostGarbageCollectionProcessing(); |
@@ -2008,6 +2006,7 @@ 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; |
@@ -2059,12 +2058,15 @@ class ScavengingVisitor : public StaticVisitorBase { |
} |
- template<ObjectContents object_contents, int alignment> |
+ template<ObjectContents object_contents, |
+ SizeRestriction size_restriction, |
+ int alignment> |
static inline void EvacuateObject(Map* map, |
HeapObject** slot, |
HeapObject* object, |
int object_size) { |
- SLOW_ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); |
+ SLOW_ASSERT((size_restriction != SMALL) || |
+ (object_size <= Page::kMaxNonCodeHeapObjectSize)); |
SLOW_ASSERT(object->Size() == object_size); |
int allocation_size = object_size; |
@@ -2077,11 +2079,17 @@ class ScavengingVisitor : public StaticVisitorBase { |
if (heap->ShouldBePromoted(object->address(), object_size)) { |
MaybeObject* maybe_result; |
- if (object_contents == DATA_OBJECT) { |
- maybe_result = heap->old_data_space()->AllocateRaw(allocation_size); |
+ if ((size_restriction != SMALL) && |
+ (allocation_size > Page::kMaxNonCodeHeapObjectSize)) { |
+ maybe_result = heap->lo_space()->AllocateRaw(allocation_size, |
+ NOT_EXECUTABLE); |
} else { |
- maybe_result = |
- heap->old_pointer_space()->AllocateRaw(allocation_size); |
+ if (object_contents == DATA_OBJECT) { |
+ maybe_result = heap->old_data_space()->AllocateRaw(allocation_size); |
+ } else { |
+ maybe_result = |
+ heap->old_pointer_space()->AllocateRaw(allocation_size); |
+ } |
} |
Object* result = NULL; // Initialization to please compiler. |
@@ -2155,8 +2163,10 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject** slot, |
HeapObject* object) { |
int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); |
- EvacuateObject<POINTER_OBJECT, kObjectAlignment>( |
- map, slot, object, object_size); |
+ EvacuateObject<POINTER_OBJECT, UNKNOWN_SIZE, kObjectAlignment>(map, |
+ slot, |
+ object, |
+ object_size); |
} |
@@ -2165,8 +2175,11 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* object) { |
int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); |
int object_size = FixedDoubleArray::SizeFor(length); |
- EvacuateObject<DATA_OBJECT, kDoubleAlignment>( |
- map, slot, object, object_size); |
+ EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kDoubleAlignment>( |
+ map, |
+ slot, |
+ object, |
+ object_size); |
} |
@@ -2174,7 +2187,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject** slot, |
HeapObject* object) { |
int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize(); |
- EvacuateObject<DATA_OBJECT, kObjectAlignment>( |
+ EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2184,7 +2197,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* object) { |
int object_size = SeqOneByteString::cast(object)-> |
SeqOneByteStringSize(map->instance_type()); |
- EvacuateObject<DATA_OBJECT, kObjectAlignment>( |
+ EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2194,7 +2207,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* object) { |
int object_size = SeqTwoByteString::cast(object)-> |
SeqTwoByteStringSize(map->instance_type()); |
- EvacuateObject<DATA_OBJECT, kObjectAlignment>( |
+ EvacuateObject<DATA_OBJECT, UNKNOWN_SIZE, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2238,7 +2251,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
} |
int object_size = ConsString::kSize; |
- EvacuateObject<POINTER_OBJECT, kObjectAlignment>( |
+ EvacuateObject<POINTER_OBJECT, SMALL, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2249,7 +2262,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
static inline void VisitSpecialized(Map* map, |
HeapObject** slot, |
HeapObject* object) { |
- EvacuateObject<object_contents, kObjectAlignment>( |
+ EvacuateObject<object_contents, SMALL, kObjectAlignment>( |
map, slot, object, object_size); |
} |
@@ -2257,7 +2270,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject** slot, |
HeapObject* object) { |
int object_size = map->instance_size(); |
- EvacuateObject<object_contents, kObjectAlignment>( |
+ EvacuateObject<object_contents, SMALL, kObjectAlignment>( |
map, slot, object, object_size); |
} |
}; |
@@ -3205,6 +3218,9 @@ bool Heap::CreateInitialObjects() { |
} |
set_observed_symbol(Symbol::cast(obj)); |
+ set_i18n_template_one(the_hole_value()); |
+ set_i18n_template_two(the_hole_value()); |
+ |
// Handling of script id generation is in Factory::NewScript. |
set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId)); |
@@ -6592,14 +6608,6 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) { |
} |
v->Synchronize(VisitorSynchronization::kGlobalHandles); |
- // Iterate over eternal handles. |
- if (mode == VISIT_ALL_IN_SCAVENGE) { |
- isolate_->eternal_handles()->IterateNewSpaceRoots(v); |
- } else { |
- isolate_->eternal_handles()->IterateAllRoots(v); |
- } |
- v->Synchronize(VisitorSynchronization::kEternalHandles); |
- |
// Iterate over pointers being held by inactive threads. |
isolate_->thread_manager()->Iterate(v); |
v->Synchronize(VisitorSynchronization::kThreadManager); |