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 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2393 | 2393 |
2394 class AlwaysAllocateScope { | 2394 class AlwaysAllocateScope { |
2395 public: | 2395 public: |
2396 explicit inline AlwaysAllocateScope(Isolate* isolate); | 2396 explicit inline AlwaysAllocateScope(Isolate* isolate); |
2397 inline ~AlwaysAllocateScope(); | 2397 inline ~AlwaysAllocateScope(); |
2398 | 2398 |
2399 private: | 2399 private: |
2400 Heap* heap_; | 2400 Heap* heap_; |
2401 }; | 2401 }; |
2402 | 2402 |
2403 | |
2404 // Visitor class to verify interior pointers in spaces that do not contain | 2403 // Visitor class to verify interior pointers in spaces that do not contain |
2405 // or care about intergenerational references. All heap object pointers have to | 2404 // or care about intergenerational references. All heap object pointers have to |
2406 // point into the heap to a location that has a map pointer at its first word. | 2405 // point into the heap to a location that has a map pointer at its first word. |
2407 // Caveat: Heap::Contains is an approximation because it can return true for | 2406 // Caveat: Heap::Contains is an approximation because it can return true for |
2408 // objects in a heap space but above the allocation pointer. | 2407 // objects in a heap space but above the allocation pointer. |
2409 class VerifyPointersVisitor : public ObjectVisitor { | 2408 class VerifyPointersVisitor : public ObjectVisitor { |
2410 public: | 2409 public: |
2411 inline void VisitPointers(Object** start, Object** end) override; | 2410 inline void VisitPointers(Object** start, Object** end) override; |
2412 }; | 2411 }; |
2413 | 2412 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2522 class WeakObjectRetainer { | 2521 class WeakObjectRetainer { |
2523 public: | 2522 public: |
2524 virtual ~WeakObjectRetainer() {} | 2523 virtual ~WeakObjectRetainer() {} |
2525 | 2524 |
2526 // Return whether this object should be retained. If NULL is returned the | 2525 // Return whether this object should be retained. If NULL is returned the |
2527 // object has no references. Otherwise the address of the retained object | 2526 // object has no references. Otherwise the address of the retained object |
2528 // should be returned as in some GC situations the object has been moved. | 2527 // should be returned as in some GC situations the object has been moved. |
2529 virtual Object* RetainAs(Object* object) = 0; | 2528 virtual Object* RetainAs(Object* object) = 0; |
2530 }; | 2529 }; |
2531 | 2530 |
2532 | |
2533 #ifdef DEBUG | 2531 #ifdef DEBUG |
2534 // Helper class for tracing paths to a search target Object from all roots. | 2532 // Helper class for tracing paths to a search target Object from all roots. |
2535 // The TracePathFrom() method can be used to trace paths from a specific | 2533 // The TracePathFrom() method can be used to trace paths from a specific |
2536 // object to the search target object. | 2534 // object to the search target object. |
2537 class PathTracer : public ObjectVisitor { | 2535 class PathTracer : public ObjectVisitor { |
2538 public: | 2536 public: |
2539 enum WhatToFind { | 2537 enum WhatToFind { |
2540 FIND_ALL, // Will find all matches. | 2538 FIND_ALL, // Will find all matches. |
2541 FIND_FIRST // Will stop the search after first match. | 2539 FIND_FIRST // Will stop the search after first match. |
2542 }; | 2540 }; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 friend class LargeObjectSpace; | 2637 friend class LargeObjectSpace; |
2640 friend class NewSpace; | 2638 friend class NewSpace; |
2641 friend class PagedSpace; | 2639 friend class PagedSpace; |
2642 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2640 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2643 }; | 2641 }; |
2644 | 2642 |
2645 } // namespace internal | 2643 } // namespace internal |
2646 } // namespace v8 | 2644 } // namespace v8 |
2647 | 2645 |
2648 #endif // V8_HEAP_HEAP_H_ | 2646 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |