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

Unified Diff: src/full-codegen.cc

Issue 561913002: Class syntax parsing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add early error checks for static prototype and get/set constructor Created 6 years, 3 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/flag-definitions.h ('k') | src/hydrogen.cc » ('j') | src/preparser.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index aee5ca72a165084c4e1a03eb3b41448b3b894140..0f0c6e4bf71279c160f3fa77973504f0237d2038 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -32,18 +32,27 @@ void BreakableStatementChecker::VisitVariableDeclaration(
VariableDeclaration* decl) {
}
+
void BreakableStatementChecker::VisitFunctionDeclaration(
FunctionDeclaration* decl) {
}
+
+void BreakableStatementChecker::VisitClassDeclaration(ClassDeclaration* decl) {
+ Visit(decl->classLiteral());
+}
+
+
void BreakableStatementChecker::VisitModuleDeclaration(
ModuleDeclaration* decl) {
}
+
void BreakableStatementChecker::VisitImportDeclaration(
ImportDeclaration* decl) {
}
+
void BreakableStatementChecker::VisitExportDeclaration(
ExportDeclaration* decl) {
}
@@ -177,6 +186,13 @@ void BreakableStatementChecker::VisitFunctionLiteral(FunctionLiteral* expr) {
}
+void BreakableStatementChecker::VisitClassLiteral(ClassLiteral* expr) {
+ if (expr->extends() != NULL) {
+ Visit(expr->extends());
+ }
+}
+
+
void BreakableStatementChecker::VisitNativeFunctionLiteral(
NativeFunctionLiteral* expr) {
}
@@ -1531,6 +1547,35 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
}
+void FullCodeGenerator::VisitClassLiteral(ClassLiteral* expr) {
+ Comment cmnt(masm_, "[ ClassLiteral");
+ if (expr->extends() != NULL) {
+ VisitForStackValue(expr->extends());
+ }
+ /*
+ SetStatementPosition(stmt);
+
+ VisitForStackValue(stmt->expression());
+ PushFunctionArgumentForContextAllocation();
+ __ CallRuntime(Runtime::kPushWithContext, 2);
+ StoreToFrameField(StandardFrameConstants::kContextOffset, context_register());
+
+ Scope* saved_scope = scope();
+ scope_ = stmt->scope();
+ { WithOrCatch body(this);
+ Visit(stmt->statement());
+ }
+ scope_ = saved_scope;
+
+ // Pop context.
+ LoadContextField(context_register(), Context::PREVIOUS_INDEX);
+ // Update local stack frame context field.
+ StoreToFrameField(StandardFrameConstants::kContextOffset,
+ context_register());(
+ */
+}
+
+
void FullCodeGenerator::VisitNativeFunctionLiteral(
NativeFunctionLiteral* expr) {
Comment cmnt(masm_, "[ NativeFunctionLiteral");
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.cc » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698