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

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

Issue 2593823002: [cctest] print name instead of context index for CallJSRuntime (Closed)
Patch Set: Created 4 years 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 | « no previous file | test/cctest/interpreter/bytecode_expectations/CallRuntime.golden » ('j') | 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 f7a5bb94670f96da4a29e25cfc2568ffdee0915f..8f34308ee0e839ead35ce31ec9d5726a47f77924 100644
--- a/test/cctest/interpreter/bytecode-expectations-printer.cc
+++ b/test/cctest/interpreter/bytecode-expectations-printer.cc
@@ -25,6 +25,21 @@ namespace v8 {
namespace internal {
namespace interpreter {
+static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) {
+ switch (idx) {
+#define COMPARE_NATIVE_CONTEXT_INTRINSIC_IDX(NAME, Type, name) \
+ case Context::NAME: \
+ return #name;
+
+ NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NATIVE_CONTEXT_INTRINSIC_IDX)
+
+ default:
+ break;
+ }
+
+ return "UnknownIntrinsicIndex";
+}
+
// static
const char* const BytecodeExpectationsPrinter::kDefaultTopFunctionName =
"__genbckexp_wrapper__";
@@ -162,9 +177,15 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand(
case OperandType::kFlag8:
stream << bytecode_iterator.GetFlagOperand(op_index);
break;
- case OperandType::kIdx:
- stream << bytecode_iterator.GetIndexOperand(op_index);
+ case OperandType::kIdx: {
+ uint32_t idx = bytecode_iterator.GetIndexOperand(op_index);
+ if (bytecode == Bytecode::kCallJSRuntime && op_index == 0) {
+ stream << "%" << NameForNativeContextIntrinsicIndex(idx);
+ } else {
+ stream << idx;
+ }
break;
+ }
case OperandType::kUImm:
stream << bytecode_iterator.GetUnsignedImmediateOperand(op_index);
break;
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/CallRuntime.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698