| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 void BreakableStatementChecker::Check(Expression* expr) { | 27 void BreakableStatementChecker::Check(Expression* expr) { |
| 28 Visit(expr); | 28 Visit(expr); |
| 29 } | 29 } |
| 30 | 30 |
| 31 | 31 |
| 32 void BreakableStatementChecker::VisitVariableDeclaration( | 32 void BreakableStatementChecker::VisitVariableDeclaration( |
| 33 VariableDeclaration* decl) { | 33 VariableDeclaration* decl) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 |
| 36 void BreakableStatementChecker::VisitFunctionDeclaration( | 37 void BreakableStatementChecker::VisitFunctionDeclaration( |
| 37 FunctionDeclaration* decl) { | 38 FunctionDeclaration* decl) { |
| 38 } | 39 } |
| 39 | 40 |
| 41 |
| 40 void BreakableStatementChecker::VisitModuleDeclaration( | 42 void BreakableStatementChecker::VisitModuleDeclaration( |
| 41 ModuleDeclaration* decl) { | 43 ModuleDeclaration* decl) { |
| 42 } | 44 } |
| 43 | 45 |
| 46 |
| 44 void BreakableStatementChecker::VisitImportDeclaration( | 47 void BreakableStatementChecker::VisitImportDeclaration( |
| 45 ImportDeclaration* decl) { | 48 ImportDeclaration* decl) { |
| 46 } | 49 } |
| 47 | 50 |
| 51 |
| 48 void BreakableStatementChecker::VisitExportDeclaration( | 52 void BreakableStatementChecker::VisitExportDeclaration( |
| 49 ExportDeclaration* decl) { | 53 ExportDeclaration* decl) { |
| 50 } | 54 } |
| 51 | 55 |
| 52 | 56 |
| 53 void BreakableStatementChecker::VisitModuleLiteral(ModuleLiteral* module) { | 57 void BreakableStatementChecker::VisitModuleLiteral(ModuleLiteral* module) { |
| 54 } | 58 } |
| 55 | 59 |
| 56 | 60 |
| 57 void BreakableStatementChecker::VisitModuleVariable(ModuleVariable* module) { | 61 void BreakableStatementChecker::VisitModuleVariable(ModuleVariable* module) { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 175 |
| 172 | 176 |
| 173 void BreakableStatementChecker::VisitCaseClause(CaseClause* clause) { | 177 void BreakableStatementChecker::VisitCaseClause(CaseClause* clause) { |
| 174 } | 178 } |
| 175 | 179 |
| 176 | 180 |
| 177 void BreakableStatementChecker::VisitFunctionLiteral(FunctionLiteral* expr) { | 181 void BreakableStatementChecker::VisitFunctionLiteral(FunctionLiteral* expr) { |
| 178 } | 182 } |
| 179 | 183 |
| 180 | 184 |
| 185 void BreakableStatementChecker::VisitClassLiteral(ClassLiteral* expr) { |
| 186 if (expr->extends() != NULL) { |
| 187 Visit(expr->extends()); |
| 188 } |
| 189 } |
| 190 |
| 191 |
| 181 void BreakableStatementChecker::VisitNativeFunctionLiteral( | 192 void BreakableStatementChecker::VisitNativeFunctionLiteral( |
| 182 NativeFunctionLiteral* expr) { | 193 NativeFunctionLiteral* expr) { |
| 183 } | 194 } |
| 184 | 195 |
| 185 | 196 |
| 186 void BreakableStatementChecker::VisitConditional(Conditional* expr) { | 197 void BreakableStatementChecker::VisitConditional(Conditional* expr) { |
| 187 } | 198 } |
| 188 | 199 |
| 189 | 200 |
| 190 void BreakableStatementChecker::VisitVariableProxy(VariableProxy* expr) { | 201 void BreakableStatementChecker::VisitVariableProxy(VariableProxy* expr) { |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 Handle<SharedFunctionInfo> function_info = | 1535 Handle<SharedFunctionInfo> function_info = |
| 1525 Compiler::BuildFunctionInfo(expr, script(), info_); | 1536 Compiler::BuildFunctionInfo(expr, script(), info_); |
| 1526 if (function_info.is_null()) { | 1537 if (function_info.is_null()) { |
| 1527 SetStackOverflow(); | 1538 SetStackOverflow(); |
| 1528 return; | 1539 return; |
| 1529 } | 1540 } |
| 1530 EmitNewClosure(function_info, expr->pretenure()); | 1541 EmitNewClosure(function_info, expr->pretenure()); |
| 1531 } | 1542 } |
| 1532 | 1543 |
| 1533 | 1544 |
| 1545 void FullCodeGenerator::VisitClassLiteral(ClassLiteral* expr) { |
| 1546 // TODO(arv): Implement |
| 1547 Comment cmnt(masm_, "[ ClassLiteral"); |
| 1548 if (expr->extends() != NULL) { |
| 1549 VisitForEffect(expr->extends()); |
| 1550 } |
| 1551 context()->Plug(isolate()->factory()->undefined_value()); |
| 1552 } |
| 1553 |
| 1554 |
| 1534 void FullCodeGenerator::VisitNativeFunctionLiteral( | 1555 void FullCodeGenerator::VisitNativeFunctionLiteral( |
| 1535 NativeFunctionLiteral* expr) { | 1556 NativeFunctionLiteral* expr) { |
| 1536 Comment cmnt(masm_, "[ NativeFunctionLiteral"); | 1557 Comment cmnt(masm_, "[ NativeFunctionLiteral"); |
| 1537 | 1558 |
| 1538 // Compute the function template for the native function. | 1559 // Compute the function template for the native function. |
| 1539 Handle<String> name = expr->name(); | 1560 Handle<String> name = expr->name(); |
| 1540 v8::Handle<v8::FunctionTemplate> fun_template = | 1561 v8::Handle<v8::FunctionTemplate> fun_template = |
| 1541 expr->extension()->GetNativeFunctionTemplate( | 1562 expr->extension()->GetNativeFunctionTemplate( |
| 1542 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); | 1563 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); |
| 1543 DCHECK(!fun_template.IsEmpty()); | 1564 DCHECK(!fun_template.IsEmpty()); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 } | 1711 } |
| 1691 return true; | 1712 return true; |
| 1692 } | 1713 } |
| 1693 #endif // DEBUG | 1714 #endif // DEBUG |
| 1694 | 1715 |
| 1695 | 1716 |
| 1696 #undef __ | 1717 #undef __ |
| 1697 | 1718 |
| 1698 | 1719 |
| 1699 } } // namespace v8::internal | 1720 } } // namespace v8::internal |
| OLD | NEW |