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

Unified Diff: src/parser.cc

Issue 718833002: Classes: Cleanup default constructor flag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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-inl.h ('k') | no next file » | 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 4c813554e7e07174bf1994f08713dab426a8303a..8e16ce01869ca972b79dc937efb15c067bfb1cd4 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -284,8 +284,6 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
AstProperties ast_properties;
BailoutReason dont_optimize_reason = kNoReason;
const AstRawString* name = ast_value_factory()->empty_string();
- FunctionKind kind = call_super ? FunctionKind::kDefaultConstructorCallSuper
- : FunctionKind::kDefaultConstructor;
Scope* function_scope = NewScope(scope, FUNCTION_SCOPE);
function_scope->SetStrictMode(STRICT);
@@ -309,6 +307,7 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
Runtime::FunctionForId(Runtime::kDefaultConstructorSuperCall), args,
pos);
body->Add(factory()->NewExpressionStatement(call, pos), zone());
+ function_scope->RecordSuperUsage();
}
materialized_literal_count = function_state.materialized_literal_count();
@@ -324,7 +323,8 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
materialized_literal_count, expected_property_count, handler_count,
parameter_count, FunctionLiteral::kNoDuplicateParameters,
FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
- FunctionLiteral::kNotParenthesized, kind, pos);
+ FunctionLiteral::kNotParenthesized, FunctionKind::kDefaultConstructor,
+ pos);
function_literal->set_ast_properties(&ast_properties);
function_literal->set_dont_optimize_reason(dont_optimize_reason);
@@ -1069,11 +1069,10 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
Expression* expression = ParseExpression(false, &ok);
DCHECK(expression->IsFunctionLiteral());
result = expression->AsFunctionLiteral();
- } else if (shared_info->is_default_constructor() ||
- shared_info->is_default_constructor_call_super()) {
- result = DefaultConstructor(
- shared_info->is_default_constructor_call_super(), scope,
- shared_info->start_position(), shared_info->end_position());
+ } else if (shared_info->is_default_constructor()) {
+ result = DefaultConstructor(shared_info->uses_super(), scope,
+ shared_info->start_position(),
+ shared_info->end_position());
} else {
result = ParseFunctionLiteral(raw_name, Scanner::Location::invalid(),
false, // Strict mode name already checked.
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698