| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ |
| 6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ | 6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/globals.h" |
| 8 #include "src/interpreter/bytecode-peephole-table.h" | 10 #include "src/interpreter/bytecode-peephole-table.h" |
| 9 #include "src/interpreter/bytecode-pipeline.h" | 11 #include "src/interpreter/bytecode-pipeline.h" |
| 10 | 12 |
| 11 namespace v8 { | 13 namespace v8 { |
| 12 namespace internal { | 14 namespace internal { |
| 13 namespace interpreter { | 15 namespace interpreter { |
| 14 | 16 |
| 15 class BytecodePeepholeActionAndData; | 17 class BytecodePeepholeActionAndData; |
| 16 | 18 |
| 17 // An optimization stage for performing peephole optimizations on | 19 // An optimization stage for performing peephole optimizations on |
| 18 // generated bytecode. The optimizer may buffer one bytecode | 20 // generated bytecode. The optimizer may buffer one bytecode |
| 19 // internally. | 21 // internally. |
| 20 class BytecodePeepholeOptimizer final : public BytecodePipelineStage, | 22 class V8_EXPORT_PRIVATE BytecodePeepholeOptimizer final |
| 21 public ZoneObject { | 23 : public NON_EXPORTED_BASE(BytecodePipelineStage), |
| 24 public NON_EXPORTED_BASE(ZoneObject) { |
| 22 public: | 25 public: |
| 23 explicit BytecodePeepholeOptimizer(BytecodePipelineStage* next_stage); | 26 explicit BytecodePeepholeOptimizer(BytecodePipelineStage* next_stage); |
| 24 | 27 |
| 25 // BytecodePipelineStage interface. | 28 // BytecodePipelineStage interface. |
| 26 void Write(BytecodeNode* node) override; | 29 void Write(BytecodeNode* node) override; |
| 27 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; | 30 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; |
| 28 void BindLabel(BytecodeLabel* label) override; | 31 void BindLabel(BytecodeLabel* label) override; |
| 29 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; | 32 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; |
| 30 Handle<BytecodeArray> ToBytecodeArray( | 33 Handle<BytecodeArray> ToBytecodeArray( |
| 31 Isolate* isolate, int register_count, int parameter_count, | 34 Isolate* isolate, int register_count, int parameter_count, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 53 BytecodeNode last_; | 56 BytecodeNode last_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer); | 58 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 } // namespace interpreter | 61 } // namespace interpreter |
| 59 } // namespace internal | 62 } // namespace internal |
| 60 } // namespace v8 | 63 } // namespace v8 |
| 61 | 64 |
| 62 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ | 65 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ |
| OLD | NEW |