OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_ACCESSOR_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_ |
7 | 7 |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/interpreter/bytecode-register.h" | 10 #include "src/interpreter/bytecode-register.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 int GetRegisterOperandRange(int operand_index) const; | 41 int GetRegisterOperandRange(int operand_index) const; |
42 Runtime::FunctionId GetRuntimeIdOperand(int operand_index) const; | 42 Runtime::FunctionId GetRuntimeIdOperand(int operand_index) const; |
43 Runtime::FunctionId GetIntrinsicIdOperand(int operand_index) const; | 43 Runtime::FunctionId GetIntrinsicIdOperand(int operand_index) const; |
44 Handle<Object> GetConstantForIndexOperand(int operand_index) const; | 44 Handle<Object> GetConstantForIndexOperand(int operand_index) const; |
45 | 45 |
46 // Returns the absolute offset of the branch target at the current | 46 // Returns the absolute offset of the branch target at the current |
47 // bytecode. It is an error to call this method if the bytecode is | 47 // bytecode. It is an error to call this method if the bytecode is |
48 // not for a jump or conditional jump. | 48 // not for a jump or conditional jump. |
49 int GetJumpTargetOffset() const; | 49 int GetJumpTargetOffset() const; |
50 | 50 |
51 std::ostream& PrintTo(std::ostream& os) const; | |
52 | |
53 private: | 51 private: |
54 bool OffsetInBounds() const; | 52 bool OffsetInBounds() const; |
55 | 53 |
56 uint32_t GetUnsignedOperand(int operand_index, | 54 uint32_t GetUnsignedOperand(int operand_index, |
57 OperandType operand_type) const; | 55 OperandType operand_type) const; |
58 int32_t GetSignedOperand(int operand_index, OperandType operand_type) const; | 56 int32_t GetSignedOperand(int operand_index, OperandType operand_type) const; |
59 | 57 |
60 void UpdateOperandScale(); | 58 void UpdateOperandScale(); |
61 | 59 |
62 Handle<BytecodeArray> bytecode_array_; | 60 Handle<BytecodeArray> bytecode_array_; |
63 int bytecode_offset_; | 61 int bytecode_offset_; |
64 OperandScale operand_scale_; | 62 OperandScale operand_scale_; |
65 int prefix_offset_; | 63 int prefix_offset_; |
66 | 64 |
67 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayAccessor); | 65 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayAccessor); |
68 }; | 66 }; |
69 | 67 |
70 } // namespace interpreter | 68 } // namespace interpreter |
71 } // namespace internal | 69 } // namespace internal |
72 } // namespace v8 | 70 } // namespace v8 |
73 | 71 |
74 #endif // V8_INTERPRETER_BYTECODE_GRAPH_ACCESSOR_H_ | 72 #endif // V8_INTERPRETER_BYTECODE_GRAPH_ACCESSOR_H_ |
OLD | NEW |