| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 | 1340 |
| 1341 // The hidden_string is special because it is the empty string, but does | 1341 // The hidden_string is special because it is the empty string, but does |
| 1342 // not match the empty string. | 1342 // not match the empty string. |
| 1343 String* hidden_string() { return hidden_string_; } | 1343 String* hidden_string() { return hidden_string_; } |
| 1344 | 1344 |
| 1345 void set_native_contexts_list(Object* object) { | 1345 void set_native_contexts_list(Object* object) { |
| 1346 native_contexts_list_ = object; | 1346 native_contexts_list_ = object; |
| 1347 } | 1347 } |
| 1348 Object* native_contexts_list() { return native_contexts_list_; } | 1348 Object* native_contexts_list() { return native_contexts_list_; } |
| 1349 | 1349 |
| 1350 void set_array_buffers_list(Object* object) { |
| 1351 array_buffers_list_ = object; |
| 1352 } |
| 1353 Object* array_buffers_list() { return array_buffers_list_; } |
| 1354 |
| 1355 |
| 1350 // Number of mark-sweeps. | 1356 // Number of mark-sweeps. |
| 1351 unsigned int ms_count() { return ms_count_; } | 1357 unsigned int ms_count() { return ms_count_; } |
| 1352 | 1358 |
| 1353 // Iterates over all roots in the heap. | 1359 // Iterates over all roots in the heap. |
| 1354 void IterateRoots(ObjectVisitor* v, VisitMode mode); | 1360 void IterateRoots(ObjectVisitor* v, VisitMode mode); |
| 1355 // Iterates over all strong roots in the heap. | 1361 // Iterates over all strong roots in the heap. |
| 1356 void IterateStrongRoots(ObjectVisitor* v, VisitMode mode); | 1362 void IterateStrongRoots(ObjectVisitor* v, VisitMode mode); |
| 1357 // Iterates over all the other roots in the heap. | 1363 // Iterates over all the other roots in the heap. |
| 1358 void IterateWeakRoots(ObjectVisitor* v, VisitMode mode); | 1364 void IterateWeakRoots(ObjectVisitor* v, VisitMode mode); |
| 1359 | 1365 |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 | 2016 |
| 2011 // Caches the amount of external memory registered at the last global gc. | 2017 // Caches the amount of external memory registered at the last global gc. |
| 2012 intptr_t amount_of_external_allocated_memory_at_last_global_gc_; | 2018 intptr_t amount_of_external_allocated_memory_at_last_global_gc_; |
| 2013 | 2019 |
| 2014 // Indicates that an allocation has failed in the old generation since the | 2020 // Indicates that an allocation has failed in the old generation since the |
| 2015 // last GC. | 2021 // last GC. |
| 2016 bool old_gen_exhausted_; | 2022 bool old_gen_exhausted_; |
| 2017 | 2023 |
| 2018 Object* native_contexts_list_; | 2024 Object* native_contexts_list_; |
| 2019 | 2025 |
| 2026 Object* array_buffers_list_; |
| 2027 |
| 2020 StoreBufferRebuilder store_buffer_rebuilder_; | 2028 StoreBufferRebuilder store_buffer_rebuilder_; |
| 2021 | 2029 |
| 2022 struct StringTypeTable { | 2030 struct StringTypeTable { |
| 2023 InstanceType type; | 2031 InstanceType type; |
| 2024 int size; | 2032 int size; |
| 2025 RootListIndex index; | 2033 RootListIndex index; |
| 2026 }; | 2034 }; |
| 2027 | 2035 |
| 2028 struct ConstantStringTable { | 2036 struct ConstantStringTable { |
| 2029 const char* contents; | 2037 const char* contents; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 static void ScavengeStoreBufferCallback(Heap* heap, | 2161 static void ScavengeStoreBufferCallback(Heap* heap, |
| 2154 MemoryChunk* page, | 2162 MemoryChunk* page, |
| 2155 StoreBufferEvent event); | 2163 StoreBufferEvent event); |
| 2156 | 2164 |
| 2157 // Performs a major collection in the whole heap. | 2165 // Performs a major collection in the whole heap. |
| 2158 void MarkCompact(GCTracer* tracer); | 2166 void MarkCompact(GCTracer* tracer); |
| 2159 | 2167 |
| 2160 // Code to be run before and after mark-compact. | 2168 // Code to be run before and after mark-compact. |
| 2161 void MarkCompactPrologue(); | 2169 void MarkCompactPrologue(); |
| 2162 | 2170 |
| 2171 void ProcessNativeContexts(WeakObjectRetainer* retainer, bool record_slots); |
| 2172 void ProcessArrayBuffers(WeakObjectRetainer* retainer, bool record_slots); |
| 2173 |
| 2163 // Record statistics before and after garbage collection. | 2174 // Record statistics before and after garbage collection. |
| 2164 void ReportStatisticsBeforeGC(); | 2175 void ReportStatisticsBeforeGC(); |
| 2165 void ReportStatisticsAfterGC(); | 2176 void ReportStatisticsAfterGC(); |
| 2166 | 2177 |
| 2167 // Slow part of scavenge object. | 2178 // Slow part of scavenge object. |
| 2168 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); | 2179 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
| 2169 | 2180 |
| 2170 // Initializes a function with a shared part and prototype. | 2181 // Initializes a function with a shared part and prototype. |
| 2171 // Note: this code was factored out of AllocateFunction such that | 2182 // Note: this code was factored out of AllocateFunction such that |
| 2172 // other parts of the VM could use it. Specifically, a function that creates | 2183 // other parts of the VM could use it. Specifically, a function that creates |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3038 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3049 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 3039 | 3050 |
| 3040 private: | 3051 private: |
| 3041 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3052 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 3042 }; | 3053 }; |
| 3043 #endif // DEBUG | 3054 #endif // DEBUG |
| 3044 | 3055 |
| 3045 } } // namespace v8::internal | 3056 } } // namespace v8::internal |
| 3046 | 3057 |
| 3047 #endif // V8_HEAP_H_ | 3058 #endif // V8_HEAP_H_ |
| OLD | NEW |