Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/heap/heap.h

Issue 1199913002: Keep track of ArrayBuffers based on collector type, not space (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 // The following methods are used to track raw C++ pointers to externally 1591 // The following methods are used to track raw C++ pointers to externally
1592 // allocated memory used as backing store in live array buffers. 1592 // allocated memory used as backing store in live array buffers.
1593 1593
1594 // A new ArrayBuffer was created with |data| as backing store. 1594 // A new ArrayBuffer was created with |data| as backing store.
1595 void RegisterNewArrayBuffer(bool in_new_space, void* data, size_t length); 1595 void RegisterNewArrayBuffer(bool in_new_space, void* data, size_t length);
1596 1596
1597 // The backing store |data| is no longer owned by V8. 1597 // The backing store |data| is no longer owned by V8.
1598 void UnregisterArrayBuffer(bool in_new_space, void* data); 1598 void UnregisterArrayBuffer(bool in_new_space, void* data);
1599 1599
1600 // A live ArrayBuffer was discovered during marking/scavenge. 1600 // A live ArrayBuffer was discovered during marking/scavenge.
1601 void RegisterLiveArrayBuffer(bool in_new_space, void* data); 1601 void RegisterLiveArrayBuffer(bool from_scavenge, void* data);
1602 1602
1603 // Frees all backing store pointers that weren't discovered in the previous 1603 // Frees all backing store pointers that weren't discovered in the previous
1604 // marking or scavenge phase. 1604 // marking or scavenge phase.
1605 void FreeDeadArrayBuffers(bool in_new_space); 1605 void FreeDeadArrayBuffers(bool from_scavenge);
1606 1606
1607 // Prepare for a new scavenge phase. A new marking phase is implicitly 1607 // Prepare for a new scavenge phase. A new marking phase is implicitly
1608 // prepared by finishing the previous one. 1608 // prepared by finishing the previous one.
1609 void PrepareArrayBufferDiscoveryInNewSpace(); 1609 void PrepareArrayBufferDiscoveryInNewSpace();
1610 1610
1611 // An ArrayBuffer moved from new space to old space. 1611 // An ArrayBuffer moved from new space to old space.
1612 void PromoteArrayBuffer(Object* buffer); 1612 void PromoteArrayBuffer(Object* buffer);
1613 1613
1614 protected: 1614 protected:
1615 // Methods made available to tests. 1615 // Methods made available to tests.
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 2364
2365 MemoryChunk* chunks_queued_for_free_; 2365 MemoryChunk* chunks_queued_for_free_;
2366 2366
2367 base::Mutex relocation_mutex_; 2367 base::Mutex relocation_mutex_;
2368 2368
2369 int gc_callbacks_depth_; 2369 int gc_callbacks_depth_;
2370 2370
2371 bool deserialization_complete_; 2371 bool deserialization_complete_;
2372 2372
2373 bool concurrent_sweeping_enabled_; 2373 bool concurrent_sweeping_enabled_;
2374 2374
Hannes Payer (out of office) 2015/06/22 12:54:23 Can we add comments to describe what these data st
2375 std::map<void*, size_t> live_array_buffers_; 2375 std::map<void*, size_t> live_array_buffers_;
2376 std::map<void*, size_t> live_new_array_buffers_;
2377 std::map<void*, size_t> not_yet_discovered_array_buffers_; 2376 std::map<void*, size_t> not_yet_discovered_array_buffers_;
2378 std::map<void*, size_t> not_yet_discovered_new_array_buffers_; 2377
2378 std::map<void*, size_t> live_array_buffers_for_scavenge_;
2379 std::map<void*, size_t> not_yet_discovered_array_buffers_for_scavenge_;
2379 2380
2380 struct StrongRootsList; 2381 struct StrongRootsList;
2381 StrongRootsList* strong_roots_list_; 2382 StrongRootsList* strong_roots_list_;
2382 2383
2383 friend class AlwaysAllocateScope; 2384 friend class AlwaysAllocateScope;
2384 friend class Deserializer; 2385 friend class Deserializer;
2385 friend class Factory; 2386 friend class Factory;
2386 friend class GCCallbacksScope; 2387 friend class GCCallbacksScope;
2387 friend class GCTracer; 2388 friend class GCTracer;
2388 friend class HeapIterator; 2389 friend class HeapIterator;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2836 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2837 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2837 2838
2838 private: 2839 private:
2839 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2840 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2840 }; 2841 };
2841 #endif // DEBUG 2842 #endif // DEBUG
2842 } 2843 }
2843 } // namespace v8::internal 2844 } // namespace v8::internal
2844 2845
2845 #endif // V8_HEAP_HEAP_H_ 2846 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698