X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..refs/heads/master:/assembler/LinkBuffer.cpp diff --git a/assembler/LinkBuffer.cpp b/assembler/LinkBuffer.cpp index a66541d..d53ef45 100644 --- a/assembler/LinkBuffer.cpp +++ b/assembler/LinkBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013, 2014 Apple Inc. All rights reserved. + * Copyright (C) 2012-2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -59,19 +59,28 @@ LinkBuffer::CodeRef LinkBuffer::finalizeCodeWithDisassembly(const char* format, { CodeRef result = finalizeCodeWithoutDisassembly(); -#if ENABLE(DISASSEMBLER) - dataLogF("Generated JIT code for "); + if (m_alreadyDisassembled) + return result; + + StringPrintStream out; + out.printf("Generated JIT code for "); va_list argList; va_start(argList, format); - WTF::dataLogFV(format, argList); + out.vprintf(format, argList); va_end(argList); - dataLogF(":\n"); + out.printf(":\n"); + + out.printf(" Code at [%p, %p):\n", result.code().executableAddress(), static_cast(result.code().executableAddress()) + result.size()); + + CString header = out.toCString(); - dataLogF(" Code at [%p, %p):\n", result.code().executableAddress(), static_cast(result.code().executableAddress()) + result.size()); + if (Options::asyncDisassembly()) { + disassembleAsynchronously(header, result, m_size, " "); + return result; + } + + dataLog(header); disassemble(result.code(), m_size, " ", WTF::dataFile()); -#else - UNUSED_PARAM(format); -#endif // ENABLE(DISASSEMBLER) return result; }