summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap.h')
-rw-r--r--deps/v8/src/heap.h53
1 files changed, 35 insertions, 18 deletions
diff --git a/deps/v8/src/heap.h b/deps/v8/src/heap.h
index fdc04a8ea..1f044441a 100644
--- a/deps/v8/src/heap.h
+++ b/deps/v8/src/heap.h
@@ -269,7 +269,7 @@ class Heap : public AllStatic {
return reinterpret_cast<Address>(&always_allocate_scope_depth_);
}
static bool linear_allocation() {
- return linear_allocation_scope_depth_ != 0;
+ return linear_allocation_scope_depth_ != 0;
}
static Address* NewSpaceAllocationTopAddress() {
@@ -804,9 +804,27 @@ class Heap : public AllStatic {
// Rebuild remembered set in old and map spaces.
static void RebuildRSets();
+ // Update an old object's remembered set
+ static int UpdateRSet(HeapObject* obj);
+
// Commits from space if it is uncommitted.
static void EnsureFromSpaceIsCommitted();
+ // Support for partial snapshots. After calling this we can allocate a
+ // certain number of bytes using only linear allocation (with a
+ // LinearAllocationScope and an AlwaysAllocateScope) without using freelists
+ // or causing a GC. It returns true of space was reserved or false if a GC is
+ // needed. For paged spaces the space requested must include the space wasted
+ // at the end of each page when allocating linearly.
+ static void ReserveSpace(
+ int new_space_size,
+ int pointer_space_size,
+ int data_space_size,
+ int code_space_size,
+ int map_space_size,
+ int cell_space_size,
+ int large_object_size);
+
//
// Support for the API.
//
@@ -820,9 +838,6 @@ class Heap : public AllStatic {
// Update the cache with a new number-string pair.
static void SetNumberStringCache(Object* number, String* str);
- // Entries in the cache. Must be a power of 2.
- static const int kNumberStringCacheSize = 64;
-
// Adjusts the amount of registered external memory.
// Returns the adjusted value.
static inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
@@ -837,11 +852,15 @@ class Heap : public AllStatic {
> old_gen_promotion_limit_;
}
+ static intptr_t OldGenerationSpaceAvailable() {
+ return old_gen_allocation_limit_ -
+ (PromotedSpaceSize() + PromotedExternalMemorySize());
+ }
+
// True if we have reached the allocation limit in the old generation that
// should artificially cause a GC right now.
static bool OldGenerationAllocationLimitReached() {
- return (PromotedSpaceSize() + PromotedExternalMemorySize())
- > old_gen_allocation_limit_;
+ return OldGenerationSpaceAvailable() < 0;
}
// Can be called when the embedding application is idle.
@@ -890,11 +909,6 @@ class Heap : public AllStatic {
static int linear_allocation_scope_depth_;
static bool context_disposed_pending_;
- // The number of MapSpace pages is limited by the way we pack
- // Map pointers during GC.
- static const int kMaxMapSpaceSize =
- (1 << (MapWord::kMapPageIndexBits)) * Page::kPageSize;
-
#if defined(V8_TARGET_ARCH_X64)
static const int kMaxObjectSizeInNewSpace = 512*KB;
#else
@@ -1060,9 +1074,9 @@ class Heap : public AllStatic {
// Helper function used by CopyObject to copy a source object to an
// allocated target object and update the forwarding pointer in the source
// object. Returns the target object.
- static HeapObject* MigrateObject(HeapObject* source,
- HeapObject* target,
- int size);
+ static inline HeapObject* MigrateObject(HeapObject* source,
+ 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
@@ -1078,9 +1092,6 @@ class Heap : public AllStatic {
static void ReportStatisticsAfterGC();
#endif
- // Update an old object's remembered set
- static int UpdateRSet(HeapObject* obj);
-
// Rebuild remembered set in an old space.
static void RebuildRSets(PagedSpace* space);
@@ -1103,6 +1114,12 @@ class Heap : public AllStatic {
SharedFunctionInfo* shared,
Object* prototype);
+
+ // Initializes the number to string cache based on the max semispace size.
+ static Object* InitializeNumberStringCache();
+ // Flush the number to string cache.
+ static void FlushNumberStringCache();
+
static const int kInitialSymbolTableSize = 2048;
static const int kInitialEvalCacheSize = 64;
@@ -1234,7 +1251,7 @@ class OldSpaces BASE_EMBEDDED {
// Space iterator for iterating over all the paged spaces of the heap:
-// Map space, old pointer space, old data space and code space.
+// Map space, old pointer space, old data space, code space and cell space.
// Returns each space in turn, and null when it is done.
class PagedSpaces BASE_EMBEDDED {
public: