Commit bfc3ce26 authored by Andreas Haas's avatar Andreas Haas Committed by V8 LUCI CQ

[bazel] Only add traphandler if wasm is enabled

Additionally this CL adds some #if V8_ENABLE_WEBASSEMBLY
that were missing.

Change-Id: I7c840ebfa800ad62f0b6f075c997bd1989a007e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596169Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80151}
parent 48ac33be
......@@ -1034,6 +1034,15 @@ filegroup(
],
)
# Default setting for v8_enable_pointer_compression when target is x64.
selects.config_setting_group(
name = "is_v8_enable_webassembly_on_non_android_posix_x64",
match_all = [
":is_v8_enable_webassembly",
"@v8//bazel/config:is_non_android_posix_x64",
],
)
filegroup(
name = "v8_base_without_compiler_files",
srcs = [
......@@ -2102,12 +2111,6 @@ filegroup(
"src/tracing/traced-value.h",
"src/tracing/tracing-category-observer.cc",
"src/tracing/tracing-category-observer.h",
"src/trap-handler/handler-inside-posix.h",
"src/trap-handler/handler-inside.cc",
"src/trap-handler/handler-outside.cc",
"src/trap-handler/handler-shared.cc",
"src/trap-handler/trap-handler-internal.h",
"src/trap-handler/trap-handler.h",
"src/utils/address-map.cc",
"src/utils/address-map.h",
"src/utils/allocation.cc",
......@@ -2391,7 +2394,7 @@ filegroup(
],
}) + select({
# Only for x64 builds and for arm64 with x64 host simulator.
"@v8//bazel/config:is_non_android_posix_x64": [
":is_v8_enable_webassembly_on_non_android_posix_x64": [
"src/trap-handler/handler-inside-posix.cc",
"src/trap-handler/handler-outside-posix.cc",
],
......@@ -2435,6 +2438,12 @@ filegroup(
"src/debug/debug-wasm-objects-inl.h",
"src/runtime/runtime-test-wasm.cc",
"src/runtime/runtime-wasm.cc",
"src/trap-handler/handler-inside-posix.h",
"src/trap-handler/handler-inside.cc",
"src/trap-handler/handler-outside.cc",
"src/trap-handler/handler-shared.cc",
"src/trap-handler/trap-handler-internal.h",
"src/trap-handler/trap-handler.h",
"src/wasm/assembler-buffer-cache.cc",
"src/wasm/assembler-buffer-cache.h",
"src/wasm/baseline/liftoff-assembler.cc",
......
......@@ -140,9 +140,13 @@
#if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD
#include <signal.h>
#if V8_ENABLE_WEBASSEMBLY
#include "include/v8-wasm-trap-handler-posix.h"
#include "src/trap-handler/handler-inside-posix.h"
#endif
#endif // V8_ENABLE_WEBASSEMBLY
#endif // V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD
#if V8_OS_WIN
#include <windows.h>
......
......@@ -80,7 +80,9 @@ CodeGenerator::CodeGenerator(Zone* codegen_zone, Frame* frame, Linkage* linkage,
optimized_out_literal_id_(-1),
source_position_table_builder_(
codegen_zone, SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS),
#if V8_ENABLE_WEBASSEMBLY
protected_instructions_(codegen_zone),
#endif // V8_ENABLE_WEBASSEMBLY
result_(kSuccess),
block_starts_(codegen_zone),
instr_starts_(codegen_zone),
......@@ -108,7 +110,9 @@ bool CodeGenerator::wasm_runtime_exception_support() const {
void CodeGenerator::AddProtectedInstructionLanding(uint32_t instr_offset,
uint32_t landing_offset) {
#if V8_ENABLE_WEBASSEMBLY
protected_instructions_.push_back({instr_offset, landing_offset});
#endif // V8_ENABLE_WEBASSEMBLY
}
void CodeGenerator::CreateFrameAccessState(Frame* frame) {
......@@ -442,8 +446,12 @@ base::OwnedVector<byte> CodeGenerator::GetSourcePositionTable() {
}
base::OwnedVector<byte> CodeGenerator::GetProtectedInstructionsData() {
#if V8_ENABLE_WEBASSEMBLY
return base::OwnedVector<byte>::Of(
base::Vector<byte>::cast(base::VectorOf(protected_instructions_)));
#else
return {};
#endif // V8_ENABLE_WEBASSEMBLY
}
MaybeHandle<Code> CodeGenerator::FinalizeCode() {
......
......@@ -18,7 +18,10 @@
#include "src/compiler/osr.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/objects/code-kind.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/trap-handler/trap-handler.h"
#endif // V8_ENABLE_WEBASSEMBLY
namespace v8 {
namespace internal {
......@@ -462,7 +465,9 @@ class V8_EXPORT_PRIVATE CodeGenerator final : public GapResolver::Assembler {
int osr_pc_offset_;
int optimized_out_literal_id_;
SourcePositionTableBuilder source_position_table_builder_;
#if V8_ENABLE_WEBASSEMBLY
ZoneVector<trap_handler::ProtectedInstructionData> protected_instructions_;
#endif // V8_ENABLE_WEBASSEMBLY
CodeGenResult result_;
ZoneVector<int> block_starts_;
TurbolizerCodeOffsetsInfo offsets_info_;
......
......@@ -64,7 +64,6 @@
#include "src/profiler/profile-generator.h"
#include "src/snapshot/snapshot.h"
#include "src/tasks/cancelable-task.h"
#include "src/trap-handler/trap-handler.h"
#include "src/utils/ostreams.h"
#include "src/utils/utils.h"
#include "src/web-snapshot/web-snapshot.h"
......@@ -91,6 +90,10 @@
#include <windows.h>
#endif // !defined(_WIN32) && !defined(_WIN64)
#if V8_ENABLE_WEBASSEMBLY
#include "src/trap-handler/trap-handler.h"
#endif // V8_ENABLE_WEBASSEMBLY
//
#ifndef DCHECK
#define DCHECK(condition) assert(condition)
#endif
......@@ -2537,7 +2540,7 @@ MaybeLocal<String> Shell::ReadSource(
String::Utf8Value filename(isolate, args[index]);
if (!Shell::ReadFile(isolate, *filename).ToLocal(&source)) {
return MaybeLocal<String>();
};
}
break;
}
case CodeType::kString:
......
......@@ -5,7 +5,10 @@
#include "src/execution/thread-local-top.h"
#include "src/execution/isolate.h"
#include "src/execution/simulator.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/trap-handler/trap-handler.h"
#endif // V8_ENABLE_WEBASSEMBLY
namespace v8 {
namespace internal {
......
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