| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \ | 188 V(invalid_lhs_in_prefix_op_symbol, "invalid_lhs_in_prefix_op") \ |
| 189 V(illegal_return_symbol, "illegal_return") \ | 189 V(illegal_return_symbol, "illegal_return") \ |
| 190 V(illegal_break_symbol, "illegal_break") \ | 190 V(illegal_break_symbol, "illegal_break") \ |
| 191 V(illegal_continue_symbol, "illegal_continue") \ | 191 V(illegal_continue_symbol, "illegal_continue") \ |
| 192 V(unknown_label_symbol, "unknown_label") \ | 192 V(unknown_label_symbol, "unknown_label") \ |
| 193 V(redeclaration_symbol, "redeclaration") \ | 193 V(redeclaration_symbol, "redeclaration") \ |
| 194 V(failure_symbol, "<failure>") \ | 194 V(failure_symbol, "<failure>") \ |
| 195 V(space_symbol, " ") \ | 195 V(space_symbol, " ") \ |
| 196 V(exec_symbol, "exec") \ | 196 V(exec_symbol, "exec") \ |
| 197 V(zero_symbol, "0") \ | 197 V(zero_symbol, "0") \ |
| 198 V(global_eval_symbol, "GlobalEval") | 198 V(global_eval_symbol, "GlobalEval") \ |
| 199 V(identity_hash_symbol, "v8::IdentityHash") |
| 199 | 200 |
| 200 | 201 |
| 201 // Forward declaration of the GCTracer class. | 202 // Forward declaration of the GCTracer class. |
| 202 class GCTracer; | 203 class GCTracer; |
| 203 | 204 |
| 204 | 205 |
| 205 // The all static Heap captures the interface to the global object heap. | 206 // The all static Heap captures the interface to the global object heap. |
| 206 // All JavaScript contexts by this process share the same object heap. | 207 // All JavaScript contexts by this process share the same object heap. |
| 207 | 208 |
| 208 class Heap : public AllStatic { | 209 class Heap : public AllStatic { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 640 |
| 640 // Utility type maps | 641 // Utility type maps |
| 641 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \ | 642 #define STRUCT_MAP_ACCESSOR(NAME, Name, name) \ |
| 642 static Map* name##_map() { return name##_map_; } | 643 static Map* name##_map() { return name##_map_; } |
| 643 STRUCT_LIST(STRUCT_MAP_ACCESSOR) | 644 STRUCT_LIST(STRUCT_MAP_ACCESSOR) |
| 644 #undef STRUCT_MAP_ACCESSOR | 645 #undef STRUCT_MAP_ACCESSOR |
| 645 | 646 |
| 646 #define SYMBOL_ACCESSOR(name, str) static String* name() { return name##_; } | 647 #define SYMBOL_ACCESSOR(name, str) static String* name() { return name##_; } |
| 647 SYMBOL_LIST(SYMBOL_ACCESSOR) | 648 SYMBOL_LIST(SYMBOL_ACCESSOR) |
| 648 #undef SYMBOL_ACCESSOR | 649 #undef SYMBOL_ACCESSOR |
| 650 |
| 651 // The hidden_symbol is special because it is the empty string, but does |
| 652 // not match the empty string. |
| 653 static String* hidden_symbol() { return hidden_symbol_; } |
| 649 | 654 |
| 650 // Iterates over all roots in the heap. | 655 // Iterates over all roots in the heap. |
| 651 static void IterateRoots(ObjectVisitor* v); | 656 static void IterateRoots(ObjectVisitor* v); |
| 652 // Iterates over all strong roots in the heap. | 657 // Iterates over all strong roots in the heap. |
| 653 static void IterateStrongRoots(ObjectVisitor* v); | 658 static void IterateStrongRoots(ObjectVisitor* v); |
| 654 | 659 |
| 655 // Iterates remembered set of an old space. | 660 // Iterates remembered set of an old space. |
| 656 static void IterateRSet(PagedSpace* space, ObjectSlotCallback callback); | 661 static void IterateRSet(PagedSpace* space, ObjectSlotCallback callback); |
| 657 | 662 |
| 658 // Iterates a range of remembered set addresses starting with rset_start | 663 // Iterates a range of remembered set addresses starting with rset_start |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 #undef ROOT_DECLARATION | 897 #undef ROOT_DECLARATION |
| 893 | 898 |
| 894 // Utility type maps | 899 // Utility type maps |
| 895 #define DECLARE_STRUCT_MAP(NAME, Name, name) static Map* name##_map_; | 900 #define DECLARE_STRUCT_MAP(NAME, Name, name) static Map* name##_map_; |
| 896 STRUCT_LIST(DECLARE_STRUCT_MAP) | 901 STRUCT_LIST(DECLARE_STRUCT_MAP) |
| 897 #undef DECLARE_STRUCT_MAP | 902 #undef DECLARE_STRUCT_MAP |
| 898 | 903 |
| 899 #define SYMBOL_DECLARATION(name, str) static String* name##_; | 904 #define SYMBOL_DECLARATION(name, str) static String* name##_; |
| 900 SYMBOL_LIST(SYMBOL_DECLARATION) | 905 SYMBOL_LIST(SYMBOL_DECLARATION) |
| 901 #undef SYMBOL_DECLARATION | 906 #undef SYMBOL_DECLARATION |
| 907 |
| 908 // The special hidden symbol which is an empty string, but does not match |
| 909 // any string when looked up in properties. |
| 910 static String* hidden_symbol_; |
| 902 | 911 |
| 903 // GC callback function, called before and after mark-compact GC. | 912 // GC callback function, called before and after mark-compact GC. |
| 904 // Allocations in the callback function are disallowed. | 913 // Allocations in the callback function are disallowed. |
| 905 static GCCallback global_gc_prologue_callback_; | 914 static GCCallback global_gc_prologue_callback_; |
| 906 static GCCallback global_gc_epilogue_callback_; | 915 static GCCallback global_gc_epilogue_callback_; |
| 907 | 916 |
| 908 // Checks whether a global GC is necessary | 917 // Checks whether a global GC is necessary |
| 909 static GarbageCollector SelectGarbageCollector(AllocationSpace space); | 918 static GarbageCollector SelectGarbageCollector(AllocationSpace space); |
| 910 | 919 |
| 911 // Performs garbage collection | 920 // Performs garbage collection |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 int marked_count_; | 1313 int marked_count_; |
| 1305 | 1314 |
| 1306 // The count from the end of the previous full GC. Will be zero if there | 1315 // The count from the end of the previous full GC. Will be zero if there |
| 1307 // was no previous full GC. | 1316 // was no previous full GC. |
| 1308 int previous_marked_count_; | 1317 int previous_marked_count_; |
| 1309 }; | 1318 }; |
| 1310 | 1319 |
| 1311 } } // namespace v8::internal | 1320 } } // namespace v8::internal |
| 1312 | 1321 |
| 1313 #endif // V8_HEAP_H_ | 1322 #endif // V8_HEAP_H_ |
| OLD | NEW |