| Index: src/heap.h
|
| diff --git a/src/heap.h b/src/heap.h
|
| index deb1e2616fa25092c930a9e29834450c09f34705..a0c85e5c7728e6df8dfbe6720a7070b0d5c85a93 100644
|
| --- a/src/heap.h
|
| +++ b/src/heap.h
|
| @@ -209,8 +209,10 @@ namespace internal {
|
| V(Boolean_string, "Boolean") \
|
| V(callee_string, "callee") \
|
| V(constructor_string, "constructor") \
|
| - V(result_string, ".result") \
|
| + V(dot_result_string, ".result") \
|
| V(dot_for_string, ".for.") \
|
| + V(dot_iterator_string, ".iterator") \
|
| + V(dot_generator_object_string, ".generator_object") \
|
| V(eval_string, "eval") \
|
| V(empty_string, "") \
|
| V(function_string, "function") \
|
| @@ -533,6 +535,13 @@ class Heap {
|
| // Returns the amount of phyical memory currently committed for the heap.
|
| size_t CommittedPhysicalMemory();
|
|
|
| + // Returns the maximum amount of memory ever committed for the heap.
|
| + intptr_t MaximumCommittedMemory() { return maximum_committed_; }
|
| +
|
| + // Updates the maximum committed memory for the heap. Should be called
|
| + // whenever a space grows.
|
| + void UpdateMaximumCommitted();
|
| +
|
| // 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.
|
| @@ -624,9 +633,6 @@ class Heap {
|
| JSFunction* constructor,
|
| Handle<AllocationSite> allocation_site);
|
|
|
| - MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject(
|
| - JSFunction* function);
|
| -
|
| MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context,
|
| ScopeInfo* scope_info);
|
|
|
| @@ -668,12 +674,6 @@ class Heap {
|
| MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source,
|
| AllocationSite* site = NULL);
|
|
|
| - // Allocates the function prototype.
|
| - // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| - // failed.
|
| - // Please note this does not perform a garbage collection.
|
| - MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function);
|
| -
|
| // Allocates a JS ArrayBuffer object.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| @@ -740,9 +740,6 @@ class Heap {
|
| MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type,
|
| int instance_size);
|
|
|
| - // Allocate a map for the specified function
|
| - MUST_USE_RESULT MaybeObject* AllocateInitialMap(JSFunction* fun);
|
| -
|
| // Allocates an empty code cache.
|
| MUST_USE_RESULT MaybeObject* AllocateCodeCache();
|
|
|
| @@ -767,6 +764,9 @@ class Heap {
|
| // Clear the Instanceof cache (used when a prototype changes).
|
| inline void ClearInstanceofCache();
|
|
|
| + // Iterates the whole code space to clear all ICs of the given kind.
|
| + void ClearAllICsByKind(Code::Kind kind);
|
| +
|
| // For use during bootup.
|
| void RepairFreeListsAfterBoot();
|
|
|
| @@ -881,6 +881,7 @@ class Heap {
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| MUST_USE_RESULT MaybeObject* AllocateSymbol();
|
| + MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol();
|
|
|
| // Allocate a tenured AllocationSite. It's payload is null
|
| MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
|
| @@ -1812,7 +1813,7 @@ class Heap {
|
| FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS,
|
| FIRST_CODE_AGE_SUB_TYPE =
|
| FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1,
|
| - OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kLastCodeAge + 1
|
| + OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kCodeAgeCount + 1
|
| };
|
|
|
| void RecordObjectStats(InstanceType type, size_t size) {
|
| @@ -1822,12 +1823,17 @@ class Heap {
|
| }
|
|
|
| void RecordCodeSubTypeStats(int code_sub_type, int code_age, size_t size) {
|
| - ASSERT(code_sub_type < Code::NUMBER_OF_KINDS);
|
| - ASSERT(code_age < Code::kLastCodeAge);
|
| - object_counts_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type]++;
|
| - object_sizes_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type] += size;
|
| - object_counts_[FIRST_CODE_AGE_SUB_TYPE + code_age]++;
|
| - object_sizes_[FIRST_CODE_AGE_SUB_TYPE + code_age] += size;
|
| + int code_sub_type_index = FIRST_CODE_KIND_SUB_TYPE + code_sub_type;
|
| + int code_age_index =
|
| + FIRST_CODE_AGE_SUB_TYPE + code_age - Code::kFirstCodeAge;
|
| + ASSERT(code_sub_type_index >= FIRST_CODE_KIND_SUB_TYPE &&
|
| + code_sub_type_index < FIRST_CODE_AGE_SUB_TYPE);
|
| + ASSERT(code_age_index >= FIRST_CODE_AGE_SUB_TYPE &&
|
| + code_age_index < OBJECT_STATS_COUNT);
|
| + object_counts_[code_sub_type_index]++;
|
| + object_sizes_[code_sub_type_index] += size;
|
| + object_counts_[code_age_index]++;
|
| + object_sizes_[code_age_index] += size;
|
| }
|
|
|
| void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) {
|
| @@ -1888,6 +1894,7 @@ class Heap {
|
| int initial_semispace_size_;
|
| intptr_t max_old_generation_size_;
|
| intptr_t max_executable_size_;
|
| + intptr_t maximum_committed_;
|
|
|
| // For keeping track of how much data has survived
|
| // scavenge since last new space expansion.
|
| @@ -2091,18 +2098,6 @@ class Heap {
|
| return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE;
|
| }
|
|
|
| - // Allocate an uninitialized object in map space. The behavior is identical
|
| - // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
|
| - // have to test the allocation space argument and (b) can reduce code size
|
| - // (since both AllocateRaw and AllocateRawMap are inlined).
|
| - MUST_USE_RESULT inline MaybeObject* AllocateRawMap();
|
| -
|
| - // Allocate an uninitialized object in the simple cell space.
|
| - MUST_USE_RESULT inline MaybeObject* AllocateRawCell();
|
| -
|
| - // Allocate an uninitialized object in the global property cell space.
|
| - MUST_USE_RESULT inline MaybeObject* AllocateRawPropertyCell();
|
| -
|
| // Allocate an uninitialized fixed array.
|
| MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(
|
| int length, PretenureFlag pretenure);
|
| @@ -2481,6 +2476,7 @@ class AlwaysAllocateScope {
|
| DisallowAllocationFailure disallow_allocation_failure_;
|
| };
|
|
|
| +
|
| #ifdef VERIFY_HEAP
|
| class NoWeakObjectVerificationScope {
|
| public:
|
|
|