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

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

Issue 1133773002: Keep track of array buffers in new space separately (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 7 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/api.cc ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')
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 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 PromoteArrayBuffer(JSArrayBuffer* buffer);
1518 1519
1519 protected: 1520 protected:
1520 // Methods made available to tests. 1521 // Methods made available to tests.
1521 1522
1522 // Allocates a JS Map in the heap. 1523 // Allocates a JS Map in the heap.
1523 MUST_USE_RESULT AllocationResult 1524 MUST_USE_RESULT AllocationResult
1524 AllocateMap(InstanceType instance_type, int instance_size, 1525 AllocateMap(InstanceType instance_type, int instance_size,
1525 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); 1526 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
1526 1527
1527 // Allocates and initializes a new JavaScript object based on a 1528 // Allocates and initializes a new JavaScript object based on a
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 2174
2174 base::Mutex relocation_mutex_; 2175 base::Mutex relocation_mutex_;
2175 2176
2176 int gc_callbacks_depth_; 2177 int gc_callbacks_depth_;
2177 2178
2178 bool deserialization_complete_; 2179 bool deserialization_complete_;
2179 2180
2180 bool concurrent_sweeping_enabled_; 2181 bool concurrent_sweeping_enabled_;
2181 2182
2182 std::map<void*, size_t> live_array_buffers_; 2183 std::map<void*, size_t> live_array_buffers_;
2184 std::map<void*, size_t> live_new_array_buffers_;
2183 std::map<void*, size_t> not_yet_discovered_array_buffers_; 2185 std::map<void*, size_t> not_yet_discovered_array_buffers_;
2186 std::map<void*, size_t> not_yet_discovered_new_array_buffers_;
2184 2187
2185 struct StrongRootsList; 2188 struct StrongRootsList;
2186 StrongRootsList* strong_roots_list_; 2189 StrongRootsList* strong_roots_list_;
2187 2190
2188 friend class AlwaysAllocateScope; 2191 friend class AlwaysAllocateScope;
2189 friend class Deserializer; 2192 friend class Deserializer;
2190 friend class Factory; 2193 friend class Factory;
2191 friend class GCCallbacksScope; 2194 friend class GCCallbacksScope;
2192 friend class GCTracer; 2195 friend class GCTracer;
2193 friend class HeapIterator; 2196 friend class HeapIterator;
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2642 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2640 2643
2641 private: 2644 private:
2642 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2645 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2643 }; 2646 };
2644 #endif // DEBUG 2647 #endif // DEBUG
2645 } 2648 }
2646 } // namespace v8::internal 2649 } // namespace v8::internal
2647 2650
2648 #endif // V8_HEAP_HEAP_H_ 2651 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698