Chromium Code Reviews| 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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 // by runtime. Allocations of target space for object evacuation do not | 1503 // by runtime. Allocations of target space for object evacuation do not |
| 1504 // trigger the event. In order to track ALL allocations one must turn off | 1504 // trigger the event. In order to track ALL allocations one must turn off |
| 1505 // FLAG_inline_new and FLAG_use_allocation_folding. | 1505 // FLAG_inline_new and FLAG_use_allocation_folding. |
| 1506 inline void OnAllocationEvent(HeapObject* object, int size_in_bytes); | 1506 inline void OnAllocationEvent(HeapObject* object, int size_in_bytes); |
| 1507 | 1507 |
| 1508 // This event is triggered after object is moved to a new place. | 1508 // This event is triggered after object is moved to a new place. |
| 1509 inline void OnMoveEvent(HeapObject* target, HeapObject* source, | 1509 inline void OnMoveEvent(HeapObject* target, HeapObject* source, |
| 1510 int size_in_bytes); | 1510 int size_in_bytes); |
| 1511 | 1511 |
| 1512 bool deserialization_complete() const { return deserialization_complete_; } | 1512 bool deserialization_complete() const { return deserialization_complete_; } |
| 1513 | 1513 |
|
Hannes Payer (out of office)
2015/05/12 06:33:28
Please add a bunch of comments about what these fu
| |
| 1514 void RegisterNewArrayBuffer(void* data, size_t length); | 1514 void RegisterNewArrayBuffer(bool in_new_space, void* data, size_t length); |
| 1515 void UnregisterArrayBuffer(void* data); | 1515 void UnregisterArrayBuffer(bool in_new_space, void* data); |
| 1516 void RegisterLiveArrayBuffer(void* data); | 1516 void RegisterLiveArrayBuffer(bool in_new_space, void* data); |
| 1517 void FreeDeadArrayBuffers(); | 1517 void FreeDeadArrayBuffers(bool in_new_space); |
| 1518 void PrepareArrayBufferDiscoveryInNewSpace(); | |
| 1519 void PromoteArrayBuffer(JSArrayBuffer* buffer); | |
| 1518 | 1520 |
| 1519 protected: | 1521 protected: |
| 1520 // Methods made available to tests. | 1522 // Methods made available to tests. |
| 1521 | 1523 |
| 1522 // Allocates a JS Map in the heap. | 1524 // Allocates a JS Map in the heap. |
| 1523 MUST_USE_RESULT AllocationResult | 1525 MUST_USE_RESULT AllocationResult |
| 1524 AllocateMap(InstanceType instance_type, int instance_size, | 1526 AllocateMap(InstanceType instance_type, int instance_size, |
| 1525 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); | 1527 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); |
| 1526 | 1528 |
| 1527 // Allocates and initializes a new JavaScript object based on a | 1529 // Allocates and initializes a new JavaScript object based on a |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2173 | 2175 |
| 2174 base::Mutex relocation_mutex_; | 2176 base::Mutex relocation_mutex_; |
| 2175 | 2177 |
| 2176 int gc_callbacks_depth_; | 2178 int gc_callbacks_depth_; |
| 2177 | 2179 |
| 2178 bool deserialization_complete_; | 2180 bool deserialization_complete_; |
| 2179 | 2181 |
| 2180 bool concurrent_sweeping_enabled_; | 2182 bool concurrent_sweeping_enabled_; |
| 2181 | 2183 |
| 2182 std::map<void*, size_t> live_array_buffers_; | 2184 std::map<void*, size_t> live_array_buffers_; |
| 2185 std::map<void*, size_t> live_new_array_buffers_; | |
| 2183 std::map<void*, size_t> not_yet_discovered_array_buffers_; | 2186 std::map<void*, size_t> not_yet_discovered_array_buffers_; |
| 2187 std::map<void*, size_t> not_yet_discovered_new_array_buffers_; | |
| 2184 | 2188 |
| 2185 struct StrongRootsList; | 2189 struct StrongRootsList; |
| 2186 StrongRootsList* strong_roots_list_; | 2190 StrongRootsList* strong_roots_list_; |
| 2187 | 2191 |
| 2188 friend class AlwaysAllocateScope; | 2192 friend class AlwaysAllocateScope; |
| 2189 friend class Deserializer; | 2193 friend class Deserializer; |
| 2190 friend class Factory; | 2194 friend class Factory; |
| 2191 friend class GCCallbacksScope; | 2195 friend class GCCallbacksScope; |
| 2192 friend class GCTracer; | 2196 friend class GCTracer; |
| 2193 friend class HeapIterator; | 2197 friend class HeapIterator; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2639 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2643 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2640 | 2644 |
| 2641 private: | 2645 private: |
| 2642 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2646 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2643 }; | 2647 }; |
| 2644 #endif // DEBUG | 2648 #endif // DEBUG |
| 2645 } | 2649 } |
| 2646 } // namespace v8::internal | 2650 } // namespace v8::internal |
| 2647 | 2651 |
| 2648 #endif // V8_HEAP_HEAP_H_ | 2652 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |