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 1128323003: Remove explicit double alignment from allocation helper functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « 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 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 // Selects the proper allocation space depending on the given object 1808 // Selects the proper allocation space depending on the given object
1809 // size and pretenuring decision. 1809 // size and pretenuring decision.
1810 static AllocationSpace SelectSpace(int object_size, 1810 static AllocationSpace SelectSpace(int object_size,
1811 PretenureFlag pretenure) { 1811 PretenureFlag pretenure) {
1812 if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE; 1812 if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE;
1813 return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE; 1813 return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE;
1814 } 1814 }
1815 1815
1816 HeapObject* DoubleAlignForDeserialization(HeapObject* object, int size); 1816 HeapObject* DoubleAlignForDeserialization(HeapObject* object, int size);
1817 1817
1818 enum Alignment { kWordAligned, kDoubleAligned };
1819
1818 // Allocate an uninitialized object. The memory is non-executable if the 1820 // Allocate an uninitialized object. The memory is non-executable if the
1819 // hardware and OS allow. This is the single choke-point for allocations 1821 // hardware and OS allow. This is the single choke-point for allocations
1820 // performed by the runtime and should not be bypassed (to extend this to 1822 // performed by the runtime and should not be bypassed (to extend this to
1821 // inlined allocations, use the Heap::DisableInlineAllocation() support). 1823 // inlined allocations, use the Heap::DisableInlineAllocation() support).
1822 MUST_USE_RESULT inline AllocationResult AllocateRaw( 1824 MUST_USE_RESULT inline AllocationResult AllocateRaw(
1823 int size_in_bytes, AllocationSpace space, AllocationSpace retry_space); 1825 int size_in_bytes, AllocationSpace space, AllocationSpace retry_space,
1826 Alignment aligment = kWordAligned);
1824 1827
1825 // Allocates a heap object based on the map. 1828 // Allocates a heap object based on the map.
1826 MUST_USE_RESULT AllocationResult 1829 MUST_USE_RESULT AllocationResult
1827 Allocate(Map* map, AllocationSpace space, 1830 Allocate(Map* map, AllocationSpace space,
1828 AllocationSite* allocation_site = NULL); 1831 AllocationSite* allocation_site = NULL);
1829 1832
1830 // Allocates a partial map for bootstrapping. 1833 // Allocates a partial map for bootstrapping.
1831 MUST_USE_RESULT AllocationResult 1834 MUST_USE_RESULT AllocationResult
1832 AllocatePartialMap(InstanceType instance_type, int instance_size); 1835 AllocatePartialMap(InstanceType instance_type, int instance_size);
1833 1836
(...skipping 805 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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698