Chromium Code Reviews| Index: src/interpreter/bytecode-emitter.cc |
| diff --git a/src/interpreter/bytecode-emitter.cc b/src/interpreter/bytecode-emitter.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c75be5b6c0455c65cea37685eccd9327d8faae72 |
| --- /dev/null |
| +++ b/src/interpreter/bytecode-emitter.cc |
| @@ -0,0 +1,169 @@ |
| +// 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. |
| + |
| +#include "src/interpreter/bytecode-emitter.h" |
| + |
| +namespace v8 { |
| +namespace internal { |
| +namespace interpreter { |
| + |
| +BytecodeEmitter::BytecodeEmitter(Isolate* isolate, Zone* zone) { |
| + InitializeAstVisitor(isolate, zone); |
| +} |
| + |
| + |
| +BytecodeEmitter::~BytecodeEmitter() {} |
| + |
| + |
| +Handle<BytecodeArray> BytecodeEmitter::Emit(FunctionLiteral* function) { |
| + Visit(function); |
| + DCHECK(bytecodes_.size() > 0); |
| + return isolate_->factory()->NewBytecodeArray( |
| + static_cast<int>(bytecodes_.size()), |
| + reinterpret_cast<byte*>(&bytecodes_.front())); |
| +} |
| + |
| + |
| +void BytecodeEmitter::VisitBlock(Block* node) {} |
|
rmcilroy
2015/07/15 13:33:38
Could you please add UNIMPLEMENTED(); to each of t
oth
2015/07/16 09:15:50
Done.
|
| + |
| + |
| +void BytecodeEmitter::VisitVariableDeclaration(VariableDeclaration* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitFunctionDeclaration(FunctionDeclaration* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitImportDeclaration(ImportDeclaration* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitExportDeclaration(ExportDeclaration* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitExpressionStatement(ExpressionStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitEmptyStatement(EmptyStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitIfStatement(IfStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitContinueStatement(ContinueStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitBreakStatement(BreakStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitReturnStatement(ReturnStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitWithStatement(WithStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitSwitchStatement(SwitchStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitCaseClause(CaseClause* clause) {} |
| + |
| + |
| +void BytecodeEmitter::VisitDoWhileStatement(DoWhileStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitWhileStatement(WhileStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitForStatement(ForStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitForInStatement(ForInStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitForOfStatement(ForOfStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitTryCatchStatement(TryCatchStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitTryFinallyStatement(TryFinallyStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitDebuggerStatement(DebuggerStatement* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitFunctionLiteral(FunctionLiteral* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitClassLiteral(ClassLiteral* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitConditional(Conditional* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitLiteral(Literal* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitRegExpLiteral(RegExpLiteral* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitObjectLiteral(ObjectLiteral* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitArrayLiteral(ArrayLiteral* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitVariableProxy(VariableProxy* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitAssignment(Assignment* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitYield(Yield* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitThrow(Throw* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitProperty(Property* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitCall(Call* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitCallNew(CallNew* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitCallRuntime(CallRuntime* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitUnaryOperation(UnaryOperation* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitCountOperation(CountOperation* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitBinaryOperation(BinaryOperation* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitCompareOperation(CompareOperation* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitSpread(Spread* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitThisFunction(ThisFunction* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitSuperCallReference(SuperCallReference* node) {} |
| + |
| + |
| +void BytecodeEmitter::VisitSuperPropertyReference( |
| + SuperPropertyReference* node) {} |
| + |
| + |
| +} // namespace interpreter |
| +} // namespace internal |
| +} // namespace v8 |