OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 #ifndef V8_HEAP_H_ | 28 #ifndef V8_HEAP_H_ |
29 #define V8_HEAP_H_ | 29 #define V8_HEAP_H_ |
30 | 30 |
31 #include "zone-inl.h" | 31 #include "zone-inl.h" |
32 | 32 |
33 namespace v8 { | 33 namespace v8 { |
34 namespace internal { | 34 namespace internal { |
35 | 35 |
36 // Defines all the roots in Heap. | 36 // Defines all the roots in Heap. |
37 #define STRONG_ROOT_LIST(V) \ | 37 #define STRONG_ROOT_LIST(V) \ |
38 V(Map, meta_map) \ | 38 V(Map, meta_map, MetaMap) \ |
Kasper Lund
2009/07/08 12:42:37
Is it really worth giving everything two names to
Erik Corry
2009/07/08 14:19:50
I think I'll stick with both names because the cam
| |
39 V(Map, heap_number_map) \ | 39 V(Map, heap_number_map, HeapNumberMap) \ |
40 V(Map, short_string_map) \ | 40 V(Map, short_string_map, ShortStringMap) \ |
41 V(Map, medium_string_map) \ | 41 V(Map, medium_string_map, MediumStringMap) \ |
42 V(Map, long_string_map) \ | 42 V(Map, long_string_map, LongStringMap) \ |
43 V(Map, short_ascii_string_map) \ | 43 V(Map, short_ascii_string_map, ShortAsciiStringMap) \ |
44 V(Map, medium_ascii_string_map) \ | 44 V(Map, medium_ascii_string_map, MediumAsciiStringMap) \ |
45 V(Map, long_ascii_string_map) \ | 45 V(Map, long_ascii_string_map, LongAsciiStringMap) \ |
46 V(Map, short_symbol_map) \ | 46 V(Map, short_symbol_map, ShortSymbolMap) \ |
47 V(Map, medium_symbol_map) \ | 47 V(Map, medium_symbol_map, MediumSymbolMap) \ |
48 V(Map, long_symbol_map) \ | 48 V(Map, long_symbol_map, LongSymbolMap) \ |
49 V(Map, short_ascii_symbol_map) \ | 49 V(Map, short_ascii_symbol_map, ShortAsciiSymbolMap) \ |
50 V(Map, medium_ascii_symbol_map) \ | 50 V(Map, medium_ascii_symbol_map, MediumAsciiSymbolMap) \ |
51 V(Map, long_ascii_symbol_map) \ | 51 V(Map, long_ascii_symbol_map, LongAsciiSymbolMap) \ |
52 V(Map, short_cons_symbol_map) \ | 52 V(Map, short_cons_symbol_map, ShortConsSymbolMap) \ |
53 V(Map, medium_cons_symbol_map) \ | 53 V(Map, medium_cons_symbol_map, MediumConsSymbolMap) \ |
54 V(Map, long_cons_symbol_map) \ | 54 V(Map, long_cons_symbol_map, LongConsSymbolMap) \ |
55 V(Map, short_cons_ascii_symbol_map) \ | 55 V(Map, short_cons_ascii_symbol_map, ShortConsAsciiSymbolMap) \ |
56 V(Map, medium_cons_ascii_symbol_map) \ | 56 V(Map, medium_cons_ascii_symbol_map, MediumConsAsciiSymbolMap) \ |
57 V(Map, long_cons_ascii_symbol_map) \ | 57 V(Map, long_cons_ascii_symbol_map, LongConsAsciiSymbolMap) \ |
58 V(Map, short_sliced_symbol_map) \ | 58 V(Map, short_sliced_symbol_map, ShortSlicedSymbolMap) \ |
59 V(Map, medium_sliced_symbol_map) \ | 59 V(Map, medium_sliced_symbol_map, MediumSlicedSymbolMap) \ |
60 V(Map, long_sliced_symbol_map) \ | 60 V(Map, long_sliced_symbol_map, LongSlicedSymbolMap) \ |
61 V(Map, short_sliced_ascii_symbol_map) \ | 61 V(Map, short_sliced_ascii_symbol_map, ShortSlicedAsciiSymbolMap) \ |
62 V(Map, medium_sliced_ascii_symbol_map) \ | 62 V(Map, medium_sliced_ascii_symbol_map, MediumSlicedAsciiSymbolMap) \ |
63 V(Map, long_sliced_ascii_symbol_map) \ | 63 V(Map, long_sliced_ascii_symbol_map, LongSlicedAsciiSymbolMap) \ |
64 V(Map, short_external_symbol_map) \ | 64 V(Map, short_external_symbol_map, ShortExternalSymbolMap) \ |
65 V(Map, medium_external_symbol_map) \ | 65 V(Map, medium_external_symbol_map, MediumExternalSymbolMap) \ |
66 V(Map, long_external_symbol_map) \ | 66 V(Map, long_external_symbol_map, LongExternalSymbolMap) \ |
67 V(Map, short_external_ascii_symbol_map) \ | 67 V(Map, short_external_ascii_symbol_map, ShortExternalAsciiSymbolMap) \ |
68 V(Map, medium_external_ascii_symbol_map) \ | 68 V(Map, medium_external_ascii_symbol_map, MediumExternalAsciiSymbolMap) \ |
69 V(Map, long_external_ascii_symbol_map) \ | 69 V(Map, long_external_ascii_symbol_map, LongExternalAsciiSymbolMap) \ |
70 V(Map, short_cons_string_map) \ | 70 V(Map, short_cons_string_map, ShortConsStringMap) \ |
71 V(Map, medium_cons_string_map) \ | 71 V(Map, medium_cons_string_map, MediumConsStringMap) \ |
72 V(Map, long_cons_string_map) \ | 72 V(Map, long_cons_string_map, LongConsStringMap) \ |
73 V(Map, short_cons_ascii_string_map) \ | 73 V(Map, short_cons_ascii_string_map, ShortConsAsciiStringMap) \ |
74 V(Map, medium_cons_ascii_string_map) \ | 74 V(Map, medium_cons_ascii_string_map, MediumConsAsciiStringMap) \ |
75 V(Map, long_cons_ascii_string_map) \ | 75 V(Map, long_cons_ascii_string_map, LongConsAsciiStringMap) \ |
76 V(Map, short_sliced_string_map) \ | 76 V(Map, short_sliced_string_map, ShortSlicedStringMap) \ |
77 V(Map, medium_sliced_string_map) \ | 77 V(Map, medium_sliced_string_map, MediumSlicedStringMap) \ |
78 V(Map, long_sliced_string_map) \ | 78 V(Map, long_sliced_string_map, LongSlicedStringMap) \ |
79 V(Map, short_sliced_ascii_string_map) \ | 79 V(Map, short_sliced_ascii_string_map, ShortSlicedAsciiStringMap) \ |
80 V(Map, medium_sliced_ascii_string_map) \ | 80 V(Map, medium_sliced_ascii_string_map, MediumSlicedAsciiStringMap) \ |
81 V(Map, long_sliced_ascii_string_map) \ | 81 V(Map, long_sliced_ascii_string_map, LongSlicedAsciiStringMap) \ |
82 V(Map, short_external_string_map) \ | 82 V(Map, short_external_string_map, ShortExternalStringMap) \ |
83 V(Map, medium_external_string_map) \ | 83 V(Map, medium_external_string_map, MediumExternalStringMap) \ |
84 V(Map, long_external_string_map) \ | 84 V(Map, long_external_string_map, LongExternalStringMap) \ |
85 V(Map, short_external_ascii_string_map) \ | 85 V(Map, short_external_ascii_string_map, ShortExternalAsciiStringMap) \ |
86 V(Map, medium_external_ascii_string_map) \ | 86 V(Map, medium_external_ascii_string_map, MediumExternalAsciiStringMap) \ |
87 V(Map, long_external_ascii_string_map) \ | 87 V(Map, long_external_ascii_string_map, LongExternalAsciiStringMap) \ |
88 V(Map, undetectable_short_string_map) \ | 88 V(Map, undetectable_short_string_map, UndetectableShortStringMap) \ |
89 V(Map, undetectable_medium_string_map) \ | 89 V(Map, undetectable_medium_string_map, UndetectableMediumStringMap) \ |
90 V(Map, undetectable_long_string_map) \ | 90 V(Map, undetectable_long_string_map, UndetectableLongStringMap) \ |
91 V(Map, undetectable_short_ascii_string_map) \ | 91 V(Map, undetectable_short_ascii_string_map, UndetectableShortAsciiStringMap) \ |
92 V(Map, undetectable_medium_ascii_string_map) \ | 92 V(Map, \ |
93 V(Map, undetectable_long_ascii_string_map) \ | 93 undetectable_medium_ascii_string_map, \ |
94 V(Map, byte_array_map) \ | 94 UndetectableMediumAsciiStringMap) \ |
95 V(Map, fixed_array_map) \ | 95 V(Map, undetectable_long_ascii_string_map, UndetectableLongAsciiStringMap) \ |
96 V(Map, hash_table_map) \ | 96 V(Map, byte_array_map, ByteArrayMap) \ |
97 V(Map, context_map) \ | 97 V(Map, fixed_array_map, FixedArrayMap) \ |
98 V(Map, catch_context_map) \ | 98 V(Map, hash_table_map, HashTableMap) \ |
99 V(Map, global_context_map) \ | 99 V(Map, context_map, ContextMap) \ |
100 V(Map, code_map) \ | 100 V(Map, catch_context_map, CatchContextMap) \ |
101 V(Map, oddball_map) \ | 101 V(Map, global_context_map, GlobalContextMap) \ |
102 V(Map, global_property_cell_map) \ | 102 V(Map, code_map, CodeMap) \ |
103 V(Map, boilerplate_function_map) \ | 103 V(Map, oddball_map, OddballMap) \ |
104 V(Map, shared_function_info_map) \ | 104 V(Map, global_property_cell_map, GlobalPropertyCellMap) \ |
105 V(Map, proxy_map) \ | 105 V(Map, boilerplate_function_map, BoilerplateFunctionMap) \ |
106 V(Map, one_word_filler_map) \ | 106 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ |
107 V(Map, two_word_filler_map) \ | 107 V(Map, proxy_map, ProxyMap) \ |
108 V(Object, nan_value) \ | 108 V(Map, one_word_filler_map, OneWordFillerMap) \ |
109 V(Object, undefined_value) \ | 109 V(Map, two_word_filler_map, TwoWordFillerMap) \ |
110 V(Object, minus_zero_value) \ | 110 V(Object, nan_value, NanValue) \ |
111 V(Object, null_value) \ | 111 V(Object, undefined_value, UndefinedValue) \ |
112 V(Object, true_value) \ | 112 V(Object, minus_zero_value, MinusZeroValue) \ |
113 V(Object, false_value) \ | 113 V(Object, null_value, NullValue) \ |
114 V(String, empty_string) \ | 114 V(Object, true_value, TrueValue) \ |
115 V(FixedArray, empty_fixed_array) \ | 115 V(Object, false_value, FalseValue) \ |
116 V(DescriptorArray, empty_descriptor_array) \ | 116 V(String, empty_string, EmptyString) \ |
117 V(Object, the_hole_value) \ | 117 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
118 V(Map, neander_map) \ | 118 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ |
119 V(JSObject, message_listeners) \ | 119 V(Object, the_hole_value, TheHoleValue) \ |
120 V(Proxy, prototype_accessors) \ | 120 V(Map, neander_map, NeanderMap) \ |
121 V(NumberDictionary, code_stubs) \ | 121 V(JSObject, message_listeners, MessageListeners) \ |
122 V(NumberDictionary, non_monomorphic_cache) \ | 122 V(Proxy, prototype_accessors, PrototypeAccessors) \ |
123 V(Code, js_entry_code) \ | 123 V(NumberDictionary, code_stubs, CodeStubs) \ |
124 V(Code, js_construct_entry_code) \ | 124 V(NumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \ |
125 V(Code, c_entry_code) \ | 125 V(Code, js_entry_code, JsEntryCode) \ |
126 V(Code, c_entry_debug_break_code) \ | 126 V(Code, js_construct_entry_code, JsConstructEntryCode) \ |
127 V(FixedArray, number_string_cache) \ | 127 V(Code, c_entry_code, CEntryCode) \ |
128 V(FixedArray, single_character_string_cache) \ | 128 V(Code, c_entry_debug_break_code, CEntryDebugBreakCode) \ |
129 V(FixedArray, natives_source_cache) \ | 129 V(FixedArray, number_string_cache, NumberStringCache) \ |
130 V(Object, last_script_id) | 130 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ |
131 V(FixedArray, natives_source_cache, NativesSourceCache) \ | |
132 V(Object, last_script_id, LastScriptId) | |
131 | 133 |
132 | 134 |
133 #define ROOT_LIST(V) \ | 135 #define ROOT_LIST(V) \ |
134 STRONG_ROOT_LIST(V) \ | 136 STRONG_ROOT_LIST(V) \ |
135 V(Object, symbol_table) | 137 V(Object, symbol_table, SymbolTable) |
Kasper Lund
2009/07/08 12:42:37
Why isn't this of type SymbolTable*?
Erik Corry
2009/07/08 14:19:50
It is now.
| |
136 | 138 |
137 #define SYMBOL_LIST(V) \ | 139 #define SYMBOL_LIST(V) \ |
138 V(Array_symbol, "Array") \ | 140 V(Array_symbol, "Array") \ |
139 V(Object_symbol, "Object") \ | 141 V(Object_symbol, "Object") \ |
140 V(Proto_symbol, "__proto__") \ | 142 V(Proto_symbol, "__proto__") \ |
141 V(StringImpl_symbol, "StringImpl") \ | 143 V(StringImpl_symbol, "StringImpl") \ |
142 V(arguments_symbol, "arguments") \ | 144 V(arguments_symbol, "arguments") \ |
143 V(Arguments_symbol, "Arguments") \ | 145 V(Arguments_symbol, "Arguments") \ |
144 V(arguments_shadow_symbol, ".arguments") \ | 146 V(arguments_shadow_symbol, ".arguments") \ |
145 V(call_symbol, "call") \ | 147 V(call_symbol, "call") \ |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
629 static bool GarbageCollectionGreedyCheck(); | 631 static bool GarbageCollectionGreedyCheck(); |
630 #endif | 632 #endif |
631 | 633 |
632 static void SetGlobalGCPrologueCallback(GCCallback callback) { | 634 static void SetGlobalGCPrologueCallback(GCCallback callback) { |
633 global_gc_prologue_callback_ = callback; | 635 global_gc_prologue_callback_ = callback; |
634 } | 636 } |
635 static void SetGlobalGCEpilogueCallback(GCCallback callback) { | 637 static void SetGlobalGCEpilogueCallback(GCCallback callback) { |
636 global_gc_epilogue_callback_ = callback; | 638 global_gc_epilogue_callback_ = callback; |
637 } | 639 } |
638 | 640 |
639 // Heap roots | 641 // Heap roots. We have versions with and without type::cast() here. You |
640 #define ROOT_ACCESSOR(type, name) static type* name() { return name##_; } | 642 // can't use type::cast during GC because the assert fails. |
643 #define ROOT_ACCESSOR(type, name, camel_name) \ | |
644 static inline type* name() { \ | |
645 return type::cast(roots_[k##camel_name##RootIndex]); \ | |
646 } \ | |
647 static inline type* raw_unchecked_##name() { \ | |
648 return reinterpret_cast<type*>(roots_[k##camel_name##RootIndex]); \ | |
649 } | |
641 ROOT_LIST(ROOT_ACCESSOR) | 650 ROOT_LIST(ROOT_ACCESSOR) |
642 #undef ROOT_ACCESSOR | 651 #undef ROOT_ACCESSOR |
643 | 652 |
644 // Utility type maps | 653 // Utility type maps |
645 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \ | 654 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \ |
646 static Map* name##_map() { return name##_map_; } | 655 static inline Map* name##_map() { \ |
656 return Map::cast(roots_[k##Name##MapRootIndex]); \ | |
657 } | |
647 STRUCT_LIST(STRUCT_MAP_ACCESSOR) | 658 STRUCT_LIST(STRUCT_MAP_ACCESSOR) |
648 #undef STRUCT_MAP_ACCESSOR | 659 #undef STRUCT_MAP_ACCESSOR |
649 | 660 |
650 #define SYMBOL_ACCESSOR(name, str) static String* name() { return name##_; } | 661 #define SYMBOL_ACCESSOR(name, str) static inline String* name() { \ |
662 return String::cast(roots_[k##name##RootIndex]); \ | |
663 } | |
651 SYMBOL_LIST(SYMBOL_ACCESSOR) | 664 SYMBOL_LIST(SYMBOL_ACCESSOR) |
652 #undef SYMBOL_ACCESSOR | 665 #undef SYMBOL_ACCESSOR |
653 | 666 |
654 // The hidden_symbol is special because it is the empty string, but does | 667 // The hidden_symbol is special because it is the empty string, but does |
655 // not match the empty string. | 668 // not match the empty string. |
656 static String* hidden_symbol() { return hidden_symbol_; } | 669 static String* hidden_symbol() { return hidden_symbol_; } |
657 | 670 |
658 // Iterates over all roots in the heap. | 671 // Iterates over all roots in the heap. |
659 static void IterateRoots(ObjectVisitor* v); | 672 static void IterateRoots(ObjectVisitor* v); |
660 // Iterates over all strong roots in the heap. | 673 // Iterates over all strong roots in the heap. |
(...skipping 24 matching lines...) Expand all Loading... | |
685 // Checks whether an address/object in a space. | 698 // Checks whether an address/object in a space. |
686 // Currently used by tests and heap verification only. | 699 // Currently used by tests and heap verification only. |
687 static bool InSpace(Address addr, AllocationSpace space); | 700 static bool InSpace(Address addr, AllocationSpace space); |
688 static bool InSpace(HeapObject* value, AllocationSpace space); | 701 static bool InSpace(HeapObject* value, AllocationSpace space); |
689 | 702 |
690 // Finds out which space an object should get promoted to based on its type. | 703 // Finds out which space an object should get promoted to based on its type. |
691 static inline OldSpace* TargetSpace(HeapObject* object); | 704 static inline OldSpace* TargetSpace(HeapObject* object); |
692 static inline AllocationSpace TargetSpaceId(InstanceType type); | 705 static inline AllocationSpace TargetSpaceId(InstanceType type); |
693 | 706 |
694 // Sets the stub_cache_ (only used when expanding the dictionary). | 707 // Sets the stub_cache_ (only used when expanding the dictionary). |
695 static void set_code_stubs(NumberDictionary* value) { code_stubs_ = value; } | 708 static void set_code_stubs(NumberDictionary* value) { |
709 roots_[kCodeStubsRootIndex] = value; | |
710 } | |
696 | 711 |
697 // Sets the non_monomorphic_cache_ (only used when expanding the dictionary). | 712 // Sets the non_monomorphic_cache_ (only used when expanding the dictionary). |
698 static void set_non_monomorphic_cache(NumberDictionary* value) { | 713 static void set_non_monomorphic_cache(NumberDictionary* value) { |
699 non_monomorphic_cache_ = value; | 714 roots_[kNonMonomorphicCacheRootIndex] = value; |
700 } | 715 } |
701 | 716 |
702 // Update the next script id. | 717 // Update the next script id. |
703 static inline void SetLastScriptId(Object* last_script_id); | 718 static inline void SetLastScriptId(Object* last_script_id); |
704 | 719 |
705 #ifdef DEBUG | 720 #ifdef DEBUG |
706 static void Print(); | 721 static void Print(); |
707 static void PrintHandles(); | 722 static void PrintHandles(); |
708 | 723 |
709 // Verify the heap is in its normal state before or after a GC. | 724 // Verify the heap is in its normal state before or after a GC. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
876 // by global handles | 891 // by global handles |
877 static int amount_of_external_allocated_memory_; | 892 static int amount_of_external_allocated_memory_; |
878 | 893 |
879 // Caches the amount of external memory registered at the last global gc. | 894 // Caches the amount of external memory registered at the last global gc. |
880 static int amount_of_external_allocated_memory_at_last_global_gc_; | 895 static int amount_of_external_allocated_memory_at_last_global_gc_; |
881 | 896 |
882 // Indicates that an allocation has failed in the old generation since the | 897 // Indicates that an allocation has failed in the old generation since the |
883 // last GC. | 898 // last GC. |
884 static int old_gen_exhausted_; | 899 static int old_gen_exhausted_; |
885 | 900 |
886 // Declare all the roots | 901 // Declare all the root indices. |
887 #define ROOT_DECLARATION(type, name) static type* name##_; | 902 enum RootListIndex { |
888 ROOT_LIST(ROOT_DECLARATION) | 903 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
889 #undef ROOT_DECLARATION | 904 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) |
905 #undef ROOT_INDEX_DECLARATION | |
890 | 906 |
891 // Utility type maps | 907 // Utility type maps |
892 #define DECLARE_STRUCT_MAP(NAME, Name, name) static Map* name##_map_; | 908 #define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex, |
893 STRUCT_LIST(DECLARE_STRUCT_MAP) | 909 STRUCT_LIST(DECLARE_STRUCT_MAP) |
894 #undef DECLARE_STRUCT_MAP | 910 #undef DECLARE_STRUCT_MAP |
895 | 911 |
896 #define SYMBOL_DECLARATION(name, str) static String* name##_; | 912 #define SYMBOL_INDEX_DECLARATION(name, str) k##name##RootIndex, |
897 SYMBOL_LIST(SYMBOL_DECLARATION) | 913 SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) |
898 #undef SYMBOL_DECLARATION | 914 #undef SYMBOL_DECLARATION |
899 | 915 |
916 kSymbolTableRootIndex, | |
917 kStrongRootListLength = kSymbolTableRootIndex, | |
918 kRootListLength}; | |
Kasper Lund
2009/07/08 12:42:37
Put }; on a new line.
Erik Corry
2009/07/08 14:19:50
OK
| |
919 | |
920 static Object* roots_[kRootListLength]; | |
921 | |
922 struct StringTypeTable { | |
923 InstanceType type; | |
924 int size; | |
925 RootListIndex index; | |
926 }; | |
927 | |
928 struct ConstantSymbolTable { | |
929 const char* contents; | |
930 RootListIndex index; | |
931 }; | |
932 | |
933 struct StructTable { | |
934 InstanceType type; | |
935 int size; | |
936 RootListIndex index; | |
937 }; | |
938 | |
939 static const StringTypeTable string_type_table[]; | |
940 static const ConstantSymbolTable constant_symbol_table[]; | |
941 static const StructTable struct_table[]; | |
942 | |
900 // The special hidden symbol which is an empty string, but does not match | 943 // The special hidden symbol which is an empty string, but does not match |
901 // any string when looked up in properties. | 944 // any string when looked up in properties. |
902 static String* hidden_symbol_; | 945 static String* hidden_symbol_; |
903 | 946 |
904 // GC callback function, called before and after mark-compact GC. | 947 // GC callback function, called before and after mark-compact GC. |
905 // Allocations in the callback function are disallowed. | 948 // Allocations in the callback function are disallowed. |
906 static GCCallback global_gc_prologue_callback_; | 949 static GCCallback global_gc_prologue_callback_; |
907 static GCCallback global_gc_epilogue_callback_; | 950 static GCCallback global_gc_epilogue_callback_; |
908 | 951 |
909 // Checks whether a global GC is necessary | 952 // Checks whether a global GC is necessary |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1403 int marked_count_; | 1446 int marked_count_; |
1404 | 1447 |
1405 // The count from the end of the previous full GC. Will be zero if there | 1448 // The count from the end of the previous full GC. Will be zero if there |
1406 // was no previous full GC. | 1449 // was no previous full GC. |
1407 int previous_marked_count_; | 1450 int previous_marked_count_; |
1408 }; | 1451 }; |
1409 | 1452 |
1410 } } // namespace v8::internal | 1453 } } // namespace v8::internal |
1411 | 1454 |
1412 #endif // V8_HEAP_H_ | 1455 #endif // V8_HEAP_H_ |
OLD | NEW |