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

Unified Diff: src/parser.cc

Issue 1425293007: [crankshaft] Do not optimize ClassConstructor calls and apply. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: hope my magic works Created 5 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/parser.h ('k') | test/mjsunit/es6/classes.js » ('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 bb3874d9e39fc91dc9fbdc40ea1a88b24ff3efb4..cff4d5dd96f0152129190c875d7b6b174f055707 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -359,7 +359,6 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
kind, &function_factory);
body = new (zone()) ZoneList<Statement*>(call_super ? 2 : 1, zone());
- AddAssertIsConstruct(body, pos);
if (call_super) {
// %_DefaultConstructorCallSuper(new.target, %GetPrototype(<this-fun>))
ZoneList<Expression*>* args =
@@ -4476,21 +4475,6 @@ void Parser::SkipLazyFunctionBody(int* materialized_literal_count,
}
-void Parser::AddAssertIsConstruct(ZoneList<Statement*>* body, int pos) {
- ZoneList<Expression*>* arguments =
- new (zone()) ZoneList<Expression*>(0, zone());
- CallRuntime* construct_check = factory()->NewCallRuntime(
- Runtime::kInlineIsConstructCall, arguments, pos);
- CallRuntime* non_callable_error = factory()->NewCallRuntime(
- Runtime::kThrowConstructorNonCallableError, arguments, pos);
- IfStatement* if_statement = factory()->NewIfStatement(
- factory()->NewUnaryOperation(Token::NOT, construct_check, pos),
- factory()->NewReturnStatement(non_callable_error, pos),
- factory()->NewEmptyStatement(pos), pos);
- body->Add(if_statement, zone());
-}
-
-
Statement* Parser::BuildAssertIsCoercible(Variable* var) {
// if (var === null || var === undefined)
// throw /* type error kNonCoercible) */;
@@ -4684,12 +4668,6 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
result->Add(NULL, zone());
}
- // For concise constructors, check that they are constructed,
- // not called.
- if (IsClassConstructor(kind)) {
- AddAssertIsConstruct(result, pos);
- }
-
ZoneList<Statement*>* body = result;
Scope* inner_scope = scope_;
Block* inner_block = nullptr;
« no previous file with comments | « src/parser.h ('k') | test/mjsunit/es6/classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698