Commit 5d272cf8 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Remove obsolete {Builtins::IsWasmRuntimeStub}.

The last use of the predicate in question was to switch builtins that
implement WebAssembly runtime stubs to use hard aborts instead of normal
aborts like other builtins. This is no longer needed since the builtins
in question are embedded and no longer copied into WebAssembly modules.

This also allows to move the {WASM_RUNTIME_STUB_LIST} macro out of the
builtins-defintions.h file and into the wasm-code-manager.h file.

R=clemensb@chromium.org
BUG=v8:10021

Change-Id: Ib42d3731fc92df378cfce39d39e7fbdbbf722937
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1940266
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65238}
parent 3bbadd00
...@@ -1213,32 +1213,6 @@ namespace internal { ...@@ -1213,32 +1213,6 @@ namespace internal {
V(PromiseRace) \ V(PromiseRace) \
V(ResolvePromise) V(ResolvePromise)
// Convenience macro listing all wasm runtime stubs. Note that the first few
// elements of the list coincide with {compiler::TrapId}, order matters.
#define WASM_RUNTIME_STUB_LIST(V, VTRAP) \
FOREACH_WASM_TRAPREASON(VTRAP) \
V(WasmCompileLazy) \
V(WasmAtomicNotify) \
V(WasmI32AtomicWait) \
V(WasmI64AtomicWait) \
V(WasmMemoryGrow) \
V(WasmTableGet) \
V(WasmTableSet) \
V(WasmStackGuard) \
V(WasmStackOverflow) \
V(WasmThrow) \
V(WasmRethrow) \
V(WasmTraceMemory) \
V(AllocateHeapNumber) \
V(ArgumentsAdaptorTrampoline) \
V(BigIntToI32Pair) \
V(BigIntToI64) \
V(DoubleToI) \
V(I32PairToBigInt) \
V(I64ToBigInt) \
V(RecordWrite) \
V(ToNumber)
// The exception thrown in the following builtins are caught internally and will // The exception thrown in the following builtins are caught internally and will
// not be propagated further or re-thrown // not be propagated further or re-thrown
#define BUILTIN_EXCEPTION_CAUGHT_PREDICTION_LIST(V) V(PromiseRejectReactionJob) #define BUILTIN_EXCEPTION_CAUGHT_PREDICTION_LIST(V) V(PromiseRejectReactionJob)
......
...@@ -260,22 +260,6 @@ bool Builtins::IsIsolateIndependentBuiltin(const Code code) { ...@@ -260,22 +260,6 @@ bool Builtins::IsIsolateIndependentBuiltin(const Code code) {
Builtins::IsIsolateIndependent(builtin_index); Builtins::IsIsolateIndependent(builtin_index);
} }
// static
bool Builtins::IsWasmRuntimeStub(int index) {
DCHECK(IsBuiltinId(index));
switch (index) {
#define CASE_TRAP(Name) case kThrowWasm##Name:
#define CASE(Name) case k##Name:
WASM_RUNTIME_STUB_LIST(CASE, CASE_TRAP)
#undef CASE_TRAP
#undef CASE
return true;
default:
return false;
}
UNREACHABLE();
}
// static // static
void Builtins::InitializeBuiltinEntryTable(Isolate* isolate) { void Builtins::InitializeBuiltinEntryTable(Isolate* isolate) {
EmbeddedData d = EmbeddedData::FromBlob(); EmbeddedData d = EmbeddedData::FromBlob();
......
...@@ -136,8 +136,6 @@ class Builtins { ...@@ -136,8 +136,6 @@ class Builtins {
return kAllBuiltinsAreIsolateIndependent; return kAllBuiltinsAreIsolateIndependent;
} }
static bool IsWasmRuntimeStub(int index);
// Initializes the table of builtin entry points based on the current contents // Initializes the table of builtin entry points based on the current contents
// of the builtins table. // of the builtins table.
static void InitializeBuiltinEntryTable(Isolate* isolate); static void InitializeBuiltinEntryTable(Isolate* isolate);
......
...@@ -93,9 +93,7 @@ CodeGenerator::CodeGenerator( ...@@ -93,9 +93,7 @@ CodeGenerator::CodeGenerator(
code_kind == Code::WASM_TO_CAPI_FUNCTION || code_kind == Code::WASM_TO_CAPI_FUNCTION ||
code_kind == Code::WASM_TO_JS_FUNCTION || code_kind == Code::WASM_TO_JS_FUNCTION ||
code_kind == Code::WASM_INTERPRETER_ENTRY || code_kind == Code::WASM_INTERPRETER_ENTRY ||
code_kind == Code::JS_TO_WASM_FUNCTION || code_kind == Code::JS_TO_WASM_FUNCTION) {
(Builtins::IsBuiltinId(builtin_index) &&
Builtins::IsWasmRuntimeStub(builtin_index))) {
tasm_.set_abort_hard(true); tasm_.set_abort_hard(true);
} }
tasm_.set_builtin_index(builtin_index); tasm_.set_builtin_index(builtin_index);
......
...@@ -42,6 +42,32 @@ class WasmEngine; ...@@ -42,6 +42,32 @@ class WasmEngine;
class WasmImportWrapperCache; class WasmImportWrapperCache;
struct WasmModule; struct WasmModule;
// Convenience macro listing all wasm runtime stubs. Note that the first few
// elements of the list coincide with {compiler::TrapId}, order matters.
#define WASM_RUNTIME_STUB_LIST(V, VTRAP) \
FOREACH_WASM_TRAPREASON(VTRAP) \
V(WasmCompileLazy) \
V(WasmAtomicNotify) \
V(WasmI32AtomicWait) \
V(WasmI64AtomicWait) \
V(WasmMemoryGrow) \
V(WasmTableGet) \
V(WasmTableSet) \
V(WasmStackGuard) \
V(WasmStackOverflow) \
V(WasmThrow) \
V(WasmRethrow) \
V(WasmTraceMemory) \
V(AllocateHeapNumber) \
V(ArgumentsAdaptorTrampoline) \
V(BigIntToI32Pair) \
V(BigIntToI64) \
V(DoubleToI) \
V(I32PairToBigInt) \
V(I64ToBigInt) \
V(RecordWrite) \
V(ToNumber)
// Sorted, disjoint and non-overlapping memory regions. A region is of the // Sorted, disjoint and non-overlapping memory regions. A region is of the
// form [start, end). So there's no [start, end), [end, other_end), // form [start, end). So there's no [start, end), [end, other_end),
// because that should have been reduced to [start, other_end). // because that should have been reduced to [start, other_end).
......
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