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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } | 756 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } |
757 | 757 |
758 // If an object has an AllocationMemento trailing it, return it, otherwise | 758 // If an object has an AllocationMemento trailing it, return it, otherwise |
759 // return NULL; | 759 // return NULL; |
760 template <FindMementoMode mode> | 760 template <FindMementoMode mode> |
761 inline AllocationMemento* FindAllocationMemento(HeapObject* object); | 761 inline AllocationMemento* FindAllocationMemento(HeapObject* object); |
762 | 762 |
763 // Returns false if not able to reserve. | 763 // Returns false if not able to reserve. |
764 bool ReserveSpace(Reservation* reservations, List<Address>* maps); | 764 bool ReserveSpace(Reservation* reservations, List<Address>* maps); |
765 | 765 |
766 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); | |
767 | |
768 bool UsingEmbedderHeapTracer(); | |
769 | |
770 void TracePossibleWrapper(JSObject* js_object); | |
771 | |
772 void RegisterExternallyReferencedObject(Object** object); | |
773 | |
774 // | 766 // |
775 // Support for the API. | 767 // Support for the API. |
776 // | 768 // |
777 | 769 |
778 void CreateApiObjects(); | 770 void CreateApiObjects(); |
779 | 771 |
780 // Implements the corresponding V8 API function. | 772 // Implements the corresponding V8 API function. |
781 bool IdleNotification(double deadline_in_seconds); | 773 bool IdleNotification(double deadline_in_seconds); |
782 bool IdleNotification(int idle_time_in_ms); | 774 bool IdleNotification(int idle_time_in_ms); |
783 | 775 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 | 1159 |
1168 void FinalizeIncrementalMarkingIfComplete(const char* comment); | 1160 void FinalizeIncrementalMarkingIfComplete(const char* comment); |
1169 | 1161 |
1170 bool TryFinalizeIdleIncrementalMarking(double idle_time_in_ms); | 1162 bool TryFinalizeIdleIncrementalMarking(double idle_time_in_ms); |
1171 | 1163 |
1172 void RegisterReservationsForBlackAllocation(Reservation* reservations); | 1164 void RegisterReservationsForBlackAllocation(Reservation* reservations); |
1173 | 1165 |
1174 IncrementalMarking* incremental_marking() { return incremental_marking_; } | 1166 IncrementalMarking* incremental_marking() { return incremental_marking_; } |
1175 | 1167 |
1176 // =========================================================================== | 1168 // =========================================================================== |
| 1169 // Embedder heap tracer support. ============================================= |
| 1170 // =========================================================================== |
| 1171 |
| 1172 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); |
| 1173 |
| 1174 bool UsingEmbedderHeapTracer(); |
| 1175 |
| 1176 void TracePossibleWrapper(JSObject* js_object); |
| 1177 |
| 1178 void RegisterExternallyReferencedObject(Object** object); |
| 1179 |
| 1180 // =========================================================================== |
1177 // External string table API. ================================================ | 1181 // External string table API. ================================================ |
1178 // =========================================================================== | 1182 // =========================================================================== |
1179 | 1183 |
1180 // Registers an external string. | 1184 // Registers an external string. |
1181 inline void RegisterExternalString(String* string); | 1185 inline void RegisterExternalString(String* string); |
1182 | 1186 |
1183 // Finalizes an external string by deleting the associated external | 1187 // Finalizes an external string by deleting the associated external |
1184 // data and clearing the resource pointer. | 1188 // data and clearing the resource pointer. |
1185 inline void FinalizeExternalString(String* string); | 1189 inline void FinalizeExternalString(String* string); |
1186 | 1190 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 } | 1585 } |
1582 | 1586 |
1583 inline bool ShouldAbortIncrementalMarking() const { | 1587 inline bool ShouldAbortIncrementalMarking() const { |
1584 return current_gc_flags_ & kAbortIncrementalMarkingMask; | 1588 return current_gc_flags_ & kAbortIncrementalMarkingMask; |
1585 } | 1589 } |
1586 | 1590 |
1587 inline bool ShouldFinalizeIncrementalMarking() const { | 1591 inline bool ShouldFinalizeIncrementalMarking() const { |
1588 return current_gc_flags_ & kFinalizeIncrementalMarkingMask; | 1592 return current_gc_flags_ & kFinalizeIncrementalMarkingMask; |
1589 } | 1593 } |
1590 | 1594 |
| 1595 // Checks whether both, the internal marking deque, and the embedder provided |
| 1596 // one are empty. Avoid in fast path as it potentially calls through the API. |
| 1597 bool MarkingDequesAreEmpty(); |
| 1598 |
1591 void PreprocessStackTraces(); | 1599 void PreprocessStackTraces(); |
1592 | 1600 |
1593 // Checks whether a global GC is necessary | 1601 // Checks whether a global GC is necessary |
1594 GarbageCollector SelectGarbageCollector(AllocationSpace space, | 1602 GarbageCollector SelectGarbageCollector(AllocationSpace space, |
1595 const char** reason); | 1603 const char** reason); |
1596 | 1604 |
1597 // Make sure there is a filler value behind the top of the new space | 1605 // Make sure there is a filler value behind the top of the new space |
1598 // so that the GC does not confuse some unintialized/stale memory | 1606 // so that the GC does not confuse some unintialized/stale memory |
1599 // with the allocation memento of the object at the top | 1607 // with the allocation memento of the object at the top |
1600 void EnsureFillerObjectAtTop(); | 1608 void EnsureFillerObjectAtTop(); |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 friend class LargeObjectSpace; | 2725 friend class LargeObjectSpace; |
2718 friend class NewSpace; | 2726 friend class NewSpace; |
2719 friend class PagedSpace; | 2727 friend class PagedSpace; |
2720 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2728 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2721 }; | 2729 }; |
2722 | 2730 |
2723 } // namespace internal | 2731 } // namespace internal |
2724 } // namespace v8 | 2732 } // namespace v8 |
2725 | 2733 |
2726 #endif // V8_HEAP_HEAP_H_ | 2734 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |