Chromium Code Reviews| Index: src/a64/assembler-a64.cc |
| diff --git a/src/a64/assembler-a64.cc b/src/a64/assembler-a64.cc |
| index fba1be9144fefae3d03ec40a4e2fc2587a62a25a..dc004cf2cc6629677c0ff949942b92481b8fe351 100644 |
| --- a/src/a64/assembler-a64.cc |
| +++ b/src/a64/assembler-a64.cc |
| @@ -1766,23 +1766,32 @@ void Assembler::brk(int code) { |
| void Assembler::debug(const char* message, uint32_t code, Instr params) { |
| #ifdef USE_SIMULATOR |
| - // The arguments to the debug marker need to be contiguous in memory, so make |
| - // sure we don't try to emit a literal pool. |
| - BlockConstPoolScope scope(this); |
| - |
| - Label start; |
| - bind(&start); |
| - |
| - // Refer to instructions-a64.h for a description of the marker and its |
| - // arguments. |
| - hlt(kImmExceptionIsDebug); |
| - ASSERT(SizeOfCodeGeneratedSince(&start) == kDebugCodeOffset); |
| - dc32(code); |
| - ASSERT(SizeOfCodeGeneratedSince(&start) == kDebugParamsOffset); |
| - dc32(params); |
| - ASSERT(SizeOfCodeGeneratedSince(&start) == kDebugMessageOffset); |
| - EmitStringData(message); |
| - hlt(kImmExceptionIsUnreachable); |
| + // Don't generate simulator specific code if we are building a snapshot, which |
| + // might be run on real hardware. |
| + if (!Serializer::enabled()) { |
| +#ifdef DEBUG |
| + Serializer::TooLateToEnableNow(); |
| +#endif |
| + // The arguments to the debug marker need to be contiguous in memory, so |
| + // make sure we don't try to emit a literal pool. |
| + BlockConstPoolScope scope(this); |
| + |
| + Label start; |
| + bind(&start); |
| + |
| + // Refer to instructions-a64.h for a description of the marker and its |
| + // arguments. |
| + hlt(kImmExceptionIsDebug); |
| + ASSERT(SizeOfCodeGeneratedSince(&start) == kDebugCodeOffset); |
| + dc32(code); |
| + ASSERT(SizeOfCodeGeneratedSince(&start) == kDebugParamsOffset); |
| + dc32(params); |
| + ASSERT(SizeOfCodeGeneratedSince(&start) == kDebugMessageOffset); |
| + EmitStringData(message); |
| + hlt(kImmExceptionIsUnreachable); |
| + |
| + return; |
|
Rodolph Perfetta (ARM)
2014/02/10 15:18:19
not necessary.
rmcilroy
2014/02/10 16:18:33
Actually, what I meant to do was fall through to t
|
| + } |
| #else |
| if (params & BREAK) { |
| hlt(kImmExceptionIsDebug); |