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

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

Issue 2203783002: [heap] Record references in the new code objects in heap::CopyCode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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') | 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
11 // Clients of this interface shouldn't depend on lots of heap internals. 11 // Clients of this interface shouldn't depend on lots of heap internals.
12 // Do not include anything from src/heap here! 12 // Do not include anything from src/heap here!
13 #include "include/v8.h" 13 #include "include/v8.h"
14 #include "src/allocation.h" 14 #include "src/allocation.h"
15 #include "src/assert-scope.h" 15 #include "src/assert-scope.h"
16 #include "src/base/atomic-utils.h" 16 #include "src/base/atomic-utils.h"
17 #include "src/globals.h" 17 #include "src/globals.h"
18 #include "src/heap-symbols.h" 18 #include "src/heap-symbols.h"
19 // TODO(mstarzinger): One more include to kill! 19 // TODO(mstarzinger): One more include to kill!
20 #include "src/heap/spaces.h" 20 #include "src/heap/spaces.h"
21 #include "src/list.h" 21 #include "src/list.h"
22 22
23 namespace v8 { 23 namespace v8 {
24 namespace internal { 24 namespace internal {
25 25
26 class Heap;
27 AllocationResult TestCopyCode(Heap* heap, Code* code);
28
26 using v8::MemoryPressureLevel; 29 using v8::MemoryPressureLevel;
27 30
28 // Defines all the roots in Heap. 31 // Defines all the roots in Heap.
29 #define STRONG_ROOT_LIST(V) \ 32 #define STRONG_ROOT_LIST(V) \
30 /* Cluster the most popular ones in a few cache lines here at the top. */ \ 33 /* Cluster the most popular ones in a few cache lines here at the top. */ \
31 /* The first 32 entries are most often used in the startup snapshot and */ \ 34 /* The first 32 entries are most often used in the startup snapshot and */ \
32 /* can use a shorter representation in the serialization format. */ \ 35 /* can use a shorter representation in the serialization format. */ \
33 V(Map, free_space_map, FreeSpaceMap) \ 36 V(Map, free_space_map, FreeSpaceMap) \
34 V(Map, one_pointer_filler_map, OnePointerFillerMap) \ 37 V(Map, one_pointer_filler_map, OnePointerFillerMap) \
35 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ 38 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 // Allocates a byte array of the specified length 1859 // Allocates a byte array of the specified length
1857 MUST_USE_RESULT AllocationResult 1860 MUST_USE_RESULT AllocationResult
1858 AllocateByteArray(int length, PretenureFlag pretenure = NOT_TENURED); 1861 AllocateByteArray(int length, PretenureFlag pretenure = NOT_TENURED);
1859 1862
1860 // Allocates a bytecode array with given contents. 1863 // Allocates a bytecode array with given contents.
1861 MUST_USE_RESULT AllocationResult 1864 MUST_USE_RESULT AllocationResult
1862 AllocateBytecodeArray(int length, const byte* raw_bytecodes, int frame_size, 1865 AllocateBytecodeArray(int length, const byte* raw_bytecodes, int frame_size,
1863 int parameter_count, FixedArray* constant_pool); 1866 int parameter_count, FixedArray* constant_pool);
1864 1867
1865 MUST_USE_RESULT AllocationResult CopyCode(Code* code); 1868 MUST_USE_RESULT AllocationResult CopyCode(Code* code);
1869 // The test function ofCopyCode in cctest/test-heap.cc.
1870 friend AllocationResult TestCopyCode(Heap* heap, Code* code);
Michael Lippautz 2016/08/02 19:07:57 No need to do that. Have a look at test/cctest/h
ahaas 2016/08/03 08:47:42 Done.
1866 1871
1867 MUST_USE_RESULT AllocationResult 1872 MUST_USE_RESULT AllocationResult
1868 CopyBytecodeArray(BytecodeArray* bytecode_array); 1873 CopyBytecodeArray(BytecodeArray* bytecode_array);
1869 1874
1870 // Allocates a fixed array initialized with undefined values 1875 // Allocates a fixed array initialized with undefined values
1871 MUST_USE_RESULT AllocationResult 1876 MUST_USE_RESULT AllocationResult
1872 AllocateFixedArray(int length, PretenureFlag pretenure = NOT_TENURED); 1877 AllocateFixedArray(int length, PretenureFlag pretenure = NOT_TENURED);
1873 1878
1874 // Allocate an uninitialized object. The memory is non-executable if the 1879 // Allocate an uninitialized object. The memory is non-executable if the
1875 // hardware and OS allow. This is the single choke-point for allocations 1880 // hardware and OS allow. This is the single choke-point for allocations
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 friend class LargeObjectSpace; 2702 friend class LargeObjectSpace;
2698 friend class NewSpace; 2703 friend class NewSpace;
2699 friend class PagedSpace; 2704 friend class PagedSpace;
2700 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2705 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2701 }; 2706 };
2702 2707
2703 } // namespace internal 2708 } // namespace internal
2704 } // namespace v8 2709 } // namespace v8
2705 2710
2706 #endif // V8_HEAP_HEAP_H_ 2711 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698