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

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

Issue 1612323003: Introduce {FAST,SLOW}_STRING_WRAPPER_ELEMENTS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: one more DCHECK fix Created 4 years, 10 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/ic/ic-compiler.cc ('k') | src/key-accumulator.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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return GetCountOperand(operand_index + 1); 126 return GetCountOperand(operand_index + 1);
127 } 127 }
128 } 128 }
129 return 1; 129 return 1;
130 } 130 }
131 } 131 }
132 } 132 }
133 133
134 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( 134 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand(
135 int operand_index) const { 135 int operand_index) const {
136 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); 136 return FixedArray::get(bytecode_array()->constant_pool(),
137 return FixedArray::get(constants, GetIndexOperand(operand_index)); 137 GetIndexOperand(operand_index),
138 bytecode_array()->GetIsolate());
138 } 139 }
139 140
140 141
141 int BytecodeArrayIterator::GetJumpTargetOffset() const { 142 int BytecodeArrayIterator::GetJumpTargetOffset() const {
142 Bytecode bytecode = current_bytecode(); 143 Bytecode bytecode = current_bytecode();
143 if (interpreter::Bytecodes::IsJumpImmediate(bytecode)) { 144 if (interpreter::Bytecodes::IsJumpImmediate(bytecode)) {
144 int relative_offset = GetImmediateOperand(0); 145 int relative_offset = GetImmediateOperand(0);
145 return current_offset() + relative_offset; 146 return current_offset() + relative_offset;
146 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode) || 147 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode) ||
147 interpreter::Bytecodes::IsJumpConstantWide(bytecode)) { 148 interpreter::Bytecodes::IsJumpConstantWide(bytecode)) {
148 Smi* smi = Smi::cast(*GetConstantForIndexOperand(0)); 149 Smi* smi = Smi::cast(*GetConstantForIndexOperand(0));
149 return current_offset() + smi->value(); 150 return current_offset() + smi->value();
150 } else { 151 } else {
151 UNREACHABLE(); 152 UNREACHABLE();
152 return kMinInt; 153 return kMinInt;
153 } 154 }
154 } 155 }
155 156
156 } // namespace interpreter 157 } // namespace interpreter
157 } // namespace internal 158 } // namespace internal
158 } // namespace v8 159 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/key-accumulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698