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

Unified 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 review comments on patch sets 2 & 3. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
new file mode 100644
index 0000000000000000000000000000000000000000..5caf3f1813cb349e9c0980486d70b61f48e241e7
--- /dev/null
+++ b/src/interpreter/bytecode-generator.h
@@ -0,0 +1,44 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_
+#define V8_INTERPRETER_BYTECODE_GENERATOR_H_
+
+#include "src/ast.h"
+#include "src/interpreter/bytecode-array-builder.h"
+#include "src/interpreter/bytecodes.h"
+
+namespace v8 {
+namespace internal {
+namespace interpreter {
+
+class BytecodeGenerator : public AstVisitor {
+ public:
+ BytecodeGenerator(Isolate* isolate, Zone* zone);
+ virtual ~BytecodeGenerator();
+
+ Handle<BytecodeArray> MakeBytecode(CompilationInfo* info);
+
+#define DECLARE_VISIT(type) void Visit##type(type* node) override;
+ AST_NODE_LIST(DECLARE_VISIT)
+#undef DECLARE_VISIT
+
+ private:
+ DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
+
+ void VisitArithmeticExpression(BinaryOperation* binop);
+
+ inline BytecodeArrayBuilder& builder() { return builder_; }
+ inline Scope* scope() const { return scope_; }
+ inline void set_scope(Scope* s) { scope_ = s; }
+
+ BytecodeArrayBuilder builder_;
+ Scope* scope_;
+};
+
+} // namespace interpreter
+} // namespace internal
+} // namespace v8
+
+#endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698