Commit a71ab76a authored by Toon Verwaest's avatar Toon Verwaest Committed by V8 LUCI CQ

[interpreter] Remove %_Call

This isn't used outside of tests, so let's just remove it.

Change-Id: I06b7ec11911fd8ebc3bbabcba16d0c2a3fafddab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2968413Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75220}
parent 4c535930
......@@ -1284,21 +1284,6 @@ void BaselineCompiler::VisitIntrinsicCreateIterResultObject(
CallBuiltin<Builtin::kCreateIterResultObject>(args);
}
void BaselineCompiler::VisitIntrinsicCall(interpreter::RegisterList args) {
// First argument register contains the function target.
__ LoadRegister(kJavaScriptCallTargetRegister, args.first_register());
// The arguments for the target function are from the second runtime call
// argument.
args = args.PopLeft();
uint32_t arg_count = args.register_count();
CallBuiltin<Builtin::kCall_ReceiverIsAny>(
kJavaScriptCallTargetRegister, // kFunction
arg_count - 1, // kActualArgumentsCount
args);
}
void BaselineCompiler::VisitIntrinsicCreateAsyncFromSyncIterator(
interpreter::RegisterList args) {
CallBuiltin<Builtin::kCreateAsyncFromSyncIteratorBaseline>(args[0]);
......
......@@ -74,8 +74,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceAsyncGeneratorYield(node);
case Runtime::kInlineGeneratorGetResumeMode:
return ReduceGeneratorGetResumeMode(node);
case Runtime::kInlineCall:
return ReduceCall(node);
case Runtime::kInlineIncBlockCounter:
return ReduceIncBlockCounter(node);
case Runtime::kInlineGetImportMetaObject:
......
......@@ -395,7 +395,6 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
// Intrinsics with inline versions have to be allowlisted here a second time.
#define INLINE_INTRINSIC_ALLOWLIST(V) \
V(Call) \
V(AsyncFunctionEnter) \
V(AsyncFunctionReject) \
V(AsyncFunctionResolve)
......
......@@ -180,33 +180,6 @@ TNode<Object> IntrinsicsGenerator::CreateIterResultObject(
arg_count);
}
TNode<Object> IntrinsicsGenerator::Call(
const InterpreterAssembler::RegListNodePair& args, TNode<Context> context,
int arg_count) {
// First argument register contains the function target.
TNode<Object> function = __ LoadRegisterFromRegisterList(args, 0);
// The arguments for the target function are from the second runtime call
// argument.
InterpreterAssembler::RegListNodePair target_args(
__ RegisterLocationInRegisterList(args, 1),
__ Int32Sub(args.reg_count(), __ Int32Constant(1)));
if (FLAG_debug_code) {
InterpreterAssembler::Label arg_count_positive(assembler_);
TNode<BoolT> comparison =
__ Int32LessThan(target_args.reg_count(), __ Int32Constant(0));
__ GotoIfNot(comparison, &arg_count_positive);
__ Abort(AbortReason::kWrongArgumentCountForInvokeIntrinsic);
__ Goto(&arg_count_positive);
__ BIND(&arg_count_positive);
}
__ CallJSAndDispatch(function, context, target_args,
ConvertReceiverMode::kAny);
return TNode<Object>(); // We never return from the CallJSAndDispatch above.
}
TNode<Object> IntrinsicsGenerator::CreateAsyncFromSyncIterator(
const InterpreterAssembler::RegListNodePair& args, TNode<Context> context,
int arg_count) {
......
......@@ -28,7 +28,6 @@ namespace interpreter {
V(GeneratorGetResumeMode, generator_get_resume_mode, 1) \
V(GeneratorClose, generator_close, 1) \
V(GetImportMetaObject, get_import_meta_object, 0) \
V(Call, call, -1) \
V(CopyDataProperties, copy_data_properties, 2) \
V(CreateIterResultObject, create_iter_result_object, 2) \
V(CreateAsyncFromSyncIterator, create_async_from_sync_iterator, 1)
......
......@@ -171,7 +171,7 @@ namespace internal {
FOR_EACH_INTRINSIC_TRACE_FEEDBACK(F, I)
#define FOR_EACH_INTRINSIC_FUNCTION(F, I) \
I(Call, -1 /* >= 2 */, 1) \
F(Call, -1 /* >= 2 */, 1) \
F(FunctionGetScriptSource, 1, 1) \
F(FunctionGetScriptId, 1, 1) \
F(FunctionGetScriptSourcePosition, 1, 1) \
......
......@@ -114,7 +114,6 @@ v8_source_set("cctest_sources") {
"compiler/test-run-bytecode-graph-builder.cc",
"compiler/test-run-calls-to-external-references.cc",
"compiler/test-run-deopt.cc",
"compiler/test-run-intrinsics.cc",
"compiler/test-run-jsbranches.cc",
"compiler/test-run-jscalls.cc",
"compiler/test-run-jsexceptions.cc",
......
// Copyright 2014 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/codegen/optimized-compilation-info.h"
#include "src/objects/string.h"
#include "test/cctest/compiler/function-tester.h"
namespace v8 {
namespace internal {
namespace compiler {
uint32_t flags = OptimizedCompilationInfo::kInlining;
TEST(Call) {
FunctionTester T("(function(a,b) { return %_Call(b, a, 1, 2, 3); })", flags);
CompileRun("function f(a,b,c) { return a + b + c + this.d; }");
T.CheckCall(T.Val(129), T.NewObject("({d:123})"), T.NewObject("f"));
T.CheckCall(T.Val("6x"), T.NewObject("({d:'x'})"), T.NewObject("f"));
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -60,28 +60,6 @@ class InvokeIntrinsicHelper {
} // namespace
TEST(Call) {
HandleAndZoneScope handles;
Isolate* isolate = handles.main_isolate();
Factory* factory = isolate->factory();
InvokeIntrinsicHelper helper(isolate, handles.main_zone(),
Runtime::kInlineCall);
CHECK_EQ(Smi::FromInt(20),
*helper.Invoke(helper.NewObject("(function() { return this.x; })"),
helper.NewObject("({ x: 20 })")));
CHECK_EQ(Smi::FromInt(50),
*helper.Invoke(helper.NewObject("(function(arg1) { return arg1; })"),
factory->undefined_value(),
handle(Smi::FromInt(50), isolate)));
CHECK_EQ(
Smi::FromInt(20),
*helper.Invoke(
helper.NewObject("(function(a, b, c) { return a + b + c; })"),
factory->undefined_value(), handle(Smi::FromInt(10), isolate),
handle(Smi::FromInt(7), isolate), handle(Smi::FromInt(3), isolate)));
}
} // namespace interpreter
} // namespace internal
} // namespace v8
......@@ -19,7 +19,7 @@ function listener(event, exec_state, event_data, data) {
Debug.setListener(listener);
function f(x) {
if (x > 0) %_Call(f, null, x-1);
if (x > 0) %Call(f, null, x-1);
}
debugger;
......
......@@ -37,7 +37,7 @@ function f(x, y) {
%DeoptimizeFunction(f);
return 1;
}
a[0] = %_Call(f, null, x - 1);
a[0] = %Call(f, null, x - 1);
return x >> a[0];
}
......
......@@ -95,10 +95,6 @@ function TestCall(isStrict, callTrap) {
receiver = 333
assertEquals(42, %Call(f, null, 11, 31));
receiver = 333
assertEquals(42, %_Call(f, o, 11, 31))
assertSame(o, receiver)
receiver = 333
assertEquals(42, %_Call(f, null, 11, 31))
var ff = Function.prototype.bind.call(f, o, 12)
assertTrue(ff.length <= 1) // TODO(rossberg): Not spec'ed yet, be lax.
......@@ -118,11 +114,6 @@ function TestCall(isStrict, callTrap) {
assertEquals(23, %Call(ff, {}, 11, 3));
assertSame(o, receiver)
receiver = 333
assertEquals(34, %_Call(ff, {}, 22))
assertSame(o, receiver)
receiver = 333
assertEquals(34, %_Call(ff, {}, 22, 3))
assertSame(o, receiver)
var fff = Function.prototype.bind.call(ff, o, 30)
assertEquals(0, fff.length)
......@@ -142,11 +133,6 @@ function TestCall(isStrict, callTrap) {
assertEquals(42, %Call(fff, {}, 11, 3))
assertSame(o, receiver)
receiver = 333
assertEquals(42, %_Call(fff, {}))
assertSame(o, receiver)
receiver = 333
assertEquals(42, %_Call(fff, {}, 3, 4, 5))
assertSame(o, receiver)
var f = new Proxy(()=>{}, {apply: callTrap})
receiver = 333
......@@ -174,8 +160,6 @@ function TestCall(isStrict, callTrap) {
assertEquals(23, %Call(f, o, 11, 12))
assertSame(o, receiver)
receiver = 333
assertEquals(42, %_Call(f, o, 18, 24))
assertSame(o, receiver)
}
TestCall(false, function(_, that, [x, y]) {
......@@ -239,8 +223,6 @@ function TestCallThrow(callTrap) {
assertThrowsEquals(() => Function.prototype.apply.call(f, {}, [1]), "myexn")
assertThrowsEquals(() => %Call(f, {}), "myexn")
assertThrowsEquals(() => %Call(f, {}, 1, 2), "myexn")
assertThrowsEquals(() => %_Call(f, {}), "myexn")
assertThrowsEquals(() => %_Call(f, {}, 1, 2), "myexn")
var f = Object.freeze(new Proxy(()=>{}, {apply: callTrap}))
assertThrowsEquals(() => f(11), "myexn")
......@@ -250,8 +232,6 @@ function TestCallThrow(callTrap) {
assertThrowsEquals(() => Function.prototype.apply.call(f, {}, [1]), "myexn")
assertThrowsEquals(() => %Call(f, {}), "myexn")
assertThrowsEquals(() => %Call(f, {}, 1, 2), "myexn")
assertThrowsEquals(() => %_Call(f, {}), "myexn")
assertThrowsEquals(() => %_Call(f, {}, 1, 2), "myexn")
}
TestCallThrow(function() { throw "myexn" })
......@@ -553,7 +533,6 @@ function TestCalls() {
function(f, x, y, o) { return f.apply(o, [x, y]) },
function(f, x, y, o) { return Function.prototype.call.call(f, o, x, y) },
function(f, x, y, o) { return Function.prototype.apply.call(f, o, [x, y]) },
function(f, x, y, o) { return %_Call(f, o, x, y) },
function(f, x, y, o) { return %Call(f, o, x, y) },
function(f, x, y, o) { return %Apply(f, o, [null, x, y, null], 1, 2) },
function(f, x, y, o) { return %Apply(f, o, arguments, 2, 2) },
......
......@@ -29,7 +29,7 @@
function f(deopt, osr) {
var result = "result";
%_Call(function() {}, 0, 0);
%Call(function() {}, 0, 0);
var dummy = deopt + 0;
for (var i = 0; osr && i < 2; i++) {
%PrepareFunctionForOptimization(f);
......
......@@ -87,7 +87,7 @@
}
function bar(x, deopt) {
%_Call(f1, null, 'push', [x][0], ((deopt + 0), 1));
%Call(f1, null, 'push', [x][0], ((deopt + 0), 1));
}
function foo() { return bar(arguments[0], arguments[1]); }
......
......@@ -418,7 +418,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
builder.SwitchOnGeneratorState(reg, gen_jump_table).Bind(gen_jump_table, 0);
// Intrinsics handled by the interpreter.
builder.CallRuntime(Runtime::kInlineCall, reg_list);
builder.CallRuntime(Runtime::kInlineAsyncFunctionReject, reg_list);
// Emit debugger bytecode.
builder.Debugger();
......
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