Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: src/fast-codegen.h

Issue 558042: Add fast code generator visitor. (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 {
67 public:
68 FastCodeGenerator(Handle<Script> script, bool is_eval)
69 : masm_(NULL),
70 script_(script),
71 is_eval_(is_eval),
72 function_(NULL),
73 info_(NULL) {
74 }
75
76 static void MakeCode(FunctionLiteral* fun,
77 Handle<Script> script,
78 bool is_eval,
79 CompilationInfo* info);
80
81 void Generate(FunctionLiteral* fun, CompilationInfo* info);
82
83 private:
84 // AST node visit functions.
85 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
86 AST_NODE_LIST(DECLARE_VISIT)
87 #undef DECLARE_VISIT
88
89 MacroAssembler* masm_;
90 Handle<Script> script_;
91 bool is_eval_;
92
93 FunctionLiteral* function_;
94 CompilationInfo* info_;
95
96 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator);
97 };
98
99
66 } } // namespace v8::internal 100 } } // namespace v8::internal
67 101
68 #endif // V8_FAST_CODEGEN_H_ 102 #endif // V8_FAST_CODEGEN_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/fast-codegen.cc » ('j') | src/fast-codegen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698