Reviewers: rossberg, adamk, caitp,
Message:
Andreas: PTAL.
Adam, Caitlin: FYI.
Description:
Remove obsolete %CallSuperWithSpread intrinsic.
The aforementioned intrinsic is now longer needed and can be fully
desugared now that binding assignments to 'this' are explicit.
[email protected]
Please review this at https://codereview.chromium.org/1234383002/
Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-super-4
Affected files (+11, -57 lines):
M src/compiler/ast-graph-builder.cc
M src/full-codegen.h
M src/ia32/full-codegen-ia32.cc
M src/parser.cc
M src/runtime/runtime.h
M src/runtime/runtime-classes.cc
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc
b/src/compiler/ast-graph-builder.cc
index
1dd7e5fee99bb27ce3e952bfb718b677e06bbc48..f4d272f389c0aeb35d965023b99d702f369f2f63
100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -2584,8 +2584,7 @@ void AstGraphBuilder::VisitCallRuntime(CallRuntime*
expr) {
// TODO(mstarzinger): This bailout is a gigantic hack, the owner is
ashamed.
if (function->function_id == Runtime::kInlineGeneratorNext ||
function->function_id == Runtime::kInlineGeneratorThrow ||
- function->function_id == Runtime::kInlineDefaultConstructorCallSuper
||
- function->function_id == Runtime::kInlineCallSuperWithSpread) {
+ function->function_id ==
Runtime::kInlineDefaultConstructorCallSuper) {
ast_context()->ProduceValue(jsgraph()->TheHoleConstant());
return SetStackOverflow();
}
Index: src/full-codegen.h
diff --git a/src/full-codegen.h b/src/full-codegen.h
index
88a88f45b2d56c5924e0219bfc7d8ca29d7f5b52..c22a6c0e0e07f469ecd3d3519f3d5321e6a17106
100644
--- a/src/full-codegen.h
+++ b/src/full-codegen.h
@@ -531,8 +531,7 @@ class FullCodeGenerator: public AstVisitor {
F(RegExpConstructResult) \
F(GetFromCache) \
F(NumberToString) \
- F(DebugIsActive) \
- F(CallSuperWithSpread)
+ F(DebugIsActive)
#define GENERATOR_DECLARATION(Name) void Emit##Name(CallRuntime* call);
FOR_EACH_FULL_CODE_INTRINSIC(GENERATOR_DECLARATION)
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index
d212eccd50b2d595ac81a1926e5444b72f301f06..1151dfd90b0f2ce982892cb5b34ce07426490a9f
100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -4637,43 +4637,6 @@ void
FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
}
-void FullCodeGenerator::EmitCallSuperWithSpread(CallRuntime* expr) {
- // Assert: expr == CallRuntime("ReflectConstruct")
- DCHECK_EQ(1, expr->arguments()->length());
- CallRuntime* call = expr->arguments()->at(0)->AsCallRuntime();
-
- ZoneList<Expression*>* args = call->arguments();
- DCHECK_EQ(3, args->length());
-
- SuperCallReference* super_call_ref = args->at(0)->AsSuperCallReference();
- DCHECK_NOT_NULL(super_call_ref);
-
- // Load ReflectConstruct function
- EmitLoadJSRuntimeFunction(call);
-
- // Push the target function under the receiver
- __ push(Operand(esp, 0));
- __ mov(Operand(esp, kPointerSize), eax);
-
- // Push super constructor
- EmitLoadSuperConstructor(super_call_ref);
- __ Push(result_register());
-
- // Push arguments array
- VisitForStackValue(args->at(1));
-
- // Push NewTarget
- DCHECK(args->at(2)->IsVariableProxy());
- VisitForStackValue(args->at(2));
-
- EmitCallJSRuntimeFunction(call);
-
- // Restore context register.
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
- context()->DropAndPlug(1, eax);
-}
-
-
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
// Push the builtins object as receiver.
__ mov(eax, GlobalObjectOperand());
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
2b3f482a265c17e99d4202fa2bb798cc4972a0bd..d9b058f5c20adf1b596440fe07c4b2c69a7000d4
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -5931,16 +5931,16 @@ Expression* Parser::SpreadCall(Expression* function,
int pos) {
if (function->IsSuperCallReference()) {
// Super calls
- // %_CallSuperWithSpread(%ReflectConstruct(<super>, args, new.target))
- args->InsertAt(0, function, zone());
+ // %ReflectConstruct(%GetPrototype(<this-function>), args, new.target))
+ ZoneList<Expression*>* tmp = new (zone()) ZoneList<Expression*>(1,
zone());
+ tmp->Add(function->AsSuperCallReference()->this_function_var(),
zone());
+ Expression* get_prototype = factory()->NewCallRuntime(
+ ast_value_factory()->empty_string(),
+ Runtime::FunctionForId(Runtime::kGetPrototype), tmp, pos);
+ args->InsertAt(0, get_prototype, zone());
args->Add(function->AsSuperCallReference()->new_target_var(), zone());
- Expression* result = factory()->NewCallRuntime(
- ast_value_factory()->reflect_construct_string(), NULL, args, pos);
- args = new (zone()) ZoneList<Expression*>(1, zone());
- args->Add(result, zone());
return factory()->NewCallRuntime(
- ast_value_factory()->empty_string(),
- Runtime::FunctionForId(Runtime::kInlineCallSuperWithSpread), args,
pos);
+ ast_value_factory()->reflect_construct_string(), NULL, args, pos);
} else {
if (function->IsProperty()) {
// Method calls
Index: src/runtime/runtime-classes.cc
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
index
159614875e2fe0ab10ad3a843b4b651c846c2810..7b42c1df3877c0b143be460c511b325a4fa0f90b
100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -524,11 +524,5 @@ RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
UNIMPLEMENTED();
return nullptr;
}
-
-
-RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) {
- UNIMPLEMENTED();
- return nullptr;
-}
} // namespace internal
} // namespace v8
Index: src/runtime/runtime.h
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h
index
06182c620239b21de5ac47fa58bca3dbae04d34c..0ab0777691e505c74acde571b77dbebab31aba4d
100644
--- a/src/runtime/runtime.h
+++ b/src/runtime/runtime.h
@@ -86,8 +86,7 @@ namespace internal {
F(StoreKeyedToSuper_Strict, 4, 1) \
F(StoreKeyedToSuper_Sloppy, 4, 1) \
F(HandleStepInForDerivedConstructors, 1, 1) \
- F(DefaultConstructorCallSuper, 2, 1) \
- F(CallSuperWithSpread, 1, 1)
+ F(DefaultConstructorCallSuper, 2, 1)
#define FOR_EACH_INTRINSIC_COLLECTIONS(F) \
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.