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 #include "src/interpreter/bytecode-array-iterator.h" | 5 #include "src/interpreter/bytecode-array-iterator.h" |
6 | 6 |
7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); | 99 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); |
100 return FixedArray::get(constants, GetIndexOperand(operand_index)); | 100 return FixedArray::get(constants, GetIndexOperand(operand_index)); |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 int BytecodeArrayIterator::GetJumpTargetOffset() const { | 104 int BytecodeArrayIterator::GetJumpTargetOffset() const { |
105 Bytecode bytecode = current_bytecode(); | 105 Bytecode bytecode = current_bytecode(); |
106 if (interpreter::Bytecodes::IsJumpImmediate(bytecode)) { | 106 if (interpreter::Bytecodes::IsJumpImmediate(bytecode)) { |
107 int relative_offset = GetImmediateOperand(0); | 107 int relative_offset = GetImmediateOperand(0); |
108 return current_offset() + relative_offset; | 108 return current_offset() + relative_offset; |
109 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) { | 109 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode) || |
| 110 interpreter::Bytecodes::IsJumpConstantWide(bytecode)) { |
110 Smi* smi = Smi::cast(*GetConstantForIndexOperand(0)); | 111 Smi* smi = Smi::cast(*GetConstantForIndexOperand(0)); |
111 return current_offset() + smi->value(); | 112 return current_offset() + smi->value(); |
112 } else { | 113 } else { |
113 UNREACHABLE(); | 114 UNREACHABLE(); |
114 return kMinInt; | 115 return kMinInt; |
115 } | 116 } |
116 } | 117 } |
117 | 118 |
118 } // namespace interpreter | 119 } // namespace interpreter |
119 } // namespace internal | 120 } // namespace internal |
120 } // namespace v8 | 121 } // namespace v8 |
OLD | NEW |