| 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_DEAD_CODE_OPTIMIZER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_DEAD_CODE_OPTIMIZER_H_ |
| 6 #define V8_INTERPRETER_BYTECODE_DEAD_CODE_OPTIMIZER_H_ | 6 #define V8_INTERPRETER_BYTECODE_DEAD_CODE_OPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/globals.h" |
| 8 #include "src/interpreter/bytecode-pipeline.h" | 10 #include "src/interpreter/bytecode-pipeline.h" |
| 9 | 11 |
| 10 namespace v8 { | 12 namespace v8 { |
| 11 namespace internal { | 13 namespace internal { |
| 12 namespace interpreter { | 14 namespace interpreter { |
| 13 | 15 |
| 14 // An optimization stage for eliminating obviously dead code in bytecode | 16 // An optimization stage for eliminating obviously dead code in bytecode |
| 15 // generation. | 17 // generation. |
| 16 class BytecodeDeadCodeOptimizer final : public BytecodePipelineStage, | 18 class V8_EXPORT_PRIVATE BytecodeDeadCodeOptimizer final |
| 17 public ZoneObject { | 19 : public NON_EXPORTED_BASE(BytecodePipelineStage), |
| 20 public NON_EXPORTED_BASE(ZoneObject) { |
| 18 public: | 21 public: |
| 19 explicit BytecodeDeadCodeOptimizer(BytecodePipelineStage* next_stage); | 22 explicit BytecodeDeadCodeOptimizer(BytecodePipelineStage* next_stage); |
| 20 | 23 |
| 21 // BytecodePipelineStage interface. | 24 // BytecodePipelineStage interface. |
| 22 void Write(BytecodeNode* node) override; | 25 void Write(BytecodeNode* node) override; |
| 23 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; | 26 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; |
| 24 void BindLabel(BytecodeLabel* label) override; | 27 void BindLabel(BytecodeLabel* label) override; |
| 25 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; | 28 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; |
| 26 Handle<BytecodeArray> ToBytecodeArray( | 29 Handle<BytecodeArray> ToBytecodeArray( |
| 27 Isolate* isolate, int register_count, int parameter_count, | 30 Isolate* isolate, int register_count, int parameter_count, |
| 28 Handle<FixedArray> handler_table) override; | 31 Handle<FixedArray> handler_table) override; |
| 29 | 32 |
| 30 private: | 33 private: |
| 31 BytecodePipelineStage* next_stage_; | 34 BytecodePipelineStage* next_stage_; |
| 32 bool exit_seen_in_block_; | 35 bool exit_seen_in_block_; |
| 33 | 36 |
| 34 DISALLOW_COPY_AND_ASSIGN(BytecodeDeadCodeOptimizer); | 37 DISALLOW_COPY_AND_ASSIGN(BytecodeDeadCodeOptimizer); |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 } // namespace interpreter | 40 } // namespace interpreter |
| 38 } // namespace internal | 41 } // namespace internal |
| 39 } // namespace v8 | 42 } // namespace v8 |
| 40 | 43 |
| 41 #endif // V8_INTERPRETER_BYTECODE_DEAD_CODE_OPTIMIZER_H_ | 44 #endif // V8_INTERPRETER_BYTECODE_DEAD_CODE_OPTIMIZER_H_ |
| OLD | NEW |