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

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: Rebase 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
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecode-array-writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SourcePositionTableBuilder;
15
16 // Class for emitting bytecode as the final stage of the bytecode
17 // generation pipeline.
18 class BytecodeArrayWriter final : public BytecodePipelineStage {
19 public:
20 BytecodeArrayWriter(
21 Zone* zone, SourcePositionTableBuilder* source_position_table_builder);
22 virtual ~BytecodeArrayWriter();
23
24 void Write(BytecodeNode* node) override;
25 size_t FlushForOffset() override;
26 void FlushBasicBlock() override;
27
28 // Get the bytecode vector.
29 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; }
30
31 // Returns the size in bytes of the frame associated with the
32 // bytecode written.
33 int GetMaximumFrameSizeUsed();
34
35 private:
36 void EmitBytecode(const BytecodeNode* const node);
37 void UpdateSourcePositionTable(const BytecodeNode* const node);
38
39 ZoneVector<uint8_t> bytecodes_;
40 int max_register_count_;
41 SourcePositionTableBuilder* source_position_table_builder_;
42
43 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayWriter);
44 };
45
46 } // namespace interpreter
47 } // namespace internal
48 } // namespace v8
49
50 #endif // V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecode-array-writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698