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 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2050 void MarkMapPointersAsEncoded(bool encoded) { | 2050 void MarkMapPointersAsEncoded(bool encoded) { |
2051 ASSERT(!encoded); | 2051 ASSERT(!encoded); |
2052 gc_safe_size_of_old_object_ = &GcSafeSizeOfOldObject; | 2052 gc_safe_size_of_old_object_ = &GcSafeSizeOfOldObject; |
2053 } | 2053 } |
2054 | 2054 |
2055 // Code that should be run before and after each GC. Includes some | 2055 // Code that should be run before and after each GC. Includes some |
2056 // reporting/verification activities when compiled with DEBUG set. | 2056 // reporting/verification activities when compiled with DEBUG set. |
2057 void GarbageCollectionPrologue(); | 2057 void GarbageCollectionPrologue(); |
2058 void GarbageCollectionEpilogue(); | 2058 void GarbageCollectionEpilogue(); |
2059 | 2059 |
| 2060 // Pretenuring decisions are made based on feedback collected during new |
| 2061 // space evacuation. Note that between feedback collection and calling this |
| 2062 // method object in old space must not move. |
| 2063 void ProcessPretenuringFeedback(); |
| 2064 |
2060 // Checks whether a global GC is necessary | 2065 // Checks whether a global GC is necessary |
2061 GarbageCollector SelectGarbageCollector(AllocationSpace space, | 2066 GarbageCollector SelectGarbageCollector(AllocationSpace space, |
2062 const char** reason); | 2067 const char** reason); |
2063 | 2068 |
2064 // Performs garbage collection operation. | 2069 // Performs garbage collection operation. |
2065 // Returns whether there is a chance that another major GC could | 2070 // Returns whether there is a chance that another major GC could |
2066 // collect more garbage. | 2071 // collect more garbage. |
2067 bool CollectGarbage(AllocationSpace space, | 2072 bool CollectGarbage(AllocationSpace space, |
2068 GarbageCollector collector, | 2073 GarbageCollector collector, |
2069 const char* gc_reason, | 2074 const char* gc_reason, |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2376 | 2381 |
2377 // If the --deopt_every_n_garbage_collections flag is set to a positive value, | 2382 // If the --deopt_every_n_garbage_collections flag is set to a positive value, |
2378 // this variable holds the number of garbage collections since the last | 2383 // this variable holds the number of garbage collections since the last |
2379 // deoptimization triggered by garbage collection. | 2384 // deoptimization triggered by garbage collection. |
2380 int gcs_since_last_deopt_; | 2385 int gcs_since_last_deopt_; |
2381 | 2386 |
2382 #ifdef VERIFY_HEAP | 2387 #ifdef VERIFY_HEAP |
2383 int no_weak_object_verification_scope_depth_; | 2388 int no_weak_object_verification_scope_depth_; |
2384 #endif | 2389 #endif |
2385 | 2390 |
| 2391 |
| 2392 static const int kAllocationSiteScratchpadSize = 256; |
| 2393 int allocation_sites_scratchpad_pointer; |
| 2394 AllocationSite* allocation_sites_scratchpad[kAllocationSiteScratchpadSize]; |
| 2395 |
2386 static const int kMaxMarkSweepsInIdleRound = 7; | 2396 static const int kMaxMarkSweepsInIdleRound = 7; |
2387 static const int kIdleScavengeThreshold = 5; | 2397 static const int kIdleScavengeThreshold = 5; |
2388 | 2398 |
2389 // Shared state read by the scavenge collector and set by ScavengeObject. | 2399 // Shared state read by the scavenge collector and set by ScavengeObject. |
2390 PromotionQueue promotion_queue_; | 2400 PromotionQueue promotion_queue_; |
2391 | 2401 |
2392 // Flag is set when the heap has been configured. The heap can be repeatedly | 2402 // Flag is set when the heap has been configured. The heap can be repeatedly |
2393 // configured through the API until it is set up. | 2403 // configured through the API until it is set up. |
2394 bool configured_; | 2404 bool configured_; |
2395 | 2405 |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3090 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
3081 | 3091 |
3082 private: | 3092 private: |
3083 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3093 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3084 }; | 3094 }; |
3085 #endif // DEBUG | 3095 #endif // DEBUG |
3086 | 3096 |
3087 } } // namespace v8::internal | 3097 } } // namespace v8::internal |
3088 | 3098 |
3089 #endif // V8_HEAP_H_ | 3099 #endif // V8_HEAP_H_ |
OLD | NEW |