Remove ValidateSuperCall
We don't need this since this case is now a SyntaxError. BUG=None LOG=N R=dslomov@chromium.org Review URL: https://codereview.chromium.org/957823002 Cr-Commit-Position: refs/heads/master@{#26864}
This commit is contained in:
parent
8b33567fd3
commit
5c19e4f1cb
@ -3273,7 +3273,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(result_register(), new_target_var);
|
||||
__ Push(result_register());
|
||||
|
@ -2962,8 +2962,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(result_register(), new_target_var);
|
||||
__ Push(result_register());
|
||||
|
@ -838,22 +838,6 @@ void FullCodeGenerator::VisitSuperReference(SuperReference* super) {
|
||||
}
|
||||
|
||||
|
||||
bool FullCodeGenerator::ValidateSuperCall(Call* expr) {
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
if (new_target_var == nullptr) {
|
||||
// TODO(dslomov): this is not exactly correct, the spec requires us
|
||||
// to execute the constructor and only fail when an assigment to 'this'
|
||||
// is attempted. Will implement once we have general new.target support,
|
||||
// but also filed spec bug 3843 to make it an early error.
|
||||
__ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0);
|
||||
RecordJSReturnSite(expr);
|
||||
context()->Plug(result_register());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
|
||||
if (!info_->is_debug()) {
|
||||
CodeGenerator::RecordPositions(masm_, expr->position());
|
||||
|
@ -640,7 +640,6 @@ class FullCodeGenerator: public AstVisitor {
|
||||
void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset);
|
||||
|
||||
void EmitLoadSuperConstructor();
|
||||
bool ValidateSuperCall(Call* expr);
|
||||
|
||||
void CallIC(Handle<Code> code,
|
||||
TypeFeedbackId id = TypeFeedbackId::None());
|
||||
|
@ -3154,8 +3154,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(eax, new_target_var);
|
||||
__ push(eax);
|
||||
|
@ -3247,7 +3247,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(result_register(), new_target_var);
|
||||
__ Push(result_register());
|
||||
|
@ -3247,7 +3247,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(result_register(), new_target_var);
|
||||
__ Push(result_register());
|
||||
|
@ -3262,7 +3262,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(result_register(), new_target_var);
|
||||
__ Push(result_register());
|
||||
|
@ -3160,8 +3160,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(result_register(), new_target_var);
|
||||
__ Push(result_register());
|
||||
|
@ -3141,8 +3141,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
||||
if (!ValidateSuperCall(expr)) return;
|
||||
|
||||
Variable* new_target_var = scope()->DeclarationScope()->new_target_var();
|
||||
GetVar(eax, new_target_var);
|
||||
__ push(eax);
|
||||
|
Loading…
Reference in New Issue
Block a user