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

Side by Side Diff: test/cctest/interpreter/bytecode-expectations-printer.cc

Issue 1723223002: [Interpreter] Textual representation for runtime function IDs. (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
« src/interpreter/bytecodes.h ('K') | « src/interpreter/bytecodes.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 "test/cctest/interpreter/bytecode-expectations-printer.h" 5 #include "test/cctest/interpreter/bytecode-expectations-printer.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 #include <vector> 8 #include <vector>
9 9
10 #include "include/libplatform/libplatform.h" 10 #include "include/libplatform/libplatform.h"
11 #include "include/v8.h" 11 #include "include/v8.h"
12 12
13 #include "src/base/logging.h" 13 #include "src/base/logging.h"
14 #include "src/base/smart-pointers.h" 14 #include "src/base/smart-pointers.h"
15 #include "src/compiler.h" 15 #include "src/compiler.h"
16 #include "src/runtime/runtime.h"
16 17
17 #include "src/interpreter/bytecode-array-iterator.h" 18 #include "src/interpreter/bytecode-array-iterator.h"
18 #include "src/interpreter/bytecode-generator.h" 19 #include "src/interpreter/bytecode-generator.h"
19 #include "src/interpreter/bytecodes.h" 20 #include "src/interpreter/bytecodes.h"
20 #include "src/interpreter/interpreter.h" 21 #include "src/interpreter/interpreter.h"
21 22
22 namespace v8 { 23 namespace v8 {
23 namespace internal { 24 namespace internal {
24 namespace interpreter { 25 namespace interpreter {
25 26
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 stream << "(this)"; 130 stream << "(this)";
130 } else { 131 } else {
131 stream << "(arg" << (parameter_index - 1) << ')'; 132 stream << "(arg" << (parameter_index - 1) << ')';
132 } 133 }
133 } else { 134 } else {
134 stream << '(' << register_value.index() << ')'; 135 stream << '(' << register_value.index() << ')';
135 } 136 }
136 } else { 137 } else {
137 stream << 'U' << size_tag << '('; 138 stream << 'U' << size_tag << '(';
138 139
139 if (Bytecodes::IsImmediateOperandType(op_type)) { 140 if (op_index == 0 && Bytecodes::IsCallRuntime(bytecode)) {
141 stream << "Runtime::"
142 << i::Runtime::FunctionForId(
oth 2016/02/23 17:37:15 Nit - this is a bit dense with braces and brackets
Stefano Sanfilippo 2016/02/23 17:43:50 Done.
143 static_cast<i::Runtime::FunctionId>(
144 bytecode_iter.GetIndexOperand(op_index)))
145 ->name;
146 } else if (Bytecodes::IsImmediateOperandType(op_type)) {
140 // We need a cast, otherwise the result is printed as char. 147 // We need a cast, otherwise the result is printed as char.
141 stream << static_cast<int>(bytecode_iter.GetImmediateOperand(op_index)); 148 stream << static_cast<int>(bytecode_iter.GetImmediateOperand(op_index));
142 } else if (Bytecodes::IsRegisterCountOperandType(op_type)) { 149 } else if (Bytecodes::IsRegisterCountOperandType(op_type)) {
143 stream << bytecode_iter.GetRegisterCountOperand(op_index); 150 stream << bytecode_iter.GetRegisterCountOperand(op_index);
144 } else if (Bytecodes::IsIndexOperandType(op_type)) { 151 } else if (Bytecodes::IsIndexOperandType(op_type)) {
145 stream << bytecode_iter.GetIndexOperand(op_index); 152 stream << bytecode_iter.GetIndexOperand(op_index);
146 } else { 153 } else {
147 UNREACHABLE(); 154 UNREACHABLE();
148 } 155 }
149 156
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 299
293 stream << "---\n"; 300 stream << "---\n";
294 PrintCodeSnippet(stream, snippet); 301 PrintCodeSnippet(stream, snippet);
295 PrintBytecodeArray(stream, bytecode_array); 302 PrintBytecodeArray(stream, bytecode_array);
296 stream << '\n'; 303 stream << '\n';
297 } 304 }
298 305
299 } // namespace interpreter 306 } // namespace interpreter
300 } // namespace internal 307 } // namespace internal
301 } // namespace v8 308 } // namespace v8
OLDNEW
« src/interpreter/bytecodes.h ('K') | « src/interpreter/bytecodes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698