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

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

Issue 1690963002: Revert of [Interpreter] Rename GetCountOperand to GetRegisterCountOperand. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 return 0; 57 return 0;
58 } 58 }
59 59
60 60
61 int8_t BytecodeArrayIterator::GetImmediateOperand(int operand_index) const { 61 int8_t BytecodeArrayIterator::GetImmediateOperand(int operand_index) const {
62 uint32_t operand = GetRawOperand(operand_index, OperandType::kImm8); 62 uint32_t operand = GetRawOperand(operand_index, OperandType::kImm8);
63 return static_cast<int8_t>(operand); 63 return static_cast<int8_t>(operand);
64 } 64 }
65 65
66 int BytecodeArrayIterator::GetRegisterCountOperand(int operand_index) const { 66
67 int BytecodeArrayIterator::GetCountOperand(int operand_index) const {
67 OperandSize size = 68 OperandSize size =
68 Bytecodes::GetOperandSize(current_bytecode(), operand_index); 69 Bytecodes::GetOperandSize(current_bytecode(), operand_index);
69 OperandType type = (size == OperandSize::kByte) ? OperandType::kRegCount8 70 OperandType type = (size == OperandSize::kByte) ? OperandType::kRegCount8
70 : OperandType::kRegCount16; 71 : OperandType::kRegCount16;
71 uint32_t operand = GetRawOperand(operand_index, type); 72 uint32_t operand = GetRawOperand(operand_index, type);
72 return static_cast<int>(operand); 73 return static_cast<int>(operand);
73 } 74 }
74 75
75 76
76 int BytecodeArrayIterator::GetIndexOperand(int operand_index) const { 77 int BytecodeArrayIterator::GetIndexOperand(int operand_index) const {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return 2; 124 return 2;
124 case OperandType::kRegOutTriple8: 125 case OperandType::kRegOutTriple8:
125 case OperandType::kRegOutTriple16: 126 case OperandType::kRegOutTriple16:
126 return 3; 127 return 3;
127 default: { 128 default: {
128 if (operand_index + 1 != 129 if (operand_index + 1 !=
129 Bytecodes::NumberOfOperands(current_bytecode())) { 130 Bytecodes::NumberOfOperands(current_bytecode())) {
130 OperandType next_operand_type = 131 OperandType next_operand_type =
131 Bytecodes::GetOperandType(current_bytecode(), operand_index + 1); 132 Bytecodes::GetOperandType(current_bytecode(), operand_index + 1);
132 if (Bytecodes::IsRegisterCountOperandType(next_operand_type)) { 133 if (Bytecodes::IsRegisterCountOperandType(next_operand_type)) {
133 return GetRegisterCountOperand(operand_index + 1); 134 return GetCountOperand(operand_index + 1);
134 } 135 }
135 } 136 }
136 return 1; 137 return 1;
137 } 138 }
138 } 139 }
139 } 140 }
140 141
141 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( 142 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand(
142 int operand_index) const { 143 int operand_index) const {
143 return FixedArray::get(bytecode_array()->constant_pool(), 144 return FixedArray::get(bytecode_array()->constant_pool(),
(...skipping 13 matching lines...) Expand all
157 return current_offset() + smi->value(); 158 return current_offset() + smi->value();
158 } else { 159 } else {
159 UNREACHABLE(); 160 UNREACHABLE();
160 return kMinInt; 161 return kMinInt;
161 } 162 }
162 } 163 }
163 164
164 } // namespace interpreter 165 } // namespace interpreter
165 } // namespace internal 166 } // namespace internal
166 } // namespace v8 167 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-iterator.h ('k') | test/unittests/interpreter/bytecode-array-iterator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698