Update V8 to r3121 as required for WebKit update.
Change-Id: Ic53e0aef9a9eb9b71ee7d25a8aef61520bba899c
diff --git a/src/heap.h b/src/heap.h
index e878efc..cd49a8d 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -111,6 +111,13 @@
V(Map, undetectable_long_ascii_string_map, UndetectableLongAsciiStringMap) \
V(Map, byte_array_map, ByteArrayMap) \
V(Map, pixel_array_map, PixelArrayMap) \
+ V(Map, external_byte_array_map, ExternalByteArrayMap) \
+ V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \
+ V(Map, external_short_array_map, ExternalShortArrayMap) \
+ V(Map, external_unsigned_short_array_map, ExternalUnsignedShortArrayMap) \
+ V(Map, external_int_array_map, ExternalIntArrayMap) \
+ V(Map, external_unsigned_int_array_map, ExternalUnsignedIntArrayMap) \
+ V(Map, external_float_array_map, ExternalFloatArrayMap) \
V(Map, context_map, ContextMap) \
V(Map, catch_context_map, CatchContextMap) \
V(Map, code_map, CodeMap) \
@@ -228,7 +235,7 @@
public:
// Configure heap size before setup. Return false if the heap has been
// setup already.
- static bool ConfigureHeap(int semispace_size, int old_gen_size);
+ static bool ConfigureHeap(int max_semispace_size, int max_old_gen_size);
static bool ConfigureHeapDefault();
// Initializes the global object heap. If create_heap_objects is true,
@@ -247,19 +254,26 @@
// Returns whether Setup has been called.
static bool HasBeenSetup();
- // Returns the maximum heap capacity.
- static int MaxCapacity() {
- return young_generation_size_ + old_generation_size_;
+ // Returns the maximum amount of memory reserved for the heap. For
+ // the young generation, we reserve 4 times the amount needed for a
+ // semi space. The young generation consists of two semi spaces and
+ // we reserve twice the amount needed for those in order to ensure
+ // that new space can be aligned to its size.
+ static int MaxReserved() {
+ return 4 * reserved_semispace_size_ + max_old_generation_size_;
}
- static int SemiSpaceSize() { return semispace_size_; }
+ static int MaxSemiSpaceSize() { return max_semispace_size_; }
+ static int ReservedSemiSpaceSize() { return reserved_semispace_size_; }
static int InitialSemiSpaceSize() { return initial_semispace_size_; }
- static int YoungGenerationSize() { return young_generation_size_; }
- static int OldGenerationSize() { return old_generation_size_; }
+ static int MaxOldGenerationSize() { return max_old_generation_size_; }
// Returns the capacity of the heap in bytes w/o growing. Heap grows when
// more spaces are needed until it reaches the limit.
static int Capacity();
+ // Returns the amount of memory currently committed for the heap.
+ static int CommittedMemory();
+
// Returns the available bytes in space w/o growing.
// Heap doesn't guarantee that it can allocate an object that requires
// all available bytes. Check MaxHeapObjectSize() instead.
@@ -449,6 +463,15 @@
uint8_t* external_pointer,
PretenureFlag pretenure);
+ // Allocates an external array of the specified length and type.
+ // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
+ // failed.
+ // Please note this does not perform a garbage collection.
+ static Object* AllocateExternalArray(int length,
+ ExternalArrayType array_type,
+ void* external_pointer,
+ PretenureFlag pretenure);
+
// Allocate a tenured JS global property cell.
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
// failed.
@@ -637,9 +660,6 @@
static void GarbageCollectionPrologue();
static void GarbageCollectionEpilogue();
- // Code that should be executed after the garbage collection proper.
- static void PostGarbageCollectionProcessing();
-
// Performs garbage collection operation.
// Returns whether required_space bytes are available after the collection.
static bool CollectGarbage(int required_space, AllocationSpace space);
@@ -884,11 +904,15 @@
static Object* NumberToString(Object* number);
+ static Map* MapForExternalArrayType(ExternalArrayType array_type);
+ static RootListIndex RootIndexForExternalArrayType(
+ ExternalArrayType array_type);
+
private:
- static int semispace_size_;
+ static int reserved_semispace_size_;
+ static int max_semispace_size_;
static int initial_semispace_size_;
- static int young_generation_size_;
- static int old_generation_size_;
+ static int max_old_generation_size_;
static size_t code_range_size_;
// For keeping track of how much data has survived