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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 namespace v8 { | 36 namespace v8 { |
37 namespace internal { | 37 namespace internal { |
38 | 38 |
39 class FastCodeGenSyntaxChecker: public AstVisitor { | 39 class FastCodeGenSyntaxChecker: public AstVisitor { |
40 public: | 40 public: |
41 explicit FastCodeGenSyntaxChecker() | 41 explicit FastCodeGenSyntaxChecker() |
42 : info_(NULL), has_supported_syntax_(true) { | 42 : info_(NULL), has_supported_syntax_(true) { |
43 } | 43 } |
44 | 44 |
45 void Check(CompilationInfo* info); | 45 void Check(CompilationInfo* info); |
46 | 46 |
47 CompilationInfo* info() { return info_; } | 47 CompilationInfo* info() { return info_; } |
48 bool has_supported_syntax() { return has_supported_syntax_; } | 48 bool has_supported_syntax() { return has_supported_syntax_; } |
49 | 49 |
50 private: | 50 private: |
51 void VisitDeclarations(ZoneList<Declaration*>* decls); | 51 void VisitDeclarations(ZoneList<Declaration*>* decls); |
52 void VisitStatements(ZoneList<Statement*>* stmts); | 52 void VisitStatements(ZoneList<Statement*>* stmts); |
53 | 53 |
54 // AST node visit functions. | 54 // AST node visit functions. |
55 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 55 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
56 AST_NODE_LIST(DECLARE_VISIT) | 56 AST_NODE_LIST(DECLARE_VISIT) |
57 #undef DECLARE_VISIT | 57 #undef DECLARE_VISIT |
58 | 58 |
59 CompilationInfo* info_; | 59 CompilationInfo* info_; |
60 bool has_supported_syntax_; | 60 bool has_supported_syntax_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); | 62 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); |
63 }; | 63 }; |
64 | 64 |
65 | 65 |
66 class FastCodeGenerator: public AstVisitor { | 66 class FastCodeGenerator: public AstVisitor { |
67 public: | 67 public: |
68 FastCodeGenerator(MacroAssembler* masm) : masm_(masm), info_(NULL) {} | 68 explicit FastCodeGenerator(MacroAssembler* masm) : masm_(masm), info_(NULL) {} |
69 | 69 |
70 static Handle<Code> MakeCode(CompilationInfo* info); | 70 static Handle<Code> MakeCode(CompilationInfo* info); |
71 | 71 |
72 void Generate(CompilationInfo* info); | 72 void Generate(CompilationInfo* info); |
73 | 73 |
74 private: | 74 private: |
75 MacroAssembler* masm() { return masm_; } | 75 MacroAssembler* masm() { return masm_; } |
76 Label* bailout() { return &bailout_; } | 76 Label* bailout() { return &bailout_; } |
77 | 77 |
78 bool has_receiver() { return !info_->receiver().is_null(); } | 78 bool has_receiver() { return !info_->receiver().is_null(); } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 Label bailout_; | 112 Label bailout_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); | 114 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); |
115 }; | 115 }; |
116 | 116 |
117 | 117 |
118 } } // namespace v8::internal | 118 } } // namespace v8::internal |
119 | 119 |
120 #endif // V8_FAST_CODEGEN_H_ | 120 #endif // V8_FAST_CODEGEN_H_ |
OLD | NEW |