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

Side by Side Diff: src/interpreter/bytecodes.cc

Issue 1343363002: [Interpreter] Basic flow control. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clarify comment and diff reduction. Created 5 years, 3 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/bytecodes.h" 5 #include "src/interpreter/bytecodes.h"
6 6
7 #include "src/frames.h" 7 #include "src/frames.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 OperandType op_type = GetOperandType(bytecode, i); 126 OperandType op_type = GetOperandType(bytecode, i);
127 uint8_t operand = operands_start[i]; 127 uint8_t operand = operands_start[i];
128 switch (op_type) { 128 switch (op_type) {
129 case interpreter::OperandType::kCount: 129 case interpreter::OperandType::kCount:
130 os << "#" << static_cast<unsigned int>(operand); 130 os << "#" << static_cast<unsigned int>(operand);
131 break; 131 break;
132 case interpreter::OperandType::kIdx: 132 case interpreter::OperandType::kIdx:
133 os << "[" << static_cast<unsigned int>(operand) << "]"; 133 os << "[" << static_cast<unsigned int>(operand) << "]";
134 break; 134 break;
135 case interpreter::OperandType::kImm8: 135 case interpreter::OperandType::kImm8:
136 os << "#" << static_cast<int>(operand); 136 os << "#" << static_cast<int>(static_cast<int8_t>(operand));
137 break; 137 break;
138 case interpreter::OperandType::kReg: { 138 case interpreter::OperandType::kReg: {
139 Register reg = Register::FromOperand(operand); 139 Register reg = Register::FromOperand(operand);
140 if (reg.is_parameter()) { 140 if (reg.is_parameter()) {
141 int parameter_index = reg.ToParameterIndex(parameter_count); 141 int parameter_index = reg.ToParameterIndex(parameter_count);
142 if (parameter_index == 0) { 142 if (parameter_index == 0) {
143 os << "<this>"; 143 os << "<this>";
144 } else { 144 } else {
145 os << "a" << parameter_index - 1; 145 os << "a" << parameter_index - 1;
146 } 146 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); } 204 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); }
205 205
206 206
207 Register Register::FromOperand(uint8_t operand) { 207 Register Register::FromOperand(uint8_t operand) {
208 return Register(-static_cast<int8_t>(operand)); 208 return Register(-static_cast<int8_t>(operand));
209 } 209 }
210 210
211 } // namespace interpreter 211 } // namespace interpreter
212 } // namespace internal 212 } // namespace internal
213 } // namespace v8 213 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698