Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: src/heap.h

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 V(Object, undefined_value, UndefinedValue) \ 62 V(Object, undefined_value, UndefinedValue) \
63 V(Object, the_hole_value, TheHoleValue) \ 63 V(Object, the_hole_value, TheHoleValue) \
64 V(Object, null_value, NullValue) \ 64 V(Object, null_value, NullValue) \
65 V(Object, true_value, TrueValue) \ 65 V(Object, true_value, TrueValue) \
66 V(Object, false_value, FalseValue) \ 66 V(Object, false_value, FalseValue) \
67 V(Object, arguments_marker, ArgumentsMarker) \ 67 V(Object, arguments_marker, ArgumentsMarker) \
68 V(Map, heap_number_map, HeapNumberMap) \ 68 V(Map, heap_number_map, HeapNumberMap) \
69 V(Map, global_context_map, GlobalContextMap) \ 69 V(Map, global_context_map, GlobalContextMap) \
70 V(Map, fixed_array_map, FixedArrayMap) \ 70 V(Map, fixed_array_map, FixedArrayMap) \
71 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ 71 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
72 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
72 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ 73 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
73 V(Map, meta_map, MetaMap) \ 74 V(Map, meta_map, MetaMap) \
74 V(Map, hash_table_map, HashTableMap) \ 75 V(Map, hash_table_map, HashTableMap) \
75 V(Smi, stack_limit, StackLimit) \ 76 V(Smi, stack_limit, StackLimit) \
76 V(FixedArray, number_string_cache, NumberStringCache) \ 77 V(FixedArray, number_string_cache, NumberStringCache) \
77 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ 78 V(Object, instanceof_cache_function, InstanceofCacheFunction) \
78 V(Object, instanceof_cache_map, InstanceofCacheMap) \ 79 V(Object, instanceof_cache_map, InstanceofCacheMap) \
79 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ 80 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \
80 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ 81 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
81 V(Object, termination_exception, TerminationException) \ 82 V(Object, termination_exception, TerminationException) \
82 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ 83 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
83 V(ByteArray, empty_byte_array, EmptyByteArray) \ 84 V(ByteArray, empty_byte_array, EmptyByteArray) \
85 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \
84 V(String, empty_string, EmptyString) \ 86 V(String, empty_string, EmptyString) \
85 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ 87 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
86 V(Map, string_map, StringMap) \ 88 V(Map, string_map, StringMap) \
87 V(Map, ascii_string_map, AsciiStringMap) \ 89 V(Map, ascii_string_map, AsciiStringMap) \
88 V(Map, symbol_map, SymbolMap) \ 90 V(Map, symbol_map, SymbolMap) \
89 V(Map, cons_string_map, ConsStringMap) \ 91 V(Map, cons_string_map, ConsStringMap) \
90 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ 92 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \
91 V(Map, ascii_symbol_map, AsciiSymbolMap) \ 93 V(Map, ascii_symbol_map, AsciiSymbolMap) \
92 V(Map, cons_symbol_map, ConsSymbolMap) \ 94 V(Map, cons_symbol_map, ConsSymbolMap) \
93 V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \ 95 V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \
94 V(Map, external_symbol_map, ExternalSymbolMap) \ 96 V(Map, external_symbol_map, ExternalSymbolMap) \
95 V(Map, external_symbol_with_ascii_data_map, ExternalSymbolWithAsciiDataMap) \ 97 V(Map, external_symbol_with_ascii_data_map, ExternalSymbolWithAsciiDataMap) \
96 V(Map, external_ascii_symbol_map, ExternalAsciiSymbolMap) \ 98 V(Map, external_ascii_symbol_map, ExternalAsciiSymbolMap) \
97 V(Map, external_string_map, ExternalStringMap) \ 99 V(Map, external_string_map, ExternalStringMap) \
98 V(Map, external_string_with_ascii_data_map, ExternalStringWithAsciiDataMap) \ 100 V(Map, external_string_with_ascii_data_map, ExternalStringWithAsciiDataMap) \
99 V(Map, external_ascii_string_map, ExternalAsciiStringMap) \ 101 V(Map, external_ascii_string_map, ExternalAsciiStringMap) \
100 V(Map, undetectable_string_map, UndetectableStringMap) \ 102 V(Map, undetectable_string_map, UndetectableStringMap) \
101 V(Map, undetectable_ascii_string_map, UndetectableAsciiStringMap) \ 103 V(Map, undetectable_ascii_string_map, UndetectableAsciiStringMap) \
102 V(Map, external_pixel_array_map, ExternalPixelArrayMap) \ 104 V(Map, external_pixel_array_map, ExternalPixelArrayMap) \
103 V(Map, external_byte_array_map, ExternalByteArrayMap) \ 105 V(Map, external_byte_array_map, ExternalByteArrayMap) \
104 V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \ 106 V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \
105 V(Map, external_short_array_map, ExternalShortArrayMap) \ 107 V(Map, external_short_array_map, ExternalShortArrayMap) \
106 V(Map, external_unsigned_short_array_map, ExternalUnsignedShortArrayMap) \ 108 V(Map, external_unsigned_short_array_map, ExternalUnsignedShortArrayMap) \
107 V(Map, external_int_array_map, ExternalIntArrayMap) \ 109 V(Map, external_int_array_map, ExternalIntArrayMap) \
108 V(Map, external_unsigned_int_array_map, ExternalUnsignedIntArrayMap) \ 110 V(Map, external_unsigned_int_array_map, ExternalUnsignedIntArrayMap) \
109 V(Map, external_float_array_map, ExternalFloatArrayMap) \ 111 V(Map, external_float_array_map, ExternalFloatArrayMap) \
110 V(Map, external_double_array_map, ExternalDoubleArrayMap) \ 112 V(Map, external_double_array_map, ExternalDoubleArrayMap) \
111 V(Map, context_map, ContextMap) \ 113 V(Map, non_strict_arguments_elements_map, NonStrictArgumentsElementsMap) \
114 V(Map, function_context_map, FunctionContextMap) \
112 V(Map, catch_context_map, CatchContextMap) \ 115 V(Map, catch_context_map, CatchContextMap) \
116 V(Map, with_context_map, WithContextMap) \
113 V(Map, code_map, CodeMap) \ 117 V(Map, code_map, CodeMap) \
114 V(Map, oddball_map, OddballMap) \ 118 V(Map, oddball_map, OddballMap) \
115 V(Map, global_property_cell_map, GlobalPropertyCellMap) \ 119 V(Map, global_property_cell_map, GlobalPropertyCellMap) \
116 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ 120 V(Map, shared_function_info_map, SharedFunctionInfoMap) \
117 V(Map, message_object_map, JSMessageObjectMap) \ 121 V(Map, message_object_map, JSMessageObjectMap) \
118 V(Map, foreign_map, ForeignMap) \ 122 V(Map, foreign_map, ForeignMap) \
119 V(Object, nan_value, NanValue) \ 123 V(Object, nan_value, NanValue) \
120 V(Object, minus_zero_value, MinusZeroValue) \ 124 V(Object, minus_zero_value, MinusZeroValue) \
121 V(Map, neander_map, NeanderMap) \ 125 V(Map, neander_map, NeanderMap) \
122 V(JSObject, message_listeners, MessageListeners) \ 126 V(JSObject, message_listeners, MessageListeners) \
123 V(Foreign, prototype_accessors, PrototypeAccessors) \ 127 V(Foreign, prototype_accessors, PrototypeAccessors) \
124 V(NumberDictionary, code_stubs, CodeStubs) \ 128 V(NumberDictionary, code_stubs, CodeStubs) \
125 V(NumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \ 129 V(NumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \
130 V(PolymorphicCodeCache, polymorphic_code_cache, PolymorphicCodeCache) \
126 V(Code, js_entry_code, JsEntryCode) \ 131 V(Code, js_entry_code, JsEntryCode) \
127 V(Code, js_construct_entry_code, JsConstructEntryCode) \ 132 V(Code, js_construct_entry_code, JsConstructEntryCode) \
128 V(FixedArray, natives_source_cache, NativesSourceCache) \ 133 V(FixedArray, natives_source_cache, NativesSourceCache) \
129 V(Object, last_script_id, LastScriptId) \ 134 V(Object, last_script_id, LastScriptId) \
130 V(Script, empty_script, EmptyScript) \ 135 V(Script, empty_script, EmptyScript) \
131 V(Smi, real_stack_limit, RealStackLimit) \ 136 V(Smi, real_stack_limit, RealStackLimit) \
132 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ 137 V(StringDictionary, intrinsic_function_names, IntrinsicFunctionNames) \
133 138
134 #define ROOT_LIST(V) \ 139 #define ROOT_LIST(V) \
135 STRONG_ROOT_LIST(V) \ 140 STRONG_ROOT_LIST(V) \
136 V(SymbolTable, symbol_table, SymbolTable) 141 V(SymbolTable, symbol_table, SymbolTable)
137 142
138 #define SYMBOL_LIST(V) \ 143 #define SYMBOL_LIST(V) \
139 V(Array_symbol, "Array") \ 144 V(Array_symbol, "Array") \
140 V(Object_symbol, "Object") \ 145 V(Object_symbol, "Object") \
141 V(Proto_symbol, "__proto__") \ 146 V(Proto_symbol, "__proto__") \
142 V(StringImpl_symbol, "StringImpl") \ 147 V(StringImpl_symbol, "StringImpl") \
143 V(arguments_symbol, "arguments") \ 148 V(arguments_symbol, "arguments") \
144 V(Arguments_symbol, "Arguments") \ 149 V(Arguments_symbol, "Arguments") \
145 V(arguments_shadow_symbol, ".arguments") \
146 V(call_symbol, "call") \ 150 V(call_symbol, "call") \
147 V(apply_symbol, "apply") \ 151 V(apply_symbol, "apply") \
148 V(caller_symbol, "caller") \ 152 V(caller_symbol, "caller") \
149 V(boolean_symbol, "boolean") \ 153 V(boolean_symbol, "boolean") \
150 V(Boolean_symbol, "Boolean") \ 154 V(Boolean_symbol, "Boolean") \
151 V(callee_symbol, "callee") \ 155 V(callee_symbol, "callee") \
152 V(constructor_symbol, "constructor") \ 156 V(constructor_symbol, "constructor") \
153 V(code_symbol, ".code") \ 157 V(code_symbol, ".code") \
154 V(result_symbol, ".result") \ 158 V(result_symbol, ".result") \
155 V(catch_var_symbol, ".catch-var") \ 159 V(catch_var_symbol, ".catch-var") \
156 V(empty_symbol, "") \ 160 V(empty_symbol, "") \
157 V(eval_symbol, "eval") \ 161 V(eval_symbol, "eval") \
158 V(function_symbol, "function") \ 162 V(function_symbol, "function") \
159 V(length_symbol, "length") \ 163 V(length_symbol, "length") \
160 V(name_symbol, "name") \ 164 V(name_symbol, "name") \
165 V(native_symbol, "native") \
161 V(number_symbol, "number") \ 166 V(number_symbol, "number") \
162 V(Number_symbol, "Number") \ 167 V(Number_symbol, "Number") \
163 V(nan_symbol, "NaN") \ 168 V(nan_symbol, "NaN") \
164 V(RegExp_symbol, "RegExp") \ 169 V(RegExp_symbol, "RegExp") \
165 V(source_symbol, "source") \ 170 V(source_symbol, "source") \
166 V(global_symbol, "global") \ 171 V(global_symbol, "global") \
167 V(ignore_case_symbol, "ignoreCase") \ 172 V(ignore_case_symbol, "ignoreCase") \
168 V(multiline_symbol, "multiline") \ 173 V(multiline_symbol, "multiline") \
169 V(input_symbol, "input") \ 174 V(input_symbol, "input") \
170 V(index_symbol, "index") \ 175 V(index_symbol, "index") \
171 V(last_index_symbol, "lastIndex") \ 176 V(last_index_symbol, "lastIndex") \
172 V(object_symbol, "object") \ 177 V(object_symbol, "object") \
173 V(prototype_symbol, "prototype") \ 178 V(prototype_symbol, "prototype") \
174 V(string_symbol, "string") \ 179 V(string_symbol, "string") \
175 V(String_symbol, "String") \ 180 V(String_symbol, "String") \
176 V(Date_symbol, "Date") \ 181 V(Date_symbol, "Date") \
177 V(this_symbol, "this") \ 182 V(this_symbol, "this") \
178 V(to_string_symbol, "toString") \ 183 V(to_string_symbol, "toString") \
179 V(char_at_symbol, "CharAt") \ 184 V(char_at_symbol, "CharAt") \
180 V(undefined_symbol, "undefined") \ 185 V(undefined_symbol, "undefined") \
181 V(value_of_symbol, "valueOf") \ 186 V(value_of_symbol, "valueOf") \
182 V(InitializeVarGlobal_symbol, "InitializeVarGlobal") \ 187 V(InitializeVarGlobal_symbol, "InitializeVarGlobal") \
183 V(InitializeConstGlobal_symbol, "InitializeConstGlobal") \ 188 V(InitializeConstGlobal_symbol, "InitializeConstGlobal") \
184 V(KeyedLoadSpecializedMonomorphic_symbol, \ 189 V(KeyedLoadElementMonomorphic_symbol, \
185 "KeyedLoadSpecializedMonomorphic") \ 190 "KeyedLoadElementMonomorphic") \
186 V(KeyedLoadSpecializedPolymorphic_symbol, \ 191 V(KeyedLoadElementPolymorphic_symbol, \
187 "KeyedLoadSpecializedPolymorphic") \ 192 "KeyedLoadElementPolymorphic") \
188 V(KeyedStoreSpecializedMonomorphic_symbol, \ 193 V(KeyedStoreElementMonomorphic_symbol, \
189 "KeyedStoreSpecializedMonomorphic") \ 194 "KeyedStoreElementMonomorphic") \
190 V(KeyedStoreSpecializedPolymorphic_symbol, \ 195 V(KeyedStoreElementPolymorphic_symbol, \
191 "KeyedStoreSpecializedPolymorphic") \ 196 "KeyedStoreElementPolymorphic") \
192 V(stack_overflow_symbol, "kStackOverflowBoilerplate") \ 197 V(stack_overflow_symbol, "kStackOverflowBoilerplate") \
193 V(illegal_access_symbol, "illegal access") \ 198 V(illegal_access_symbol, "illegal access") \
194 V(out_of_memory_symbol, "out-of-memory") \ 199 V(out_of_memory_symbol, "out-of-memory") \
195 V(illegal_execution_state_symbol, "illegal execution state") \ 200 V(illegal_execution_state_symbol, "illegal execution state") \
196 V(get_symbol, "get") \ 201 V(get_symbol, "get") \
197 V(set_symbol, "set") \ 202 V(set_symbol, "set") \
198 V(function_class_symbol, "Function") \ 203 V(function_class_symbol, "Function") \
199 V(illegal_argument_symbol, "illegal argument") \ 204 V(illegal_argument_symbol, "illegal argument") \
200 V(MakeReferenceError_symbol, "MakeReferenceError") \ 205 V(MakeReferenceError_symbol, "MakeReferenceError") \
201 V(MakeSyntaxError_symbol, "MakeSyntaxError") \ 206 V(MakeSyntaxError_symbol, "MakeSyntaxError") \
202 V(MakeTypeError_symbol, "MakeTypeError") \ 207 V(MakeTypeError_symbol, "MakeTypeError") \
203 V(invalid_lhs_in_assignment_symbol, "invalid_lhs_in_assignment") \ 208 V(invalid_lhs_in_assignment_symbol, "invalid_lhs_in_assignment") \
204 V(invalid_lhs_in_for_in_symbol, "invalid_lhs_in_for_in") \ 209 V(invalid_lhs_in_for_in_symbol, "invalid_lhs_in_for_in") \
205 V(invalid_lhs_in_postfix_op_symbol, "invalid_lhs_in_postfix_op") \ 210 V(invalid_lhs_in_postfix_op_symbol, "invalid_lhs_in_postfix_op") \
206 V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \ 211 V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \
207 V(illegal_return_symbol, "illegal_return") \ 212 V(illegal_return_symbol, "illegal_return") \
208 V(illegal_break_symbol, "illegal_break") \ 213 V(illegal_break_symbol, "illegal_break") \
209 V(illegal_continue_symbol, "illegal_continue") \ 214 V(illegal_continue_symbol, "illegal_continue") \
210 V(unknown_label_symbol, "unknown_label") \ 215 V(unknown_label_symbol, "unknown_label") \
211 V(redeclaration_symbol, "redeclaration") \ 216 V(redeclaration_symbol, "redeclaration") \
212 V(failure_symbol, "<failure>") \ 217 V(failure_symbol, "<failure>") \
213 V(space_symbol, " ") \ 218 V(space_symbol, " ") \
214 V(exec_symbol, "exec") \ 219 V(exec_symbol, "exec") \
215 V(zero_symbol, "0") \ 220 V(zero_symbol, "0") \
216 V(global_eval_symbol, "GlobalEval") \ 221 V(global_eval_symbol, "GlobalEval") \
217 V(identity_hash_symbol, "v8::IdentityHash") \ 222 V(identity_hash_symbol, "v8::IdentityHash") \
218 V(closure_symbol, "(closure)") \ 223 V(closure_symbol, "(closure)") \
219 V(use_strict, "use strict") 224 V(use_strict, "use strict") \
225 V(dot_symbol, ".") \
226 V(anonymous_function_symbol, "(anonymous function)")
220 227
221 // Forward declarations. 228 // Forward declarations.
222 class GCTracer; 229 class GCTracer;
223 class HeapStats; 230 class HeapStats;
224 class Isolate; 231 class Isolate;
225 class WeakObjectRetainer; 232 class WeakObjectRetainer;
226 233
227 234
228 typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap, 235 typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap,
229 Object** pointer); 236 Object** pointer);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 // Allocates a partial map for bootstrapping. 516 // Allocates a partial map for bootstrapping.
510 MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type, 517 MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type,
511 int instance_size); 518 int instance_size);
512 519
513 // Allocate a map for the specified function 520 // Allocate a map for the specified function
514 MUST_USE_RESULT MaybeObject* AllocateInitialMap(JSFunction* fun); 521 MUST_USE_RESULT MaybeObject* AllocateInitialMap(JSFunction* fun);
515 522
516 // Allocates an empty code cache. 523 // Allocates an empty code cache.
517 MUST_USE_RESULT MaybeObject* AllocateCodeCache(); 524 MUST_USE_RESULT MaybeObject* AllocateCodeCache();
518 525
526 // Allocates an empty PolymorphicCodeCache.
527 MUST_USE_RESULT MaybeObject* AllocatePolymorphicCodeCache();
528
519 // Clear the Instanceof cache (used when a prototype changes). 529 // Clear the Instanceof cache (used when a prototype changes).
520 inline void ClearInstanceofCache(); 530 inline void ClearInstanceofCache();
521 531
522 // Allocates and fully initializes a String. There are two String 532 // Allocates and fully initializes a String. There are two String
523 // encodings: ASCII and two byte. One should choose between the three string 533 // encodings: ASCII and two byte. One should choose between the three string
524 // allocation functions based on the encoding of the string buffer used to 534 // allocation functions based on the encoding of the string buffer used to
525 // initialized the string. 535 // initialized the string.
526 // - ...FromAscii initializes the string from a buffer that is ASCII 536 // - ...FromAscii initializes the string from a buffer that is ASCII
527 // encoded (it does not check that the buffer is ASCII encoded) and the 537 // encoded (it does not check that the buffer is ASCII encoded) and the
528 // result will be ASCII encoded. 538 // result will be ASCII encoded.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 MUST_USE_RESULT MaybeObject* CopyFixedArrayWithMap(FixedArray* src, Map* map); 658 MUST_USE_RESULT MaybeObject* CopyFixedArrayWithMap(FixedArray* src, Map* map);
649 659
650 // Allocates a fixed array initialized with the hole values. 660 // Allocates a fixed array initialized with the hole values.
651 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 661 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
652 // failed. 662 // failed.
653 // Please note this does not perform a garbage collection. 663 // Please note this does not perform a garbage collection.
654 MUST_USE_RESULT MaybeObject* AllocateFixedArrayWithHoles( 664 MUST_USE_RESULT MaybeObject* AllocateFixedArrayWithHoles(
655 int length, 665 int length,
656 PretenureFlag pretenure = NOT_TENURED); 666 PretenureFlag pretenure = NOT_TENURED);
657 667
668 MUST_USE_RESULT MaybeObject* AllocateRawFixedDoubleArray(
669 int length,
670 PretenureFlag pretenure);
671
672 // Allocates a fixed double array with uninitialized values. Returns
673 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
674 // Please note this does not perform a garbage collection.
675 MUST_USE_RESULT MaybeObject* AllocateUninitializedFixedDoubleArray(
676 int length,
677 PretenureFlag pretenure = NOT_TENURED);
678
658 // AllocateHashTable is identical to AllocateFixedArray except 679 // AllocateHashTable is identical to AllocateFixedArray except
659 // that the resulting object has hash_table_map as map. 680 // that the resulting object has hash_table_map as map.
660 MUST_USE_RESULT MaybeObject* AllocateHashTable( 681 MUST_USE_RESULT MaybeObject* AllocateHashTable(
661 int length, PretenureFlag pretenure = NOT_TENURED); 682 int length, PretenureFlag pretenure = NOT_TENURED);
662 683
663 // Allocate a global (but otherwise uninitialized) context. 684 // Allocate a global (but otherwise uninitialized) context.
664 MUST_USE_RESULT MaybeObject* AllocateGlobalContext(); 685 MUST_USE_RESULT MaybeObject* AllocateGlobalContext();
665 686
666 // Allocate a function context. 687 // Allocate a function context.
667 MUST_USE_RESULT MaybeObject* AllocateFunctionContext(int length, 688 MUST_USE_RESULT MaybeObject* AllocateFunctionContext(int length,
668 JSFunction* closure); 689 JSFunction* function);
669 690
691 // Allocate a catch context.
692 MUST_USE_RESULT MaybeObject* AllocateCatchContext(JSFunction* function,
693 Context* previous,
694 String* name,
695 Object* thrown_object);
670 // Allocate a 'with' context. 696 // Allocate a 'with' context.
671 MUST_USE_RESULT MaybeObject* AllocateWithContext(Context* previous, 697 MUST_USE_RESULT MaybeObject* AllocateWithContext(JSFunction* function,
672 JSObject* extension, 698 Context* previous,
673 bool is_catch_context); 699 JSObject* extension);
674 700
675 // Allocates a new utility object in the old generation. 701 // Allocates a new utility object in the old generation.
676 MUST_USE_RESULT MaybeObject* AllocateStruct(InstanceType type); 702 MUST_USE_RESULT MaybeObject* AllocateStruct(InstanceType type);
677 703
678 // Allocates a function initialized with a shared part. 704 // Allocates a function initialized with a shared part.
679 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 705 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
680 // failed. 706 // failed.
681 // Please note this does not perform a garbage collection. 707 // Please note this does not perform a garbage collection.
682 MUST_USE_RESULT MaybeObject* AllocateFunction( 708 MUST_USE_RESULT MaybeObject* AllocateFunction(
683 Map* function_map, 709 Map* function_map,
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 1122
1097 // Given an address occupied by a live code object, return that object. 1123 // Given an address occupied by a live code object, return that object.
1098 Object* FindCodeObject(Address a); 1124 Object* FindCodeObject(Address a);
1099 1125
1100 // Invoke Shrink on shrinkable spaces. 1126 // Invoke Shrink on shrinkable spaces.
1101 void Shrink(); 1127 void Shrink();
1102 1128
1103 enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT }; 1129 enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT };
1104 inline HeapState gc_state() { return gc_state_; } 1130 inline HeapState gc_state() { return gc_state_; }
1105 1131
1132 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; }
1133
1106 #ifdef DEBUG 1134 #ifdef DEBUG
1107 bool IsAllocationAllowed() { return allocation_allowed_; } 1135 bool IsAllocationAllowed() { return allocation_allowed_; }
1108 inline bool allow_allocation(bool enable); 1136 inline bool allow_allocation(bool enable);
1109 1137
1110 bool disallow_allocation_failure() { 1138 bool disallow_allocation_failure() {
1111 return disallow_allocation_failure_; 1139 return disallow_allocation_failure_;
1112 } 1140 }
1113 1141
1114 void TracePathToObject(Object* target); 1142 void TracePathToObject(Object* target);
1115 void TracePathToGlobal(); 1143 void TracePathToGlobal();
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 1328
1301 // TODO(gc) Rename to IncrementalMarker after merge. 1329 // TODO(gc) Rename to IncrementalMarker after merge.
1302 IncrementalMarking* incremental_marking() { 1330 IncrementalMarking* incremental_marking() {
1303 return &incremental_marking_; 1331 return &incremental_marking_;
1304 } 1332 }
1305 1333
1306 ExternalStringTable* external_string_table() { 1334 ExternalStringTable* external_string_table() {
1307 return &external_string_table_; 1335 return &external_string_table_;
1308 } 1336 }
1309 1337
1338 // Returns the current sweep generation.
1339 int sweep_generation() {
1340 return sweep_generation_;
1341 }
1342
1310 inline Isolate* isolate(); 1343 inline Isolate* isolate();
1311 1344
1312 inline void CallGlobalGCPrologueCallback() { 1345 inline void CallGlobalGCPrologueCallback() {
1313 if (global_gc_prologue_callback_ != NULL) global_gc_prologue_callback_(); 1346 if (global_gc_prologue_callback_ != NULL) global_gc_prologue_callback_();
1314 } 1347 }
1315 1348
1316 inline void CallGlobalGCEpilogueCallback() { 1349 inline void CallGlobalGCEpilogueCallback() {
1317 if (global_gc_epilogue_callback_ != NULL) global_gc_epilogue_callback_(); 1350 if (global_gc_epilogue_callback_ != NULL) global_gc_epilogue_callback_();
1318 } 1351 }
1319 1352
(...skipping 23 matching lines...) Expand all
1343 int reserved_semispace_size_; 1376 int reserved_semispace_size_;
1344 int max_semispace_size_; 1377 int max_semispace_size_;
1345 int initial_semispace_size_; 1378 int initial_semispace_size_;
1346 intptr_t max_old_generation_size_; 1379 intptr_t max_old_generation_size_;
1347 intptr_t max_executable_size_; 1380 intptr_t max_executable_size_;
1348 1381
1349 // For keeping track of how much data has survived 1382 // For keeping track of how much data has survived
1350 // scavenge since last new space expansion. 1383 // scavenge since last new space expansion.
1351 int survived_since_last_expansion_; 1384 int survived_since_last_expansion_;
1352 1385
1386 // For keeping track on when to flush RegExp code.
1387 int sweep_generation_;
1388
1353 int always_allocate_scope_depth_; 1389 int always_allocate_scope_depth_;
1354 int linear_allocation_scope_depth_; 1390 int linear_allocation_scope_depth_;
1355 1391
1356 // For keeping track of context disposals. 1392 // For keeping track of context disposals.
1357 int contexts_disposed_; 1393 int contexts_disposed_;
1358 1394
1359 int scan_on_scavenge_pages_; 1395 int scan_on_scavenge_pages_;
1360 1396
1361 #if defined(V8_TARGET_ARCH_X64) 1397 #if defined(V8_TARGET_ARCH_X64)
1362 static const int kMaxObjectSizeInNewSpace = 1024*KB; 1398 static const int kMaxObjectSizeInNewSpace = 1024*KB;
1363 #else 1399 #else
1364 static const int kMaxObjectSizeInNewSpace = 512*KB; 1400 static const int kMaxObjectSizeInNewSpace = 512*KB;
1365 #endif 1401 #endif
1366 1402
1367 NewSpace new_space_; 1403 NewSpace new_space_;
1368 OldSpace* old_pointer_space_; 1404 OldSpace* old_pointer_space_;
1369 OldSpace* old_data_space_; 1405 OldSpace* old_data_space_;
1370 OldSpace* code_space_; 1406 OldSpace* code_space_;
1371 MapSpace* map_space_; 1407 MapSpace* map_space_;
1372 CellSpace* cell_space_; 1408 CellSpace* cell_space_;
1373 LargeObjectSpace* lo_space_; 1409 LargeObjectSpace* lo_space_;
1374 HeapState gc_state_; 1410 HeapState gc_state_;
1411 int gc_post_processing_depth_;
1375 1412
1376 // Returns the amount of external memory registered since last global gc. 1413 // Returns the amount of external memory registered since last global gc.
1377 int PromotedExternalMemorySize(); 1414 int PromotedExternalMemorySize();
1378 1415
1379 int ms_count_; // how many mark-sweep collections happened 1416 int ms_count_; // how many mark-sweep collections happened
1380 unsigned int gc_count_; // how many gc happened 1417 unsigned int gc_count_; // how many gc happened
1381 1418
1382 // Total length of the strings we failed to flatten since the last GC. 1419 // Total length of the strings we failed to flatten since the last GC.
1383 int unflattened_strings_length_; 1420 int unflattened_strings_length_;
1384 1421
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 1573
1537 void CreateFixedStubs(); 1574 void CreateFixedStubs();
1538 1575
1539 MaybeObject* CreateOddball(const char* to_string, 1576 MaybeObject* CreateOddball(const char* to_string,
1540 Object* to_number, 1577 Object* to_number,
1541 byte kind); 1578 byte kind);
1542 1579
1543 // Allocate empty fixed array. 1580 // Allocate empty fixed array.
1544 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); 1581 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray();
1545 1582
1583 // Allocate empty fixed double array.
1584 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedDoubleArray();
1585
1546 // Performs a minor collection in new generation. 1586 // Performs a minor collection in new generation.
1547 void Scavenge(); 1587 void Scavenge();
1548 1588
1549 static String* UpdateNewSpaceReferenceInExternalStringTableEntry( 1589 static String* UpdateNewSpaceReferenceInExternalStringTableEntry(
1550 Heap* heap, 1590 Heap* heap,
1551 Object** pointer); 1591 Object** pointer);
1552 1592
1553 Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front); 1593 Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front);
1554 static void ScavengeStoreBufferCallback(Heap* heap, 1594 static void ScavengeStoreBufferCallback(Heap* heap,
1555 MemoryChunk* page, 1595 MemoryChunk* page,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 intptr_t* code_space_capacity; // 8 1760 intptr_t* code_space_capacity; // 8
1721 intptr_t* map_space_size; // 9 1761 intptr_t* map_space_size; // 9
1722 intptr_t* map_space_capacity; // 10 1762 intptr_t* map_space_capacity; // 10
1723 intptr_t* cell_space_size; // 11 1763 intptr_t* cell_space_size; // 11
1724 intptr_t* cell_space_capacity; // 12 1764 intptr_t* cell_space_capacity; // 12
1725 intptr_t* lo_space_size; // 13 1765 intptr_t* lo_space_size; // 13
1726 int* global_handle_count; // 14 1766 int* global_handle_count; // 14
1727 int* weak_global_handle_count; // 15 1767 int* weak_global_handle_count; // 15
1728 int* pending_global_handle_count; // 16 1768 int* pending_global_handle_count; // 16
1729 int* near_death_global_handle_count; // 17 1769 int* near_death_global_handle_count; // 17
1730 int* destroyed_global_handle_count; // 18 1770 int* free_global_handle_count; // 18
1731 intptr_t* memory_allocator_size; // 19 1771 intptr_t* memory_allocator_size; // 19
1732 intptr_t* memory_allocator_capacity; // 20 1772 intptr_t* memory_allocator_capacity; // 20
1733 int* objects_per_type; // 21 1773 int* objects_per_type; // 21
1734 int* size_per_type; // 22 1774 int* size_per_type; // 22
1735 int* os_error; // 23 1775 int* os_error; // 23
1736 int* end_marker; // 24 1776 int* end_marker; // 24
1737 }; 1777 };
1738 1778
1739 1779
1740 class AlwaysAllocateScope { 1780 class AlwaysAllocateScope {
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 key.array = array; 1996 key.array = array;
1957 key.name = name; 1997 key.name = name;
1958 results_[index] = result; 1998 results_[index] = result;
1959 } 1999 }
1960 } 2000 }
1961 2001
1962 // Clear the cache. 2002 // Clear the cache.
1963 void Clear(); 2003 void Clear();
1964 2004
1965 static const int kAbsent = -2; 2005 static const int kAbsent = -2;
2006
1966 private: 2007 private:
1967 DescriptorLookupCache() { 2008 DescriptorLookupCache() {
1968 for (int i = 0; i < kLength; ++i) { 2009 for (int i = 0; i < kLength; ++i) {
1969 keys_[i].array = NULL; 2010 keys_[i].array = NULL;
1970 keys_[i].name = NULL; 2011 keys_[i].name = NULL;
1971 results_[i] = kAbsent; 2012 results_[i] = kAbsent;
1972 } 2013 }
1973 } 2014 }
1974 2015
1975 static int Hash(DescriptorArray* array, String* name) { 2016 static int Hash(DescriptorArray* array, String* name) {
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 2380
2340 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2381 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2341 }; 2382 };
2342 #endif // DEBUG || LIVE_OBJECT_LIST 2383 #endif // DEBUG || LIVE_OBJECT_LIST
2343 2384
2344 } } // namespace v8::internal 2385 } } // namespace v8::internal
2345 2386
2346 #undef HEAP 2387 #undef HEAP
2347 2388
2348 #endif // V8_HEAP_H_ 2389 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698