Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/interpreter/bytecode-peephole-optimizer.h

Issue 2030583002: [Interpreter] Don't try to eliminate dead-code in bytecode-array-builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-pipeline.h" 8 #include "src/interpreter/bytecode-pipeline.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 namespace interpreter { 12 namespace interpreter {
13 13
14 class ConstantArrayBuilder; 14 class ConstantArrayBuilder;
15 15
16 // An optimization stage for performing peephole optimizations on 16 // An optimization stage for performing peephole optimizations on
17 // generated bytecode. The optimizer may buffer one bytecode 17 // generated bytecode. The optimizer may buffer one bytecode
18 // internally. 18 // internally.
19 class BytecodePeepholeOptimizer final : public BytecodePipelineStage, 19 class BytecodePeepholeOptimizer final : public BytecodePipelineStage,
20 public ZoneObject { 20 public ZoneObject {
21 public: 21 public:
22 BytecodePeepholeOptimizer(ConstantArrayBuilder* constant_array_builder, 22 BytecodePeepholeOptimizer(ConstantArrayBuilder* constant_array_builder,
23 BytecodePipelineStage* next_stage); 23 BytecodePipelineStage* next_stage);
24 24
25 // BytecodePipelineStage interface.
25 void Write(BytecodeNode* node) override; 26 void Write(BytecodeNode* node) override;
26 size_t FlushForOffset() override; 27 size_t FlushForOffset() override;
27 void FlushBasicBlock() override; 28 void FlushBasicBlock() override;
28 29
29 private: 30 private:
30 BytecodeNode* Optimize(BytecodeNode* current); 31 BytecodeNode* Optimize(BytecodeNode* current);
31 32
32 void TryToRemoveLastExpressionPosition(const BytecodeNode* const current); 33 void TryToRemoveLastExpressionPosition(const BytecodeNode* const current);
33 bool TransformLastAndCurrentBytecodes(BytecodeNode* const current); 34 bool TransformLastAndCurrentBytecodes(BytecodeNode* const current);
34 bool CanElideCurrent(const BytecodeNode* const current) const; 35 bool CanElideCurrent(const BytecodeNode* const current) const;
(...skipping 21 matching lines...) Expand all
56 bool last_is_discardable_; 57 bool last_is_discardable_;
57 58
58 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer); 59 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer);
59 }; 60 };
60 61
61 } // namespace interpreter 62 } // namespace interpreter
62 } // namespace internal 63 } // namespace internal
63 } // namespace v8 64 } // namespace v8
64 65
65 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_ 66 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecode-register-optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698