From a9817c6846f995cc458d963e6e89e35d9d6b9731 Mon Sep 17 00:00:00 2001 From: joransiu Date: Wed, 13 Apr 2016 18:22:20 -0700 Subject: [PATCH] S390:[simulator] Fix int64_t printf + minor cleanup * Use proper int64_t printf format qualifier to fix 64-bit sim compile on Mac. * Minor cleanup to ExecuteInstruction() to remove an unncessary 'processed' variable. R=jyan@ca.ibm.com,mbrandy@us.ibm.com,michael_dawson@ca.ibm.com BUG= Review URL: https://codereview.chromium.org/1889643002 Cr-Commit-Position: refs/heads/master@{#35460} --- src/s390/simulator-s390.cc | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/s390/simulator-s390.cc b/src/s390/simulator-s390.cc index 06e52a7626..bc058ab63e 100644 --- a/src/s390/simulator-s390.cc +++ b/src/s390/simulator-s390.cc @@ -4807,41 +4807,33 @@ void Simulator::ExecuteInstruction(Instruction* instr, bool auto_incr_pc) { if (v8::internal::FLAG_check_icache) { CheckICache(isolate_->simulator_i_cache(), instr); } + pc_modified_ = false; + if (::v8::internal::FLAG_trace_sim) { disasm::NameConverter converter; disasm::Disassembler dasm(converter); // use a reasonably large buffer v8::internal::EmbeddedVector buffer; dasm.InstructionDecode(buffer, reinterpret_cast(instr)); -#ifdef V8_TARGET_ARCH_S390X - PrintF("%05ld %08" V8PRIxPTR " %s\n", icount_, + PrintF("%05" PRId64 " %08" V8PRIxPTR " %s\n", icount_, reinterpret_cast(instr), buffer.start()); -#else - PrintF("%05lld %08" V8PRIxPTR " %s\n", icount_, - reinterpret_cast(instr), buffer.start()); -#endif + // Flush stdout to prevent incomplete file output during abnormal exits // This is caused by the output being buffered before being written to file fflush(stdout); } - // Try to simulate as S390 Instruction first. - bool processed = true; - int instrLength = instr->InstructionLength(); if (instrLength == 2) - processed = DecodeTwoByte(instr); + DecodeTwoByte(instr); else if (instrLength == 4) - processed = DecodeFourByte(instr); - else if (instrLength == 6) - processed = DecodeSixByte(instr); + DecodeFourByte(instr); + else + DecodeSixByte(instr); - if (processed) { - if (!pc_modified_ && auto_incr_pc) { - set_pc(reinterpret_cast(instr) + instrLength); - } - return; + if (!pc_modified_ && auto_incr_pc) { + set_pc(reinterpret_cast(instr) + instrLength); } }