diff options
author | isaacs <i@izs.me> | 2012-05-15 19:53:16 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-05-16 14:22:33 -0700 |
commit | 3f3f958c14cf4e963a73d6f037ac381c77fe78bb (patch) | |
tree | 391e35b59e76d038534fbd375f1bbe0dc55076cf /deps/v8/src/heap.h | |
parent | 4099d1eebae4e78864a6879c0b9e08f31d48d8cb (diff) | |
download | node-new-3f3f958c14cf4e963a73d6f037ac381c77fe78bb.tar.gz |
Upgrade V8 to 3.11.1
Diffstat (limited to 'deps/v8/src/heap.h')
-rw-r--r-- | deps/v8/src/heap.h | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/deps/v8/src/heap.h b/deps/v8/src/heap.h index 2bd037f15b..beb1bc511e 100644 --- a/deps/v8/src/heap.h +++ b/deps/v8/src/heap.h @@ -243,7 +243,8 @@ namespace internal { V(compare_ic_symbol, ".compare_ic") \ V(infinity_symbol, "Infinity") \ V(minus_infinity_symbol, "-Infinity") \ - V(hidden_stack_trace_symbol, "v8::hidden_stack_trace") + V(hidden_stack_trace_symbol, "v8::hidden_stack_trace") \ + V(query_colon_symbol, "(?:)") // Forward declarations. class GCTracer; @@ -529,6 +530,8 @@ class Heap { MUST_USE_RESULT MaybeObject* AllocateJSObject( JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED); + MUST_USE_RESULT MaybeObject* AllocateJSModule(); + // Allocate a JSArray with no elements MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( ElementsKind elements_kind, @@ -820,6 +823,10 @@ class Heap { // Allocate a global (but otherwise uninitialized) context. MUST_USE_RESULT MaybeObject* AllocateGlobalContext(); + // Allocate a module context. + MUST_USE_RESULT MaybeObject* AllocateModuleContext(Context* previous, + ScopeInfo* scope_info); + // Allocate a function context. MUST_USE_RESULT MaybeObject* AllocateFunctionContext(int length, JSFunction* function); @@ -1326,7 +1333,8 @@ class Heap { // Adjusts the amount of registered external memory. // Returns the adjusted value. - inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes); + inline intptr_t AdjustAmountOfExternalAllocatedMemory( + intptr_t change_in_bytes); // Allocate uninitialized fixed array. MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length); @@ -1334,7 +1342,7 @@ class Heap { PretenureFlag pretenure); inline intptr_t PromotedTotalSize() { - return PromotedSpaceSize() + PromotedExternalMemorySize(); + return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); } // True if we have reached the allocation limit in the old generation that @@ -1355,19 +1363,6 @@ class Heap { static const intptr_t kMinimumAllocationLimit = 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); - // When we sweep lazily we initially guess that there is no garbage on the - // heap and set the limits for the next GC accordingly. As we sweep we find - // out that some of the pages contained garbage and we have to adjust - // downwards the size of the heap. This means the limits that control the - // timing of the next GC also need to be adjusted downwards. - void LowerOldGenLimits(intptr_t adjustment) { - size_of_old_gen_at_last_old_space_gc_ -= adjustment; - old_gen_promotion_limit_ = - OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_); - old_gen_allocation_limit_ = - OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); - } - intptr_t OldGenPromotionLimit(intptr_t old_gen_size) { const int divisor = FLAG_stress_compaction ? 10 : 3; intptr_t limit = @@ -1411,6 +1406,12 @@ class Heap { kRootListLength }; + STATIC_CHECK(kUndefinedValueRootIndex == Internals::kUndefinedValueRootIndex); + STATIC_CHECK(kNullValueRootIndex == Internals::kNullValueRootIndex); + STATIC_CHECK(kTrueValueRootIndex == Internals::kTrueValueRootIndex); + STATIC_CHECK(kFalseValueRootIndex == Internals::kFalseValueRootIndex); + STATIC_CHECK(kempty_symbolRootIndex == Internals::kEmptySymbolRootIndex); + MUST_USE_RESULT MaybeObject* NumberToString( Object* number, bool check_number_string_cache = true); MUST_USE_RESULT MaybeObject* Uint32ToString( @@ -1442,6 +1443,8 @@ class Heap { inline bool NextGCIsLikelyToBeFull() { if (FLAG_gc_global) return true; + if (FLAG_stress_compaction && (gc_count_ & 1) != 0) return true; + intptr_t total_promoted = PromotedTotalSize(); intptr_t adjusted_promotion_limit = @@ -1452,7 +1455,7 @@ class Heap { intptr_t adjusted_allocation_limit = old_gen_allocation_limit_ - new_space_.Capacity() / 5; - if (PromotedSpaceSize() >= adjusted_allocation_limit) return true; + if (PromotedSpaceSizeOfObjects() >= adjusted_allocation_limit) return true; return false; } @@ -1490,7 +1493,6 @@ class Heap { GCTracer* tracer() { return tracer_; } // Returns the size of objects residing in non new spaces. - intptr_t PromotedSpaceSize(); intptr_t PromotedSpaceSizeOfObjects(); double total_regexp_code_generated() { return total_regexp_code_generated_; } @@ -1569,10 +1571,6 @@ class Heap { // The roots that have an index less than this are always in old space. static const int kOldSpaceRoots = 0x20; - bool idle_notification_will_schedule_next_gc() { - return idle_notification_will_schedule_next_gc_; - } - uint32_t HashSeed() { uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); ASSERT(FLAG_randomize_hashes || seed == 0); @@ -1609,6 +1607,8 @@ class Heap { // more expedient to get at the isolate directly from within Heap methods. Isolate* isolate_; + Object* roots_[kRootListLength]; + intptr_t code_range_size_; int reserved_semispace_size_; int max_semispace_size_; @@ -1650,7 +1650,7 @@ class Heap { int gc_post_processing_depth_; // Returns the amount of external memory registered since last global gc. - int PromotedExternalMemorySize(); + intptr_t PromotedExternalMemorySize(); int ms_count_; // how many mark-sweep collections happened unsigned int gc_count_; // how many gc happened @@ -1715,17 +1715,15 @@ class Heap { // The amount of external memory registered through the API kept alive // by global handles - int amount_of_external_allocated_memory_; + intptr_t amount_of_external_allocated_memory_; // Caches the amount of external memory registered at the last global gc. - int amount_of_external_allocated_memory_at_last_global_gc_; + intptr_t amount_of_external_allocated_memory_at_last_global_gc_; // Indicates that an allocation has failed in the old generation since the // last GC. int old_gen_exhausted_; - Object* roots_[kRootListLength]; - Object* global_contexts_list_; StoreBufferRebuilder store_buffer_rebuilder_; @@ -1978,13 +1976,6 @@ class Heap { return (scavenges_since_last_idle_round_ >= kIdleScavengeThreshold); } - bool WorthStartingGCWhenIdle() { - if (contexts_disposed_ > 0) { - return true; - } - return incremental_marking()->WorthActivating(); - } - // Estimates how many milliseconds a Mark-Sweep would take to complete. // In idle notification handler we assume that this function will return: // - a number less than 10 for small heaps, which are less than 8Mb. @@ -2033,7 +2024,6 @@ class Heap { unsigned int last_idle_notification_gc_count_; bool last_idle_notification_gc_count_init_; - bool idle_notification_will_schedule_next_gc_; int mark_sweeps_since_idle_round_started_; int ms_count_at_last_idle_notification_; unsigned int gc_count_at_last_idle_gc_; |