OLD | NEW |
---|---|
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_ARRAY_WRITER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_ |
7 | 7 |
8 #include "src/interpreter/bytecode-pipeline.h" | 8 #include "src/interpreter/bytecode-pipeline.h" |
9 #include "src/interpreter/source-position-table.h" | 9 #include "src/interpreter/source-position-table.h" |
10 | 10 |
(...skipping 16 matching lines...) Loading... | |
27 // BytecodePipelineStage interface. | 27 // BytecodePipelineStage interface. |
28 void Write(BytecodeNode* node) override; | 28 void Write(BytecodeNode* node) override; |
29 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; | 29 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; |
30 void BindLabel(BytecodeLabel* label) override; | 30 void BindLabel(BytecodeLabel* label) override; |
31 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; | 31 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; |
32 Handle<BytecodeArray> ToBytecodeArray( | 32 Handle<BytecodeArray> ToBytecodeArray( |
33 int fixed_register_count, int parameter_count, | 33 int fixed_register_count, int parameter_count, |
34 Handle<FixedArray> handler_table) override; | 34 Handle<FixedArray> handler_table) override; |
35 | 35 |
36 private: | 36 private: |
37 // Maximum sized packed bytecode is comprised of a prefix bytecode, | |
38 // plus the actual bytecode, plus the maximum number of operands times | |
39 // the maximum operand size. | |
40 static const size_t kMaxSizeOfPackedBytecode = | |
41 2 * sizeof(Bytecode) + | |
42 Bytecodes::kMaxOperands * sizeof(static_cast<size_t>(OperandSize::kLast)); | |
rmcilroy
2016/06/28 09:07:26
I don't think you want the sizeof here any longer,
| |
43 | |
37 // Constants that act as placeholders for jump operands to be | 44 // Constants that act as placeholders for jump operands to be |
38 // patched. These have operand sizes that match the sizes of | 45 // patched. These have operand sizes that match the sizes of |
39 // reserved constant pool entries. | 46 // reserved constant pool entries. |
40 const uint32_t k8BitJumpPlaceholder = 0x7f; | 47 const uint32_t k8BitJumpPlaceholder = 0x7f; |
41 const uint32_t k16BitJumpPlaceholder = | 48 const uint32_t k16BitJumpPlaceholder = |
42 k8BitJumpPlaceholder | (k8BitJumpPlaceholder << 8); | 49 k8BitJumpPlaceholder | (k8BitJumpPlaceholder << 8); |
43 const uint32_t k32BitJumpPlaceholder = | 50 const uint32_t k32BitJumpPlaceholder = |
44 k16BitJumpPlaceholder | (k16BitJumpPlaceholder << 16); | 51 k16BitJumpPlaceholder | (k16BitJumpPlaceholder << 16); |
45 | 52 |
46 void PatchJump(size_t jump_target, size_t jump_location); | 53 void PatchJump(size_t jump_target, size_t jump_location); |
(...skipping 24 matching lines...) Loading... | |
71 | 78 |
72 friend class BytecodeArrayWriterUnittest; | 79 friend class BytecodeArrayWriterUnittest; |
73 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayWriter); | 80 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayWriter); |
74 }; | 81 }; |
75 | 82 |
76 } // namespace interpreter | 83 } // namespace interpreter |
77 } // namespace internal | 84 } // namespace internal |
78 } // namespace v8 | 85 } // namespace v8 |
79 | 86 |
80 #endif // V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_ | 87 #endif // V8_INTERPRETER_BYTECODE_ARRAY_WRITER_H_ |
OLD | NEW |