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

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

Issue 1321663003: [Interpreter] Add support for loading literals from the constant pool. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_const_pool_1
Patch Set: Review comments 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
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.cc » ('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/bytecodes.h" 5 #include "src/interpreter/bytecodes.h"
6 6
7 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 os << bytecode << " "; 121 os << bytecode << " ";
122 122
123 const uint8_t* operands_start = bytecode_start + 1; 123 const uint8_t* operands_start = bytecode_start + 1;
124 int operands_size = bytecode_size - 1; 124 int operands_size = bytecode_size - 1;
125 for (int i = 0; i < operands_size; i++) { 125 for (int i = 0; i < operands_size; i++) {
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::kIdx:
130 os << "[" << static_cast<unsigned int>(operand) << "]";
131 break;
129 case interpreter::OperandType::kImm8: 132 case interpreter::OperandType::kImm8:
130 os << "#" << static_cast<int>(operand); 133 os << "#" << static_cast<int>(operand);
131 break; 134 break;
132 case interpreter::OperandType::kReg: 135 case interpreter::OperandType::kReg:
133 os << "r" << Register::FromOperand(operand).index(); 136 os << "r" << Register::FromOperand(operand).index();
134 break; 137 break;
135 case interpreter::OperandType::kNone: 138 case interpreter::OperandType::kNone:
136 UNREACHABLE(); 139 UNREACHABLE();
137 break; 140 break;
138 } 141 }
(...skipping 10 matching lines...) Expand all
149 } 152 }
150 153
151 154
152 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) { 155 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) {
153 return os << Bytecodes::OperandTypeToString(operand_type); 156 return os << Bytecodes::OperandTypeToString(operand_type);
154 } 157 }
155 158
156 } // namespace interpreter 159 } // namespace interpreter
157 } // namespace internal 160 } // namespace internal
158 } // namespace v8 161 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698