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

Unified 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: CallJSRuntime != CallRuntime, DCHECK op type, Runtime::k prefix. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/bytecode-expectations-printer.cc
diff --git a/test/cctest/interpreter/bytecode-expectations-printer.cc b/test/cctest/interpreter/bytecode-expectations-printer.cc
index d5e0456511528a13bf0f68c0d81c937fa06e44c8..b4a51c6e3b1693b79f646e476740f3fad774e715 100644
--- a/test/cctest/interpreter/bytecode-expectations-printer.cc
+++ b/test/cctest/interpreter/bytecode-expectations-printer.cc
@@ -13,6 +13,7 @@
#include "src/base/logging.h"
#include "src/base/smart-pointers.h"
#include "src/compiler.h"
+#include "src/runtime/runtime.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-generator.h"
@@ -94,6 +95,12 @@ void BytecodeExpectationsPrinter::PrintEscapedString(
}
}
+namespace {
+i::Runtime::FunctionId IndexToFunctionId(int index) {
+ return static_cast<i::Runtime::FunctionId>(index);
+}
+} // namespace
+
void BytecodeExpectationsPrinter::PrintBytecodeOperand(
std::ostream& stream, const BytecodeArrayIterator& bytecode_iter,
const Bytecode& bytecode, int op_index, int parameter_count) const {
@@ -136,7 +143,12 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand(
} else {
stream << 'U' << size_tag << '(';
- if (Bytecodes::IsImmediateOperandType(op_type)) {
+ if (op_index == 0 && Bytecodes::IsCallRuntime(bytecode)) {
+ DCHECK_EQ(op_type, OperandType::kIdx16);
+ int operand = bytecode_iter.GetIndexOperand(op_index);
+ stream << "Runtime::k"
+ << i::Runtime::FunctionForId(IndexToFunctionId(operand))->name;
+ } else if (Bytecodes::IsImmediateOperandType(op_type)) {
// We need a cast, otherwise the result is printed as char.
stream << static_cast<int>(bytecode_iter.GetImmediateOperand(op_index));
} else if (Bytecodes::IsRegisterCountOperandType(op_type)) {
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698