"src/assert-scope.cc",
"src/ast-numbering.cc",
"src/ast-numbering.h",
- "src/ast-this-access-visitor.cc",
- "src/ast-this-access-visitor.h",
"src/ast-value-factory.cc",
"src/ast-value-factory.h",
"src/ast.cc",
// sequence.
{ Assembler::BlockConstPoolScope block_const_pool(masm_);
int32_t arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
int32_t sp_delta = arg_count * kPointerSize;
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- EmitLoadSuperConstructor();
- __ Push(result_register());
- SuperReference* super_ref = callee->AsSuperReference();
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
__ add(current_sp, current_sp, ip0);
__ ret();
int32_t arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
__ dc64(kXRegSize * arg_count);
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- SuperReference* super_ref = callee->AsSuperReference();
- EmitLoadSuperConstructor();
- __ Push(result_register());
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
+++ /dev/null
-// 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/ast-this-access-visitor.h"
-#include "src/parser.h"
-
-namespace v8 {
-namespace internal {
-
-typedef class AstThisAccessVisitor ATAV; // for code shortitude.
-
-ATAV::AstThisAccessVisitor(Isolate* isolate, Zone* zone) : uses_this_(false) {
- InitializeAstVisitor(isolate, zone);
-}
-
-
-void ATAV::VisitVariableProxy(VariableProxy* proxy) {
- if (proxy->is_this()) {
- uses_this_ = true;
- }
-}
-
-
-void ATAV::VisitSuperReference(SuperReference* leaf) {
- // disallow super.method() and super(...).
- uses_this_ = true;
-}
-
-
-void ATAV::VisitCallNew(CallNew* e) {
- // new super(..) does not use 'this'.
- if (!e->expression()->IsSuperReference()) {
- Visit(e->expression());
- }
- VisitExpressions(e->arguments());
-}
-
-
-// ---------------------------------------------------------------------------
-// -- Leaf nodes -------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
-void ATAV::VisitVariableDeclaration(VariableDeclaration* leaf) {}
-void ATAV::VisitFunctionDeclaration(FunctionDeclaration* leaf) {}
-void ATAV::VisitModuleDeclaration(ModuleDeclaration* leaf) {}
-void ATAV::VisitImportDeclaration(ImportDeclaration* leaf) {}
-void ATAV::VisitExportDeclaration(ExportDeclaration* leaf) {}
-void ATAV::VisitModuleVariable(ModuleVariable* leaf) {}
-void ATAV::VisitModulePath(ModulePath* leaf) {}
-void ATAV::VisitModuleUrl(ModuleUrl* leaf) {}
-void ATAV::VisitEmptyStatement(EmptyStatement* leaf) {}
-void ATAV::VisitContinueStatement(ContinueStatement* leaf) {}
-void ATAV::VisitBreakStatement(BreakStatement* leaf) {}
-void ATAV::VisitDebuggerStatement(DebuggerStatement* leaf) {}
-void ATAV::VisitFunctionLiteral(FunctionLiteral* leaf) {}
-void ATAV::VisitNativeFunctionLiteral(NativeFunctionLiteral* leaf) {}
-void ATAV::VisitLiteral(Literal* leaf) {}
-void ATAV::VisitRegExpLiteral(RegExpLiteral* leaf) {}
-void ATAV::VisitThisFunction(ThisFunction* leaf) {}
-
-// ---------------------------------------------------------------------------
-// -- Pass-through nodes------------------------------------------------------
-// ---------------------------------------------------------------------------
-void ATAV::VisitModuleLiteral(ModuleLiteral* e) { Visit(e->body()); }
-
-
-void ATAV::VisitBlock(Block* stmt) { VisitStatements(stmt->statements()); }
-
-
-void ATAV::VisitExpressionStatement(ExpressionStatement* stmt) {
- Visit(stmt->expression());
-}
-
-
-void ATAV::VisitIfStatement(IfStatement* stmt) {
- Visit(stmt->condition());
- Visit(stmt->then_statement());
- Visit(stmt->else_statement());
-}
-
-
-void ATAV::VisitReturnStatement(ReturnStatement* stmt) {
- Visit(stmt->expression());
-}
-
-
-void ATAV::VisitWithStatement(WithStatement* stmt) {
- Visit(stmt->expression());
- Visit(stmt->statement());
-}
-
-
-void ATAV::VisitSwitchStatement(SwitchStatement* stmt) {
- Visit(stmt->tag());
- ZoneList<CaseClause*>* clauses = stmt->cases();
- for (int i = 0; i < clauses->length(); i++) {
- Visit(clauses->at(i));
- }
-}
-
-
-void ATAV::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
- Visit(stmt->try_block());
- Visit(stmt->finally_block());
-}
-
-
-void ATAV::VisitClassLiteral(ClassLiteral* e) {
- VisitIfNotNull(e->extends());
- Visit(e->constructor());
- ZoneList<ObjectLiteralProperty*>* properties = e->properties();
- for (int i = 0; i < properties->length(); i++) {
- Visit(properties->at(i)->value());
- }
-}
-
-
-void ATAV::VisitConditional(Conditional* e) {
- Visit(e->condition());
- Visit(e->then_expression());
- Visit(e->else_expression());
-}
-
-
-void ATAV::VisitObjectLiteral(ObjectLiteral* e) {
- ZoneList<ObjectLiteralProperty*>* properties = e->properties();
- for (int i = 0; i < properties->length(); i++) {
- Visit(properties->at(i)->value());
- }
-}
-
-
-void ATAV::VisitArrayLiteral(ArrayLiteral* e) { VisitExpressions(e->values()); }
-
-
-void ATAV::VisitYield(Yield* stmt) {
- Visit(stmt->generator_object());
- Visit(stmt->expression());
-}
-
-
-void ATAV::VisitThrow(Throw* stmt) { Visit(stmt->exception()); }
-
-
-void ATAV::VisitProperty(Property* e) {
- Visit(e->obj());
- Visit(e->key());
-}
-
-
-void ATAV::VisitCall(Call* e) {
- Visit(e->expression());
- VisitExpressions(e->arguments());
-}
-
-
-void ATAV::VisitCallRuntime(CallRuntime* e) {
- VisitExpressions(e->arguments());
-}
-
-
-void ATAV::VisitUnaryOperation(UnaryOperation* e) { Visit(e->expression()); }
-
-
-void ATAV::VisitBinaryOperation(BinaryOperation* e) {
- Visit(e->left());
- Visit(e->right());
-}
-
-
-void ATAV::VisitCompareOperation(CompareOperation* e) {
- Visit(e->left());
- Visit(e->right());
-}
-
-
-void ATAV::VisitCaseClause(CaseClause* cc) {
- if (!cc->is_default()) Visit(cc->label());
- VisitStatements(cc->statements());
-}
-
-
-void ATAV::VisitModuleStatement(ModuleStatement* stmt) { Visit(stmt->body()); }
-
-
-void ATAV::VisitTryCatchStatement(TryCatchStatement* stmt) {
- Visit(stmt->try_block());
- Visit(stmt->catch_block());
-}
-
-
-void ATAV::VisitDoWhileStatement(DoWhileStatement* loop) {
- Visit(loop->body());
- Visit(loop->cond());
-}
-
-
-void ATAV::VisitWhileStatement(WhileStatement* loop) {
- Visit(loop->cond());
- Visit(loop->body());
-}
-
-
-void ATAV::VisitForStatement(ForStatement* loop) {
- VisitIfNotNull(loop->init());
- VisitIfNotNull(loop->cond());
- Visit(loop->body());
- VisitIfNotNull(loop->next());
-}
-
-
-void ATAV::VisitForInStatement(ForInStatement* loop) {
- Visit(loop->each());
- Visit(loop->subject());
- Visit(loop->body());
-}
-
-
-void ATAV::VisitForOfStatement(ForOfStatement* loop) {
- Visit(loop->each());
- Visit(loop->subject());
- Visit(loop->body());
-}
-
-
-void ATAV::VisitAssignment(Assignment* stmt) {
- Expression* l = stmt->target();
- Visit(l);
- Visit(stmt->value());
-}
-
-
-void ATAV::VisitCountOperation(CountOperation* e) {
- Expression* l = e->expression();
- Visit(l);
-}
-}
-} // namespace v8::internal
+++ /dev/null
-// 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.
-
-#ifndef V8_AST_THIS_ACCESS_VISITOR_H_
-#define V8_AST_THIS_ACCESS_VISITOR_H_
-#include "src/ast.h"
-
-namespace v8 {
-namespace internal {
-
-class AstThisAccessVisitor : public AstVisitor {
- public:
- AstThisAccessVisitor(Isolate* isolate, Zone* zone);
-
- bool UsesThis() { return uses_this_; }
-
-#define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE;
- AST_NODE_LIST(DECLARE_VISIT)
-#undef DECLARE_VISIT
-
- private:
- bool uses_this_;
-
- void VisitIfNotNull(AstNode* node) {
- if (node != NULL) Visit(node);
- }
-
- DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
- DISALLOW_COPY_AND_ASSIGN(AstThisAccessVisitor);
-};
-}
-} // namespace v8::internal
-#endif // V8_AST_THIS_ACCESS_VISITOR_H_
bool Call::IsUsingCallFeedbackSlot(Isolate* isolate) const {
// SuperConstructorCall uses a CallConstructStub, which wants
// a Slot, not an IC slot.
- return FLAG_experimental_classes && GetCallType(isolate) == SUPER_CALL;
+ return GetCallType(isolate) == SUPER_CALL;
}
#include "src/compiler.h"
#include "src/ast-numbering.h"
-#include "src/ast-this-access-visitor.h"
#include "src/bootstrapper.h"
#include "src/codegen.h"
#include "src/compilation-cache.h"
}
-static void ThrowSuperConstructorCheckError(CompilationInfo* info,
- Statement* stmt) {
- MaybeHandle<Object> obj = info->isolate()->factory()->NewTypeError(
- "super_constructor_call", HandleVector<Object>(nullptr, 0));
- Handle<Object> exception;
- if (!obj.ToHandle(&exception)) return;
-
- MessageLocation location(info->script(), stmt->position(), stmt->position());
- USE(info->isolate()->Throw(*exception, &location));
-}
-
-
-static bool CheckSuperConstructorCall(CompilationInfo* info) {
- FunctionLiteral* function = info->function();
- if (FLAG_experimental_classes) return true;
- if (!function->uses_super_constructor_call()) return true;
- if (IsDefaultConstructor(function->kind())) return true;
-
- ZoneList<Statement*>* body = function->body();
- CHECK(body->length() > 0);
-
- int super_call_index = 0;
- // Allow 'use strict' and similiar and empty statements.
- while (true) {
- CHECK(super_call_index < body->length()); // We know there is a super call.
- Statement* stmt = body->at(super_call_index);
- if (stmt->IsExpressionStatement() &&
- stmt->AsExpressionStatement()->expression()->IsLiteral()) {
- super_call_index++;
- continue;
- }
- if (stmt->IsEmptyStatement()) {
- super_call_index++;
- continue;
- }
- break;
- }
-
- Statement* stmt = body->at(super_call_index);
- ExpressionStatement* exprStm = stmt->AsExpressionStatement();
- if (exprStm == nullptr) {
- ThrowSuperConstructorCheckError(info, stmt);
- return false;
- }
- Call* callExpr = exprStm->expression()->AsCall();
- if (callExpr == nullptr) {
- ThrowSuperConstructorCheckError(info, stmt);
- return false;
- }
-
- if (!callExpr->expression()->IsSuperReference()) {
- ThrowSuperConstructorCheckError(info, stmt);
- return false;
- }
-
- ZoneList<Expression*>* arguments = callExpr->arguments();
-
- AstThisAccessVisitor this_access_visitor(info->isolate(), info->zone());
- this_access_visitor.VisitExpressions(arguments);
-
- if (this_access_visitor.HasStackOverflow()) return false;
- if (this_access_visitor.UsesThis()) {
- ThrowSuperConstructorCheckError(info, stmt);
- return false;
- }
- return true;
-}
-
-
bool Compiler::Analyze(CompilationInfo* info) {
DCHECK(info->function() != NULL);
if (!Rewriter::Rewrite(info)) return false;
if (!Scope::Analyze(info)) return false;
if (!Renumber(info)) return false;
DCHECK(info->scope() != NULL);
- if (!CheckSuperConstructorCall(info)) return false;
return true;
}
DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
DEFINE_BOOL(smi_binop, true, "support smi representation in binary operations")
DEFINE_BOOL(vector_ics, false, "support vector-based ics")
-DEFINE_BOOL(experimental_classes, false,
- "experimental new semantics for super() calls")
-DEFINE_IMPLICATION(harmony_classes, experimental_classes)
-DEFINE_IMPLICATION(experimental_classes, harmony_classes)
-DEFINE_IMPLICATION(experimental_classes, harmony_object_literals)
// Flags for optimization types.
DEFINE_BOOL(optimize_for_size, false,
__ pop(ebp);
int arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
int arguments_bytes = arg_count * kPointerSize;
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- SuperReference* super_ref = callee->AsSuperReference();
- EmitLoadSuperConstructor();
- __ push(result_register());
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
// Here we use masm_-> instead of the __ macro to avoid the code coverage
// tool from instrumenting as we rely on the code size here.
int32_t arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
int32_t sp_delta = arg_count * kPointerSize;
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- EmitLoadSuperConstructor();
- __ Push(result_register());
- SuperReference* super_ref = callee->AsSuperReference();
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
// Here we use masm_-> instead of the __ macro to avoid the code coverage
// tool from instrumenting as we rely on the code size here.
int32_t arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
int32_t sp_delta = arg_count * kPointerSize;
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- EmitLoadSuperConstructor();
- __ Push(result_register());
- SuperReference* super_ref = callee->AsSuperReference();
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
void SharedFunctionInfo::InitFromFunctionLiteral(
Handle<SharedFunctionInfo> shared_info, FunctionLiteral* lit) {
shared_info->set_length(lit->parameter_count());
- if (FLAG_experimental_classes && IsSubclassConstructor(lit->kind())) {
+ if (IsSubclassConstructor(lit->kind())) {
shared_info->set_internal_formal_parameter_count(lit->parameter_count() +
1);
} else {
const AstRawString* name = ast_value_factory()->empty_string();
- FunctionKind kind = call_super && !FLAG_experimental_classes
- ? FunctionKind::kDefaultBaseConstructor
- : FunctionKind::kDefaultSubclassConstructor;
+ FunctionKind kind = call_super ? FunctionKind::kDefaultSubclassConstructor
+ : FunctionKind::kDefaultBaseConstructor;
Scope* function_scope = NewScope(scope, FUNCTION_SCOPE, kind);
function_scope->SetLanguageMode(
static_cast<LanguageMode>(scope->language_mode() | STRICT_BIT));
if (call_super) {
ZoneList<Expression*>* args =
new (zone()) ZoneList<Expression*>(0, zone());
- if (FLAG_experimental_classes) {
- CallRuntime* call = factory()->NewCallRuntime(
- ast_value_factory()->empty_string(),
- Runtime::FunctionForId(Runtime::kInlineDefaultConstructorCallSuper),
- args, pos);
- body->Add(factory()->NewReturnStatement(call, pos), zone());
- } else {
- CallRuntime* call = factory()->NewCallRuntime(
- ast_value_factory()->empty_string(),
- Runtime::FunctionForId(Runtime::kDefaultConstructorSuperCall), args,
- pos);
- body->Add(factory()->NewExpressionStatement(call, pos), zone());
- }
+ CallRuntime* call = factory()->NewCallRuntime(
+ ast_value_factory()->empty_string(),
+ Runtime::FunctionForId(Runtime::kInlineDefaultConstructorCallSuper),
+ args, pos);
+ body->Add(factory()->NewReturnStatement(call, pos), zone());
function_scope->RecordSuperConstructorCallUsage();
}
tok == Token::SEMICOLON ||
tok == Token::RBRACE ||
tok == Token::EOS) {
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(function_state_->kind())) {
+ if (IsSubclassConstructor(function_state_->kind())) {
return_value = ThisExpression(scope_, factory(), loc.beg_pos);
} else {
return_value = GetLiteralUndefined(position());
void Parser::AddAssertIsConstruct(ZoneList<Statement*>* body, int pos) {
- if (!FLAG_experimental_classes) return;
-
ZoneList<Expression*>* arguments =
new (zone()) ZoneList<Expression*>(0, zone());
CallRuntime* construct_check = factory()->NewCallRuntime(
yield, RelocInfo::kNoPosition), zone());
}
- if (FLAG_experimental_classes && IsSubclassConstructor(kind)) {
+ if (IsSubclassConstructor(kind)) {
body->Add(
factory()->NewReturnStatement(
this->ThisExpression(scope_, factory(), RelocInfo::kNoPosition),
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- SuperReference* super_ref = callee->AsSuperReference();
- EmitLoadSuperConstructor(super_ref);
- __ Push(result_register());
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
kind == kNormalFunction);
Scope* result =
new (zone()) Scope(zone(), parent, scope_type, ast_value_factory());
- bool uninitialized_this =
- FLAG_experimental_classes && IsSubclassConstructor(kind);
+ bool uninitialized_this = IsSubclassConstructor(kind);
result->Initialize(uninitialized_this);
return result;
}
: isolate->factory()->empty_string();
constructor->shared()->set_name(*name_string);
- if (FLAG_experimental_classes) {
- if (!super_class->IsTheHole()) {
- Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived());
- constructor->shared()->set_construct_stub(*stub);
- }
+ if (!super_class->IsTheHole()) {
+ Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived());
+ constructor->shared()->set_construct_stub(*stub);
}
JSFunction::SetPrototype(constructor, prototype);
UNREACHABLE();
return nullptr;
}
-
-
-// TODO(dslomov): deprecated, will remove when experimenal classes is default.
-RUNTIME_FUNCTION(Runtime_DefaultConstructorSuperCall) {
- CHECK(!FLAG_experimental_classes);
- HandleScope scope(isolate);
- DCHECK(args.length() == 0);
-
- // Compute the frame holding the arguments.
- JavaScriptFrameIterator it(isolate);
- it.AdvanceToArgumentsFrame();
- JavaScriptFrame* frame = it.frame();
-
- Handle<JSFunction> function(frame->function(), isolate);
- Handle<Object> receiver(frame->receiver(), isolate);
-
- Handle<Object> proto_function;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, proto_function,
- Runtime::GetPrototype(isolate, function));
-
- // Get the actual number of provided arguments.
- const int argc = frame->ComputeParametersCount();
-
- // Loose upper bound to allow fuzzing. We'll most likely run out of
- // stack space before hitting this limit.
- static int kMaxArgc = 1000000;
- RUNTIME_ASSERT(argc >= 0 && argc <= kMaxArgc);
-
- // If there are too many arguments, allocate argv via malloc.
- const int argv_small_size = 10;
- Handle<Object> argv_small_buffer[argv_small_size];
- SmartArrayPointer<Handle<Object> > argv_large_buffer;
- Handle<Object>* argv = argv_small_buffer;
- if (argc > argv_small_size) {
- argv = new Handle<Object>[argc];
- if (argv == NULL) return isolate->StackOverflow();
- argv_large_buffer = SmartArrayPointer<Handle<Object> >(argv);
- }
-
- for (int i = 0; i < argc; ++i) {
- argv[i] = handle(frame->GetParameter(i), isolate);
- }
-
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- Execution::Call(isolate, proto_function, receiver, argc, argv, false));
- return *result;
-}
}
} // namespace v8::internal
/* Classes support */ \
F(ToMethod, 2, 1) \
F(HomeObjectSymbol, 0, 1) \
- F(DefaultConstructorSuperCall, 0, 1) \
F(DefineClass, 6, 1) \
F(DefineClassMethod, 3, 1) \
F(ClassGetSourceCode, 1, 1) \
// invoking scripts
if (is_declaration_scope()) {
DCHECK(!subclass_constructor || is_function_scope());
- DCHECK(FLAG_experimental_classes || !subclass_constructor);
Variable* var = variables_.Declare(
this, ast_value_factory_->this_string(),
subclass_constructor ? CONST : VAR, false, Variable::THIS,
int no_frame_start = masm_->pc_offset();
int arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
int arguments_bytes = arg_count * kPointerSize;
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- EmitLoadSuperConstructor();
- __ Push(result_register());
- SuperReference* super_ref = callee->AsSuperReference();
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
__ pop(ebp);
int arg_count = info_->scope()->num_parameters() + 1;
- if (FLAG_experimental_classes &&
- IsSubclassConstructor(info_->function()->kind())) {
+ if (IsSubclassConstructor(info_->function()->kind())) {
arg_count++;
}
int arguments_bytes = arg_count * kPointerSize;
}
}
} else if (call_type == Call::SUPER_CALL) {
- if (FLAG_experimental_classes) {
- EmitSuperConstructorCall(expr);
- } else {
- SuperReference* super_ref = callee->AsSuperReference();
- EmitLoadSuperConstructor();
- __ push(result_register());
- VisitForStackValue(super_ref->this_var());
- EmitCall(expr, CallICState::METHOD);
- }
+ EmitSuperConstructorCall(expr);
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Flags: --experimental-classes --harmony-classes
+// Flags: --harmony-classes
'use strict';
(function TestArgumentsAccess() {
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Flags: --experimental-classes --no-lazy
+// Flags: --harmony-classes --no-lazy
"use strict";
class Base {
}
'../../src/assembler.h',
'../../src/assert-scope.h',
'../../src/assert-scope.cc',
- '../../src/ast-this-access-visitor.cc',
- '../../src/ast-this-access-visitor.h',
'../../src/ast-value-factory.cc',
'../../src/ast-value-factory.h',
'../../src/ast-numbering.cc',