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

Side by Side Diff: src/heap/array-buffer-tracker.h

Issue 1640563004: Reland of "[heap] Parallel newspace evacuation, semispace copy, and compaction \o/" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Convert bogus DCHECK into proper branch Created 4 years, 10 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 | « src/globals.h ('k') | src/heap/array-buffer-tracker.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_ARRAY_BUFFER_TRACKER_H_ 5 #ifndef V8_HEAP_ARRAY_BUFFER_TRACKER_H_
6 #define V8_HEAP_ARRAY_BUFFER_TRACKER_H_ 6 #define V8_HEAP_ARRAY_BUFFER_TRACKER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "src/base/platform/mutex.h"
10 #include "src/globals.h" 11 #include "src/globals.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 15
15 // Forward declarations. 16 // Forward declarations.
16 class Heap; 17 class Heap;
17 class JSArrayBuffer; 18 class JSArrayBuffer;
18 19
19 class ArrayBufferTracker { 20 class ArrayBufferTracker {
(...skipping 20 matching lines...) Expand all
40 void FreeDead(bool from_scavenge); 41 void FreeDead(bool from_scavenge);
41 42
42 // Prepare for a new scavenge phase. A new marking phase is implicitly 43 // Prepare for a new scavenge phase. A new marking phase is implicitly
43 // prepared by finishing the previous one. 44 // prepared by finishing the previous one.
44 void PrepareDiscoveryInNewSpace(); 45 void PrepareDiscoveryInNewSpace();
45 46
46 // An ArrayBuffer moved from new space to old space. 47 // An ArrayBuffer moved from new space to old space.
47 void Promote(JSArrayBuffer* buffer); 48 void Promote(JSArrayBuffer* buffer);
48 49
49 private: 50 private:
51 base::Mutex mutex_;
50 Heap* heap_; 52 Heap* heap_;
51 53
52 // |live_array_buffers_| maps externally allocated memory used as backing 54 // |live_array_buffers_| maps externally allocated memory used as backing
53 // store for ArrayBuffers to the length of the respective memory blocks. 55 // store for ArrayBuffers to the length of the respective memory blocks.
54 // 56 //
55 // At the beginning of mark/compact, |not_yet_discovered_array_buffers_| is 57 // At the beginning of mark/compact, |not_yet_discovered_array_buffers_| is
56 // a copy of |live_array_buffers_| and we remove pointers as we discover live 58 // a copy of |live_array_buffers_| and we remove pointers as we discover live
57 // ArrayBuffer objects during marking. At the end of mark/compact, the 59 // ArrayBuffer objects during marking. At the end of mark/compact, the
58 // remaining memory blocks can be freed. 60 // remaining memory blocks can be freed.
59 std::map<void*, size_t> live_array_buffers_; 61 std::map<void*, size_t> live_array_buffers_;
60 std::map<void*, size_t> not_yet_discovered_array_buffers_; 62 std::map<void*, size_t> not_yet_discovered_array_buffers_;
61 63
62 // To be able to free memory held by ArrayBuffers during scavenge as well, we 64 // To be able to free memory held by ArrayBuffers during scavenge as well, we
63 // have a separate list of allocated memory held by ArrayBuffers in new space. 65 // have a separate list of allocated memory held by ArrayBuffers in new space.
64 // 66 //
65 // Since mark/compact also evacuates the new space, all pointers in the 67 // Since mark/compact also evacuates the new space, all pointers in the
66 // |live_array_buffers_for_scavenge_| list are also in the 68 // |live_array_buffers_for_scavenge_| list are also in the
67 // |live_array_buffers_| list. 69 // |live_array_buffers_| list.
68 std::map<void*, size_t> live_array_buffers_for_scavenge_; 70 std::map<void*, size_t> live_array_buffers_for_scavenge_;
69 std::map<void*, size_t> not_yet_discovered_array_buffers_for_scavenge_; 71 std::map<void*, size_t> not_yet_discovered_array_buffers_for_scavenge_;
70 }; 72 };
71 } // namespace internal 73 } // namespace internal
72 } // namespace v8 74 } // namespace v8
73 #endif // V8_HEAP_ARRAY_BUFFER_TRACKER_H_ 75 #endif // V8_HEAP_ARRAY_BUFFER_TRACKER_H_
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/heap/array-buffer-tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698