Commit 5921f13a authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Remove obsolete {WasmCallJavaScript} builtin.

The builtin in question was just tail-calling another existing builtin
anyways. Call sites of the above builtin are rare and only appear in
import wrappers, removing the unnecessary hop is more efficient.

R=thibaudm@chromium.org

Change-Id: I42286346119fc627f8b9ef23fb6e4b2da1da80de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1752847Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63204}
parent 0d6aadb2
......@@ -1024,7 +1024,6 @@ namespace internal {
TFC(WasmAtomicNotify, WasmAtomicNotify) \
TFC(WasmI32AtomicWait, WasmI32AtomicWait) \
TFC(WasmI64AtomicWait, WasmI64AtomicWait) \
TFC(WasmCallJavaScript, CallTrampoline) \
TFC(WasmMemoryGrow, WasmMemoryGrow) \
TFC(WasmTableGet, WasmTableGet) \
TFC(WasmTableSet, WasmTableSet) \
......@@ -1340,7 +1339,6 @@ namespace internal {
V(WasmAtomicNotify) \
V(WasmI32AtomicWait) \
V(WasmI64AtomicWait) \
V(WasmCallJavaScript) \
V(WasmMemoryGrow) \
V(WasmTableGet) \
V(WasmTableSet) \
......
......@@ -64,14 +64,6 @@ TF_BUILTIN(WasmAllocateHeapNumber, WasmBuiltinsAssembler) {
TailCallStub(AllocateHeapNumberDescriptor(), target, NoContextConstant());
}
TF_BUILTIN(WasmCallJavaScript, WasmBuiltinsAssembler) {
TNode<Object> context = UncheckedParameter(Descriptor::kContext);
TNode<Object> function = UncheckedParameter(Descriptor::kFunction);
TNode<Object> argc = UncheckedParameter(Descriptor::kActualArgumentsCount);
TNode<Code> target = LoadBuiltinFromFrame(Builtins::kCall_ReceiverIsAny);
TailCallStub(CallTrampolineDescriptor{}, target, context, function, argc);
}
TF_BUILTIN(WasmRecordWrite, WasmBuiltinsAssembler) {
TNode<Object> object = UncheckedParameter(Descriptor::kObject);
TNode<Object> slot = UncheckedParameter(Descriptor::kSlot);
......
......@@ -5772,16 +5772,15 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
case WasmImportCallKind::kUseCallBuiltin: {
Vector<Node*> args = Buffer(wasm_count + 7);
int pos = 0;
args[pos++] = mcgraph()->RelocatableIntPtrConstant(
wasm::WasmCode::kWasmCallJavaScript, RelocInfo::WASM_STUB_CALL);
args[pos++] =
BuildLoadBuiltinFromIsolateRoot(Builtins::kCall_ReceiverIsAny);
args[pos++] = callable_node;
args[pos++] = mcgraph()->Int32Constant(wasm_count); // argument count
args[pos++] = undefined_node; // receiver
auto call_descriptor = Linkage::GetStubCallDescriptor(
graph()->zone(), CallTrampolineDescriptor{}, wasm_count + 1,
CallDescriptor::kNoFlags, Operator::kNoProperties,
StubCallMode::kCallWasmRuntimeStub);
CallDescriptor::kNoFlags, Operator::kNoProperties);
// Convert wasm numbers to JS values.
pos = AddArgumentNodes(args, pos, wasm_count, sig_);
......@@ -6708,6 +6707,8 @@ MaybeHandle<Code> CompileCWasmEntry(Isolate* isolate, wasm::FunctionSig* sig) {
return code;
}
namespace {
bool BuildGraphForWasmFunction(AccountingAllocator* allocator,
wasm::CompilationEnv* env,
const wasm::FunctionBody& func_body,
......@@ -6746,7 +6747,6 @@ bool BuildGraphForWasmFunction(AccountingAllocator* allocator,
return true;
}
namespace {
Vector<const char> GetDebugName(Zone* zone, int index) {
// TODO(herhut): Use name from module if available.
constexpr int kBufferLength = 24;
......@@ -6759,6 +6759,7 @@ Vector<const char> GetDebugName(Zone* zone, int index) {
memcpy(index_name, name_vector.begin(), name_len);
return Vector<const char>(index_name, name_len);
}
} // namespace
wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
......
......@@ -47,14 +47,6 @@ struct WasmFeatures;
namespace compiler {
bool BuildGraphForWasmFunction(AccountingAllocator* allocator,
wasm::CompilationEnv* env,
const wasm::FunctionBody& func_body,
int func_index, wasm::WasmFeatures* detected,
MachineGraph* mcgraph,
NodeOriginTable* node_origins,
SourcePositionTable* source_positions);
wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
wasm::WasmEngine*, wasm::CompilationEnv*, const wasm::FunctionBody&,
int func_index, Counters*, wasm::WasmFeatures* detected);
......
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