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"); |