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

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

Issue 1947403002: [interpreter] Introduce bytecode generation pipeline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix return type of BytecodeSourceInfo::is_statement() Created 4 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
6 #define V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
7
8 #include "src/interpreter/bytecode-writer.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace interpreter {
13
14 class ConstantArrayBuilder;
15
16 class BytecodePeepholeOptimizer : public BytecodeWriter, public ZoneObject {
17 public:
18 BytecodePeepholeOptimizer(ConstantArrayBuilder* constant_array_builder,
19 BytecodeWriter* output_writer);
20
21 // Flush internal state for a branch.
22 size_t FlushForOffset() override;
23
24 // Signal end of basic block.
25 void LeaveBasicBlock() override;
26
27 // Write bytecode into pipeline.
28 void Write(BytecodeNode* node) override;
29
30 private:
31 BytecodeNode* Optimize(BytecodeNode* current);
32
33 Handle<Object> GetConstantForIndexOperand(const BytecodeNode* const node,
34 int index) const;
35
36 ConstantArrayBuilder* constant_array_builder_;
37 BytecodeWriter* output_writer_;
38 BytecodeNode* last_;
39 bool last_is_discardable_;
40
41 DISALLOW_COPY_AND_ASSIGN(BytecodePeepholeOptimizer);
42 };
43
44 } // namespace interpreter
45 } // namespace internal
46 } // namespace v8
47
48 #endif // V8_INTERPRETER_BYTECODE_PEEPHOLE_OPTIMIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698