[ext-code-space] Make some EmbeddedData methods inline
Bug: v8:11880 Change-Id: Id3975d0c10ac5ece5c55d9db5ae7c6786fde2dfe Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3564566 Reviewed-by: Clemens Backes <clemensb@chromium.org> Reviewed-by: Jakob Linke <jgruber@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/main@{#79739}
This commit is contained in:
parent
ea2bbcbe87
commit
5a7ed57b10
@ -2026,6 +2026,7 @@ filegroup(
|
||||
"src/snapshot/deserializer.cc",
|
||||
"src/snapshot/deserializer.h",
|
||||
"src/snapshot/embedded/embedded-data.cc",
|
||||
"src/snapshot/embedded/embedded-data-inl.h",
|
||||
"src/snapshot/embedded/embedded-data.h",
|
||||
"src/snapshot/embedded/embedded-file-writer-interface.h",
|
||||
"src/snapshot/object-deserializer.cc",
|
||||
|
1
BUILD.gn
1
BUILD.gn
@ -3394,6 +3394,7 @@ v8_header_set("v8_internal_headers") {
|
||||
"src/snapshot/context-deserializer.h",
|
||||
"src/snapshot/context-serializer.h",
|
||||
"src/snapshot/deserializer.h",
|
||||
"src/snapshot/embedded/embedded-data-inl.h",
|
||||
"src/snapshot/embedded/embedded-data.h",
|
||||
"src/snapshot/embedded/embedded-file-writer-interface.h",
|
||||
"src/snapshot/object-deserializer.h",
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "src/objects/fixed-array.h"
|
||||
#include "src/objects/objects-inl.h"
|
||||
#include "src/objects/visitors.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/utils/ostreams.h"
|
||||
|
||||
namespace v8 {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "src/deoptimizer/deoptimizer.h"
|
||||
#include "src/heap/heap-write-barrier-inl.h"
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "src/common/globals.h"
|
||||
#include "src/execution/isolate-data.h"
|
||||
#include "src/execution/isolate-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "src/objects/slots.h"
|
||||
#include "src/objects/smi.h"
|
||||
#include "src/objects/visitors.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/strings/string-stream.h"
|
||||
#include "src/zone/zone-containers.h"
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
||||
#include "src/profiler/heap-profiler.h"
|
||||
#include "src/profiler/tracing-cpu-profiler.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-file-writer-interface.h"
|
||||
#include "src/snapshot/read-only-deserializer.h"
|
||||
#include "src/snapshot/shared-heap-deserializer.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "src/objects/code-kind.h"
|
||||
#include "src/objects/fixed-array.h"
|
||||
#include "src/roots/roots-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/utils/ostreams.h"
|
||||
|
||||
#ifdef ENABLE_DISASSEMBLER
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "src/logging/log.h"
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "src/logging/log.h"
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "src/logging/log.h"
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "src/logging/log.h"
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "src/logging/log.h"
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "src/objects/objects-inl.h"
|
||||
#include "src/regexp/regexp-macro-assembler.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/strings/unicode.h"
|
||||
|
||||
namespace v8 {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "src/objects/string.h"
|
||||
#include "src/roots/roots.h"
|
||||
#include "src/sandbox/external-pointer.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/snapshot/references.h"
|
||||
#include "src/snapshot/serializer-deserializer.h"
|
||||
#include "src/snapshot/shared-heap-serializer.h"
|
||||
|
159
src/snapshot/embedded/embedded-data-inl.h
Normal file
159
src/snapshot/embedded/embedded-data-inl.h
Normal file
@ -0,0 +1,159 @@
|
||||
// Copyright 2022 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef V8_SNAPSHOT_EMBEDDED_EMBEDDED_DATA_INL_H_
|
||||
#define V8_SNAPSHOT_EMBEDDED_EMBEDDED_DATA_INL_H_
|
||||
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
Address EmbeddedData::InstructionStartOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawCode() + desc.instruction_offset;
|
||||
DCHECK_LT(result, code_ + code_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::InstructionSizeOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
return desc.instruction_length;
|
||||
}
|
||||
|
||||
Address EmbeddedData::MetadataStartOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.metadata_offset;
|
||||
DCHECK_LE(desc.metadata_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::MetadataSizeOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
return desc.metadata_length;
|
||||
}
|
||||
|
||||
Address EmbeddedData::SafepointTableStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.metadata_offset;
|
||||
DCHECK_LE(desc.handler_table_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::SafepointTableSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
DCHECK_LE(desc.handler_table_offset, desc.constant_pool_offset);
|
||||
#else
|
||||
DCHECK_LE(desc.handler_table_offset, desc.code_comments_offset_offset);
|
||||
#endif
|
||||
return desc.handler_table_offset;
|
||||
}
|
||||
|
||||
Address EmbeddedData::HandlerTableStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.handler_table_offset;
|
||||
DCHECK_LE(desc.handler_table_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::HandlerTableSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
DCHECK_LE(desc.handler_table_offset, desc.constant_pool_offset);
|
||||
return desc.constant_pool_offset - desc.handler_table_offset;
|
||||
#else
|
||||
DCHECK_LE(desc.handler_table_offset, desc.code_comments_offset_offset);
|
||||
return desc.code_comments_offset_offset - desc.handler_table_offset;
|
||||
#endif
|
||||
}
|
||||
|
||||
Address EmbeddedData::ConstantPoolStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.constant_pool_offset;
|
||||
DCHECK_LE(desc.constant_pool_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
#else
|
||||
return kNullAddress;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::ConstantPoolSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
DCHECK_LE(desc.constant_pool_offset, desc.code_comments_offset_offset);
|
||||
return desc.code_comments_offset_offset - desc.constant_pool_offset;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
Address EmbeddedData::CodeCommentsStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.code_comments_offset_offset;
|
||||
DCHECK_LE(desc.code_comments_offset_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::CodeCommentsSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
DCHECK_LE(desc.code_comments_offset_offset,
|
||||
desc.unwinding_info_offset_offset);
|
||||
return desc.unwinding_info_offset_offset - desc.code_comments_offset_offset;
|
||||
}
|
||||
|
||||
Address EmbeddedData::UnwindingInfoStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.unwinding_info_offset_offset;
|
||||
DCHECK_LE(desc.unwinding_info_offset_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::UnwindingInfoSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
DCHECK_LE(desc.unwinding_info_offset_offset, desc.metadata_length);
|
||||
return desc.metadata_length - desc.unwinding_info_offset_offset;
|
||||
}
|
||||
|
||||
Address EmbeddedData::InstructionStartOfBytecodeHandlers() const {
|
||||
return InstructionStartOfBuiltin(Builtin::kFirstBytecodeHandler);
|
||||
}
|
||||
|
||||
Address EmbeddedData::InstructionEndOfBytecodeHandlers() const {
|
||||
STATIC_ASSERT(static_cast<int>(Builtin::kFirstBytecodeHandler) +
|
||||
kNumberOfBytecodeHandlers +
|
||||
2 * kNumberOfWideBytecodeHandlers ==
|
||||
Builtins::kBuiltinCount);
|
||||
Builtin lastBytecodeHandler = Builtins::FromInt(Builtins::kBuiltinCount - 1);
|
||||
return InstructionStartOfBuiltin(lastBytecodeHandler) +
|
||||
InstructionSizeOfBuiltin(lastBytecodeHandler);
|
||||
}
|
||||
|
||||
// Padded with kCodeAlignment.
|
||||
// TODO(v8:11045): Consider removing code alignment.
|
||||
uint32_t EmbeddedData::PaddedInstructionSizeOfBuiltin(Builtin builtin) const {
|
||||
uint32_t size = InstructionSizeOfBuiltin(builtin);
|
||||
CHECK_NE(size, 0);
|
||||
return PadAndAlignCode(size);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
#endif // V8_SNAPSHOT_EMBEDDED_EMBEDDED_DATA_INL_H_
|
@ -8,6 +8,7 @@
|
||||
#include "src/codegen/callable.h"
|
||||
#include "src/codegen/interface-descriptors-inl.h"
|
||||
#include "src/objects/objects-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/snapshot/snapshot-utils.h"
|
||||
#include "src/snapshot/snapshot.h"
|
||||
#include "v8-internal.h"
|
||||
@ -411,141 +412,6 @@ EmbeddedData EmbeddedData::FromIsolate(Isolate* isolate) {
|
||||
return d;
|
||||
}
|
||||
|
||||
Address EmbeddedData::InstructionStartOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawCode() + desc.instruction_offset;
|
||||
DCHECK_LT(result, code_ + code_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::InstructionSizeOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
return desc.instruction_length;
|
||||
}
|
||||
|
||||
Address EmbeddedData::MetadataStartOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.metadata_offset;
|
||||
DCHECK_LE(desc.metadata_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::MetadataSizeOfBuiltin(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
return desc.metadata_length;
|
||||
}
|
||||
|
||||
Address EmbeddedData::SafepointTableStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.metadata_offset;
|
||||
DCHECK_LE(desc.handler_table_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::SafepointTableSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
DCHECK_LE(desc.handler_table_offset, desc.constant_pool_offset);
|
||||
#else
|
||||
DCHECK_LE(desc.handler_table_offset, desc.code_comments_offset_offset);
|
||||
#endif
|
||||
return desc.handler_table_offset;
|
||||
}
|
||||
|
||||
Address EmbeddedData::HandlerTableStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.handler_table_offset;
|
||||
DCHECK_LE(desc.handler_table_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::HandlerTableSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
DCHECK_LE(desc.handler_table_offset, desc.constant_pool_offset);
|
||||
return desc.constant_pool_offset - desc.handler_table_offset;
|
||||
#else
|
||||
DCHECK_LE(desc.handler_table_offset, desc.code_comments_offset_offset);
|
||||
return desc.code_comments_offset_offset - desc.handler_table_offset;
|
||||
#endif
|
||||
}
|
||||
|
||||
Address EmbeddedData::ConstantPoolStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.constant_pool_offset;
|
||||
DCHECK_LE(desc.constant_pool_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
#else
|
||||
return kNullAddress;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::ConstantPoolSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
#if V8_EMBEDDED_CONSTANT_POOL
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
DCHECK_LE(desc.constant_pool_offset, desc.code_comments_offset_offset);
|
||||
return desc.code_comments_offset_offset - desc.constant_pool_offset;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
Address EmbeddedData::CodeCommentsStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.code_comments_offset_offset;
|
||||
DCHECK_LE(desc.code_comments_offset_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::CodeCommentsSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
DCHECK_LE(desc.code_comments_offset_offset,
|
||||
desc.unwinding_info_offset_offset);
|
||||
return desc.unwinding_info_offset_offset - desc.code_comments_offset_offset;
|
||||
}
|
||||
|
||||
Address EmbeddedData::UnwindingInfoStartOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
const uint8_t* result = RawMetadata() + desc.unwinding_info_offset_offset;
|
||||
DCHECK_LE(desc.unwinding_info_offset_offset, data_size_);
|
||||
return reinterpret_cast<Address>(result);
|
||||
}
|
||||
|
||||
uint32_t EmbeddedData::UnwindingInfoSizeOf(Builtin builtin) const {
|
||||
DCHECK(Builtins::IsBuiltinId(builtin));
|
||||
const struct LayoutDescription& desc = LayoutDescription(builtin);
|
||||
DCHECK_LE(desc.unwinding_info_offset_offset, desc.metadata_length);
|
||||
return desc.metadata_length - desc.unwinding_info_offset_offset;
|
||||
}
|
||||
|
||||
Address EmbeddedData::InstructionStartOfBytecodeHandlers() const {
|
||||
return InstructionStartOfBuiltin(Builtin::kFirstBytecodeHandler);
|
||||
}
|
||||
|
||||
Address EmbeddedData::InstructionEndOfBytecodeHandlers() const {
|
||||
STATIC_ASSERT(static_cast<int>(Builtin::kFirstBytecodeHandler) +
|
||||
kNumberOfBytecodeHandlers +
|
||||
2 * kNumberOfWideBytecodeHandlers ==
|
||||
Builtins::kBuiltinCount);
|
||||
Builtin lastBytecodeHandler = Builtins::FromInt(Builtins::kBuiltinCount - 1);
|
||||
return InstructionStartOfBuiltin(lastBytecodeHandler) +
|
||||
InstructionSizeOfBuiltin(lastBytecodeHandler);
|
||||
}
|
||||
|
||||
size_t EmbeddedData::CreateEmbeddedBlobDataHash() const {
|
||||
STATIC_ASSERT(EmbeddedBlobDataHashOffset() == 0);
|
||||
STATIC_ASSERT(EmbeddedBlobCodeHashOffset() == EmbeddedBlobDataHashSize());
|
||||
|
@ -128,29 +128,29 @@ class EmbeddedData final {
|
||||
}
|
||||
|
||||
// TODO(ishell): rename XyzOfBuiltin() to XyzOf().
|
||||
Address InstructionStartOfBuiltin(Builtin builtin) const;
|
||||
uint32_t InstructionSizeOfBuiltin(Builtin builtin) const;
|
||||
inline Address InstructionStartOfBuiltin(Builtin builtin) const;
|
||||
inline uint32_t InstructionSizeOfBuiltin(Builtin builtin) const;
|
||||
|
||||
Address InstructionStartOfBytecodeHandlers() const;
|
||||
Address InstructionEndOfBytecodeHandlers() const;
|
||||
inline Address InstructionStartOfBytecodeHandlers() const;
|
||||
inline Address InstructionEndOfBytecodeHandlers() const;
|
||||
|
||||
Address MetadataStartOfBuiltin(Builtin builtin) const;
|
||||
uint32_t MetadataSizeOfBuiltin(Builtin builtin) const;
|
||||
inline Address MetadataStartOfBuiltin(Builtin builtin) const;
|
||||
inline uint32_t MetadataSizeOfBuiltin(Builtin builtin) const;
|
||||
|
||||
Address SafepointTableStartOf(Builtin builtin) const;
|
||||
uint32_t SafepointTableSizeOf(Builtin builtin) const;
|
||||
inline Address SafepointTableStartOf(Builtin builtin) const;
|
||||
inline uint32_t SafepointTableSizeOf(Builtin builtin) const;
|
||||
|
||||
Address HandlerTableStartOf(Builtin builtin) const;
|
||||
uint32_t HandlerTableSizeOf(Builtin builtin) const;
|
||||
inline Address HandlerTableStartOf(Builtin builtin) const;
|
||||
inline uint32_t HandlerTableSizeOf(Builtin builtin) const;
|
||||
|
||||
Address ConstantPoolStartOf(Builtin builtin) const;
|
||||
uint32_t ConstantPoolSizeOf(Builtin builtin) const;
|
||||
inline Address ConstantPoolStartOf(Builtin builtin) const;
|
||||
inline uint32_t ConstantPoolSizeOf(Builtin builtin) const;
|
||||
|
||||
Address CodeCommentsStartOf(Builtin builtin) const;
|
||||
uint32_t CodeCommentsSizeOf(Builtin builtin) const;
|
||||
inline Address CodeCommentsStartOf(Builtin builtin) const;
|
||||
inline uint32_t CodeCommentsSizeOf(Builtin builtin) const;
|
||||
|
||||
Address UnwindingInfoStartOf(Builtin builtin) const;
|
||||
uint32_t UnwindingInfoSizeOf(Builtin builtin) const;
|
||||
inline Address UnwindingInfoStartOf(Builtin builtin) const;
|
||||
inline uint32_t UnwindingInfoSizeOf(Builtin builtin) const;
|
||||
|
||||
uint32_t AddressForHashing(Address addr) {
|
||||
DCHECK(IsInCodeRange(addr));
|
||||
@ -160,11 +160,7 @@ class EmbeddedData final {
|
||||
|
||||
// Padded with kCodeAlignment.
|
||||
// TODO(v8:11045): Consider removing code alignment.
|
||||
uint32_t PaddedInstructionSizeOfBuiltin(Builtin builtin) const {
|
||||
uint32_t size = InstructionSizeOfBuiltin(builtin);
|
||||
CHECK_NE(size, 0);
|
||||
return PadAndAlignCode(size);
|
||||
}
|
||||
inline uint32_t PaddedInstructionSizeOfBuiltin(Builtin builtin) const;
|
||||
|
||||
size_t CreateEmbeddedBlobDataHash() const;
|
||||
size_t CreateEmbeddedBlobCodeHash() const;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "src/codegen/source-position-table.h"
|
||||
#include "src/flags/flags.h" // For ENABLE_CONTROL_FLOW_INTEGRITY_BOOL
|
||||
#include "src/objects/code-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#if defined(V8_OS_WIN64)
|
||||
#include "src/builtins/builtins.h"
|
||||
#include "src/diagnostics/unwinding-info-win64.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-file-writer.h"
|
||||
#endif // V8_OS_WIN64
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "src/utils/memcopy.h"
|
||||
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "src/logging/counters.h"
|
||||
#include "src/logging/log.h"
|
||||
#include "src/objects/objects-inl.h"
|
||||
#include "src/snapshot/embedded/embedded-data.h"
|
||||
#include "src/snapshot/embedded/embedded-data-inl.h"
|
||||
#include "src/utils/ostreams.h"
|
||||
#include "src/wasm/code-space-access.h"
|
||||
#include "src/wasm/compilation-environment.h"
|
||||
|
Loading…
Reference in New Issue
Block a user