diff options
Diffstat (limited to 'Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp')
-rw-r--r-- | Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp b/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp index b0a9bf074..a6f3e65c0 100644 --- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp +++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, 2014 Apple Inc. + * Copyright (C) 2013 Apple Inc. * Copyright (C) 2009 University of Szeged * All rights reserved. * @@ -31,6 +31,10 @@ #include "MacroAssemblerARM.h" +#if USE(MASM_PROBE) +#include <wtf/StdLibExtras.h> +#endif + #if OS(LINUX) #include <sys/types.h> #include <sys/stat.h> @@ -46,7 +50,7 @@ static bool isVFPPresent() { #if OS(LINUX) int fd = open("/proc/self/auxv", O_RDONLY); - if (fd != -1) { + if (fd > 0) { Elf32_auxv_t aux; while (read(fd, &aux, sizeof(Elf32_auxv_t))) { if (aux.a_type == AT_HWCAP) { @@ -58,7 +62,7 @@ static bool isVFPPresent() } #endif // OS(LINUX) -#if (COMPILER(GCC_OR_CLANG) && defined(__VFP_FP__)) +#if (COMPILER(GCC) && defined(__VFP_FP__)) return true; #else return false; @@ -95,58 +99,51 @@ void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, Register } #endif // CPU(ARMV5_OR_LOWER) -#if ENABLE(MASM_PROBE) - -#define INDENT printIndent(indentation) +#if USE(MASM_PROBE) -void MacroAssemblerARM::printCPURegisters(CPUState& cpu, int indentation) +void MacroAssemblerARM::ProbeContext::dumpCPURegisters(const char* indentation) { - #define PRINT_GPREGISTER(_type, _regName) { \ + #define DUMP_GPREGISTER(_type, _regName) { \ int32_t value = reinterpret_cast<int32_t>(cpu._regName); \ - INDENT, dataLogF("%5s: 0x%08x %d\n", #_regName, value, value) ; \ + dataLogF("%s %5s: 0x%08x %d\n", indentation, #_regName, value, value) ; \ } - FOR_EACH_CPU_GPREGISTER(PRINT_GPREGISTER) - FOR_EACH_CPU_SPECIAL_REGISTER(PRINT_GPREGISTER) - #undef PRINT_GPREGISTER + FOR_EACH_CPU_GPREGISTER(DUMP_GPREGISTER) + FOR_EACH_CPU_SPECIAL_REGISTER(DUMP_GPREGISTER) + #undef DUMP_GPREGISTER - #define PRINT_FPREGISTER(_type, _regName) { \ - uint64_t* u = reinterpret_cast<uint64_t*>(&cpu._regName); \ + #define DUMP_FPREGISTER(_type, _regName) { \ + uint32_t* u = reinterpret_cast<uint32_t*>(&cpu._regName); \ double* d = reinterpret_cast<double*>(&cpu._regName); \ - INDENT, dataLogF("%5s: 0x%016llx %.13g\n", #_regName, *u, *d); \ + dataLogF("%s %5s: 0x %08x %08x %12g\n", \ + indentation, #_regName, u[1], u[0], d[0]); \ } - FOR_EACH_CPU_FPREGISTER(PRINT_FPREGISTER) - #undef PRINT_FPREGISTER + FOR_EACH_CPU_FPREGISTER(DUMP_FPREGISTER) + #undef DUMP_FPREGISTER } -#undef INDENT - -void MacroAssemblerARM::printRegister(MacroAssemblerARM::CPUState& cpu, RegisterID regID) +void MacroAssemblerARM::ProbeContext::dump(const char* indentation) { - const char* name = CPUState::registerName(regID); - union { - void* voidPtr; - intptr_t intptrValue; - } u; - u.voidPtr = cpu.registerValue(regID); - dataLogF("%s:<%p %ld>", name, u.voidPtr, u.intptrValue); -} + if (!indentation) + indentation = ""; -void MacroAssemblerARM::printRegister(MacroAssemblerARM::CPUState& cpu, FPRegisterID regID) -{ - const char* name = CPUState::registerName(regID); - union { - double doubleValue; - uint64_t uint64Value; - } u; - u.doubleValue = cpu.registerValue(regID); - dataLogF("%s:<0x%016llx %.13g>", name, u.uint64Value, u.doubleValue); + dataLogF("%sProbeContext %p {\n", indentation, this); + dataLogF("%s probeFunction: %p\n", indentation, probeFunction); + dataLogF("%s arg1: %p %llu\n", indentation, arg1, reinterpret_cast<int64_t>(arg1)); + dataLogF("%s arg2: %p %llu\n", indentation, arg2, reinterpret_cast<int64_t>(arg2)); + dataLogF("%s cpu: {\n", indentation); + + dumpCPURegisters(indentation); + + dataLogF("%s }\n", indentation); + dataLogF("%s}\n", indentation); } + extern "C" void ctiMasmProbeTrampoline(); // For details on "What code is emitted for the probe?" and "What values are in -// the saved registers?", see comment for MacroAssemblerX86Common::probe() in -// MacroAssemblerX86Common.cpp. +// the saved registers?", see comment for MacroAssemblerX86::probe() in +// MacroAssemblerX86_64.h. void MacroAssemblerARM::probe(MacroAssemblerARM::ProbeFunction function, void* arg1, void* arg2) { @@ -163,7 +160,7 @@ void MacroAssemblerARM::probe(MacroAssemblerARM::ProbeFunction function, void* a m_assembler.blx(RegisterID::S0); } -#endif // ENABLE(MASM_PROBE) +#endif // USE(MASM_PROBE) } // namespace JSC |