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
8
#include "
src/heap/evacuation-allocator.h
"
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
14
namespace
v8
{
15
namespace
internal
{
16
17
AllocationResult
EvacuationAllocator::Allocate
(
AllocationSpace
space,
18
int
object_size,
19
AllocationAlignment
alignment) {
20
DCHECK_IMPLIES
(!
shared_space_allocator_
, space !=
SHARED_SPACE
);
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,
25
AllocationOrigin::kGC
);
26
case
OLD_SPACE
:
27
return
old_space_allocator
()->
AllocateRaw
(object_size, alignment,
28
AllocationOrigin::kGC
);
29
case
CODE_SPACE
:
30
return
code_space_allocator
()->
AllocateRaw
(object_size, alignment,
31
AllocationOrigin::kGC
);
32
case
SHARED_SPACE
:
33
return
shared_space_allocator
()->
AllocateRaw
(object_size, alignment,
34
AllocationOrigin::kGC
);
35
case
TRUSTED_SPACE
:
36
return
trusted_space_allocator
()->
AllocateRaw
(object_size, alignment,
37
AllocationOrigin::kGC
);
38
default
:
39
UNREACHABLE
();
40
}
41
}
42
43
}
// namespace internal
44
}
// namespace v8
45
46
#endif
// V8_HEAP_EVACUATION_ALLOCATOR_INL_H_
v8::internal::AllocationResult
Definition
allocation-result.h:26
v8::internal::EvacuationAllocator::trusted_space_allocator
MainAllocator * trusted_space_allocator()
Definition
evacuation-allocator.h:46
v8::internal::EvacuationAllocator::old_space_allocator
MainAllocator * old_space_allocator()
Definition
evacuation-allocator.h:39
v8::internal::EvacuationAllocator::shared_space_allocator_
std::optional< MainAllocator > shared_space_allocator_
Definition
evacuation-allocator.h:56
v8::internal::EvacuationAllocator::new_space_allocator
MainAllocator * new_space_allocator()
Definition
evacuation-allocator.h:38
v8::internal::EvacuationAllocator::shared_space_allocator
MainAllocator * shared_space_allocator()
Definition
evacuation-allocator.h:43
v8::internal::EvacuationAllocator::code_space_allocator
MainAllocator * code_space_allocator()
Definition
evacuation-allocator.h:40
v8::internal::EvacuationAllocator::Allocate
AllocationResult Allocate(AllocationSpace space, int object_size, AllocationAlignment alignment)
Definition
evacuation-allocator-inl.h:17
v8::internal::MainAllocator::AllocateRaw
V8_WARN_UNUSED_RESULT V8_INLINE AllocationResult AllocateRaw(int size_in_bytes, AllocationAlignment alignment, AllocationOrigin origin)
Definition
main-allocator-inl.h:18
globals.h
ALIGN_TO_ALLOCATION_ALIGNMENT
#define ALIGN_TO_ALLOCATION_ALIGNMENT(value)
Definition
globals.h:1796
evacuation-allocator.h
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8::internal::AllocationAlignment
AllocationAlignment
Definition
globals.h:1548
v8::internal::AllocationSpace
AllocationSpace
Definition
globals.h:1304
v8::internal::NEW_SPACE
@ NEW_SPACE
Definition
globals.h:1306
v8::internal::CODE_SPACE
@ CODE_SPACE
Definition
globals.h:1309
v8::internal::SHARED_SPACE
@ SHARED_SPACE
Definition
globals.h:1310
v8::internal::TRUSTED_SPACE
@ TRUSTED_SPACE
Definition
globals.h:1311
v8::internal::OLD_SPACE
@ OLD_SPACE
Definition
globals.h:1308
v8::internal::AllocationOrigin::kGC
@ kGC
v8::internal::UNREACHABLE
UNREACHABLE()
v8
Definition
api-arguments-inl.h:19
spaces-inl.h
DCHECK_IMPLIES
#define DCHECK_IMPLIES(v1, v2)
Definition
logging.h:493
src
heap
evacuation-allocator-inl.h
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0