Reviewers: ulan,
Description:
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.
Please review this at https://codereview.chromium.org/201613005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+18, -0 lines):
M src/a64/assembler-a64.cc
Index: src/a64/assembler-a64.cc
diff --git a/src/a64/assembler-a64.cc b/src/a64/assembler-a64.cc
index
51542b27da0d1cdc5230cc5a6d3f8c149644cdfe..2323214fc49dbc690acdefe5eecf6de5f16be0c4
100644
--- a/src/a64/assembler-a64.cc
+++ b/src/a64/assembler-a64.cc
@@ -616,6 +616,24 @@ bool Assembler::IsConstantPoolAt(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)) {
return instr->ImmLLiteral();
} else {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.