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

Side by Side Diff: src/interpreter/bytecode-array-iterator.cc

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments on patchset 13. Created 4 years, 11 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-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); 100 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool());
101 return FixedArray::get(constants, GetIndexOperand(operand_index)); 101 return FixedArray::get(constants, GetIndexOperand(operand_index));
102 } 102 }
103 103
104 104
105 int BytecodeArrayIterator::GetJumpTargetOffset() const { 105 int BytecodeArrayIterator::GetJumpTargetOffset() const {
106 Bytecode bytecode = current_bytecode(); 106 Bytecode bytecode = current_bytecode();
107 if (interpreter::Bytecodes::IsJumpImmediate(bytecode)) { 107 if (interpreter::Bytecodes::IsJumpImmediate(bytecode)) {
108 int relative_offset = GetImmediateOperand(0); 108 int relative_offset = GetImmediateOperand(0);
109 return current_offset() + relative_offset; 109 return current_offset() + relative_offset;
110 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) { 110 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode) ||
111 interpreter::Bytecodes::IsJumpConstantWide(bytecode)) {
111 Smi* smi = Smi::cast(*GetConstantForIndexOperand(0)); 112 Smi* smi = Smi::cast(*GetConstantForIndexOperand(0));
112 return current_offset() + smi->value(); 113 return current_offset() + smi->value();
113 } else { 114 } else {
114 UNREACHABLE(); 115 UNREACHABLE();
115 return kMinInt; 116 return kMinInt;
116 } 117 }
117 } 118 }
118 119
119 } // namespace interpreter 120 } // namespace interpreter
120 } // namespace internal 121 } // namespace internal
121 } // namespace v8 122 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698