Revision: 19992
Author:   [email protected]
Date:     Mon Mar 17 13:32:39 2014 UTC
Log: 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.

[email protected]

Review URL: https://codereview.chromium.org/201613005
http://code.google.com/p/v8/source/detail?r=19992

Modified:
 /branches/bleeding_edge/src/a64/assembler-a64.cc

=======================================
--- /branches/bleeding_edge/src/a64/assembler-a64.cc Fri Mar 14 15:14:42 2014 UTC +++ /branches/bleeding_edge/src/a64/assembler-a64.cc Mon Mar 17 13:32:39 2014 UTC
@@ -616,6 +616,24 @@


 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.

Reply via email to