| 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_H_ | 5 #ifndef V8_HEAP_H_ |
| 6 #define V8_HEAP_H_ | 6 #define V8_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 uintptr_t map_word = object->map_word().ToRawValue(); | 2705 uintptr_t map_word = object->map_word().ToRawValue(); |
| 2706 return MapWord::FromRawValue(map_word | kNotMarkedBit).ToMap(); | 2706 return MapWord::FromRawValue(map_word | kNotMarkedBit).ToMap(); |
| 2707 } | 2707 } |
| 2708 | 2708 |
| 2709 static int SizeOfMarkedObject(HeapObject* object) { | 2709 static int SizeOfMarkedObject(HeapObject* object) { |
| 2710 return object->SizeFromMap(MapOfMarkedObject(object)); | 2710 return object->SizeFromMap(MapOfMarkedObject(object)); |
| 2711 } | 2711 } |
| 2712 | 2712 |
| 2713 private: | 2713 private: |
| 2714 static const uintptr_t kNotMarkedBit = 0x1; | 2714 static const uintptr_t kNotMarkedBit = 0x1; |
| 2715 STATIC_ASSERT((kHeapObjectTag & kNotMarkedBit) != 0); | 2715 STATIC_ASSERT((kHeapObjectTag & kNotMarkedBit) != 0); // NOLINT |
| 2716 }; | 2716 }; |
| 2717 | 2717 |
| 2718 | 2718 |
| 2719 #ifdef DEBUG | 2719 #ifdef DEBUG |
| 2720 // Helper class for tracing paths to a search target Object from all roots. | 2720 // Helper class for tracing paths to a search target Object from all roots. |
| 2721 // The TracePathFrom() method can be used to trace paths from a specific | 2721 // The TracePathFrom() method can be used to trace paths from a specific |
| 2722 // object to the search target object. | 2722 // object to the search target object. |
| 2723 class PathTracer : public ObjectVisitor { | 2723 class PathTracer : public ObjectVisitor { |
| 2724 public: | 2724 public: |
| 2725 enum WhatToFind { | 2725 enum WhatToFind { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2771 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2772 | 2772 |
| 2773 private: | 2773 private: |
| 2774 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2774 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2775 }; | 2775 }; |
| 2776 #endif // DEBUG | 2776 #endif // DEBUG |
| 2777 | 2777 |
| 2778 } } // namespace v8::internal | 2778 } } // namespace v8::internal |
| 2779 | 2779 |
| 2780 #endif // V8_HEAP_H_ | 2780 #endif // V8_HEAP_H_ |
| OLD | NEW |