| Index: src/interpreter/bytecode-peephole-optimizer.h
|
| diff --git a/src/interpreter/bytecode-peephole-optimizer.h b/src/interpreter/bytecode-peephole-optimizer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a5755530356f043dca8f0c0159ee0f9bd24c6bf4
|
| --- /dev/null
|
| +++ b/src/interpreter/bytecode-peephole-optimizer.h
|
| @@ -0,0 +1,48 @@
|
| +// 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_PEEPHOLE_OPTIMIZER_H_
|
| +#define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
|
| +
|
| +#include "src/interpreter/bytecode-writer.h"
|
| +
|
| +namespace v8 {
|
| +namespace internal {
|
| +namespace interpreter {
|
| +
|
| +class ConstantArrayBuilder;
|
| +
|
| +class BytecodePeepholeOptimizer : public BytecodeWriter, public ZoneObject {
|
| + public:
|
| + BytecodePeepholeOptimizer(ConstantArrayBuilder* constant_array_builder,
|
| + BytecodeWriter* output_writer);
|
| +
|
| + // Flush internal state for a branch.
|
| + size_t FlushForOffset() override;
|
| +
|
| + // Signal end of basic block.
|
| + void LeaveBasicBlock() override;
|
| +
|
| + // Write bytecode into pipeline.
|
| + void Write(BytecodeNode* node) override;
|
| +
|
| + private:
|
| + BytecodeNode* Optimize(BytecodeNode* current);
|
| +
|
| + Handle<Object> GetConstantForIndexOperand(const BytecodeNode* const node,
|
| + int index) const;
|
| +
|
| + ConstantArrayBuilder* constant_array_builder_;
|
| + BytecodeWriter* output_writer_;
|
| + BytecodeNode* last_;
|
| + bool last_is_discardable_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer);
|
| +};
|
| +
|
| +} // namespace interpreter
|
| +} // namespace internal
|
| +} // namespace v8
|
| +
|
| +#endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
|
|
|