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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 void TracePathToGlobal(); | 1497 void TracePathToGlobal(); |
1498 #endif | 1498 #endif |
1499 | 1499 |
1500 // Callback function passed to Heap::Iterate etc. Copies an object if | 1500 // Callback function passed to Heap::Iterate etc. Copies an object if |
1501 // necessary, the object might be promoted to an old space. The caller must | 1501 // necessary, the object might be promoted to an old space. The caller must |
1502 // ensure the precondition that the object is (a) a heap object and (b) in | 1502 // ensure the precondition that the object is (a) a heap object and (b) in |
1503 // the heap's from space. | 1503 // the heap's from space. |
1504 static inline void ScavengePointer(HeapObject** p); | 1504 static inline void ScavengePointer(HeapObject** p); |
1505 static inline void ScavengeObject(HeapObject** p, HeapObject* object); | 1505 static inline void ScavengeObject(HeapObject** p, HeapObject* object); |
1506 | 1506 |
| 1507 enum ScratchpadSlotMode { |
| 1508 IGNORE_SCRATCHPAD_SLOT, |
| 1509 RECORD_SCRATCHPAD_SLOT |
| 1510 }; |
| 1511 |
1507 // An object may have an AllocationSite associated with it through a trailing | 1512 // An object may have an AllocationSite associated with it through a trailing |
1508 // AllocationMemento. Its feedback should be updated when objects are found | 1513 // AllocationMemento. Its feedback should be updated when objects are found |
1509 // in the heap. | 1514 // in the heap. |
1510 static inline void UpdateAllocationSiteFeedback(HeapObject* object); | 1515 static inline void UpdateAllocationSiteFeedback( |
| 1516 HeapObject* object, ScratchpadSlotMode mode); |
1511 | 1517 |
1512 // Support for partial snapshots. After calling this we have a linear | 1518 // Support for partial snapshots. After calling this we have a linear |
1513 // space to write objects in each space. | 1519 // space to write objects in each space. |
1514 void ReserveSpace(int *sizes, Address* addresses); | 1520 void ReserveSpace(int *sizes, Address* addresses); |
1515 | 1521 |
1516 // | 1522 // |
1517 // Support for the API. | 1523 // Support for the API. |
1518 // | 1524 // |
1519 | 1525 |
1520 bool CreateApiObjects(); | 1526 bool CreateApiObjects(); |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2305 // Allocates a fixed-size allocation sites scratchpad. | 2311 // Allocates a fixed-size allocation sites scratchpad. |
2306 MUST_USE_RESULT MaybeObject* AllocateAllocationSitesScratchpad(); | 2312 MUST_USE_RESULT MaybeObject* AllocateAllocationSitesScratchpad(); |
2307 | 2313 |
2308 // Sets used allocation sites entries to undefined. | 2314 // Sets used allocation sites entries to undefined. |
2309 void FlushAllocationSitesScratchpad(); | 2315 void FlushAllocationSitesScratchpad(); |
2310 | 2316 |
2311 // Initializes the allocation sites scratchpad with undefined values. | 2317 // Initializes the allocation sites scratchpad with undefined values. |
2312 void InitializeAllocationSitesScratchpad(); | 2318 void InitializeAllocationSitesScratchpad(); |
2313 | 2319 |
2314 // Adds an allocation site to the scratchpad if there is space left. | 2320 // Adds an allocation site to the scratchpad if there is space left. |
2315 void AddAllocationSiteToScratchpad(AllocationSite* site); | 2321 void AddAllocationSiteToScratchpad(AllocationSite* site, |
| 2322 ScratchpadSlotMode mode); |
2316 | 2323 |
2317 void UpdateSurvivalRateTrend(int start_new_space_size); | 2324 void UpdateSurvivalRateTrend(int start_new_space_size); |
2318 | 2325 |
2319 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; | 2326 enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING }; |
2320 | 2327 |
2321 static const int kYoungSurvivalRateHighThreshold = 90; | 2328 static const int kYoungSurvivalRateHighThreshold = 90; |
2322 static const int kYoungSurvivalRateLowThreshold = 10; | 2329 static const int kYoungSurvivalRateLowThreshold = 10; |
2323 static const int kYoungSurvivalRateAllowedDeviation = 15; | 2330 static const int kYoungSurvivalRateAllowedDeviation = 15; |
2324 | 2331 |
2325 static const int kOldSurvivalRateLowThreshold = 20; | 2332 static const int kOldSurvivalRateLowThreshold = 20; |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3121 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
3115 | 3122 |
3116 private: | 3123 private: |
3117 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3124 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3118 }; | 3125 }; |
3119 #endif // DEBUG | 3126 #endif // DEBUG |
3120 | 3127 |
3121 } } // namespace v8::internal | 3128 } } // namespace v8::internal |
3122 | 3129 |
3123 #endif // V8_HEAP_H_ | 3130 #endif // V8_HEAP_H_ |
OLD | NEW |