diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-02 17:11:31 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-06 16:53:06 +0200 |
commit | 704fd8f3745527fc080f96e54e5ec1857c505399 (patch) | |
tree | bff68e8a731f3618d3e8f1708aa9de194bc1f612 /deps/v8/src/heap.h | |
parent | eec43351c44c0bec31a83e1a28be15e30722936a (diff) | |
download | node-new-704fd8f3745527fc080f96e54e5ec1857c505399.tar.gz |
v8: upgrade to v3.20.2
Diffstat (limited to 'deps/v8/src/heap.h')
-rw-r--r-- | deps/v8/src/heap.h | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/deps/v8/src/heap.h b/deps/v8/src/heap.h index da10efcee5..d254b607b6 100644 --- a/deps/v8/src/heap.h +++ b/deps/v8/src/heap.h @@ -60,6 +60,7 @@ namespace internal { V(Oddball, true_value, TrueValue) \ V(Oddball, false_value, FalseValue) \ V(Oddball, uninitialized_value, UninitializedValue) \ + V(Map, cell_map, CellMap) \ V(Map, global_property_cell_map, GlobalPropertyCellMap) \ V(Map, shared_function_info_map, SharedFunctionInfoMap) \ V(Map, meta_map, MetaMap) \ @@ -174,7 +175,7 @@ namespace internal { V(Code, js_entry_code, JsEntryCode) \ V(Code, js_construct_entry_code, JsConstructEntryCode) \ V(FixedArray, natives_source_cache, NativesSourceCache) \ - V(Object, last_script_id, LastScriptId) \ + V(Smi, last_script_id, LastScriptId) \ V(Script, empty_script, EmptyScript) \ V(Smi, real_stack_limit, RealStackLimit) \ V(NameDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ @@ -588,6 +589,9 @@ class Heap { OldSpace* code_space() { return code_space_; } MapSpace* map_space() { return map_space_; } CellSpace* cell_space() { return cell_space_; } + PropertyCellSpace* property_cell_space() { + return property_cell_space_; + } LargeObjectSpace* lo_space() { return lo_space_; } PagedSpace* paged_space(int idx) { switch (idx) { @@ -599,6 +603,8 @@ class Heap { return map_space(); case CELL_SPACE: return cell_space(); + case PROPERTY_CELL_SPACE: + return property_cell_space(); case CODE_SPACE: return code_space(); case NEW_SPACE: @@ -933,11 +939,17 @@ class Heap { // Please note this does not perform a garbage collection. MUST_USE_RESULT MaybeObject* AllocateSymbol(); + // Allocate a tenured simple cell. + // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation + // failed. + // Please note this does not perform a garbage collection. + MUST_USE_RESULT MaybeObject* AllocateCell(Object* value); + // Allocate a tenured JS global property cell. // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation // failed. // Please note this does not perform a garbage collection. - MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value); + MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value); // Allocate Box. MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, @@ -1428,9 +1440,6 @@ class Heap { roots_[kStoreBufferTopRootIndex] = reinterpret_cast<Smi*>(top); } - // Update the next script id. - inline void SetLastScriptId(Object* last_script_id); - // Generated code can embed this address to get access to the roots. Object** roots_array_start() { return roots_; } @@ -1861,7 +1870,7 @@ class Heap { enum { FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, FIRST_FIXED_ARRAY_SUB_TYPE = - FIRST_CODE_KIND_SUB_TYPE + Code::LAST_CODE_KIND + 1, + FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, OBJECT_STATS_COUNT = FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1 }; @@ -1873,7 +1882,7 @@ class Heap { object_sizes_[type] += size; } else { if (type == CODE_TYPE) { - ASSERT(sub_type <= Code::LAST_CODE_KIND); + ASSERT(sub_type < Code::NUMBER_OF_KINDS); object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++; object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size; } else if (type == FIXED_ARRAY_TYPE) { @@ -1946,7 +1955,7 @@ class Heap { int scan_on_scavenge_pages_; -#if defined(V8_TARGET_ARCH_X64) +#if V8_TARGET_ARCH_X64 static const int kMaxObjectSizeInNewSpace = 1024*KB; #else static const int kMaxObjectSizeInNewSpace = 512*KB; @@ -1958,6 +1967,7 @@ class Heap { OldSpace* code_space_; MapSpace* map_space_; CellSpace* cell_space_; + PropertyCellSpace* property_cell_space_; LargeObjectSpace* lo_space_; HeapState gc_state_; int gc_post_processing_depth_; @@ -2114,9 +2124,12 @@ class Heap { // (since both AllocateRaw and AllocateRawMap are inlined). MUST_USE_RESULT inline MaybeObject* AllocateRawMap(); - // Allocate an uninitialized object in the global property cell space. + // 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(); + // Initializes a JSObject based on its map. void InitializeJSObjectFromMap(JSObject* obj, FixedArray* properties, @@ -2176,6 +2189,9 @@ class Heap { void ProcessNativeContexts(WeakObjectRetainer* retainer, bool record_slots); void ProcessArrayBuffers(WeakObjectRetainer* retainer, bool record_slots); + // Called on heap tear-down. + void TearDownArrayBuffers(); + // Record statistics before and after garbage collection. void ReportStatisticsBeforeGC(); void ReportStatisticsAfterGC(); @@ -2277,7 +2293,6 @@ class Heap { void StartIdleRound() { mark_sweeps_since_idle_round_started_ = 0; - ms_count_at_last_idle_notification_ = ms_count_; } void FinishIdleRound() { @@ -2354,7 +2369,6 @@ class Heap { bool last_idle_notification_gc_count_init_; int mark_sweeps_since_idle_round_started_; - int ms_count_at_last_idle_notification_; unsigned int gc_count_at_last_idle_gc_; int scavenges_since_last_idle_round_; @@ -2437,6 +2451,8 @@ class HeapStats { int* size_per_type; // 22 int* os_error; // 23 int* end_marker; // 24 + intptr_t* property_cell_space_size; // 25 + intptr_t* property_cell_space_capacity; // 26 }; @@ -2936,6 +2952,10 @@ class TranscendentalCache { for (int i = 0; i < kNumberOfCaches; ++i) caches_[i] = NULL; } + ~TranscendentalCache() { + for (int i = 0; i < kNumberOfCaches; ++i) delete caches_[i]; + } + // Used to create an external reference. inline Address cache_array_address(); |