Commit 649d759f authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[mksnapshot] Split out platform embedded file writers

Split out embedded file writers for AIX, Windows, and macOS. These are
no longer selected by compile-time defines (e.g. V8_OS_WIN,
V8_TARGET_ARCH_X64) but by --target-os and --target-arch runtime
flags.

Bug: v8:9103
Change-Id: I5d5cac15e48b5c743d74f8a382606a6194ba7865
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624216
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61785}
parent 2b7ab6ad
......@@ -3792,10 +3792,16 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
sources = [
"src/snapshot/embedded-file-writer.cc",
"src/snapshot/embedded-file-writer.h",
"src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
"src/snapshot/embedded/platform-embedded-file-writer-aix.h",
"src/snapshot/embedded/platform-embedded-file-writer-base.cc",
"src/snapshot/embedded/platform-embedded-file-writer-base.h",
"src/snapshot/embedded/platform-embedded-file-writer-generic.cc",
"src/snapshot/embedded/platform-embedded-file-writer-generic.h",
"src/snapshot/embedded/platform-embedded-file-writer-mac.cc",
"src/snapshot/embedded/platform-embedded-file-writer-mac.h",
"src/snapshot/embedded/platform-embedded-file-writer-win.cc",
"src/snapshot/embedded/platform-embedded-file-writer-win.h",
"src/snapshot/mksnapshot.cc",
]
......
......@@ -9,8 +9,9 @@
#include "src/codegen/source-position-table.h"
#include "src/objects/code-inl.h"
// TODO(jgruber): Remove once windows-specific code is extracted.
#include "src/snapshot/embedded/platform-embedded-file-writer-generic.h"
// TODO(jgruber): Refactor to move windows-specific code into the
// windows-specific file writer.
#include "src/snapshot/embedded/platform-embedded-file-writer-win.h"
namespace v8 {
namespace internal {
......@@ -286,47 +287,47 @@ void EmbeddedFileWriter::SetBuiltinUnwindData(
void EmbeddedFileWriter::WriteUnwindInfoEntry(PlatformEmbeddedFileWriterBase* w,
uint64_t rva_start,
uint64_t rva_end) const {
PlatformEmbeddedFileWriterGeneric* w_gen =
static_cast<PlatformEmbeddedFileWriterGeneric*>(w);
w_gen->DeclareRvaToSymbol(EmbeddedBlobDataSymbol().c_str(), rva_start);
w_gen->DeclareRvaToSymbol(EmbeddedBlobDataSymbol().c_str(), rva_end);
w_gen->DeclareRvaToSymbol(BuiltinsUnwindInfoLabel().c_str());
PlatformEmbeddedFileWriterWin* w_win =
static_cast<PlatformEmbeddedFileWriterWin*>(w);
w_win->DeclareRvaToSymbol(EmbeddedBlobDataSymbol().c_str(), rva_start);
w_win->DeclareRvaToSymbol(EmbeddedBlobDataSymbol().c_str(), rva_end);
w_win->DeclareRvaToSymbol(BuiltinsUnwindInfoLabel().c_str());
}
void EmbeddedFileWriter::WriteUnwindInfo(PlatformEmbeddedFileWriterBase* w,
const i::EmbeddedData* blob) const {
PlatformEmbeddedFileWriterGeneric* w_gen =
static_cast<PlatformEmbeddedFileWriterGeneric*>(w);
PlatformEmbeddedFileWriterWin* w_win =
static_cast<PlatformEmbeddedFileWriterWin*>(w);
// Emit an UNWIND_INFO (XDATA) struct, which contains the unwinding
// information that is used for all builtin functions.
DCHECK(win64_unwindinfo::CanEmitUnwindInfoForBuiltins());
w_gen->Comment("xdata for all the code in the embedded blob.");
w_gen->DeclareExternalFunction(CRASH_HANDLER_FUNCTION_NAME_STRING);
w_win->Comment("xdata for all the code in the embedded blob.");
w_win->DeclareExternalFunction(CRASH_HANDLER_FUNCTION_NAME_STRING);
w_gen->StartXdataSection();
w_win->StartXdataSection();
{
w_gen->DeclareLabel(BuiltinsUnwindInfoLabel().c_str());
w_win->DeclareLabel(BuiltinsUnwindInfoLabel().c_str());
std::vector<uint8_t> xdata =
win64_unwindinfo::GetUnwindInfoForBuiltinFunctions();
WriteBinaryContentsAsInlineAssembly(w_gen, xdata.data(),
WriteBinaryContentsAsInlineAssembly(w_win, xdata.data(),
static_cast<uint32_t>(xdata.size()));
w_gen->Comment(" ExceptionHandler");
w_gen->DeclareRvaToSymbol(CRASH_HANDLER_FUNCTION_NAME_STRING);
w_win->Comment(" ExceptionHandler");
w_win->DeclareRvaToSymbol(CRASH_HANDLER_FUNCTION_NAME_STRING);
}
w_gen->EndXdataSection();
w_gen->Newline();
w_win->EndXdataSection();
w_win->Newline();
// Emit a RUNTIME_FUNCTION (PDATA) entry for each builtin function, as
// documented here:
// https://docs.microsoft.com/en-us/cpp/build/exception-handling-x64.
w_gen->Comment(
w_win->Comment(
"pdata for all the code in the embedded blob (structs of type "
"RUNTIME_FUNCTION).");
w_gen->Comment(" BeginAddress");
w_gen->Comment(" EndAddress");
w_gen->Comment(" UnwindInfoAddress");
w_gen->StartPdataSection();
w_win->Comment(" BeginAddress");
w_win->Comment(" EndAddress");
w_win->Comment(" UnwindInfoAddress");
w_win->StartPdataSection();
{
Address prev_builtin_end_offset = 0;
for (int i = 0; i < Builtins::builtin_count; i++) {
......@@ -350,7 +351,7 @@ void EmbeddedFileWriter::WriteUnwindInfo(PlatformEmbeddedFileWriterBase* w,
// a few bytes before the beginning of the function, if it does not
// overlap the end of the previous builtin.
WriteUnwindInfoEntry(
w_gen,
w_win,
std::max(prev_builtin_end_offset,
builtin_start_offset - win64_unwindinfo::kRbpPrefixLength),
builtin_start_offset + builtin_size);
......@@ -362,7 +363,7 @@ void EmbeddedFileWriter::WriteUnwindInfo(PlatformEmbeddedFileWriterBase* w,
// we also emit a PDATA entry for the initial block of code up to the
// first 'push rbp', like in the case above.
if (xdata_desc[0] > 0) {
WriteUnwindInfoEntry(w_gen,
WriteUnwindInfoEntry(w_win,
std::max(prev_builtin_end_offset,
builtin_start_offset -
win64_unwindinfo::kRbpPrefixLength),
......@@ -373,17 +374,17 @@ void EmbeddedFileWriter::WriteUnwindInfo(PlatformEmbeddedFileWriterBase* w,
int chunk_start = xdata_desc[j];
int chunk_end =
(j < xdata_desc.size() - 1) ? xdata_desc[j + 1] : builtin_size;
WriteUnwindInfoEntry(w_gen, builtin_start_offset + chunk_start,
WriteUnwindInfoEntry(w_win, builtin_start_offset + chunk_start,
builtin_start_offset + chunk_end);
}
}
prev_builtin_end_offset = builtin_start_offset + builtin_size;
w_gen->Newline();
w_win->Newline();
}
}
w_gen->EndPdataSection();
w_gen->Newline();
w_win->EndPdataSection();
w_win->Newline();
}
#endif
......
// Copyright 2019 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.
#include "src/snapshot/embedded/platform-embedded-file-writer-aix.h"
namespace v8 {
namespace internal {
#define SYMBOL_PREFIX ""
namespace {
const char* DirectiveAsString(DataDirective directive) {
switch (directive) {
case kByte:
return ".byte";
case kLong:
return ".long";
case kQuad:
return ".llong";
default:
UNREACHABLE();
}
}
} // namespace
void PlatformEmbeddedFileWriterAIX::SectionText() {
fprintf(fp_, ".csect .text[PR]\n");
}
void PlatformEmbeddedFileWriterAIX::SectionData() {
fprintf(fp_, ".csect .data[RW]\n");
}
void PlatformEmbeddedFileWriterAIX::SectionRoData() {
fprintf(fp_, ".csect[RO]\n");
}
void PlatformEmbeddedFileWriterAIX::DeclareUint32(const char* name,
uint32_t value) {
DeclareSymbolGlobal(name);
fprintf(fp_, ".align 2\n");
fprintf(fp_, "%s:\n", name);
IndentedDataDirective(kLong);
fprintf(fp_, "%d\n", value);
Newline();
}
void PlatformEmbeddedFileWriterAIX::DeclarePointerToSymbol(const char* name,
const char* target) {
AlignToCodeAlignment();
DeclareLabel(name);
fprintf(fp_, " %s %s\n", DirectiveAsString(PointerSizeDirective()), target);
Newline();
}
void PlatformEmbeddedFileWriterAIX::DeclareSymbolGlobal(const char* name) {
fprintf(fp_, ".globl %s\n", name);
}
void PlatformEmbeddedFileWriterAIX::AlignToCodeAlignment() {
fprintf(fp_, ".align 5\n");
}
void PlatformEmbeddedFileWriterAIX::AlignToDataAlignment() {
fprintf(fp_, ".align 3\n");
}
void PlatformEmbeddedFileWriterAIX::Comment(const char* string) {
fprintf(fp_, "// %s\n", string);
}
void PlatformEmbeddedFileWriterAIX::DeclareLabel(const char* name) {
DeclareSymbolGlobal(name);
fprintf(fp_, "%s:\n", name);
}
void PlatformEmbeddedFileWriterAIX::SourceInfo(int fileid, const char* filename,
int line) {
fprintf(fp_, ".xline %d, \"%s\"\n", line, filename);
}
void PlatformEmbeddedFileWriterAIX::DeclareFunctionBegin(const char* name) {
Newline();
DeclareSymbolGlobal(name);
fprintf(fp_, ".csect %s[DS]\n", name); // function descriptor
fprintf(fp_, "%s:\n", name);
fprintf(fp_, ".llong .%s, 0, 0\n", name);
SectionText();
fprintf(fp_, ".%s:\n", name);
}
void PlatformEmbeddedFileWriterAIX::DeclareFunctionEnd(const char* name) {}
int PlatformEmbeddedFileWriterAIX::HexLiteral(uint64_t value) {
return fprintf(fp_, "0x%" PRIx64, value);
}
void PlatformEmbeddedFileWriterAIX::FilePrologue() {}
void PlatformEmbeddedFileWriterAIX::DeclareExternalFilename(
int fileid, const char* filename) {
// File name cannot be declared with an identifier on AIX.
// We use the SourceInfo method to emit debug info in
//.xline <line-number> <file-name> format.
}
void PlatformEmbeddedFileWriterAIX::FileEpilogue() {}
int PlatformEmbeddedFileWriterAIX::IndentedDataDirective(
DataDirective directive) {
return fprintf(fp_, " %s ", DirectiveAsString(directive));
}
#undef SYMBOL_PREFIX
} // namespace internal
} // namespace v8
// Copyright 2019 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_PLATFORM_EMBEDDED_FILE_WRITER_AIX_H_
#define V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_AIX_H_
#include "src/base/macros.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-base.h"
namespace v8 {
namespace internal {
class PlatformEmbeddedFileWriterAIX : public PlatformEmbeddedFileWriterBase {
public:
PlatformEmbeddedFileWriterAIX(EmbeddedTargetArch target_arch,
EmbeddedTargetOs target_os)
: target_arch_(target_arch), target_os_(target_os) {
USE(target_arch_);
USE(target_os_);
DCHECK_EQ(target_os_, EmbeddedTargetOs::kAIX);
}
void SectionText() override;
void SectionData() override;
void SectionRoData() override;
void AlignToCodeAlignment() override;
void AlignToDataAlignment() override;
void DeclareUint32(const char* name, uint32_t value) override;
void DeclarePointerToSymbol(const char* name, const char* target) override;
void DeclareLabel(const char* name) override;
void SourceInfo(int fileid, const char* filename, int line) override;
void DeclareFunctionBegin(const char* name) override;
void DeclareFunctionEnd(const char* name) override;
int HexLiteral(uint64_t value) override;
void Comment(const char* string) override;
void FilePrologue() override;
void DeclareExternalFilename(int fileid, const char* filename) override;
void FileEpilogue() override;
int IndentedDataDirective(DataDirective directive) override;
private:
void DeclareSymbolGlobal(const char* name);
private:
const EmbeddedTargetArch target_arch_;
const EmbeddedTargetOs target_os_;
};
} // namespace internal
} // namespace v8
#endif // V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_AIX_H_
......@@ -6,11 +6,24 @@
#include <string>
#include "src/globals.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-aix.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-generic.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-mac.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-win.h"
namespace v8 {
namespace internal {
DataDirective PointerSizeDirective() {
if (kSystemPointerSize == 8) {
return kQuad;
} else {
CHECK_EQ(4, kSystemPointerSize);
return kLong;
}
}
namespace {
EmbeddedTargetArch DefaultEmbeddedTargetArch() {
......@@ -83,9 +96,24 @@ EmbeddedTargetOs ToEmbeddedTargetOs(const char* s) {
std::unique_ptr<PlatformEmbeddedFileWriterBase> NewPlatformEmbeddedFileWriter(
const char* target_arch, const char* target_os) {
return std::unique_ptr<PlatformEmbeddedFileWriterGeneric>(
new PlatformEmbeddedFileWriterGeneric(ToEmbeddedTargetArch(target_arch),
ToEmbeddedTargetOs(target_os)));
auto embedded_target_arch = ToEmbeddedTargetArch(target_arch);
auto embedded_target_os = ToEmbeddedTargetOs(target_os);
if (embedded_target_os == EmbeddedTargetOs::kAIX) {
return base::make_unique<PlatformEmbeddedFileWriterAIX>(
embedded_target_arch, embedded_target_os);
} else if (embedded_target_os == EmbeddedTargetOs::kMac) {
return base::make_unique<PlatformEmbeddedFileWriterMac>(
embedded_target_arch, embedded_target_os);
} else if (embedded_target_os == EmbeddedTargetOs::kWin) {
return base::make_unique<PlatformEmbeddedFileWriterWin>(
embedded_target_arch, embedded_target_os);
} else {
return base::make_unique<PlatformEmbeddedFileWriterGeneric>(
embedded_target_arch, embedded_target_os);
}
UNREACHABLE();
}
} // namespace internal
......
......@@ -19,6 +19,8 @@ enum DataDirective {
kOcta,
};
DataDirective PointerSizeDirective();
enum class EmbeddedTargetOs {
kAIX,
kChromeOS,
......
......@@ -5,9 +5,6 @@
#ifndef V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_GENERIC_H_
#define V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_GENERIC_H_
#include <cinttypes>
#include <cstdio> // For FILE.
#include "src/base/macros.h"
#include "src/globals.h" // For V8_OS_WIN_X64
#include "src/snapshot/embedded/platform-embedded-file-writer-base.h"
......@@ -21,9 +18,9 @@ class PlatformEmbeddedFileWriterGeneric
PlatformEmbeddedFileWriterGeneric(EmbeddedTargetArch target_arch,
EmbeddedTargetOs target_os)
: target_arch_(target_arch), target_os_(target_os) {
// TODO(jgruber): Remove these once platforms have been split off.
USE(target_arch_);
USE(target_os_);
DCHECK(target_os_ == EmbeddedTargetOs::kChromeOS ||
target_os_ == EmbeddedTargetOs::kFuchsia ||
target_os_ == EmbeddedTargetOs::kGeneric);
}
void SectionText() override;
......@@ -52,19 +49,6 @@ class PlatformEmbeddedFileWriterGeneric
int IndentedDataDirective(DataDirective directive) override;
#if defined(V8_OS_WIN_X64)
// TODO(jgruber): Move these to the windows-specific writer.
void StartPdataSection();
void EndPdataSection();
void StartXdataSection();
void EndXdataSection();
void DeclareExternalFunction(const char* name);
// Emits an RVA (address relative to the module load address) specified as an
// offset from a given symbol.
void DeclareRvaToSymbol(const char* name, uint64_t offset = 0);
#endif // defined(V8_OS_WIN_X64)
private:
void DeclareSymbolGlobal(const char* name);
......
// Copyright 2019 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.
#include "src/snapshot/embedded/platform-embedded-file-writer-mac.h"
namespace v8 {
namespace internal {
namespace {
const char* DirectiveAsString(DataDirective directive) {
switch (directive) {
case kByte:
return ".byte";
case kLong:
return ".long";
case kQuad:
return ".quad";
case kOcta:
return ".octa";
}
UNREACHABLE();
}
} // namespace
void PlatformEmbeddedFileWriterMac::SectionText() { fprintf(fp_, ".text\n"); }
void PlatformEmbeddedFileWriterMac::SectionData() { fprintf(fp_, ".data\n"); }
void PlatformEmbeddedFileWriterMac::SectionRoData() {
fprintf(fp_, ".const_data\n");
}
void PlatformEmbeddedFileWriterMac::DeclareUint32(const char* name,
uint32_t value) {
DeclareSymbolGlobal(name);
DeclareLabel(name);
IndentedDataDirective(kLong);
fprintf(fp_, "%d", value);
Newline();
}
void PlatformEmbeddedFileWriterMac::DeclarePointerToSymbol(const char* name,
const char* target) {
DeclareSymbolGlobal(name);
DeclareLabel(name);
fprintf(fp_, " %s _%s\n", DirectiveAsString(PointerSizeDirective()), target);
}
void PlatformEmbeddedFileWriterMac::DeclareSymbolGlobal(const char* name) {
// TODO(jgruber): Investigate switching to .globl. Using .private_extern
// prevents something along the compilation chain from messing with the
// embedded blob. Using .global here causes embedded blob hash verification
// failures at runtime.
fprintf(fp_, ".private_extern _%s\n", name);
}
void PlatformEmbeddedFileWriterMac::AlignToCodeAlignment() {
fprintf(fp_, ".balign 32\n");
}
void PlatformEmbeddedFileWriterMac::AlignToDataAlignment() {
fprintf(fp_, ".balign 8\n");
}
void PlatformEmbeddedFileWriterMac::Comment(const char* string) {
fprintf(fp_, "// %s\n", string);
}
void PlatformEmbeddedFileWriterMac::DeclareLabel(const char* name) {
fprintf(fp_, "_%s:\n", name);
}
void PlatformEmbeddedFileWriterMac::SourceInfo(int fileid, const char* filename,
int line) {
fprintf(fp_, ".loc %d %d\n", fileid, line);
}
void PlatformEmbeddedFileWriterMac::DeclareFunctionBegin(const char* name) {
DeclareLabel(name);
// TODO(mvstanton): Investigate the proper incantations to mark the label as
// a function on OSX.
}
void PlatformEmbeddedFileWriterMac::DeclareFunctionEnd(const char* name) {}
int PlatformEmbeddedFileWriterMac::HexLiteral(uint64_t value) {
return fprintf(fp_, "0x%" PRIx64, value);
}
void PlatformEmbeddedFileWriterMac::FilePrologue() {}
void PlatformEmbeddedFileWriterMac::DeclareExternalFilename(
int fileid, const char* filename) {
fprintf(fp_, ".file %d \"%s\"\n", fileid, filename);
}
void PlatformEmbeddedFileWriterMac::FileEpilogue() {}
int PlatformEmbeddedFileWriterMac::IndentedDataDirective(
DataDirective directive) {
return fprintf(fp_, " %s ", DirectiveAsString(directive));
}
} // namespace internal
} // namespace v8
// Copyright 2019 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_PLATFORM_EMBEDDED_FILE_WRITER_MAC_H_
#define V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_MAC_H_
#include "src/base/macros.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-base.h"
namespace v8 {
namespace internal {
class PlatformEmbeddedFileWriterMac : public PlatformEmbeddedFileWriterBase {
public:
PlatformEmbeddedFileWriterMac(EmbeddedTargetArch target_arch,
EmbeddedTargetOs target_os)
: target_arch_(target_arch), target_os_(target_os) {
USE(target_arch_);
USE(target_os_);
DCHECK_EQ(target_os_, EmbeddedTargetOs::kMac);
}
void SectionText() override;
void SectionData() override;
void SectionRoData() override;
void AlignToCodeAlignment() override;
void AlignToDataAlignment() override;
void DeclareUint32(const char* name, uint32_t value) override;
void DeclarePointerToSymbol(const char* name, const char* target) override;
void DeclareLabel(const char* name) override;
void SourceInfo(int fileid, const char* filename, int line) override;
void DeclareFunctionBegin(const char* name) override;
void DeclareFunctionEnd(const char* name) override;
int HexLiteral(uint64_t value) override;
void Comment(const char* string) override;
void FilePrologue() override;
void DeclareExternalFilename(int fileid, const char* filename) override;
void FileEpilogue() override;
int IndentedDataDirective(DataDirective directive) override;
private:
void DeclareSymbolGlobal(const char* name);
private:
const EmbeddedTargetArch target_arch_;
const EmbeddedTargetOs target_os_;
};
} // namespace internal
} // namespace v8
#endif // V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_MAC_H_
This diff is collapsed.
// Copyright 2019 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_PLATFORM_EMBEDDED_FILE_WRITER_WIN_H_
#define V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_WIN_H_
#include "src/base/macros.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-base.h"
namespace v8 {
namespace internal {
class PlatformEmbeddedFileWriterWin : public PlatformEmbeddedFileWriterBase {
public:
PlatformEmbeddedFileWriterWin(EmbeddedTargetArch target_arch,
EmbeddedTargetOs target_os)
: target_arch_(target_arch), target_os_(target_os) {
USE(target_os_);
DCHECK_EQ(target_os_, EmbeddedTargetOs::kWin);
}
void SectionText() override;
void SectionData() override;
void SectionRoData() override;
void AlignToCodeAlignment() override;
void AlignToDataAlignment() override;
void DeclareUint32(const char* name, uint32_t value) override;
void DeclarePointerToSymbol(const char* name, const char* target) override;
void DeclareLabel(const char* name) override;
void SourceInfo(int fileid, const char* filename, int line) override;
void DeclareFunctionBegin(const char* name) override;
void DeclareFunctionEnd(const char* name) override;
int HexLiteral(uint64_t value) override;
void Comment(const char* string) override;
void FilePrologue() override;
void DeclareExternalFilename(int fileid, const char* filename) override;
void FileEpilogue() override;
int IndentedDataDirective(DataDirective directive) override;
void StartPdataSection();
void EndPdataSection();
void StartXdataSection();
void EndXdataSection();
void DeclareExternalFunction(const char* name);
// Emits an RVA (address relative to the module load address) specified as an
// offset from a given symbol.
void DeclareRvaToSymbol(const char* name, uint64_t offset = 0);
private:
void DeclareSymbolGlobal(const char* name);
private:
const EmbeddedTargetArch target_arch_;
const EmbeddedTargetOs target_os_;
};
} // namespace internal
} // namespace v8
#endif // V8_SNAPSHOT_EMBEDDED_PLATFORM_EMBEDDED_FILE_WRITER_WIN_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment