Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: src/parser.cc

Issue 919643008: Remove --experimental-classes flag and related dead code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 6db2b0d71c43a376f082819fd6d0dfa9b8907ae2..47ef343a0cc9ff66cac4b7aa1c0912ba596a89ab 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -272,9 +272,8 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
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));
@@ -293,19 +292,11 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
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();
}
@@ -2635,8 +2626,7 @@ Statement* Parser::ParseReturnStatement(bool* ok) {
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());
@@ -3922,8 +3912,6 @@ void Parser::SkipLazyFunctionBody(const AstRawString* function_name,
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(
@@ -4000,7 +3988,7 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
yield, RelocInfo::kNoPosition), zone());
}
- if (FLAG_experimental_classes && IsSubclassConstructor(kind)) {
+ if (IsSubclassConstructor(kind)) {
body->Add(
factory()->NewReturnStatement(
this->ThisExpression(scope_, factory(), RelocInfo::kNoPosition),
« no previous file with comments | « src/objects.cc ('k') | src/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698