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

Side by Side Diff: src/interpreter/bytecode-array-writer.h

Issue 1947403002: [interpreter] Introduce bytecode generation pipeline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments. 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_ARRAY_WRITER_H_
6 #define V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_
7
8 #include "src/interpreter/bytecode-pipeline.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace interpreter {
13
14 // Class for emitting bytecode as the final stage of the bytecode
15 // generation pipeline.
16 class BytecodeArrayWriter : public BytecodePipelineStage {
17 public:
18 BytecodeArrayWriter(
19 Zone* zone, SourcePositionTableBuilder* source_position_table_builder);
20 virtual ~BytecodeArrayWriter();
21
22 size_t FlushForOffset() override;
23 void LeaveBasicBlock() override;
24 void Write(BytecodeNode* node) override;
25
26 // Get the bytecode vector.
27 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; }
28
29 // Returns the size in bytes of the frame associated with the
30 // bytecode written.
31 int GetMeasuredFrameSize();
32
33 private:
34 void EmitBytecode(const BytecodeNode* const node);
35 void UpdateSourcePositionTable(const BytecodeNode* const node);
36
37 ZoneVector<uint8_t> bytecodes_;
38 int frame_register_count_;
39 SourcePositionTableBuilder* source_position_table_builder_;
40
41 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayWriter);
42 };
43
44 } // namespace interpreter
45 } // namespace internal
46 } // namespace v8
47
48 #endif // V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698