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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/debug.h" | 9 #include "src/debug.h" |
10 #include "src/full-codegen.h" | 10 #include "src/full-codegen.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 | 25 |
26 void BreakableStatementChecker::Check(Expression* expr) { | 26 void BreakableStatementChecker::Check(Expression* expr) { |
27 Visit(expr); | 27 Visit(expr); |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 void BreakableStatementChecker::VisitVariableDeclaration( | 31 void BreakableStatementChecker::VisitVariableDeclaration( |
32 VariableDeclaration* decl) { | 32 VariableDeclaration* decl) { |
33 } | 33 } |
34 | 34 |
35 | |
35 void BreakableStatementChecker::VisitFunctionDeclaration( | 36 void BreakableStatementChecker::VisitFunctionDeclaration( |
36 FunctionDeclaration* decl) { | 37 FunctionDeclaration* decl) { |
37 } | 38 } |
38 | 39 |
40 | |
39 void BreakableStatementChecker::VisitModuleDeclaration( | 41 void BreakableStatementChecker::VisitModuleDeclaration( |
40 ModuleDeclaration* decl) { | 42 ModuleDeclaration* decl) { |
41 } | 43 } |
42 | 44 |
45 | |
43 void BreakableStatementChecker::VisitImportDeclaration( | 46 void BreakableStatementChecker::VisitImportDeclaration( |
44 ImportDeclaration* decl) { | 47 ImportDeclaration* decl) { |
45 } | 48 } |
46 | 49 |
50 | |
47 void BreakableStatementChecker::VisitExportDeclaration( | 51 void BreakableStatementChecker::VisitExportDeclaration( |
48 ExportDeclaration* decl) { | 52 ExportDeclaration* decl) { |
49 } | 53 } |
50 | 54 |
51 | 55 |
52 void BreakableStatementChecker::VisitModuleLiteral(ModuleLiteral* module) { | 56 void BreakableStatementChecker::VisitModuleLiteral(ModuleLiteral* module) { |
53 } | 57 } |
54 | 58 |
55 | 59 |
56 void BreakableStatementChecker::VisitModuleVariable(ModuleVariable* module) { | 60 void BreakableStatementChecker::VisitModuleVariable(ModuleVariable* module) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 | 174 |
171 | 175 |
172 void BreakableStatementChecker::VisitCaseClause(CaseClause* clause) { | 176 void BreakableStatementChecker::VisitCaseClause(CaseClause* clause) { |
173 } | 177 } |
174 | 178 |
175 | 179 |
176 void BreakableStatementChecker::VisitFunctionLiteral(FunctionLiteral* expr) { | 180 void BreakableStatementChecker::VisitFunctionLiteral(FunctionLiteral* expr) { |
177 } | 181 } |
178 | 182 |
179 | 183 |
184 void BreakableStatementChecker::VisitClassLiteral(ClassLiteral* expr) { | |
185 if (expr->extends() != NULL) { | |
186 Visit(expr->extends()); | |
187 } | |
188 } | |
189 | |
190 | |
180 void BreakableStatementChecker::VisitNativeFunctionLiteral( | 191 void BreakableStatementChecker::VisitNativeFunctionLiteral( |
181 NativeFunctionLiteral* expr) { | 192 NativeFunctionLiteral* expr) { |
182 } | 193 } |
183 | 194 |
184 | 195 |
185 void BreakableStatementChecker::VisitConditional(Conditional* expr) { | 196 void BreakableStatementChecker::VisitConditional(Conditional* expr) { |
186 } | 197 } |
187 | 198 |
188 | 199 |
189 void BreakableStatementChecker::VisitVariableProxy(VariableProxy* expr) { | 200 void BreakableStatementChecker::VisitVariableProxy(VariableProxy* expr) { |
(...skipping 1334 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()); | |
arv (Not doing code reviews)
2014/09/15 15:12:32
Another option would be to throw `new Error('Not y
rossberg
2014/09/16 15:25:40
No, I actually like this better. It allows you to
| |
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 |