| OLD | NEW |
| 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 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 // size, pretenuring decision, and preferred old-space. | 1719 // size, pretenuring decision, and preferred old-space. |
| 1720 static AllocationSpace SelectSpace(int object_size, | 1720 static AllocationSpace SelectSpace(int object_size, |
| 1721 AllocationSpace preferred_old_space, | 1721 AllocationSpace preferred_old_space, |
| 1722 PretenureFlag pretenure) { | 1722 PretenureFlag pretenure) { |
| 1723 DCHECK(preferred_old_space == OLD_POINTER_SPACE || | 1723 DCHECK(preferred_old_space == OLD_POINTER_SPACE || |
| 1724 preferred_old_space == OLD_DATA_SPACE); | 1724 preferred_old_space == OLD_DATA_SPACE); |
| 1725 if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE; | 1725 if (object_size > Page::kMaxRegularHeapObjectSize) return LO_SPACE; |
| 1726 return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; | 1726 return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; |
| 1727 } | 1727 } |
| 1728 | 1728 |
| 1729 HeapObject* DoubleAlignForDeserialization(HeapObject* object, int size); |
| 1730 |
| 1729 // Allocate an uninitialized object. The memory is non-executable if the | 1731 // Allocate an uninitialized object. The memory is non-executable if the |
| 1730 // hardware and OS allow. This is the single choke-point for allocations | 1732 // hardware and OS allow. This is the single choke-point for allocations |
| 1731 // performed by the runtime and should not be bypassed (to extend this to | 1733 // performed by the runtime and should not be bypassed (to extend this to |
| 1732 // inlined allocations, use the Heap::DisableInlineAllocation() support). | 1734 // inlined allocations, use the Heap::DisableInlineAllocation() support). |
| 1733 MUST_USE_RESULT inline AllocationResult AllocateRaw( | 1735 MUST_USE_RESULT inline AllocationResult AllocateRaw( |
| 1734 int size_in_bytes, AllocationSpace space, AllocationSpace retry_space); | 1736 int size_in_bytes, AllocationSpace space, AllocationSpace retry_space); |
| 1735 | 1737 |
| 1736 // Allocates a heap object based on the map. | 1738 // Allocates a heap object based on the map. |
| 1737 MUST_USE_RESULT AllocationResult | 1739 MUST_USE_RESULT AllocationResult |
| 1738 Allocate(Map* map, AllocationSpace space, | 1740 Allocate(Map* map, AllocationSpace space, |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2572 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2574 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2573 | 2575 |
| 2574 private: | 2576 private: |
| 2575 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2577 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2576 }; | 2578 }; |
| 2577 #endif // DEBUG | 2579 #endif // DEBUG |
| 2578 } | 2580 } |
| 2579 } // namespace v8::internal | 2581 } // namespace v8::internal |
| 2580 | 2582 |
| 2581 #endif // V8_HEAP_HEAP_H_ | 2583 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |