Commit 20c4370d authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Remove dead kArchTailCallJSFunction.

The tail-call operator for invoking a JSFunction object from within stub
code has been dead for a while and untested by now. This removes support
for such a construct.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2452943002
Cr-Commit-Position: refs/heads/master@{#40583}
parent d0a047d4
...@@ -679,8 +679,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -679,8 +679,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
...@@ -688,11 +687,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -688,11 +687,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ cmp(cp, kScratchReg); __ cmp(cp, kScratchReg);
__ Assert(eq, kWrongFunctionContext); __ Assert(eq, kWrongFunctionContext);
} }
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(0), i.TempRegister(1),
i.TempRegister(0), i.TempRegister(1), i.TempRegister(2));
i.TempRegister(2));
}
__ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(ip); __ Jump(ip);
DCHECK_EQ(LeaveCC, i.OutputSBit()); DCHECK_EQ(LeaveCC, i.OutputSBit());
......
...@@ -709,8 +709,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -709,8 +709,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
...@@ -720,11 +719,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -720,11 +719,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ cmp(cp, temp); __ cmp(cp, temp);
__ Assert(eq, kWrongFunctionContext); __ Assert(eq, kWrongFunctionContext);
} }
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(0), i.TempRegister(1),
i.TempRegister(0), i.TempRegister(1), i.TempRegister(2));
i.TempRegister(2));
}
__ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(x10); __ Jump(x10);
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
......
...@@ -580,18 +580,15 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -580,18 +580,15 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
__ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset));
__ Assert(equal, kWrongFunctionContext); __ Assert(equal, kWrongFunctionContext);
} }
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, no_reg,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, no_reg, no_reg);
no_reg, no_reg, no_reg);
}
__ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset));
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
frame_access_state()->SetFrameAccessToDefault(); frame_access_state()->SetFrameAccessToDefault();
......
...@@ -48,7 +48,6 @@ enum class RecordWriteMode { kValueIsMap, kValueIsPointer, kValueIsAny }; ...@@ -48,7 +48,6 @@ enum class RecordWriteMode { kValueIsMap, kValueIsPointer, kValueIsAny };
V(ArchTailCallCodeObject) \ V(ArchTailCallCodeObject) \
V(ArchCallJSFunction) \ V(ArchCallJSFunction) \
V(ArchTailCallJSFunctionFromJSFunction) \ V(ArchTailCallJSFunctionFromJSFunction) \
V(ArchTailCallJSFunction) \
V(ArchTailCallAddress) \ V(ArchTailCallAddress) \
V(ArchPrepareCallCFunction) \ V(ArchPrepareCallCFunction) \
V(ArchCallCFunction) \ V(ArchCallCFunction) \
......
...@@ -284,7 +284,6 @@ int InstructionScheduler::GetInstructionFlags(const Instruction* instr) const { ...@@ -284,7 +284,6 @@ int InstructionScheduler::GetInstructionFlags(const Instruction* instr) const {
case kArchTailCallCodeObjectFromJSFunction: case kArchTailCallCodeObjectFromJSFunction:
case kArchTailCallCodeObject: case kArchTailCallCodeObject:
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction:
case kArchTailCallJSFunction:
case kArchTailCallAddress: case kArchTailCallAddress:
return kHasSideEffect | kIsBlockTerminator; return kHasSideEffect | kIsBlockTerminator;
......
...@@ -1925,9 +1925,6 @@ void InstructionSelector::VisitTailCall(Node* node) { ...@@ -1925,9 +1925,6 @@ void InstructionSelector::VisitTailCall(Node* node) {
case CallDescriptor::kCallCodeObject: case CallDescriptor::kCallCodeObject:
opcode = kArchTailCallCodeObject; opcode = kArchTailCallCodeObject;
break; break;
case CallDescriptor::kCallJSFunction:
opcode = kArchTailCallJSFunction;
break;
case CallDescriptor::kCallAddress: case CallDescriptor::kCallAddress:
opcode = kArchTailCallAddress; opcode = kArchTailCallAddress;
break; break;
......
...@@ -901,7 +901,6 @@ class V8_EXPORT_PRIVATE Instruction final { ...@@ -901,7 +901,6 @@ class V8_EXPORT_PRIVATE Instruction final {
bool IsTailCall() const { bool IsTailCall() const {
return arch_opcode() == ArchOpcode::kArchTailCallCodeObject || return arch_opcode() == ArchOpcode::kArchTailCallCodeObject ||
arch_opcode() == ArchOpcode::kArchTailCallCodeObjectFromJSFunction || arch_opcode() == ArchOpcode::kArchTailCallCodeObjectFromJSFunction ||
arch_opcode() == ArchOpcode::kArchTailCallJSFunction ||
arch_opcode() == ArchOpcode::kArchTailCallJSFunctionFromJSFunction || arch_opcode() == ArchOpcode::kArchTailCallJSFunctionFromJSFunction ||
arch_opcode() == ArchOpcode::kArchTailCallAddress; arch_opcode() == ArchOpcode::kArchTailCallAddress;
} }
......
...@@ -639,20 +639,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -639,20 +639,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->SetFrameAccessToDefault(); frame_access_state()->SetFrameAccessToDefault();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
__ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); __ lw(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
__ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg));
} }
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { i.TempRegister(0), i.TempRegister(1),
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(2));
i.TempRegister(0), i.TempRegister(1),
i.TempRegister(2));
}
__ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); __ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(at); __ Jump(at);
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
......
...@@ -648,19 +648,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -648,19 +648,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
__ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); __ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
__ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); __ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg));
} }
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(0), i.TempRegister(1),
i.TempRegister(0), i.TempRegister(1), i.TempRegister(2));
i.TempRegister(2));
}
__ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); __ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(at); __ Jump(at);
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
......
...@@ -1012,8 +1012,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1012,8 +1012,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
...@@ -1022,11 +1021,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1022,11 +1021,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ cmp(cp, kScratchReg); __ cmp(cp, kScratchReg);
__ Assert(eq, kWrongFunctionContext); __ Assert(eq, kWrongFunctionContext);
} }
if (opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(0), i.TempRegister(1),
i.TempRegister(0), i.TempRegister(1), i.TempRegister(2));
i.TempRegister(2));
}
__ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(ip); __ Jump(ip);
DCHECK_EQ(LeaveRC, i.OutputRCBit()); DCHECK_EQ(LeaveRC, i.OutputRCBit());
......
...@@ -924,8 +924,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -924,8 +924,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
...@@ -934,11 +933,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -934,11 +933,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ CmpP(cp, kScratchReg); __ CmpP(cp, kScratchReg);
__ Assert(eq, kWrongFunctionContext); __ Assert(eq, kWrongFunctionContext);
} }
if (opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(0), i.TempRegister(1),
i.TempRegister(0), i.TempRegister(1), i.TempRegister(2));
i.TempRegister(2));
}
__ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); __ LoadP(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(ip); __ Jump(ip);
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
......
...@@ -848,19 +848,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -848,19 +848,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
RecordCallPosition(instr); RecordCallPosition(instr);
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
__ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset));
__ Assert(equal, kWrongFunctionContext); __ Assert(equal, kWrongFunctionContext);
} }
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, i.TempRegister(0), i.TempRegister(1),
i.TempRegister(0), i.TempRegister(1), i.TempRegister(2));
i.TempRegister(2));
}
__ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset));
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
frame_access_state()->SetFrameAccessToDefault(); frame_access_state()->SetFrameAccessToDefault();
......
...@@ -637,8 +637,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -637,8 +637,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
break; break;
} }
case kArchTailCallJSFunctionFromJSFunction: case kArchTailCallJSFunctionFromJSFunction: {
case kArchTailCallJSFunction: {
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
// Check the function's context matches the context argument. // Check the function's context matches the context argument.
...@@ -649,10 +648,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -649,10 +648,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ VerifyX87StackDepth(1); __ VerifyX87StackDepth(1);
} }
__ fstp(0); __ fstp(0);
if (arch_opcode == kArchTailCallJSFunctionFromJSFunction) { AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, no_reg,
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, no_reg, no_reg);
no_reg, no_reg, no_reg);
}
__ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); __ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset));
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
frame_access_state()->SetFrameAccessToDefault(); frame_access_state()->SetFrameAccessToDefault();
......
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