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 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_FAST_CODEGEN_H_ | 28 #ifndef V8_FAST_CODEGEN_H_ |
29 #define V8_FAST_CODEGEN_H_ | 29 #define V8_FAST_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 | 35 |
35 namespace v8 { | 36 namespace v8 { |
36 namespace internal { | 37 namespace internal { |
37 | 38 |
38 class FastCodeGenSyntaxChecker: public AstVisitor { | 39 class FastCodeGenSyntaxChecker: public AstVisitor { |
39 public: | 40 public: |
40 explicit FastCodeGenSyntaxChecker(Handle<Object> receiver) | 41 explicit FastCodeGenSyntaxChecker() |
41 : receiver_(receiver), has_supported_syntax_(true) { | 42 : info_(NULL), has_supported_syntax_(true) { |
42 } | 43 } |
43 | 44 |
44 void Check(FunctionLiteral* fun); | 45 void Check(FunctionLiteral* fun, CompilationInfo* info); |
45 | 46 |
46 Handle<Object> receiver() { return receiver_; } | 47 CompilationInfo* info() { return info_; } |
47 bool has_supported_syntax() { return has_supported_syntax_; } | 48 bool has_supported_syntax() { return has_supported_syntax_; } |
48 | 49 |
49 private: | 50 private: |
50 void VisitDeclarations(ZoneList<Declaration*>* decls); | 51 void VisitDeclarations(ZoneList<Declaration*>* decls); |
51 void VisitStatements(ZoneList<Statement*>* stmts); | 52 void VisitStatements(ZoneList<Statement*>* stmts); |
52 | 53 |
53 // AST node visit functions. | 54 // AST node visit functions. |
54 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 55 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
55 AST_NODE_LIST(DECLARE_VISIT) | 56 AST_NODE_LIST(DECLARE_VISIT) |
56 #undef DECLARE_VISIT | 57 #undef DECLARE_VISIT |
57 | 58 |
58 Handle<Object> receiver_; | 59 CompilationInfo* info_; |
59 bool has_supported_syntax_; | 60 bool has_supported_syntax_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); | 62 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); |
62 }; | 63 }; |
63 | 64 |
64 | 65 |
65 } } // namespace v8::internal | 66 } } // namespace v8::internal |
66 | 67 |
67 #endif // V8_FAST_CODEGEN_H_ | 68 #endif // V8_FAST_CODEGEN_H_ |
OLD | NEW |