| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #define V8_FULL_CODEGEN_H_ | 29 #define V8_FULL_CODEGEN_H_ |
| 30 | 30 |
| 31 #include "v8.h" | 31 #include "v8.h" |
| 32 | 32 |
| 33 #include "ast.h" | 33 #include "ast.h" |
| 34 #include "compiler.h" | 34 #include "compiler.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 class FullCodeGenSyntaxChecker: public AstVisitor { | |
| 40 public: | |
| 41 FullCodeGenSyntaxChecker() : has_supported_syntax_(true) {} | |
| 42 | |
| 43 void Check(FunctionLiteral* fun); | |
| 44 | |
| 45 bool has_supported_syntax() { return has_supported_syntax_; } | |
| 46 | |
| 47 private: | |
| 48 void VisitDeclarations(ZoneList<Declaration*>* decls); | |
| 49 void VisitStatements(ZoneList<Statement*>* stmts); | |
| 50 | |
| 51 // AST node visit functions. | |
| 52 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | |
| 53 AST_NODE_LIST(DECLARE_VISIT) | |
| 54 #undef DECLARE_VISIT | |
| 55 | |
| 56 bool has_supported_syntax_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(FullCodeGenSyntaxChecker); | |
| 59 }; | |
| 60 | |
| 61 | |
| 62 // AST node visitor which can tell whether a given statement will be breakable | 39 // AST node visitor which can tell whether a given statement will be breakable |
| 63 // when the code is compiled by the full compiler in the debugger. This means | 40 // when the code is compiled by the full compiler in the debugger. This means |
| 64 // that there will be an IC (load/store/call) in the code generated for the | 41 // that there will be an IC (load/store/call) in the code generated for the |
| 65 // debugger to piggybag on. | 42 // debugger to piggybag on. |
| 66 class BreakableStatementChecker: public AstVisitor { | 43 class BreakableStatementChecker: public AstVisitor { |
| 67 public: | 44 public: |
| 68 BreakableStatementChecker() : is_breakable_(false) {} | 45 BreakableStatementChecker() : is_breakable_(false) {} |
| 69 | 46 |
| 70 void Check(Statement* stmt); | 47 void Check(Statement* stmt); |
| 71 void Check(Expression* stmt); | 48 void Check(Expression* stmt); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 457 |
| 481 friend class NestedStatement; | 458 friend class NestedStatement; |
| 482 | 459 |
| 483 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 460 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
| 484 }; | 461 }; |
| 485 | 462 |
| 486 | 463 |
| 487 } } // namespace v8::internal | 464 } } // namespace v8::internal |
| 488 | 465 |
| 489 #endif // V8_FULL_CODEGEN_H_ | 466 #endif // V8_FULL_CODEGEN_H_ |
| OLD | NEW |