Index: src/heap.h |
=================================================================== |
--- src/heap.h (revision 4401) |
+++ src/heap.h (working copy) |
@@ -202,6 +202,9 @@ |
class HeapStats; |
+typedef String* (*ExternalStringTableUpdaterCallback)(Object** pointer); |
+ |
+ |
// The all static Heap captures the interface to the global object heap. |
// All JavaScript contexts by this process share the same object heap. |
@@ -946,6 +949,30 @@ |
static void RecordStats(HeapStats* stats); |
+ // Copy block of memory from src to dst. Size of block should be aligned |
+ // by pointer size. |
+ static inline void CopyBlock(Object** dst, Object** src, int byte_size); |
+ |
+ // Optimized version of memmove for blocks with pointer size aligned sizes and |
+ // pointer size aligned addresses. |
+ static inline void MoveBlock(Object** dst, Object** src, size_t byte_size); |
+ |
+ // Check new space expansion criteria and expand semispaces if it was hit. |
+ static void CheckNewSpaceExpansionCriteria(); |
+ |
+ static inline void IncrementYoungSurvivorsCounter(int survived) { |
+ survived_since_last_expansion_ += survived; |
+ } |
+ |
+ static void UpdateNewSpaceReferencesInExternalStringTable( |
+ ExternalStringTableUpdaterCallback updater_func); |
+ |
+ // Helper function that governs the promotion policy from new space to |
+ // old. If the object's old address lies below the new space's age |
+ // mark or if we've already filled the bottom 1/16th of the to space, |
+ // we try to promote this object. |
+ static inline bool ShouldBePromoted(Address old_address, int object_size); |
+ |
static int MaxObjectSizeInNewSpace() { return kMaxObjectSizeInNewSpace; } |
private: |
@@ -1140,7 +1167,10 @@ |
// Performs a minor collection in new generation. |
static void Scavenge(); |
- static void ScavengeExternalStringTable(); |
+ |
+ static String* UpdateNewSpaceReferenceInExternalStringTableEntry( |
+ Object** pointer); |
+ |
static Address DoScavenge(ObjectVisitor* scavenge_visitor, |
Address new_space_front); |
@@ -1158,11 +1188,6 @@ |
HeapObject* target, |
int size); |
- // Helper function that governs the promotion policy from new space to |
- // old. If the object's old address lies below the new space's age |
- // mark or if we've already filled the bottom 1/16th of the to space, |
- // we try to promote this object. |
- static inline bool ShouldBePromoted(Address old_address, int object_size); |
#if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) |
// Record the copy of an object in the NewSpace's statistics. |
static void RecordCopiedObject(HeapObject* obj); |
@@ -1181,9 +1206,6 @@ |
// Slow part of scavenge object. |
static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
- // Copy memory from src to dst. |
- static inline void CopyBlock(Object** dst, Object** src, int byte_size); |
- |
// Initializes a function with a shared part and prototype. |
// Returns the function. |
// Note: this code was factored out of AllocateFunction such that |