v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
evacuation-allocator-inl.h
Go to the documentation of this file.
1// Copyright 2018 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_HEAP_EVACUATION_ALLOCATOR_INL_H_
6#define V8_HEAP_EVACUATION_ALLOCATOR_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
11#include "src/common/globals.h"
12#include "src/heap/spaces-inl.h"
13
14namespace v8 {
15namespace internal {
16
18 int object_size,
19 AllocationAlignment alignment) {
21 object_size = ALIGN_TO_ALLOCATION_ALIGNMENT(object_size);
22 switch (space) {
23 case NEW_SPACE:
24 return new_space_allocator()->AllocateRaw(object_size, alignment,
26 case OLD_SPACE:
27 return old_space_allocator()->AllocateRaw(object_size, alignment,
29 case CODE_SPACE:
30 return code_space_allocator()->AllocateRaw(object_size, alignment,
32 case SHARED_SPACE:
33 return shared_space_allocator()->AllocateRaw(object_size, alignment,
35 case TRUSTED_SPACE:
36 return trusted_space_allocator()->AllocateRaw(object_size, alignment,
38 default:
40 }
41}
42
43} // namespace internal
44} // namespace v8
45
46#endif // V8_HEAP_EVACUATION_ALLOCATOR_INL_H_
std::optional< MainAllocator > shared_space_allocator_
AllocationResult Allocate(AllocationSpace space, int object_size, AllocationAlignment alignment)
V8_WARN_UNUSED_RESULT V8_INLINE AllocationResult AllocateRaw(int size_in_bytes, AllocationAlignment alignment, AllocationOrigin origin)
#define ALIGN_TO_ALLOCATION_ALIGNMENT(value)
Definition globals.h:1796
#define DCHECK_IMPLIES(v1, v2)
Definition logging.h:493