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

Side by Side Diff: src/interpreter/bytecode-generator.h

Issue 1294543002: [Interpreter] Minimal bytecode generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-register-conversion
Patch Set: Incorporate comments on patch set 1 and add a simple test. Created 5 years, 4 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
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_
6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_
7
8 #include "src/ast.h"
9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/bytecodes.h"
11
12 namespace v8 {
13 namespace internal {
14 namespace interpreter {
15
16 class BytecodeGenerator : public AstVisitor {
17 public:
18 BytecodeGenerator(Isolate* isolate, Zone* zone);
19 virtual ~BytecodeGenerator();
20
21 Handle<BytecodeArray> MakeBytecode(CompilationInfo* info);
22
23 #define DECLARE_VISIT(type) void Visit##type(type* node) override;
24 AST_NODE_LIST(DECLARE_VISIT)
25 #undef DECLARE_VISIT
26
27 private:
28 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
29
30 void VisitArithmeticExpression(BinaryOperation* binop);
31
32 inline BytecodeArrayBuilder& builder() { return builder_; }
33 inline Scope* scope() const { return scope_; }
34 inline void set_scope(Scope* s) { scope_ = s; }
35
36 BytecodeArrayBuilder builder_;
37 Scope* scope_;
38 };
39
40 } // namespace interpreter
41 } // namespace internal
42 } // namespace v8
43
44 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698