13#ifdef V8_ENABLE_LEAPTIERING
18void JSDispatchEntry::CheckFieldOffsets() {
19 static_assert(JSDispatchEntry::kEntrypointOffset ==
20 offsetof(JSDispatchEntry, entrypoint_));
21 static_assert(JSDispatchEntry::kCodeObjectOffset ==
22 offsetof(JSDispatchEntry, encoded_word_));
23#if defined(V8_TARGET_ARCH_64_BIT)
24#ifdef V8_TARGET_BIG_ENDIAN
26 constexpr int kBigEndianParamCountOffset =
sizeof(
Address) -
sizeof(uint16_t);
27 static_assert(
sizeof(encoded_word_) ==
sizeof(
Address));
28 static_assert(JSDispatchEntry::kParameterCountOffset ==
29 offsetof(JSDispatchEntry, encoded_word_) +
30 kBigEndianParamCountOffset);
32 static_assert(JSDispatchEntry::kParameterCountOffset ==
33 offsetof(JSDispatchEntry, encoded_word_));
35 static_assert(kParameterCountMask == 0xffff);
36 static_assert(kParameterCountSize == 2);
37#elif defined(V8_TARGET_ARCH_32_BIT)
38 static_assert(JSDispatchEntry::kParameterCountOffset ==
39 offsetof(JSDispatchEntry, parameter_count_));
40 static_assert(kParameterCountSize ==
41 sizeof(JSDispatchEntry::parameter_count_));
43#error "Unsupported Architecture"
48 Space* space,
int count,
bool ensure_static_handles) {
49 DCHECK(space->BelongsTo(
this));
50 DCHECK_IMPLIES(ensure_static_handles, space->is_internal_read_only_space());
53 uint32_t idx = AllocateEntry(space);
55 first = IndexToHandle(idx);
58 DCHECK_EQ(IndexToHandle(idx), IndexToHandle(HandleToIndex(first) +
i));
60#if V8_STATIC_DISPATCH_HANDLES_BOOL
61 if (ensure_static_handles) {
62 CHECK_EQ(IndexToHandle(idx), GetStaticHandleForReadOnlySegmentEntry(
i));
65 CHECK(!ensure_static_handles);
71bool JSDispatchTable::PreAllocatedEntryNeedsInitialization(
73 DCHECK(space->BelongsTo(
this));
74 uint32_t index = HandleToIndex(
handle);
75 return at(index).IsFreelistEntry();
78void JSDispatchTable::InitializePreAllocatedEntry(Space* space,
82 DCHECK(space->BelongsTo(
this));
83 uint32_t index = HandleToIndex(
handle);
84 DCHECK(space->Contains(index));
85 DCHECK(at(index).IsFreelistEntry());
87 "JSDispatchTable initialize pre-allocated entry");
88 at(index).MakeJSDispatchEntry(code.address(), code->instruction_start(),
94 return at(HandleToIndex(
handle)).IsMarked();
99 uint32_t index = HandleToIndex(
handle);
100 i::PrintF(
"JSDispatchEntry @ %p\n", &at(index));
101 i::PrintF(
"* code %p\n",
reinterpret_cast<void*
>(GetCode(
handle).address()));
102 i::PrintF(
"* params %d\n", at(HandleToIndex(
handle)).GetParameterCount());
104 reinterpret_cast<void*
>(GetEntrypoint(
handle)));
110#define CASE(name, ...) \
111 if (IsTieringRequested(handle, TieringBuiltin::k##name, isolate)) { \
#define BUILTIN_LIST_BASE_TIERING(TFC)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
void PrintF(const char *format,...)
Tagged(T object) -> Tagged< T >
base::StrongAlias< JSDispatchHandleAliasTag, uint32_t > JSDispatchHandle
RwxMemoryWriteScope CFIMetadataWriteScope
#define DCHECK_IMPLIES(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)