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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 | 683 |
684 // Utility to invoke the scavenger. This is needed in test code to | 684 // Utility to invoke the scavenger. This is needed in test code to |
685 // ensure correct callback for weak global handles. | 685 // ensure correct callback for weak global handles. |
686 static void PerformScavenge(); | 686 static void PerformScavenge(); |
687 | 687 |
688 #ifdef DEBUG | 688 #ifdef DEBUG |
689 // Utility used with flag gc-greedy. | 689 // Utility used with flag gc-greedy. |
690 static bool GarbageCollectionGreedyCheck(); | 690 static bool GarbageCollectionGreedyCheck(); |
691 #endif | 691 #endif |
692 | 692 |
| 693 static void SetExternalStringDiposeCallback( |
| 694 ExternalStringDiposeCallback callback) { |
| 695 external_string_dispose_callback_ = callback; |
| 696 } |
| 697 |
693 static void AddGCPrologueCallback( | 698 static void AddGCPrologueCallback( |
694 GCEpilogueCallback callback, GCType gc_type_filter); | 699 GCEpilogueCallback callback, GCType gc_type_filter); |
695 static void RemoveGCPrologueCallback(GCEpilogueCallback callback); | 700 static void RemoveGCPrologueCallback(GCEpilogueCallback callback); |
696 | 701 |
697 static void AddGCEpilogueCallback( | 702 static void AddGCEpilogueCallback( |
698 GCEpilogueCallback callback, GCType gc_type_filter); | 703 GCEpilogueCallback callback, GCType gc_type_filter); |
699 static void RemoveGCEpilogueCallback(GCEpilogueCallback callback); | 704 static void RemoveGCEpilogueCallback(GCEpilogueCallback callback); |
700 | 705 |
701 static void SetGlobalGCPrologueCallback(GCCallback callback) { | 706 static void SetGlobalGCPrologueCallback(GCCallback callback) { |
702 ASSERT((callback == NULL) ^ (global_gc_prologue_callback_ == NULL)); | 707 ASSERT((callback == NULL) ^ (global_gc_prologue_callback_ == NULL)); |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 }; | 1136 }; |
1132 | 1137 |
1133 static const StringTypeTable string_type_table[]; | 1138 static const StringTypeTable string_type_table[]; |
1134 static const ConstantSymbolTable constant_symbol_table[]; | 1139 static const ConstantSymbolTable constant_symbol_table[]; |
1135 static const StructTable struct_table[]; | 1140 static const StructTable struct_table[]; |
1136 | 1141 |
1137 // The special hidden symbol which is an empty string, but does not match | 1142 // The special hidden symbol which is an empty string, but does not match |
1138 // any string when looked up in properties. | 1143 // any string when looked up in properties. |
1139 static String* hidden_symbol_; | 1144 static String* hidden_symbol_; |
1140 | 1145 |
| 1146 static ExternalStringDiposeCallback |
| 1147 external_string_dispose_callback_; |
| 1148 |
1141 // GC callback function, called before and after mark-compact GC. | 1149 // GC callback function, called before and after mark-compact GC. |
1142 // Allocations in the callback function are disallowed. | 1150 // Allocations in the callback function are disallowed. |
1143 struct GCPrologueCallbackPair { | 1151 struct GCPrologueCallbackPair { |
1144 GCPrologueCallbackPair(GCPrologueCallback callback, GCType gc_type) | 1152 GCPrologueCallbackPair(GCPrologueCallback callback, GCType gc_type) |
1145 : callback(callback), gc_type(gc_type) { | 1153 : callback(callback), gc_type(gc_type) { |
1146 } | 1154 } |
1147 bool operator==(const GCPrologueCallbackPair& pair) const { | 1155 bool operator==(const GCPrologueCallbackPair& pair) const { |
1148 return pair.callback == callback; | 1156 return pair.callback == callback; |
1149 } | 1157 } |
1150 GCPrologueCallback callback; | 1158 GCPrologueCallback callback; |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1928 | 1936 |
1929 // To speed up scavenge collections new space string are kept | 1937 // To speed up scavenge collections new space string are kept |
1930 // separate from old space strings. | 1938 // separate from old space strings. |
1931 static List<Object*> new_space_strings_; | 1939 static List<Object*> new_space_strings_; |
1932 static List<Object*> old_space_strings_; | 1940 static List<Object*> old_space_strings_; |
1933 }; | 1941 }; |
1934 | 1942 |
1935 } } // namespace v8::internal | 1943 } } // namespace v8::internal |
1936 | 1944 |
1937 #endif // V8_HEAP_H_ | 1945 #endif // V8_HEAP_H_ |
OLD | NEW |