[build] Split out EmbeddedFileWriterInterface

To reduce gn check errors, this moves EmbeddedFileWriterInterface into
its own header file that can be included directly by isolate.cc since
embedded-file-writer.h is in the mksnapshot target.

Bug: v8:7330
Change-Id: I3bfb1f48c646680b71189e8229b8df54ead9eea0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2727817
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73118}
This commit is contained in:
Dan Elphick 2021-03-01 18:30:26 +00:00 committed by Commit Bot
parent 179ee5f250
commit be5ccde28a
4 changed files with 59 additions and 32 deletions

View File

@ -2888,6 +2888,7 @@ v8_header_set("v8_internal_headers") {
"src/snapshot/context-serializer.h",
"src/snapshot/deserializer.h",
"src/snapshot/embedded/embedded-data.h",
"src/snapshot/embedded/embedded-file-writer-interface.h",
"src/snapshot/object-deserializer.h",
"src/snapshot/read-only-deserializer.h",
"src/snapshot/read-only-serializer.h",

View File

@ -79,7 +79,7 @@
#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-file-writer.h"
#include "src/snapshot/embedded/embedded-file-writer-interface.h"
#include "src/snapshot/read-only-deserializer.h"
#include "src/snapshot/startup-deserializer.h"
#include "src/strings/string-builder-inl.h"

View File

@ -0,0 +1,56 @@
// Copyright 2021 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_FILE_WRITER_INTERFACE_H_
#define V8_SNAPSHOT_EMBEDDED_EMBEDDED_FILE_WRITER_INTERFACE_H_
#include <string>
#include "v8config.h" // NOLINT(build/include_directory)
namespace v8 {
namespace internal {
class Builtins;
#if defined(V8_OS_WIN64)
namespace win64_unwindinfo {
class BuiltinUnwindInfo;
}
#endif // V8_OS_WIN64
static constexpr char kDefaultEmbeddedVariant[] = "Default";
struct LabelInfo {
int offset;
std::string name;
};
// Detailed source-code information about builtins can only be obtained by
// registration on the isolate during compilation.
class EmbeddedFileWriterInterface {
public:
// We maintain a database of filenames to synthetic IDs.
virtual int LookupOrAddExternallyCompiledFilename(const char* filename) = 0;
virtual const char* GetExternallyCompiledFilename(int index) const = 0;
virtual int GetExternallyCompiledFilenameCount() const = 0;
// The isolate will call the method below just prior to replacing the
// compiled builtin Code objects with trampolines.
virtual void PrepareBuiltinSourcePositionMap(Builtins* builtins) = 0;
virtual void PrepareBuiltinLabelInfoMap(int create_offset,
int invoke_offset) = 0;
#if defined(V8_OS_WIN64)
virtual void SetBuiltinUnwindData(
int builtin_index,
const win64_unwindinfo::BuiltinUnwindInfo& unwinding_info) = 0;
#endif // V8_OS_WIN64
};
} // namespace internal
} // namespace v8
#endif // V8_SNAPSHOT_EMBEDDED_EMBEDDED_FILE_WRITER_INTERFACE_H_

View File

@ -12,6 +12,7 @@
#include "src/common/globals.h"
#include "src/snapshot/embedded/embedded-data.h"
#include "src/snapshot/embedded/embedded-file-writer-interface.h"
#include "src/snapshot/embedded/platform-embedded-file-writer-base.h"
#if defined(V8_OS_WIN64)
@ -21,37 +22,6 @@
namespace v8 {
namespace internal {
static constexpr char kDefaultEmbeddedVariant[] = "Default";
struct LabelInfo {
int offset;
std::string name;
};
// Detailed source-code information about builtins can only be obtained by
// registration on the isolate during compilation.
class EmbeddedFileWriterInterface {
public:
// We maintain a database of filenames to synthetic IDs.
virtual int LookupOrAddExternallyCompiledFilename(const char* filename) = 0;
virtual const char* GetExternallyCompiledFilename(int index) const = 0;
virtual int GetExternallyCompiledFilenameCount() const = 0;
// The isolate will call the method below just prior to replacing the
// compiled builtin Code objects with trampolines.
virtual void PrepareBuiltinSourcePositionMap(Builtins* builtins) = 0;
virtual void PrepareBuiltinLabelInfoMap(int create_offset,
int invoke_offset) = 0;
#if defined(V8_OS_WIN64)
virtual void SetBuiltinUnwindData(
int builtin_index,
const win64_unwindinfo::BuiltinUnwindInfo& unwinding_info) = 0;
#endif // V8_OS_WIN64
};
// Generates the embedded.S file which is later compiled into the final v8
// binary. Its contents are exported through two symbols:
//