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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 static inline void ScavengeObject(HeapObject** p, HeapObject* object); | 797 static inline void ScavengeObject(HeapObject** p, HeapObject* object); |
798 | 798 |
799 // Clear a range of remembered set addresses corresponding to the object | 799 // Clear a range of remembered set addresses corresponding to the object |
800 // area address 'start' with size 'size_in_bytes', eg, when adding blocks | 800 // area address 'start' with size 'size_in_bytes', eg, when adding blocks |
801 // to the free list. | 801 // to the free list. |
802 static void ClearRSetRange(Address start, int size_in_bytes); | 802 static void ClearRSetRange(Address start, int size_in_bytes); |
803 | 803 |
804 // Rebuild remembered set in old and map spaces. | 804 // Rebuild remembered set in old and map spaces. |
805 static void RebuildRSets(); | 805 static void RebuildRSets(); |
806 | 806 |
| 807 // Update an old object's remembered set |
| 808 static int UpdateRSet(HeapObject* obj); |
| 809 |
807 // Commits from space if it is uncommitted. | 810 // Commits from space if it is uncommitted. |
808 static void EnsureFromSpaceIsCommitted(); | 811 static void EnsureFromSpaceIsCommitted(); |
809 | 812 |
810 // | 813 // |
811 // Support for the API. | 814 // Support for the API. |
812 // | 815 // |
813 | 816 |
814 static bool CreateApiObjects(); | 817 static bool CreateApiObjects(); |
815 | 818 |
816 // Attempt to find the number in a small cache. If we finds it, return | 819 // Attempt to find the number in a small cache. If we finds it, return |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 static inline bool ShouldBePromoted(Address old_address, int object_size); | 1070 static inline bool ShouldBePromoted(Address old_address, int object_size); |
1068 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) | 1071 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) |
1069 // Record the copy of an object in the NewSpace's statistics. | 1072 // Record the copy of an object in the NewSpace's statistics. |
1070 static void RecordCopiedObject(HeapObject* obj); | 1073 static void RecordCopiedObject(HeapObject* obj); |
1071 | 1074 |
1072 // Record statistics before and after garbage collection. | 1075 // Record statistics before and after garbage collection. |
1073 static void ReportStatisticsBeforeGC(); | 1076 static void ReportStatisticsBeforeGC(); |
1074 static void ReportStatisticsAfterGC(); | 1077 static void ReportStatisticsAfterGC(); |
1075 #endif | 1078 #endif |
1076 | 1079 |
1077 // Update an old object's remembered set | |
1078 static int UpdateRSet(HeapObject* obj); | |
1079 | |
1080 // Rebuild remembered set in an old space. | 1080 // Rebuild remembered set in an old space. |
1081 static void RebuildRSets(PagedSpace* space); | 1081 static void RebuildRSets(PagedSpace* space); |
1082 | 1082 |
1083 // Rebuild remembered set in the large object space. | 1083 // Rebuild remembered set in the large object space. |
1084 static void RebuildRSets(LargeObjectSpace* space); | 1084 static void RebuildRSets(LargeObjectSpace* space); |
1085 | 1085 |
1086 // Slow part of scavenge object. | 1086 // Slow part of scavenge object. |
1087 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); | 1087 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
1088 | 1088 |
1089 // Copy memory from src to dst. | 1089 // Copy memory from src to dst. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 class OldSpaces BASE_EMBEDDED { | 1229 class OldSpaces BASE_EMBEDDED { |
1230 public: | 1230 public: |
1231 OldSpace* next(); | 1231 OldSpace* next(); |
1232 OldSpaces() { counter_ = OLD_POINTER_SPACE; } | 1232 OldSpaces() { counter_ = OLD_POINTER_SPACE; } |
1233 private: | 1233 private: |
1234 int counter_; | 1234 int counter_; |
1235 }; | 1235 }; |
1236 | 1236 |
1237 | 1237 |
1238 // Space iterator for iterating over all the paged spaces of the heap: | 1238 // Space iterator for iterating over all the paged spaces of the heap: |
1239 // Map space, old pointer space, old data space and code space. | 1239 // Map space, old pointer space, old data space, code space and cell space. |
1240 // Returns each space in turn, and null when it is done. | 1240 // Returns each space in turn, and null when it is done. |
1241 class PagedSpaces BASE_EMBEDDED { | 1241 class PagedSpaces BASE_EMBEDDED { |
1242 public: | 1242 public: |
1243 PagedSpace* next(); | 1243 PagedSpace* next(); |
1244 PagedSpaces() { counter_ = OLD_POINTER_SPACE; } | 1244 PagedSpaces() { counter_ = OLD_POINTER_SPACE; } |
1245 private: | 1245 private: |
1246 int counter_; | 1246 int counter_; |
1247 }; | 1247 }; |
1248 | 1248 |
1249 | 1249 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 | 1680 |
1681 // To speed up scavenge collections new space string are kept | 1681 // To speed up scavenge collections new space string are kept |
1682 // separate from old space strings. | 1682 // separate from old space strings. |
1683 static List<Object*> new_space_strings_; | 1683 static List<Object*> new_space_strings_; |
1684 static List<Object*> old_space_strings_; | 1684 static List<Object*> old_space_strings_; |
1685 }; | 1685 }; |
1686 | 1686 |
1687 } } // namespace v8::internal | 1687 } } // namespace v8::internal |
1688 | 1688 |
1689 #endif // V8_HEAP_H_ | 1689 #endif // V8_HEAP_H_ |
OLD | NEW |