Commit 0a1dcadd authored by petermarshall's avatar petermarshall Committed by Commit bot

[fullcodegen] Remove deprecated support for super constructor calls.

All super constructor calls go through the ignition + turbofan pipeline, so this is dead code.

BUG=v8:5657

Review-Url: https://codereview.chromium.org/2525233003
Cr-Commit-Position: refs/heads/master@{#41313}
parent ee84d9f7
......@@ -1995,14 +1995,13 @@ void AstGraphBuilder::VisitCall(Call* expr) {
environment()->Drop(1);
break;
}
case Call::SUPER_CALL:
return VisitCallSuper(expr);
case Call::OTHER_CALL:
VisitForValue(callee);
callee_value = environment()->Pop();
receiver_hint = ConvertReceiverMode::kNullOrUndefined;
receiver_value = jsgraph()->UndefinedConstant();
break;
case Call::SUPER_CALL:
case Call::WITH_CALL:
UNREACHABLE();
}
......@@ -2062,34 +2061,6 @@ void AstGraphBuilder::VisitCall(Call* expr) {
}
void AstGraphBuilder::VisitCallSuper(Call* expr) {
SuperCallReference* super = expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super);
// Prepare the callee to the super call.
VisitForValue(super->this_function_var());
Node* this_function = environment()->Pop();
const Operator* op =
javascript()->CallRuntime(Runtime::kInlineGetSuperConstructor, 1);
Node* super_function = NewNode(op, this_function);
environment()->Push(super_function);
// Evaluate all arguments to the super call.
ZoneList<Expression*>* args = expr->arguments();
VisitForValues(args);
// The new target is loaded from the {new.target} variable.
VisitForValue(super->new_target_var());
// Create node to perform the super call.
const Operator* call =
javascript()->CallConstruct(args->length() + 2, 0.0f, VectorSlotPair());
Node* value = ProcessArguments(call, args->length() + 2);
PrepareFrameState(value, expr->ReturnId(), OutputFrameStateCombine::Push());
ast_context()->ProduceValue(expr, value);
}
void AstGraphBuilder::VisitCallNew(CallNew* expr) {
VisitForValue(expr->expression());
......
......@@ -2172,49 +2172,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ ldr(result_register(),
FieldMemOperand(result_register(), HeapObject::kMapOffset));
__ ldr(result_register(),
FieldMemOperand(result_register(), Map::kPrototypeOffset));
PushOperand(result_register());
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into r3.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mov(r3, result_register());
// Load function and argument count into r1 and r0.
__ mov(r0, Operand(arg_count));
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(r0);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2123,50 +2123,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
ASM_LOCATION("FullCodeGenerator::EmitSuperConstructorCall");
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ Ldr(result_register(),
FieldMemOperand(result_register(), HeapObject::kMapOffset));
__ Ldr(result_register(),
FieldMemOperand(result_register(), Map::kPrototypeOffset));
PushOperand(result_register());
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into x3.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ Mov(x3, result_register());
// Load function and argument count into x1 and x0.
__ Mov(x0, arg_count);
__ Peek(x1, arg_count * kXRegSize);
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(x0);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -1470,9 +1470,6 @@ void FullCodeGenerator::VisitCall(Call* expr) {
case Call::KEYED_SUPER_PROPERTY_CALL:
EmitKeyedSuperCallWithLoadIC(expr);
break;
case Call::SUPER_CALL:
EmitSuperConstructorCall(expr);
break;
case Call::OTHER_CALL:
// Call to an arbitrary expression not handled specially above.
VisitForStackValue(callee);
......@@ -1481,6 +1478,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// Emit function call.
EmitCall(expr);
break;
case Call::SUPER_CALL:
case Call::WITH_CALL:
UNREACHABLE();
}
......
......@@ -405,7 +405,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
// Platform-specific code sequences for calls
void EmitCall(Call* expr, ConvertReceiverMode = ConvertReceiverMode::kAny);
void EmitSuperConstructorCall(Call* expr);
void EmitCallWithLoadIC(Call* expr);
void EmitSuperCallWithLoadIC(Call* expr);
void EmitKeyedCallWithLoadIC(Call* expr, Expression* key);
......
......@@ -2081,47 +2081,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ mov(result_register(),
FieldOperand(result_register(), HeapObject::kMapOffset));
PushOperand(FieldOperand(result_register(), Map::kPrototypeOffset));
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into edx.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mov(edx, result_register());
// Load function and argument count into edi and eax.
__ Move(eax, Immediate(arg_count));
__ mov(edi, Operand(esp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(eax);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2187,49 +2187,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ lw(result_register(),
FieldMemOperand(result_register(), HeapObject::kMapOffset));
__ lw(result_register(),
FieldMemOperand(result_register(), Map::kPrototypeOffset));
PushOperand(result_register());
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into a3.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mov(a3, result_register());
// Load function and argument count into a1 and a0.
__ li(a0, Operand(arg_count));
__ lw(a1, MemOperand(sp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(v0);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2188,49 +2188,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ ld(result_register(),
FieldMemOperand(result_register(), HeapObject::kMapOffset));
__ ld(result_register(),
FieldMemOperand(result_register(), Map::kPrototypeOffset));
PushOperand(result_register());
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into a3.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mov(a3, result_register());
// Load function and argument count into a1 and a0.
__ li(a0, Operand(arg_count));
__ ld(a1, MemOperand(sp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(v0);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2180,49 +2180,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ LoadP(result_register(),
FieldMemOperand(result_register(), HeapObject::kMapOffset));
__ LoadP(result_register(),
FieldMemOperand(result_register(), Map::kPrototypeOffset));
PushOperand(result_register());
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into r6.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mr(r6, result_register());
// Load function and argument count into r1 and r0.
__ mov(r3, Operand(arg_count));
__ LoadP(r4, MemOperand(sp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(r3);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2130,48 +2130,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
context()->Plug(r2);
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ LoadP(result_register(),
FieldMemOperand(result_register(), HeapObject::kMapOffset));
__ LoadP(result_register(),
FieldMemOperand(result_register(), Map::kPrototypeOffset));
PushOperand(result_register());
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into r5.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ LoadRR(r5, result_register());
// Load function and argument count into r1 and r0.
__ mov(r2, Operand(arg_count));
__ LoadP(r3, MemOperand(sp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(r2);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2070,48 +2070,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
context()->Plug(rax);
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ movp(result_register(),
FieldOperand(result_register(), HeapObject::kMapOffset));
PushOperand(FieldOperand(result_register(), Map::kPrototypeOffset));
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into rdx.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ movp(rdx, result_register());
// Load function and argument count into rdi and rax.
__ Set(rax, arg_count);
__ movp(rdi, Operand(rsp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(rax);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
......@@ -2073,47 +2073,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
SuperCallReference* super_call_ref =
expr->expression()->AsSuperCallReference();
DCHECK_NOT_NULL(super_call_ref);
// Push the super constructor target on the stack (may be null,
// but the Construct builtin can deal with that properly).
VisitForAccumulatorValue(super_call_ref->this_function_var());
__ AssertFunction(result_register());
__ mov(result_register(),
FieldOperand(result_register(), HeapObject::kMapOffset));
PushOperand(FieldOperand(result_register(), Map::kPrototypeOffset));
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
for (int i = 0; i < arg_count; i++) {
VisitForStackValue(args->at(i));
}
// Call the construct call builtin that handles allocation and
// constructor invocation.
SetConstructCallPosition(expr);
// Load new target into edx.
VisitForAccumulatorValue(super_call_ref->new_target_var());
__ mov(edx, result_register());
// Load function and argument count into edi and eax.
__ Move(eax, Immediate(arg_count));
__ mov(edi, Operand(esp, arg_count * kPointerSize));
__ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
OperandStackDepthDecrement(arg_count + 1);
RecordJSReturnSite(expr);
RestoreContext();
context()->Plug(eax);
}
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
......
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