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

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

Issue 1684113002: [Interpreter] Handle negative ints in generate-bytecode-expectations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move IsImmediateOperandType. 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/generate-bytecode-expectations.cc
diff --git a/test/cctest/interpreter/generate-bytecode-expectations.cc b/test/cctest/interpreter/generate-bytecode-expectations.cc
index 4fc54e12c91010fae925cd30e6ed9ffe0c95f4a3..de2c74cfa0d58c63e81b6a3568a2592ebd3a8a56 100644
--- a/test/cctest/interpreter/generate-bytecode-expectations.cc
+++ b/test/cctest/interpreter/generate-bytecode-expectations.cc
@@ -146,8 +146,20 @@ void PrintBytecodeOperand(std::ostream& stream,
if (op_size != OperandSize::kByte) stream << size_tag;
stream << '(' << register_value.index() << ')';
} else {
- uint32_t raw_value = bytecode_iter.GetRawOperand(op_index, op_type);
- stream << 'U' << size_tag << '(' << raw_value << ')';
+ stream << 'U' << size_tag << '(';
+
+ 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)) {
+ stream << bytecode_iter.GetCountOperand(op_index);
+ } else if (Bytecodes::IsIndexOperandType(op_type)) {
+ stream << bytecode_iter.GetIndexOperand(op_index);
+ } else {
+ UNREACHABLE();
+ }
+
+ stream << ')';
}
}
« 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