Better handling of constant-pool-like parts of the instruction stream.

This avoids e.g. trying to disassemble those parts, which could result
in failed assertions.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/201613005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19992 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3550e936
...@@ -616,6 +616,24 @@ bool Assembler::IsConstantPoolAt(Instruction* instr) { ...@@ -616,6 +616,24 @@ bool Assembler::IsConstantPoolAt(Instruction* instr) {
int Assembler::ConstantPoolSizeAt(Instruction* instr) { int Assembler::ConstantPoolSizeAt(Instruction* instr) {
#ifdef USE_SIMULATOR
// Assembler::debug() embeds constants directly into the instruction stream.
// Although this is not a genuine constant pool, treat it like one to avoid
// disassembling the constants.
if ((instr->Mask(ExceptionMask) == HLT) &&
(instr->ImmException() == kImmExceptionIsDebug)) {
const char* message =
reinterpret_cast<const char*>(
instr->InstructionAtOffset(kDebugMessageOffset));
int size = kDebugMessageOffset + strlen(message) + 1;
return RoundUp(size, kInstructionSize) / kInstructionSize;
}
// Same for printf support, see MacroAssembler::CallPrintf().
if ((instr->Mask(ExceptionMask) == HLT) &&
(instr->ImmException() == kImmExceptionIsPrintf)) {
return kPrintfLength / kInstructionSize;
}
#endif
if (IsConstantPoolAt(instr)) { if (IsConstantPoolAt(instr)) {
return instr->ImmLLiteral(); return instr->ImmLLiteral();
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment