OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 static double HeapGrowingFactor(double gc_speed, double mutator_speed); | 625 static double HeapGrowingFactor(double gc_speed, double mutator_speed); |
626 | 626 |
627 // Copy block of memory from src to dst. Size of block should be aligned | 627 // Copy block of memory from src to dst. Size of block should be aligned |
628 // by pointer size. | 628 // by pointer size. |
629 static inline void CopyBlock(Address dst, Address src, int byte_size); | 629 static inline void CopyBlock(Address dst, Address src, int byte_size); |
630 | 630 |
631 // Determines a static visitor id based on the given {map} that can then be | 631 // Determines a static visitor id based on the given {map} that can then be |
632 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. | 632 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. |
633 static int GetStaticVisitorIdForMap(Map* map); | 633 static int GetStaticVisitorIdForMap(Map* map); |
634 | 634 |
635 // We cannot avoid stale handles to left-trimmed objects, but can only make | |
636 // sure all handles still needed are updated. Filter out a stale pointer | |
637 // and clear the slot to allow post processing of handles (needed because | |
638 // the sweeper might actually free the underlying page). | |
639 inline bool PurgeLeftTrimmedObject(Object** object); | |
640 | |
641 // Notifies the heap that is ok to start marking or other activities that | 635 // Notifies the heap that is ok to start marking or other activities that |
642 // should not happen during deserialization. | 636 // should not happen during deserialization. |
643 void NotifyDeserializationComplete(); | 637 void NotifyDeserializationComplete(); |
644 | 638 |
645 intptr_t old_generation_allocation_limit() const { | 639 intptr_t old_generation_allocation_limit() const { |
646 return old_generation_allocation_limit_; | 640 return old_generation_allocation_limit_; |
647 } | 641 } |
648 | 642 |
649 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; } | 643 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; } |
650 | 644 |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 void TracePathToObject(Object* target); | 1431 void TracePathToObject(Object* target); |
1438 void TracePathToGlobal(); | 1432 void TracePathToGlobal(); |
1439 | 1433 |
1440 void Print(); | 1434 void Print(); |
1441 void PrintHandles(); | 1435 void PrintHandles(); |
1442 | 1436 |
1443 // Report heap statistics. | 1437 // Report heap statistics. |
1444 void ReportHeapStatistics(const char* title); | 1438 void ReportHeapStatistics(const char* title); |
1445 void ReportCodeStatistics(const char* title); | 1439 void ReportCodeStatistics(const char* title); |
1446 #endif | 1440 #endif |
| 1441 #ifdef ENABLE_SLOW_DCHECKS |
| 1442 int CountHandlesForObject(Object* object); |
| 1443 #endif |
1447 | 1444 |
1448 private: | 1445 private: |
1449 class PretenuringScope; | 1446 class PretenuringScope; |
1450 | 1447 |
1451 // External strings table is a place where all external strings are | 1448 // External strings table is a place where all external strings are |
1452 // registered. We need to keep track of such strings to properly | 1449 // registered. We need to keep track of such strings to properly |
1453 // finalize them. | 1450 // finalize them. |
1454 class ExternalStringTable { | 1451 class ExternalStringTable { |
1455 public: | 1452 public: |
1456 // Registers an external string. | 1453 // Registers an external string. |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2698 friend class LargeObjectSpace; | 2695 friend class LargeObjectSpace; |
2699 friend class NewSpace; | 2696 friend class NewSpace; |
2700 friend class PagedSpace; | 2697 friend class PagedSpace; |
2701 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2698 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2702 }; | 2699 }; |
2703 | 2700 |
2704 } // namespace internal | 2701 } // namespace internal |
2705 } // namespace v8 | 2702 } // namespace v8 |
2706 | 2703 |
2707 #endif // V8_HEAP_HEAP_H_ | 2704 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |