49 #define STRONG_ROOT_LIST(V) \
50 V(Map, byte_array_map, ByteArrayMap) \
51 V(Map, free_space_map, FreeSpaceMap) \
52 V(Map, one_pointer_filler_map, OnePointerFillerMap) \
53 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
55 V(Smi, store_buffer_top, StoreBufferTop) \
56 V(Oddball, undefined_value, UndefinedValue) \
57 V(Oddball, the_hole_value, TheHoleValue) \
58 V(Oddball, null_value, NullValue) \
59 V(Oddball, true_value, TrueValue) \
60 V(Oddball, false_value, FalseValue) \
61 V(Map, global_property_cell_map, GlobalPropertyCellMap) \
62 V(Map, shared_function_info_map, SharedFunctionInfoMap) \
63 V(Map, meta_map, MetaMap) \
64 V(Map, ascii_symbol_map, AsciiSymbolMap) \
65 V(Map, ascii_string_map, AsciiStringMap) \
66 V(Map, heap_number_map, HeapNumberMap) \
67 V(Map, global_context_map, GlobalContextMap) \
68 V(Map, fixed_array_map, FixedArrayMap) \
69 V(Map, code_map, CodeMap) \
70 V(Map, scope_info_map, ScopeInfoMap) \
71 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
72 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
73 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
74 V(Map, hash_table_map, HashTableMap) \
75 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
76 V(ByteArray, empty_byte_array, EmptyByteArray) \
77 V(String, empty_string, EmptyString) \
78 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
79 V(Smi, stack_limit, StackLimit) \
80 V(Oddball, arguments_marker, ArgumentsMarker) \
84 V(FixedArray, number_string_cache, NumberStringCache) \
85 V(Object, instanceof_cache_function, InstanceofCacheFunction) \
86 V(Object, instanceof_cache_map, InstanceofCacheMap) \
87 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \
88 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
89 V(FixedArray, string_split_cache, StringSplitCache) \
90 V(Object, termination_exception, TerminationException) \
91 V(Smi, hash_seed, HashSeed) \
92 V(Map, string_map, StringMap) \
93 V(Map, symbol_map, SymbolMap) \
94 V(Map, cons_string_map, ConsStringMap) \
95 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \
96 V(Map, sliced_string_map, SlicedStringMap) \
97 V(Map, sliced_ascii_string_map, SlicedAsciiStringMap) \
98 V(Map, cons_symbol_map, ConsSymbolMap) \
99 V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \
100 V(Map, external_symbol_map, ExternalSymbolMap) \
101 V(Map, external_symbol_with_ascii_data_map, ExternalSymbolWithAsciiDataMap) \
102 V(Map, external_ascii_symbol_map, ExternalAsciiSymbolMap) \
103 V(Map, external_string_map, ExternalStringMap) \
104 V(Map, external_string_with_ascii_data_map, ExternalStringWithAsciiDataMap) \
105 V(Map, external_ascii_string_map, ExternalAsciiStringMap) \
106 V(Map, short_external_symbol_map, ShortExternalSymbolMap) \
108 short_external_symbol_with_ascii_data_map, \
109 ShortExternalSymbolWithAsciiDataMap) \
110 V(Map, short_external_ascii_symbol_map, ShortExternalAsciiSymbolMap) \
111 V(Map, short_external_string_map, ShortExternalStringMap) \
113 short_external_string_with_ascii_data_map, \
114 ShortExternalStringWithAsciiDataMap) \
115 V(Map, short_external_ascii_string_map, ShortExternalAsciiStringMap) \
116 V(Map, undetectable_string_map, UndetectableStringMap) \
117 V(Map, undetectable_ascii_string_map, UndetectableAsciiStringMap) \
118 V(Map, external_pixel_array_map, ExternalPixelArrayMap) \
119 V(Map, external_byte_array_map, ExternalByteArrayMap) \
120 V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \
121 V(Map, external_short_array_map, ExternalShortArrayMap) \
122 V(Map, external_unsigned_short_array_map, ExternalUnsignedShortArrayMap) \
123 V(Map, external_int_array_map, ExternalIntArrayMap) \
124 V(Map, external_unsigned_int_array_map, ExternalUnsignedIntArrayMap) \
125 V(Map, external_float_array_map, ExternalFloatArrayMap) \
126 V(Map, external_double_array_map, ExternalDoubleArrayMap) \
127 V(Map, non_strict_arguments_elements_map, NonStrictArgumentsElementsMap) \
128 V(Map, function_context_map, FunctionContextMap) \
129 V(Map, catch_context_map, CatchContextMap) \
130 V(Map, with_context_map, WithContextMap) \
131 V(Map, block_context_map, BlockContextMap) \
132 V(Map, module_context_map, ModuleContextMap) \
133 V(Map, oddball_map, OddballMap) \
134 V(Map, message_object_map, JSMessageObjectMap) \
135 V(Map, foreign_map, ForeignMap) \
136 V(HeapNumber, nan_value, NanValue) \
137 V(HeapNumber, infinity_value, InfinityValue) \
138 V(HeapNumber, minus_zero_value, MinusZeroValue) \
139 V(Map, neander_map, NeanderMap) \
140 V(JSObject, message_listeners, MessageListeners) \
141 V(Foreign, prototype_accessors, PrototypeAccessors) \
142 V(UnseededNumberDictionary, code_stubs, CodeStubs) \
143 V(UnseededNumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \
144 V(PolymorphicCodeCache, polymorphic_code_cache, PolymorphicCodeCache) \
145 V(Code, js_entry_code, JsEntryCode) \
146 V(Code, js_construct_entry_code, JsConstructEntryCode) \
147 V(FixedArray, natives_source_cache, NativesSourceCache) \
148 V(Object, last_script_id, LastScriptId) \
149 V(Script, empty_script, EmptyScript) \
150 V(Smi, real_stack_limit, RealStackLimit) \
151 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \
152 V(Smi, arguments_adaptor_deopt_pc_offset, ArgumentsAdaptorDeoptPCOffset) \
153 V(Smi, construct_stub_deopt_pc_offset, ConstructStubDeoptPCOffset)
155 #define ROOT_LIST(V) \
156 STRONG_ROOT_LIST(V) \
157 V(SymbolTable, symbol_table, SymbolTable)
159 #define SYMBOL_LIST(V) \
160 V(Array_symbol, "Array") \
161 V(Object_symbol, "Object") \
162 V(Proto_symbol, "__proto__") \
163 V(StringImpl_symbol, "StringImpl") \
164 V(arguments_symbol, "arguments") \
165 V(Arguments_symbol, "Arguments") \
166 V(call_symbol, "call") \
167 V(apply_symbol, "apply") \
168 V(caller_symbol, "caller") \
169 V(boolean_symbol, "boolean") \
170 V(Boolean_symbol, "Boolean") \
171 V(callee_symbol, "callee") \
172 V(constructor_symbol, "constructor") \
173 V(code_symbol, ".code") \
174 V(result_symbol, ".result") \
175 V(catch_var_symbol, ".catch-var") \
176 V(empty_symbol, "") \
177 V(eval_symbol, "eval") \
178 V(function_symbol, "function") \
179 V(length_symbol, "length") \
180 V(module_symbol, "module") \
181 V(name_symbol, "name") \
182 V(native_symbol, "native") \
183 V(null_symbol, "null") \
184 V(number_symbol, "number") \
185 V(Number_symbol, "Number") \
186 V(nan_symbol, "NaN") \
187 V(RegExp_symbol, "RegExp") \
188 V(source_symbol, "source") \
189 V(global_symbol, "global") \
190 V(ignore_case_symbol, "ignoreCase") \
191 V(multiline_symbol, "multiline") \
192 V(input_symbol, "input") \
193 V(index_symbol, "index") \
194 V(last_index_symbol, "lastIndex") \
195 V(object_symbol, "object") \
196 V(prototype_symbol, "prototype") \
197 V(string_symbol, "string") \
198 V(String_symbol, "String") \
199 V(Date_symbol, "Date") \
200 V(this_symbol, "this") \
201 V(to_string_symbol, "toString") \
202 V(char_at_symbol, "CharAt") \
203 V(undefined_symbol, "undefined") \
204 V(value_of_symbol, "valueOf") \
205 V(InitializeVarGlobal_symbol, "InitializeVarGlobal") \
206 V(InitializeConstGlobal_symbol, "InitializeConstGlobal") \
207 V(KeyedLoadElementMonomorphic_symbol, \
208 "KeyedLoadElementMonomorphic") \
209 V(KeyedStoreElementMonomorphic_symbol, \
210 "KeyedStoreElementMonomorphic") \
211 V(KeyedStoreAndGrowElementMonomorphic_symbol, \
212 "KeyedStoreAndGrowElementMonomorphic") \
213 V(stack_overflow_symbol, "kStackOverflowBoilerplate") \
214 V(illegal_access_symbol, "illegal access") \
215 V(out_of_memory_symbol, "out-of-memory") \
216 V(illegal_execution_state_symbol, "illegal execution state") \
217 V(get_symbol, "get") \
218 V(set_symbol, "set") \
219 V(function_class_symbol, "Function") \
220 V(illegal_argument_symbol, "illegal argument") \
221 V(MakeReferenceError_symbol, "MakeReferenceError") \
222 V(MakeSyntaxError_symbol, "MakeSyntaxError") \
223 V(MakeTypeError_symbol, "MakeTypeError") \
224 V(invalid_lhs_in_assignment_symbol, "invalid_lhs_in_assignment") \
225 V(invalid_lhs_in_for_in_symbol, "invalid_lhs_in_for_in") \
226 V(invalid_lhs_in_postfix_op_symbol, "invalid_lhs_in_postfix_op") \
227 V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \
228 V(illegal_return_symbol, "illegal_return") \
229 V(illegal_break_symbol, "illegal_break") \
230 V(illegal_continue_symbol, "illegal_continue") \
231 V(unknown_label_symbol, "unknown_label") \
232 V(redeclaration_symbol, "redeclaration") \
233 V(failure_symbol, "<failure>") \
234 V(space_symbol, " ") \
235 V(exec_symbol, "exec") \
236 V(zero_symbol, "0") \
237 V(global_eval_symbol, "GlobalEval") \
238 V(identity_hash_symbol, "v8::IdentityHash") \
239 V(closure_symbol, "(closure)") \
240 V(use_strict, "use strict") \
242 V(anonymous_function_symbol, "(anonymous function)") \
243 V(compare_ic_symbol, ".compare_ic") \
244 V(infinity_symbol, "Infinity") \
245 V(minus_infinity_symbol, "-Infinity") \
246 V(hidden_stack_trace_symbol, "v8::hidden_stack_trace") \
247 V(query_colon_symbol, "(?:)")
253 class WeakObjectRetainer;
256 typedef String* (*ExternalStringTableUpdaterCallback)(
Heap* heap,
262 : store_buffer_(store_buffer) {
274 Object*** start_of_current_page_;
285 class HeapDebugUtils;
304 delete emergency_stack_;
305 emergency_stack_ =
NULL;
311 return Page::FromAllocationTop(reinterpret_cast<Address>(rear_));
320 limit_ =
reinterpret_cast<intptr_t*
>(limit);
322 if (limit_ <= rear_) {
330 return (front_ == rear_) &&
331 (emergency_stack_ ==
NULL || emergency_stack_->length() == 0);
338 if (front_ == rear_) {
339 Entry e = emergency_stack_->RemoveLast();
352 *target =
reinterpret_cast<HeapObject*
>(*(--front_));
353 *size =
static_cast<int>(*(--front_));
356 reinterpret_cast<Address>(front_));
367 static const int kEntrySizeInWords = 2;
370 Entry(
HeapObject* obj,
int size) : obj_(obj), size_(size) { }
375 List<Entry>* emergency_stack_;
379 void RelocateQueueHead();
398 inline void Iterate(ObjectVisitor* v);
412 inline void Verify();
414 inline void AddOldString(
String*
string);
417 inline void ShrinkNewStrings(
int position);
440 intptr_t max_old_gen_size,
441 intptr_t max_executable_size);
447 bool SetUp(
bool create_heap_objects);
466 return 4 * reserved_semispace_size_ + max_old_generation_size_;
509 return reinterpret_cast<Address>(&always_allocate_scope_depth_);
512 return linear_allocation_scope_depth_ != 0;
691 uint32_t hash_field);
695 uint32_t hash_field);
699 uint32_t hash_field);
749 void* external_pointer,
878 Object* callee,
int length);
987 bool immovable =
false);
1040 const char* gc_reason,
1041 const char* collector_reason);
1047 const char* gc_reason =
NULL);
1082 scan_on_scavenge_pages_++;
1083 if (FLAG_gc_verbose) {
1084 PrintF(
"Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_);
1089 scan_on_scavenge_pages_--;
1090 if (FLAG_gc_verbose) {
1091 PrintF(
"Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_);
1099 void GarbageCollectionGreedyCheck();
1111 ASSERT((callback ==
NULL) ^ (global_gc_prologue_callback_ ==
NULL));
1112 global_gc_prologue_callback_ = callback;
1115 ASSERT((callback ==
NULL) ^ (global_gc_epilogue_callback_ ==
NULL));
1116 global_gc_epilogue_callback_ = callback;
1123 #define ROOT_ACCESSOR(type, name, camel_name) \
1125 return type::cast(roots_[k##camel_name##RootIndex]); \
1127 type* raw_unchecked_##name() { \
1128 return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \
1131 #undef ROOT_ACCESSOR
1134 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \
1135 Map* name##_map() { \
1136 return Map::cast(roots_[k##Name##MapRootIndex]); \
1139 #undef STRUCT_MAP_ACCESSOR
1141 #define SYMBOL_ACCESSOR(name, str) String* name() { \
1142 return String::cast(roots_[k##name##RootIndex]); \
1145 #undef SYMBOL_ACCESSOR
1152 global_contexts_list_ = object;
1195 roots_[kCodeStubsRootIndex] = value;
1202 return gc_safe_size_of_old_object_;
1207 roots_[kNonMonomorphicCacheRootIndex] = value;
1211 roots_[kEmptyScriptRootIndex] = script;
1215 roots_[kStoreBufferTopRootIndex] =
reinterpret_cast<Smi*
>(top);
1225 return reinterpret_cast<Address*
>(&roots_[kStoreBufferTopRootIndex]);
1230 return &global_contexts_list_;
1235 void PrintHandles();
1242 void VerifyNoAccessorPairSharing();
1244 void OldPointerSpaceCheckStoreBuffer();
1245 void MapSpaceCheckStoreBuffer();
1246 void LargeObjectSpaceCheckStoreBuffer();
1249 void ReportHeapStatistics(
const char* title);
1250 void ReportCodeStatistics(
const char* title);
1253 void ZapFromSpace();
1264 const char* str,
int length,
int hash);
1285 bool IsAllocationAllowed() {
return allocation_allowed_; }
1286 inline bool allow_allocation(
bool enable);
1288 bool disallow_allocation_failure() {
1289 return disallow_allocation_failure_;
1292 void TracePathToObject(
Object* target);
1293 void TracePathToGlobal();
1301 static inline void ScavengeObject(HeapObject** p, HeapObject*
object);
1314 int pointer_space_size,
1315 int data_space_size,
1316 int code_space_size,
1318 int cell_space_size,
1319 int large_object_size);
1337 intptr_t change_in_bytes);
1367 const int divisor = FLAG_stress_compaction ? 10 : 3;
1371 limit *= old_gen_limit_factor_;
1372 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
1373 return Min(limit, halfway_to_the_max);
1377 const int divisor = FLAG_stress_compaction ? 8 : 2;
1381 limit *= old_gen_limit_factor_;
1382 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
1383 return Min(limit, halfway_to_the_max);
1391 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
1393 #undef ROOT_INDEX_DECLARATION
1396 #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex,
1398 #undef DECLARE_STRUCT_MAP
1400 #define SYMBOL_INDEX_DECLARATION(name, str) k##name##RootIndex,
1402 #undef SYMBOL_DECLARATION
1416 Object* number,
bool check_number_string_cache =
true);
1418 uint32_t value,
bool check_number_string_cache =
true);
1439 young_survivors_after_last_gc_ = survived;
1440 survived_since_last_expansion_ += survived;
1444 if (FLAG_gc_global)
return true;
1446 if (FLAG_stress_compaction && (gc_count_ & 1) != 0)
return true;
1450 intptr_t adjusted_promotion_limit =
1451 old_gen_promotion_limit_ - new_space_.
Capacity();
1453 if (total_promoted >= adjusted_promotion_limit)
return true;
1455 intptr_t adjusted_allocation_limit =
1456 old_gen_allocation_limit_ - new_space_.
Capacity() / 5;
1488 if (FLAG_cleanup_code_caches_at_gc) {
1500 total_regexp_code_generated_ += size;
1513 return &mark_compact_collector_;
1517 return &store_buffer_;
1525 return &incremental_marking_;
1536 return sweeping_complete;
1540 return &external_string_table_;
1545 return sweep_generation_;
1551 if (global_gc_prologue_callback_ !=
NULL) global_gc_prologue_callback_();
1555 if (global_gc_epilogue_callback_ !=
NULL) global_gc_epilogue_callback_();
1561 scavenging_visitors_table_.
GetVisitor(map)(map, slot, obj);
1575 uint32_t
seed =
static_cast<uint32_t
>(hash_seed()->value());
1576 ASSERT(FLAG_randomize_hashes || seed == 0);
1582 set_arguments_adaptor_deopt_pc_offset(
Smi::FromInt(pc_offset));
1587 set_construct_stub_deopt_pc_offset(
Smi::FromInt(pc_offset));
1596 return global_ic_age_;
1612 intptr_t code_range_size_;
1613 int reserved_semispace_size_;
1614 int max_semispace_size_;
1615 int initial_semispace_size_;
1616 intptr_t max_old_generation_size_;
1617 intptr_t max_executable_size_;
1621 int survived_since_last_expansion_;
1624 int sweep_generation_;
1626 int always_allocate_scope_depth_;
1627 int linear_allocation_scope_depth_;
1630 int contexts_disposed_;
1634 int scan_on_scavenge_pages_;
1636 #if defined(V8_TARGET_ARCH_X64)
1637 static const int kMaxObjectSizeInNewSpace = 1024*
KB;
1639 static const int kMaxObjectSizeInNewSpace = 512*
KB;
1650 int gc_post_processing_depth_;
1653 intptr_t PromotedExternalMemorySize();
1656 unsigned int gc_count_;
1659 static const int kRememberedUnmappedPages = 128;
1660 int remembered_unmapped_pages_index_;
1661 Address remembered_unmapped_pages_[kRememberedUnmappedPages];
1664 int unflattened_strings_length_;
1666 #define ROOT_ACCESSOR(type, name, camel_name) \
1667 inline void set_##name(type* value) { \
1670 ASSERT(k##camel_name##RootIndex >= kOldSpaceRoots || !InNewSpace(value)); \
1671 roots_[k##camel_name##RootIndex] = value; \
1674 #undef ROOT_ACCESSOR
1677 bool allocation_allowed_;
1682 int allocation_timeout_;
1686 bool disallow_allocation_failure_;
1688 HeapDebugUtils* debug_utils_;
1693 bool new_space_high_promotion_mode_active_;
1698 intptr_t old_gen_promotion_limit_;
1703 intptr_t old_gen_allocation_limit_;
1707 int old_gen_limit_factor_;
1710 intptr_t size_of_old_gen_at_last_old_space_gc_;
1714 intptr_t external_allocation_limit_;
1718 intptr_t amount_of_external_allocated_memory_;
1721 intptr_t amount_of_external_allocated_memory_at_last_global_gc_;
1725 int old_gen_exhausted_;
1727 Object* global_contexts_list_;
1729 StoreBufferRebuilder store_buffer_rebuilder_;
1731 struct StringTypeTable {
1737 struct ConstantSymbolTable {
1738 const char* contents;
1742 struct StructTable {
1748 static const StringTypeTable string_type_table[];
1749 static const ConstantSymbolTable constant_symbol_table[];
1750 static const StructTable struct_table[];
1754 String* hidden_symbol_;
1758 struct GCPrologueCallbackPair {
1760 : callback(callback), gc_type(gc_type) {
1762 bool operator==(
const GCPrologueCallbackPair& pair)
const {
1763 return pair.callback == callback;
1768 List<GCPrologueCallbackPair> gc_prologue_callbacks_;
1770 struct GCEpilogueCallbackPair {
1772 : callback(callback), gc_type(gc_type) {
1774 bool operator==(
const GCEpilogueCallbackPair& pair)
const {
1775 return pair.callback == callback;
1780 List<GCEpilogueCallbackPair> gc_epilogue_callbacks_;
1787 static int GcSafeSizeOfOldObject(HeapObject*
object);
1790 void MarkMapPointersAsEncoded(
bool encoded) {
1792 gc_safe_size_of_old_object_ = &GcSafeSizeOfOldObject;
1797 const char** reason);
1806 inline void UpdateOldSpaceLimits();
1818 void InitializeJSObjectFromMap(JSObject* obj,
1819 FixedArray* properties,
1822 bool CreateInitialMaps();
1823 bool CreateInitialObjects();
1827 NO_INLINE(
void CreateJSEntryStub());
1828 NO_INLINE(
void CreateJSConstructEntryStub());
1830 void CreateFixedStubs();
1832 MaybeObject* CreateOddball(
const char* to_string,
1850 static String* UpdateNewSpaceReferenceInExternalStringTableEntry(
1854 Address DoScavenge(ObjectVisitor* scavenge_visitor,
Address new_space_front);
1855 static void ScavengeStoreBufferCallback(Heap* heap,
1863 void MarkCompactPrologue();
1866 void ReportStatisticsBeforeGC();
1867 void ReportStatisticsAfterGC();
1870 static void ScavengeObjectSlow(HeapObject** p, HeapObject*
object);
1877 inline void InitializeFunction(
1878 JSFunction*
function,
1879 SharedFunctionInfo* shared,
1883 double total_regexp_code_generated_;
1891 void AllocateFullSizeNumberStringCache();
1894 int FullSizeNumberStringCacheLength();
1896 void FlushNumberStringCache();
1898 void UpdateSurvivalRateTrend(
int start_new_space_size);
1900 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
1902 static const int kYoungSurvivalRateHighThreshold = 90;
1903 static const int kYoungSurvivalRateLowThreshold = 10;
1904 static const int kYoungSurvivalRateAllowedDeviation = 15;
1906 int young_survivors_after_last_gc_;
1907 int high_survival_rate_period_length_;
1908 int low_survival_rate_period_length_;
1909 double survival_rate_;
1910 SurvivalRateTrend previous_survival_rate_trend_;
1911 SurvivalRateTrend survival_rate_trend_;
1913 void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) {
1914 ASSERT(survival_rate_trend != FLUCTUATING);
1915 previous_survival_rate_trend_ = survival_rate_trend_;
1916 survival_rate_trend_ = survival_rate_trend;
1919 SurvivalRateTrend survival_rate_trend() {
1920 if (survival_rate_trend_ == STABLE) {
1922 }
else if (previous_survival_rate_trend_ == STABLE) {
1923 return survival_rate_trend_;
1924 }
else if (survival_rate_trend_ != previous_survival_rate_trend_) {
1927 return survival_rate_trend_;
1931 bool IsStableOrIncreasingSurvivalTrend() {
1932 switch (survival_rate_trend()) {
1941 bool IsStableOrDecreasingSurvivalTrend() {
1942 switch (survival_rate_trend()) {
1951 bool IsIncreasingSurvivalTrend() {
1952 return survival_rate_trend() == INCREASING;
1955 bool IsHighSurvivalRate() {
1956 return high_survival_rate_period_length_ > 0;
1959 bool IsLowSurvivalRate() {
1960 return low_survival_rate_period_length_ > 0;
1963 void SelectScavengingVisitorsTable();
1965 void StartIdleRound() {
1966 mark_sweeps_since_idle_round_started_ = 0;
1967 ms_count_at_last_idle_notification_ = ms_count_;
1970 void FinishIdleRound() {
1971 mark_sweeps_since_idle_round_started_ = kMaxMarkSweepsInIdleRound;
1972 scavenges_since_last_idle_round_ = 0;
1975 bool EnoughGarbageSinceLastIdleRound() {
1976 return (scavenges_since_last_idle_round_ >= kIdleScavengeThreshold);
1983 int TimeMarkSweepWouldTakeInMs() {
1985 static const int kMbPerMs = 2;
1988 return heap_size_mb / kMbPerMs;
1992 bool IdleGlobalGC();
1994 void AdvanceIdleIncrementalMarking(intptr_t step_size);
1997 static const int kInitialSymbolTableSize = 2048;
1998 static const int kInitialEvalCacheSize = 64;
1999 static const int kInitialNumberStringCacheSize = 256;
2005 intptr_t max_alive_after_gc_;
2008 int min_in_mutator_;
2011 intptr_t alive_after_last_gc_;
2013 double last_gc_end_timestamp_;
2017 StoreBuffer store_buffer_;
2021 IncrementalMarking incremental_marking_;
2023 int number_idle_notifications_;
2024 unsigned int last_idle_notification_gc_count_;
2025 bool last_idle_notification_gc_count_init_;
2027 int mark_sweeps_since_idle_round_started_;
2028 int ms_count_at_last_idle_notification_;
2029 unsigned int gc_count_at_last_idle_gc_;
2030 int scavenges_since_last_idle_round_;
2032 static const int kMaxMarkSweepsInIdleRound = 7;
2033 static const int kIdleScavengeThreshold = 5;
2036 PromotionQueue promotion_queue_;
2042 ExternalStringTable external_string_table_;
2044 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_;
2046 MemoryChunk* chunks_queued_for_free_;
2116 class VerifyPointersVisitor:
public ObjectVisitor {
2118 inline void VisitPointers(
Object** start,
Object** end);
2198 explicit HeapIterator(HeapObjectsFiltering filtering);
2211 HeapObjectsFiltering filtering_;
2246 for (
int i = 0; i <
kLength; ++i) {
2247 keys_[i].map =
NULL;
2248 keys_[i].name =
NULL;
2253 static inline int Hash(Map* map,
String* name);
2258 return reinterpret_cast<Address>(&keys_);
2261 Address field_offsets_address() {
2262 return reinterpret_cast<Address>(&field_offsets_);
2288 if (!StringShape(name).IsSymbol())
return kAbsent;
2289 int index = Hash(array, name);
2290 Key& key = keys_[index];
2291 if ((key.array == array) && (key.name == name))
return results_[index];
2298 if (StringShape(name).IsSymbol()) {
2299 int index = Hash(array, name);
2300 Key& key = keys_[index];
2303 results_[index] = result;
2314 for (
int i = 0; i < kLength; ++i) {
2315 keys_[i].array =
NULL;
2316 keys_[i].name =
NULL;
2323 uint32_t array_hash =
2324 static_cast<uint32_t
>(
reinterpret_cast<uintptr_t
>(array)) >> 2;
2325 uint32_t name_hash =
2326 static_cast<uint32_t
>(
reinterpret_cast<uintptr_t
>(
name)) >> 2;
2327 return (array_hash ^ name_hash) % kLength;
2330 static const int kLength = 64;
2332 DescriptorArray* array;
2337 int results_[kLength];
2345 class DisallowAllocationFailure {
2347 inline DisallowAllocationFailure();
2348 inline ~DisallowAllocationFailure();
2399 MC_UPDATE_NEW_TO_NEW_POINTERS,
2400 MC_UPDATE_ROOT_TO_NEW_POINTERS,
2401 MC_UPDATE_OLD_TO_NEW_POINTERS,
2402 MC_UPDATE_POINTERS_TO_EVACUATED,
2403 MC_UPDATE_POINTERS_BETWEEN_EVACUATED,
2404 MC_UPDATE_MISC_POINTERS,
2409 Scope(GCTracer* tracer, ScopeId scope)
2416 ASSERT(scope_ < kNumberOfScopes);
2426 explicit GCTracer(Heap* heap,
2427 const char* gc_reason,
2428 const char* collector_reason);
2441 promoted_objects_size_ += object_size;
2446 const char* CollectorString();
2449 inline double SizeOfHeapObjects();
2455 intptr_t start_object_size_;
2458 intptr_t start_memory_size_;
2465 unsigned int gc_count_;
2471 double scopes_[Scope::kNumberOfScopes];
2475 intptr_t in_free_list_or_wasted_before_gc_;
2479 intptr_t allocated_since_last_gc_;
2483 double spent_in_mutator_;
2486 intptr_t promoted_objects_size_;
2491 double longest_step_;
2492 int steps_count_since_last_gc_;
2493 double steps_took_since_last_gc_;
2497 const char* gc_reason_;
2498 const char* collector_reason_;
2514 static const int kArrayEntriesPerCacheEntry = 4;
2515 static const int kStringOffset = 0;
2516 static const int kPatternOffset = 1;
2517 static const int kArrayOffset = 2;
2519 static MaybeObject* WrapFixedArrayInJSArray(
Object* fixed_array);
2539 static const int kCacheSize = 512;
2541 explicit SubCache(
Type t);
2545 inline double Calculate(
double input);
2554 uint32_t integers[2];
2557 inline static int Hash(
const Converter& c) {
2558 uint32_t hash = (c.integers[0] ^ c.integers[1]);
2559 hash ^=
static_cast<int32_t>(hash) >> 16;
2560 hash ^=
static_cast<int32_t>(hash) >> 8;
2561 return (hash & (kCacheSize - 1));
2564 Element elements_[kCacheSize];
2573 friend class TranscendentalCache;
2578 TranscendentalCache() {
2583 inline Address cache_array_address();
2619 return (object->
map_word().ToRawValue() & kNotMarkedBit) == 0;
2623 uintptr_t map_word =
object->map_word().ToRawValue();
2624 object->set_map_word(MapWord::FromRawValue(map_word | kNotMarkedBit));
2629 uintptr_t map_word =
object->map_word().ToRawValue();
2630 object->set_map_word(MapWord::FromRawValue(map_word & ~kNotMarkedBit));
2635 uintptr_t map_word =
object->
map_word().ToRawValue();
2636 return MapWord::FromRawValue(map_word | kNotMarkedBit).ToMap();
2644 static const uintptr_t kNotMarkedBit = 0x1;
2649 #if defined(DEBUG) || defined(LIVE_OBJECT_LIST)
2653 class PathTracer :
public ObjectVisitor {
2663 PathTracer(
Object* search_target,
2664 WhatToFind what_to_find,
2666 : search_target_(search_target),
2667 found_target_(
false),
2668 found_target_in_trace_(
false),
2669 what_to_find_(what_to_find),
2670 visit_mode_(visit_mode),
2674 virtual void VisitPointers(
Object** start,
Object** end);
2677 void TracePathFrom(
Object** root);
2679 bool found()
const {
return found_target_; }
2681 static Object*
const kAnyGlobalObject;
2685 class UnmarkVisitor;
2687 void MarkRecursively(
Object** p, MarkVisitor* mark_visitor);
2688 void UnmarkRecursively(
Object** p, UnmarkVisitor* unmark_visitor);
2689 virtual void ProcessResults();
2692 static const int kMarkTag = 2;
2696 bool found_target_in_trace_;
2697 WhatToFind what_to_find_;
2699 List<Object*> object_stack_;
2701 AssertNoAllocation no_alloc;
2706 #endif // DEBUG || LIVE_OBJECT_LIST
2710 #endif // V8_HEAP_H_
static int SizeOfMarkedObject(HeapObject *object)
Object ** roots_array_start()
intptr_t OldGenPromotionLimit(intptr_t old_gen_size)
void GarbageCollectionEpilogue()
MUST_USE_RESULT MaybeObject * CopyCode(Code *code)
double total_regexp_code_generated()
MUST_USE_RESULT MaybeObject * AllocateFixedArray(int length, PretenureFlag pretenure)
void CallGlobalGCEpilogueCallback()
bool NextGCIsLikelyToBeFull()
MUST_USE_RESULT MaybeObject * AllocateExternalStringFromAscii(const ExternalAsciiString::Resource *resource)
MUST_USE_RESULT MaybeObject * AllocateSymbol(Vector< const char > str, int chars, uint32_t hash_field)
void set_full_gc_count(int count)
intptr_t OldGenerationCapacityAvailable()
void Callback(MemoryChunk *page, StoreBufferEvent event)
MUST_USE_RESULT MaybeObject * CopyFixedDoubleArray(FixedDoubleArray *src)
intptr_t * old_pointer_space_size
MUST_USE_RESULT MaybeObject * AllocateFunctionPrototype(JSFunction *function)
intptr_t * cell_space_size
static const int kMapHashShift
int ReservedSemiSpaceSize()
void RecordWrite(Address address, int offset)
void PrintF(const char *format,...)
bool OldGenerationPromotionLimitReached()
bool InNewSpace(Object *object)
static const int kArgumentsObjectSize
int Lookup(DescriptorArray *array, String *name)
MUST_USE_RESULT MaybeObject * AllocateFunctionContext(int length, JSFunction *function)
MUST_USE_RESULT MaybeObject * Allocate(Map *map, AllocationSpace space)
MUST_USE_RESULT MaybeObject * AllocateSubString(String *buffer, int start, int end, PretenureFlag pretenure=NOT_TENURED)
void(* ObjectSlotCallback)(HeapObject **from, HeapObject *to)
void SetConstructStubDeoptPCOffset(int pc_offset)
void IterateWeakRoots(ObjectVisitor *v, VisitMode mode)
Object * ToBoolean(bool condition)
MUST_USE_RESULT MaybeObject * ReinitializeJSGlobalProxy(JSFunction *constructor, JSGlobalProxy *global)
MUST_USE_RESULT MaybeObject * CopyFixedDoubleArrayWithMap(FixedDoubleArray *src, Map *map)
MUST_USE_RESULT MaybeObject * AllocateGlobalObject(JSFunction *constructor)
static Smi * FromInt(int value)
MUST_USE_RESULT MaybeObject * AllocateJSFunctionProxy(Object *handler, Object *call_trap, Object *construct_trap, Object *prototype)
void FinalizeExternalString(String *string)
MUST_USE_RESULT MaybeObject * AllocateJSObject(JSFunction *constructor, PretenureFlag pretenure=NOT_TENURED)
void CompletelyClearInstanceofCache()
void CollectAllGarbage(int flags, const char *gc_reason=NULL)
value format" "after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false, "print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false, "print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false, "report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true, "garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true, "flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true, "use incremental marking") DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") DEFINE_bool(trace_incremental_marking, false, "trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true, "Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false, "Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true, "use inline caching") DEFINE_bool(native_code_counters, false, "generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false, "Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true, "Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false, "Never perform compaction on full GC-testing only") DEFINE_bool(compact_code_space, true, "Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true, "Flush inline caches prior to mark compact collection and" "flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0, "Default seed for initializing random generator" "(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true, "allows verbose printing") DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") DEFINE_bool(trace_sim, false, "Trace simulator execution") DEFINE_bool(check_icache, false, "Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator(4 or 8, 8 is default)") DEFINE_bool(trace_exception, false, "print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false, "preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true, "randomize hashes to avoid predictable hash collisions" "(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0, "Fixed seed to use to hash property keys(0 means random)" "(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false, "activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") DEFINE_int(testing_int_flag, 13, "testing_int_flag") DEFINE_float(testing_float_flag, 2.5, "float-flag") DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") DEFINE_string(testing_serialization_file, "/tmp/serdes", "file in which to serialize heap") DEFINE_bool(help, false, "Print usage message, including flags, on console") DEFINE_bool(dump_counters, false, "Dump counters on exit") DEFINE_string(map_counters, "", "Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT, "Pass all remaining arguments to the script.Alias for\"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#43"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2#define FLAG_MODE_DEFINE_DEFAULTS#1"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flag-definitions.h"1#define FLAG_FULL(ftype, ctype, nam, def, cmt)#define FLAG_READONLY(ftype, ctype, nam, def, cmt)#define DEFINE_implication(whenflag, thenflag)#define DEFINE_bool(nam, def, cmt)#define DEFINE_int(nam, def, cmt)#define DEFINE_float(nam, def, cmt)#define DEFINE_string(nam, def, cmt)#define DEFINE_args(nam, def, cmt)#define FLAG DEFINE_bool(use_strict, false,"enforce strict mode") DEFINE_bool(es5_readonly, false,"activate correct semantics for inheriting readonliness") DEFINE_bool(es52_globals, false,"activate new semantics for global var declarations") DEFINE_bool(harmony_typeof, false,"enable harmony semantics for typeof") DEFINE_bool(harmony_scoping, false,"enable harmony block scoping") DEFINE_bool(harmony_modules, false,"enable harmony modules (implies block scoping)") DEFINE_bool(harmony_proxies, false,"enable harmony proxies") DEFINE_bool(harmony_collections, false,"enable harmony collections (sets, maps, and weak maps)") DEFINE_bool(harmony, false,"enable all harmony features (except typeof)") DEFINE_implication(harmony, harmony_scoping) DEFINE_implication(harmony, harmony_modules) DEFINE_implication(harmony, harmony_proxies) DEFINE_implication(harmony, harmony_collections) DEFINE_implication(harmony_modules, harmony_scoping) DEFINE_bool(packed_arrays, false,"optimizes arrays that have no holes") DEFINE_bool(smi_only_arrays, true,"tracks arrays with only smi values") DEFINE_bool(clever_optimizations, true,"Optimize object size, Array shift, DOM strings and string +") DEFINE_bool(unbox_double_arrays, true,"automatically unbox arrays of doubles") DEFINE_bool(string_slices, true,"use string slices") DEFINE_bool(crankshaft, true,"use crankshaft") DEFINE_string(hydrogen_filter,"","optimization filter") DEFINE_bool(use_range, true,"use hydrogen range analysis") DEFINE_bool(eliminate_dead_phis, true,"eliminate dead phis") DEFINE_bool(use_gvn, true,"use hydrogen global value numbering") DEFINE_bool(use_canonicalizing, true,"use hydrogen instruction canonicalizing") DEFINE_bool(use_inlining, true,"use function inlining") DEFINE_int(max_inlined_source_size, 600,"maximum source size in bytes considered for a single inlining") DEFINE_int(max_inlined_nodes, 196,"maximum number of AST nodes considered for a single inlining") DEFINE_int(max_inlined_nodes_cumulative, 196,"maximum cumulative number of AST nodes considered for inlining") DEFINE_bool(loop_invariant_code_motion, true,"loop invariant code motion") DEFINE_bool(collect_megamorphic_maps_from_stub_cache, true,"crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false,"print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false,"trace generated hydrogen to file") DEFINE_string(trace_phase,"Z","trace generated IR for specified phases") DEFINE_bool(trace_inlining, false,"trace inlining decisions") DEFINE_bool(trace_alloc, false,"trace register allocator") DEFINE_bool(trace_all_uses, false,"trace all use positions") DEFINE_bool(trace_range, false,"trace range analysis") DEFINE_bool(trace_gvn, false,"trace global value numbering") DEFINE_bool(trace_representation, false,"trace representation types") DEFINE_bool(stress_pointer_maps, false,"pointer map for every instruction") DEFINE_bool(stress_environments, false,"environment for every instruction") DEFINE_int(deopt_every_n_times, 0,"deoptimize every n times a deopt point is passed") DEFINE_bool(trap_on_deopt, false,"put a break point before deoptimizing") DEFINE_bool(deoptimize_uncommon_cases, true,"deoptimize uncommon cases") DEFINE_bool(polymorphic_inlining, true,"polymorphic inlining") DEFINE_bool(use_osr, true,"use on-stack replacement") DEFINE_bool(array_bounds_checks_elimination, false,"perform array bounds checks elimination") DEFINE_bool(array_index_dehoisting, false,"perform array index dehoisting") DEFINE_bool(trace_osr, false,"trace on-stack replacement") DEFINE_int(stress_runs, 0,"number of stress runs") DEFINE_bool(optimize_closures, true,"optimize closures") DEFINE_bool(inline_construct, true,"inline constructor calls") DEFINE_bool(inline_arguments, true,"inline functions with arguments object") DEFINE_int(loop_weight, 1,"loop weight for representation inference") DEFINE_bool(optimize_for_in, true,"optimize functions containing for-in loops") DEFINE_bool(experimental_profiler, true,"enable all profiler experiments") DEFINE_bool(watch_ic_patching, false,"profiler considers IC stability") DEFINE_int(frame_count, 1,"number of stack frames inspected by the profiler") DEFINE_bool(self_optimization, false,"primitive functions trigger their own optimization") DEFINE_bool(direct_self_opt, false,"call recompile stub directly when self-optimizing") DEFINE_bool(retry_self_opt, false,"re-try self-optimization if it failed") DEFINE_bool(count_based_interrupts, false,"trigger profiler ticks based on counting instead of timing") DEFINE_bool(interrupt_at_exit, false,"insert an interrupt check at function exit") DEFINE_bool(weighted_back_edges, false,"weight back edges by jump distance for interrupt triggering") DEFINE_int(interrupt_budget, 5900,"execution budget before interrupt is triggered") DEFINE_int(type_info_threshold, 15,"percentage of ICs that must have type info to allow optimization") DEFINE_int(self_opt_count, 130,"call count before self-optimization") DEFINE_implication(experimental_profiler, watch_ic_patching) DEFINE_implication(experimental_profiler, self_optimization) DEFINE_implication(experimental_profiler, retry_self_opt) DEFINE_implication(experimental_profiler, count_based_interrupts) DEFINE_implication(experimental_profiler, interrupt_at_exit) DEFINE_implication(experimental_profiler, weighted_back_edges) DEFINE_bool(trace_opt_verbose, false,"extra verbose compilation tracing") DEFINE_implication(trace_opt_verbose, trace_opt) DEFINE_bool(debug_code, false,"generate extra code (assertions) for debugging") DEFINE_bool(code_comments, false,"emit comments in code disassembly") DEFINE_bool(enable_sse2, true,"enable use of SSE2 instructions if available") DEFINE_bool(enable_sse3, true,"enable use of SSE3 instructions if available") DEFINE_bool(enable_sse4_1, true,"enable use of SSE4.1 instructions if available") DEFINE_bool(enable_cmov, true,"enable use of CMOV instruction if available") DEFINE_bool(enable_rdtsc, true,"enable use of RDTSC instruction if available") DEFINE_bool(enable_sahf, true,"enable use of SAHF instruction if available (X64 only)") DEFINE_bool(enable_vfp3, true,"enable use of VFP3 instructions if available - this implies ""enabling ARMv7 instructions (ARM only)") DEFINE_bool(enable_armv7, true,"enable use of ARMv7 instructions if available (ARM only)") DEFINE_bool(enable_fpu, true,"enable use of MIPS FPU instructions if available (MIPS only)") DEFINE_string(expose_natives_as, NULL,"expose natives in global object") DEFINE_string(expose_debug_as, NULL,"expose debug in global object") DEFINE_bool(expose_gc, false,"expose gc extension") DEFINE_bool(expose_externalize_string, false,"expose externalize string extension") DEFINE_int(stack_trace_limit, 10,"number of stack frames to capture") DEFINE_bool(builtins_in_stack_traces, false,"show built-in functions in stack traces") DEFINE_bool(disable_native_files, false,"disable builtin natives files") DEFINE_bool(inline_new, true,"use fast inline allocation") DEFINE_bool(stack_trace_on_abort, true,"print a stack trace if an assertion failure occurs") DEFINE_bool(trace, false,"trace function calls") DEFINE_bool(mask_constants_with_cookie, true,"use random jit cookie to mask large constants") DEFINE_bool(lazy, true,"use lazy compilation") DEFINE_bool(trace_opt, false,"trace lazy optimization") DEFINE_bool(trace_opt_stats, false,"trace lazy optimization statistics") DEFINE_bool(opt, true,"use adaptive optimizations") DEFINE_bool(always_opt, false,"always try to optimize functions") DEFINE_bool(prepare_always_opt, false,"prepare for turning on always opt") DEFINE_bool(trace_deopt, false,"trace deoptimization") DEFINE_int(min_preparse_length, 1024,"minimum length for automatic enable preparsing") DEFINE_bool(always_full_compiler, false,"try to use the dedicated run-once backend for all code") DEFINE_bool(trace_bailout, false,"print reasons for falling back to using the classic V8 backend") DEFINE_bool(compilation_cache, true,"enable compilation cache") DEFINE_bool(cache_prototype_transitions, true,"cache prototype transitions") DEFINE_bool(trace_debug_json, false,"trace debugging JSON request/response") DEFINE_bool(debugger_auto_break, true,"automatically set the debug break flag when debugger commands are ""in the queue") DEFINE_bool(enable_liveedit, true,"enable liveedit experimental feature") DEFINE_bool(break_on_abort, true,"always cause a debug break before aborting") DEFINE_int(stack_size, kPointerSize *123,"default size of stack region v8 is allowed to use (in kBytes)") DEFINE_int(max_stack_trace_source_length, 300,"maximum length of function source code printed in a stack trace.") DEFINE_bool(always_inline_smi_code, false,"always inline smi code in non-opt code") DEFINE_int(max_new_space_size, 0,"max size of the new generation (in kBytes)") DEFINE_int(max_old_space_size, 0,"max size of the old generation (in Mbytes)") DEFINE_int(max_executable_size, 0,"max size of executable memory (in Mbytes)") DEFINE_bool(gc_global, false,"always perform global GCs") DEFINE_int(gc_interval,-1,"garbage collect after <n> allocations") DEFINE_bool(trace_gc, false,"print one trace line following each garbage collection") DEFINE_bool(trace_gc_nvp, false,"print one detailed trace line in name=value format ""after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false,"print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false,"print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false,"report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true,"garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true,"flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true,"use incremental marking") DEFINE_bool(incremental_marking_steps, true,"do incremental marking steps") DEFINE_bool(trace_incremental_marking, false,"trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true,"Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false,"Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true,"use inline caching") DEFINE_bool(native_code_counters, false,"generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false,"Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true,"Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false,"Never perform compaction on full GC - testing only") DEFINE_bool(compact_code_space, true,"Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true,"Flush inline caches prior to mark compact collection and ""flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0,"Default seed for initializing random generator ""(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true,"allows verbose printing") DEFINE_bool(allow_natives_syntax, false,"allow natives syntax") DEFINE_bool(trace_sim, false,"Trace simulator execution") DEFINE_bool(check_icache, false,"Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0,"Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8,"Stack alingment in bytes in simulator (4 or 8, 8 is default)") DEFINE_bool(trace_exception, false,"print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false,"preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true,"randomize hashes to avoid predictable hash collisions ""(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0,"Fixed seed to use to hash property keys (0 means random)""(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false,"activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true,"generate optimized regexp code") DEFINE_bool(testing_bool_flag, true,"testing_bool_flag") DEFINE_int(testing_int_flag, 13,"testing_int_flag") DEFINE_float(testing_float_flag, 2.5,"float-flag") DEFINE_string(testing_string_flag,"Hello, world!","string-flag") DEFINE_int(testing_prng_seed, 42,"Seed used for threading test randomness") DEFINE_string(testing_serialization_file,"/tmp/serdes","file in which to serialize heap") DEFINE_bool(help, false,"Print usage message, including flags, on console") DEFINE_bool(dump_counters, false,"Dump counters on exit") DEFINE_string(map_counters,"","Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT,"Pass all remaining arguments to the script. Alias for \"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#47"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2 namespace{struct Flag{enum FlagType{TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING, TYPE_ARGS} name
Map * MapForExternalArrayType(ExternalArrayType array_type)
void SetNumberStringCache(Object *number, String *str)
static const int kNullValueRootIndex
MUST_USE_RESULT MaybeObject * AllocateCodeCache()
MUST_USE_RESULT MaybeObject * AllocateTwoByteSymbol(Vector< const uc16 > str, uint32_t hash_field)
void AddString(String *string)
RootListIndex RootIndexForExternalArrayType(ExternalArrayType array_type)
MUST_USE_RESULT MaybeObject * LookupAsciiSymbol(Vector< const char > str)
static const int kOldSpaceRoots
void VisitExternalResources(v8::ExternalResourceVisitor *visitor)
intptr_t OldGenAllocationLimit(intptr_t old_gen_size)
MUST_USE_RESULT MaybeObject * AllocateByteArray(int length, PretenureFlag pretenure)
Address * allocation_top_address()
void DoScavengeObject(Map *map, HeapObject **slot, HeapObject *obj)
void SetGlobalGCPrologueCallback(GCCallback callback)
DisableAssertNoAllocation()
static Object * Lookup(FixedArray *cache, String *string, String *pattern)
void ClearInstanceofCache()
void RemoveGCPrologueCallback(GCEpilogueCallback callback)
HeapObjectCallback GcSafeSizeOfOldObjectFunction()
bool InFromSpace(Object *object)
MUST_USE_RESULT MaybeObject * Uint32ToString(uint32_t value, bool check_number_string_cache=true)
PromotionQueue * promotion_queue()
Map * SymbolMapForString(String *str)
intptr_t * code_space_size
void AddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter)
MUST_USE_RESULT MaybeObject * AllocateRawAsciiString(int length, PretenureFlag pretenure=NOT_TENURED)
static void MoveBlock(Address dst, Address src, int byte_size)
void IterateStrongRoots(ObjectVisitor *v, VisitMode mode)
#define ASSERT(condition)
bool InSpace(Address addr, AllocationSpace space)
void(* GCPrologueCallback)(GCType type, GCCallbackFlags flags)
v8::Handle< v8::Value > Print(const v8::Arguments &args)
void public_set_code_stubs(UnseededNumberDictionary *value)
static const int kReduceMemoryFootprintMask
OldSpace * TargetSpace(HeapObject *object)
void AddGCPrologueCallback(GCEpilogueCallback callback, GCType gc_type_filter)
void set_collector(GarbageCollector collector)
MUST_USE_RESULT MaybeObject * LookupTwoByteSymbol(Vector< const uc16 > str)
Address * NewSpaceAllocationLimitAddress()
#define STRONG_ROOT_LIST(V)
MUST_USE_RESULT MaybeObject * LookupSymbol(Vector< const char > str)
bool SetUp(bool create_heap_objects)
MUST_USE_RESULT MaybeObject * AllocateBlockContext(JSFunction *function, Context *previous, ScopeInfo *info)
void(* ScavengingCallback)(Map *map, HeapObject **slot, HeapObject *object)
MUST_USE_RESULT MaybeObject * AllocateStringFromUtf8Slow(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
intptr_t CommittedMemoryExecutable()
friend class ExternalReference
#define SYMBOL_ACCESSOR(name, str)
MUST_USE_RESULT MaybeObject * CopyJSObject(JSObject *source)
static const int kPageSize
int * pending_global_handle_count
Address * store_buffer_top_address()
void CallGlobalGCPrologueCallback()
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)
bool IsSweepingComplete()
MUST_USE_RESULT MaybeObject * AllocateInternalSymbol(unibrow::CharacterStream *buffer, int chars, uint32_t hash_field)
Address always_allocate_scope_depth_address()
void IterateAndMarkPointersToFromSpace(Address start, Address end, ObjectSlotCallback callback)
MUST_USE_RESULT MaybeObject * AllocateJSArrayWithElements(FixedArrayBase *array_base, ElementsKind elements_kind, PretenureFlag pretenure=NOT_TENURED)
ArrayStorageAllocationMode
STATIC_CHECK(kUndefinedValueRootIndex==Internals::kUndefinedValueRootIndex)
virtual Object * RetainAs(Object *object)=0
StoreBuffer * store_buffer()
MUST_USE_RESULT MaybeObject * AllocateHeapNumber(double value, PretenureFlag pretenure)
void ClearCodeCache(Heap *heap)
bool CollectGarbage(AllocationSpace space, GarbageCollector collector, const char *gc_reason, const char *collector_reason)
MUST_USE_RESULT MaybeObject * AllocateWithContext(JSFunction *function, Context *previous, JSObject *extension)
static const int kStringSplitCacheSize
MUST_USE_RESULT MaybeObject * CopyFixedArrayWithMap(FixedArray *src, Map *map)
int NotifyContextDisposed()
MUST_USE_RESULT MaybeObject * AllocateConsString(String *first, String *second)
#define STRUCT_MAP_ACCESSOR(NAME, Name, name)
MUST_USE_RESULT MaybeObject * NumberToString(Object *number, bool check_number_string_cache=true)
void public_set_empty_script(Script *script)
int * near_death_global_handle_count
STATIC_ASSERT((kEntriesPerBucket &(kEntriesPerBucket-1))==0)
String *(* ExternalStringTableUpdaterCallback)(Heap *heap, Object **pointer)
static const intptr_t kMinimumPromotionLimit
void SetArgumentsAdaptorDeoptPCOffset(int pc_offset)
static void ClearMark(HeapObject *object)
static const int kEndMarker
bool IdleNotification(int hint)
MUST_USE_RESULT MaybeObject * AllocateStringFromAscii(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
intptr_t MaxOldGenerationSize()
void IncreaseTotalRegexpCodeGenerated(int size)
friend class MarkCompactCollector
void EnsureHeapIsIterable()
static const int kArgumentsObjectSizeStrict
MUST_USE_RESULT MaybeObject * AllocateUninitializedFixedDoubleArray(int length, PretenureFlag pretenure=NOT_TENURED)
int(* HeapObjectCallback)(HeapObject *obj)
void SetLastScriptId(Object *last_script_id)
MUST_USE_RESULT MaybeObject * AllocateStringFromUtf8(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
bool AdvanceSweeper(intptr_t bytes_to_sweep)
static bool IsMarked(HeapObject *object)
void ClearCacheOnMap(Map *map)
void RemoveGCEpilogueCallback(GCEpilogueCallback callback)
int MaxObjectSizeInNewSpace()
static NewSpacePage * FromAddress(Address address_in_page)
void CollectAllAvailableGarbage(const char *gc_reason=NULL)
bool ConfigureHeapDefault()
static const int kNoGCFlags
MUST_USE_RESULT MaybeObject * AllocateFixedArrayWithHoles(int length, PretenureFlag pretenure=NOT_TENURED)
bool LookupTwoCharsSymbolIfExists(String *str, String **symbol)
MUST_USE_RESULT MaybeObject * AllocateInitialMap(JSFunction *fun)
friend class ExternalReference
int * global_handle_count
MUST_USE_RESULT MaybeObject * AllocateForeign(Address address, PretenureFlag pretenure=NOT_TENURED)
friend class DisallowAllocationFailure
MUST_USE_RESULT MaybeObject * AllocateModuleContext(Context *previous, ScopeInfo *scope_info)
void QueueMemoryChunkForFree(MemoryChunk *chunk)
MUST_USE_RESULT MaybeObject * AllocateGlobalContext()
MUST_USE_RESULT MaybeObject * AllocateExternalArray(int length, ExternalArrayType array_type, void *external_pointer, PretenureFlag pretenure)
static void ScavengePointer(HeapObject **p)
intptr_t * cell_space_capacity
intptr_t * memory_allocator_size
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
void decrement_scan_on_scavenge_pages()
void IncrementYoungSurvivorsCounter(int survived)
MUST_USE_RESULT MaybeObject * AllocatePolymorphicCodeCache()
intptr_t * code_space_capacity
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
void Update(Map *map, String *name, int field_offset)
static Map * MapOfMarkedObject(HeapObject *object)
OldSpace * old_pointer_space()
bool ConfigureHeap(int max_semispace_size, intptr_t max_old_gen_size, intptr_t max_executable_size)
intptr_t * map_space_size
static double TimeCurrentMillis()
MUST_USE_RESULT MaybeObject * AllocateTypeFeedbackInfo()
static const int kMakeHeapIterableMask
void public_set_store_buffer_top(Address *top)
intptr_t AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes)
MUST_USE_RESULT MaybeObject * AllocateJSArrayAndStorage(ElementsKind elements_kind, int length, int capacity, ArrayStorageAllocationMode mode=DONT_INITIALIZE_ARRAY_ELEMENTS, PretenureFlag pretenure=NOT_TENURED)
Object ** global_contexts_list_address()
static const int kUndefinedValueRootIndex
void Iterate(ObjectVisitor *v)
bool InToSpace(Object *object)
void Update(DescriptorArray *array, String *name, int result)
void GarbageCollectionPrologue()
static void Clear(FixedArray *cache)
#define ROOT_ACCESSOR(type, name, camel_name)
LargeObjectSpace * lo_space()
MUST_USE_RESULT MaybeObject * AllocateJSMessageObject(String *type, JSArray *arguments, int start_position, int end_position, Object *script, Object *stack_trace, Object *stack_frames)
static const int kFalseValueRootIndex
MUST_USE_RESULT MaybeObject * AllocateExternalStringFromTwoByte(const ExternalTwoByteString::Resource *resource)
MUST_USE_RESULT MaybeObject * AllocatePartialMap(InstanceType instance_type, int instance_size)
int * free_global_handle_count
MUST_USE_RESULT MaybeObject * CreateCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false)
STATIC_ASSERT((1<< kTranscendentalTypeBits) >=kNumberOfCaches)
MUST_USE_RESULT MaybeObject * AllocateAsciiSymbol(Vector< const char > str, uint32_t hash_field)
void set_gc_count(unsigned int count)
static const int kAbortIncrementalMarkingMask
Vector< const char > CStrVector(const char *data)
intptr_t CommittedMemory()
void increment_promoted_objects_size(int object_size)
Object * GetNumberStringCache(Object *number)
MUST_USE_RESULT MaybeObject * AllocateRawFixedDoubleArray(int length, PretenureFlag pretenure)
MUST_USE_RESULT MaybeObject * AllocateEmptyJSArray(ElementsKind elements_kind, PretenureFlag pretenure=NOT_TENURED)
virtual ~WeakObjectRetainer()
Address * NewSpaceAllocationTopAddress()
void RecordWrites(Address address, int start, int len)
void(* GCEpilogueCallback)(GCType type, GCCallbackFlags flags)
intptr_t get_max_alive_after_gc()
void UpdateReferencesInExternalStringTable(ExternalStringTableUpdaterCallback updater_func)
MUST_USE_RESULT MaybeObject * AllocateJSProxy(Object *handler, Object *prototype)
void ProcessWeakReferences(WeakObjectRetainer *retainer)
void ClearNormalizedMapCaches()
~DisableAssertNoAllocation()
MUST_USE_RESULT MaybeObject * NumberFromDouble(double value, PretenureFlag pretenure=NOT_TENURED)
MUST_USE_RESULT MaybeObject * AllocateExternalSymbol(Vector< const char > str, int chars)
intptr_t * old_data_space_capacity
void set_global_contexts_list(Object *object)
MUST_USE_RESULT MaybeObject * AllocateArgumentsObject(Object *callee, int length)
int Lookup(Map *map, String *name)
int InitialSemiSpaceSize()
MUST_USE_RESULT MaybeObject * CopyFixedArray(FixedArray *src)
void IterateRoots(ObjectVisitor *v, VisitMode mode)
MUST_USE_RESULT MaybeObject * ReinitializeJSReceiver(JSReceiver *object, InstanceType type, int size)
MUST_USE_RESULT MaybeObject * AllocateAccessorPair()
int * weak_global_handle_count
MUST_USE_RESULT MaybeObject * AllocateCatchContext(JSFunction *function, Context *previous, String *name, Object *thrown_object)
MUST_USE_RESULT MaybeObject * Get(Type type, double input)
void SetGlobalGCEpilogueCallback(GCCallback callback)
static const int kEmptySymbolRootIndex
static const int kArgumentsLengthIndex
MUST_USE_RESULT MaybeObject * LookupAsciiSymbol(const char *str)
void CheckNewSpaceExpansionCriteria()
static void Enter(Heap *heap, FixedArray *cache, String *string, String *pattern, FixedArray *array)
MUST_USE_RESULT MaybeObject * AllocateScopeInfo(int length)
bool LookupSymbolIfExists(String *str, String **symbol)
ExternalStringTable * external_string_table()
MUST_USE_RESULT MaybeObject * NumberFromUint32(uint32_t value, PretenureFlag pretenure=NOT_TENURED)
IncrementalMarking * incremental_marking()
bool Contains(Address addr)
bool InNewSpacePage(Address addr)
MUST_USE_RESULT MaybeObject * AllocateUninitializedFixedArray(int length)
static const int kStartMarker
bool ShouldBePromoted(Address old_address, int object_size)
static const intptr_t kMinimumAllocationLimit
MUST_USE_RESULT MaybeObject * AllocateJSObjectFromMap(Map *map, PretenureFlag pretenure=NOT_TENURED)
void RememberUnmappedPage(Address page, bool compacted)
Object * global_contexts_list()
static const int kNotFound
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
friend class TranscendentalCacheStub
MUST_USE_RESULT MaybeObject * LookupSingleCharacterStringFromCode(uint16_t code)
intptr_t PromotedTotalSize()
static void CopyBlock(Address dst, Address src, int byte_size)
MUST_USE_RESULT MaybeObject * AllocateJSGlobalPropertyCell(Object *value)
MUST_USE_RESULT MaybeObject * CreateSymbol(const char *str, int length, int hash)
MUST_USE_RESULT MaybeObject * AllocateFixedDoubleArrayWithHoles(int length, PretenureFlag pretenure=NOT_TENURED)
MUST_USE_RESULT MaybeObject * AllocateRawFixedArray(int length)
static const int kArgumentsCalleeIndex
MUST_USE_RESULT MaybeObject * AllocateHashTable(int length, PretenureFlag pretenure=NOT_TENURED)
void public_set_non_monomorphic_cache(UnseededNumberDictionary *value)
static const int kHeaderSize
Object * FindCodeObject(Address a)
#define DECLARE_STRUCT_MAP(NAME, Name, name)
intptr_t PromotedSpaceSizeOfObjects()
intptr_t * old_pointer_space_capacity
bool OldGenerationAllocationLimitReached()
#define ROOT_INDEX_DECLARATION(type, name, camel_name)
MUST_USE_RESULT MaybeObject * NumberFromInt32(int32_t value, PretenureFlag pretenure=NOT_TENURED)
void ClearJSFunctionResultCaches()
#define SYMBOL_INDEX_DECLARATION(name, str)
void RecordStats(HeapStats *stats, bool take_snapshot=false)
NewSpacePage * prev_page() const
bool IsInGCPostProcessing()
void CreateFillerObjectAt(Address addr, int size)
MUST_USE_RESULT MaybeObject * AllocateSharedFunctionInfo(Object *name)
bool AdvanceSweepers(int step_size)
void increment_scan_on_scavenge_pages()
Address * allocation_limit_address()
intptr_t * map_space_capacity
static const int kTrueValueRootIndex
static const int kCapacityMask
static void ScavengeObject(HeapObject **p, HeapObject *object)
bool IsSweepingComplete()
static const int kTranscendentalTypeBits
MUST_USE_RESULT MaybeObject * PrepareForCompare(String *str)
static bool IsAtStart(Address addr)
intptr_t * memory_allocator_capacity
static const int kSweepPreciselyMask
MUST_USE_RESULT MaybeObject * AllocateStruct(InstanceType type)
intptr_t * old_data_space_size
intptr_t OldGenerationSpaceAvailable()
MUST_USE_RESULT MaybeObject * AllocateJSModule()
MUST_USE_RESULT MaybeObject * AllocateMap(InstanceType instance_type, int instance_size, ElementsKind elements_kind=TERMINAL_FAST_ELEMENTS_KIND)
intptr_t MaxExecutableSize()
MUST_USE_RESULT MaybeObject * AllocateRaw(int size_in_bytes, AllocationSpace space, AllocationSpace retry_space)
void PrintShortHeapStatistics()
static const int kHashMask
AllocationSpace TargetSpaceId(InstanceType type)
OldSpace * old_data_space()
MUST_USE_RESULT MaybeObject * AllocateRawTwoByteString(int length, PretenureFlag pretenure=NOT_TENURED)
static void AssertValidRange(Address from, Address to)
static void SetMark(HeapObject *object)
MarkCompactCollector * mark_compact_collector()
MUST_USE_RESULT MaybeObject * AllocateFunction(Map *function_map, SharedFunctionInfo *shared, Object *prototype, PretenureFlag pretenure=TENURED)
void UpdateNewSpaceReferencesInExternalStringTable(ExternalStringTableUpdaterCallback updater_func)
StoreBufferRebuilder(StoreBuffer *store_buffer)
MUST_USE_RESULT MaybeObject * AllocateStringFromTwoByte(Vector< const uc16 > str, PretenureFlag pretenure=NOT_TENURED)
static const int kEntriesPerBucket
void EnsureFromSpaceIsCommitted()
MUST_USE_RESULT MaybeObject * AllocateAliasedArgumentsEntry(int slot)
Callback GetVisitor(Map *map)