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}
This commit is contained in:
parent
a63185a608
commit
a9817c6846
@ -4807,41 +4807,33 @@ void Simulator::ExecuteInstruction(Instruction* instr, bool auto_incr_pc) {
|
|||||||
if (v8::internal::FLAG_check_icache) {
|
if (v8::internal::FLAG_check_icache) {
|
||||||
CheckICache(isolate_->simulator_i_cache(), instr);
|
CheckICache(isolate_->simulator_i_cache(), instr);
|
||||||
}
|
}
|
||||||
|
|
||||||
pc_modified_ = false;
|
pc_modified_ = false;
|
||||||
|
|
||||||
if (::v8::internal::FLAG_trace_sim) {
|
if (::v8::internal::FLAG_trace_sim) {
|
||||||
disasm::NameConverter converter;
|
disasm::NameConverter converter;
|
||||||
disasm::Disassembler dasm(converter);
|
disasm::Disassembler dasm(converter);
|
||||||
// use a reasonably large buffer
|
// use a reasonably large buffer
|
||||||
v8::internal::EmbeddedVector<char, 256> buffer;
|
v8::internal::EmbeddedVector<char, 256> buffer;
|
||||||
dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
|
dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
|
||||||
#ifdef V8_TARGET_ARCH_S390X
|
PrintF("%05" PRId64 " %08" V8PRIxPTR " %s\n", icount_,
|
||||||
PrintF("%05ld %08" V8PRIxPTR " %s\n", icount_,
|
|
||||||
reinterpret_cast<intptr_t>(instr), buffer.start());
|
reinterpret_cast<intptr_t>(instr), buffer.start());
|
||||||
#else
|
|
||||||
PrintF("%05lld %08" V8PRIxPTR " %s\n", icount_,
|
|
||||||
reinterpret_cast<intptr_t>(instr), buffer.start());
|
|
||||||
#endif
|
|
||||||
// Flush stdout to prevent incomplete file output during abnormal exits
|
// Flush stdout to prevent incomplete file output during abnormal exits
|
||||||
// This is caused by the output being buffered before being written to file
|
// This is caused by the output being buffered before being written to file
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to simulate as S390 Instruction first.
|
|
||||||
bool processed = true;
|
|
||||||
|
|
||||||
int instrLength = instr->InstructionLength();
|
int instrLength = instr->InstructionLength();
|
||||||
if (instrLength == 2)
|
if (instrLength == 2)
|
||||||
processed = DecodeTwoByte(instr);
|
DecodeTwoByte(instr);
|
||||||
else if (instrLength == 4)
|
else if (instrLength == 4)
|
||||||
processed = DecodeFourByte(instr);
|
DecodeFourByte(instr);
|
||||||
else if (instrLength == 6)
|
else
|
||||||
processed = DecodeSixByte(instr);
|
DecodeSixByte(instr);
|
||||||
|
|
||||||
if (processed) {
|
if (!pc_modified_ && auto_incr_pc) {
|
||||||
if (!pc_modified_ && auto_incr_pc) {
|
set_pc(reinterpret_cast<intptr_t>(instr) + instrLength);
|
||||||
set_pc(reinterpret_cast<intptr_t>(instr) + instrLength);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user