| Index: src/interpreter/bytecode-array-writer.h
|
| diff --git a/src/interpreter/bytecode-array-writer.h b/src/interpreter/bytecode-array-writer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a3a267c98065153752cbfb223552f77272792c7f
|
| --- /dev/null
|
| +++ b/src/interpreter/bytecode-array-writer.h
|
| @@ -0,0 +1,50 @@
|
| +// 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_ARRAY_WRITER_H_
|
| +#define V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_
|
| +
|
| +#include "src/interpreter/bytecode-pipeline.h"
|
| +
|
| +namespace v8 {
|
| +namespace internal {
|
| +namespace interpreter {
|
| +
|
| +class SourcePositionTableBuilder;
|
| +
|
| +// Class for emitting bytecode as the final stage of the bytecode
|
| +// generation pipeline.
|
| +class BytecodeArrayWriter : public BytecodePipelineStage {
|
| + public:
|
| + BytecodeArrayWriter(
|
| + Zone* zone, SourcePositionTableBuilder* source_position_table_builder);
|
| + virtual ~BytecodeArrayWriter();
|
| +
|
| + size_t FlushForOffset() override;
|
| + void FlushBasicBlock() override;
|
| + void Write(BytecodeNode* node) override;
|
| +
|
| + // Get the bytecode vector.
|
| + ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; }
|
| +
|
| + // Returns the size in bytes of the frame associated with the
|
| + // bytecode written.
|
| + int GetMeasuredFrameSize();
|
| +
|
| + private:
|
| + void EmitBytecode(const BytecodeNode* const node);
|
| + void UpdateSourcePositionTable(const BytecodeNode* const node);
|
| +
|
| + ZoneVector<uint8_t> bytecodes_;
|
| + int max_register_count_;
|
| + SourcePositionTableBuilder* source_position_table_builder_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(BytecodeArrayWriter);
|
| +};
|
| +
|
| +} // namespace interpreter
|
| +} // namespace internal
|
| +} // namespace v8
|
| +
|
| +#endif // V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_
|
|
|