Mercurial > hg > truffle
diff src/cpu/ppc/vm/vm_version_ppc.cpp @ 14684:e5e8aa897002
8035647: PPC64: Support for elf v2 abi.
Summary: ELFv2 ABI used by the little endian PowerPC64 on Linux.
Reviewed-by: kvn
Contributed-by: asmundak@google.com
author | goetz |
---|---|
date | Thu, 06 Mar 2014 10:55:28 -0800 |
parents | 67fa91961822 |
children | 92aa6797d639 71a71b0bc844 |
line wrap: on
line diff
--- a/src/cpu/ppc/vm/vm_version_ppc.cpp Thu Mar 06 02:37:44 2014 -0800 +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp Thu Mar 06 10:55:28 2014 -0800 @@ -24,7 +24,8 @@ */ #include "precompiled.hpp" -#include "assembler_ppc.inline.hpp" +#include "asm/assembler.inline.hpp" +#include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" #include "memory/resourceArea.hpp" #include "runtime/java.hpp" @@ -168,7 +169,7 @@ uint32_t *code = (uint32_t *)a->pc(); // Emit code. - void (*test1)() = (void(*)())(void *)a->emit_fd(); + void (*test1)() = (void(*)())(void *)a->function_entry(); Label l1; @@ -242,7 +243,7 @@ a->blr(); // Emit code. - void (*test2)() = (void(*)())(void *)a->emit_fd(); + void (*test2)() = (void(*)())(void *)a->function_entry(); // uint32_t *code = (uint32_t *)a->pc(); Label l2; @@ -383,8 +384,12 @@ #endif // COMPILER2 void VM_Version::determine_features() { +#if defined(ABI_ELFv2) + const int code_size = (num_features+1+2*7)*BytesPerInstWord; // TODO(asmundak): calculation is incorrect. +#else // 7 InstWords for each call (function descriptor + blr instruction). const int code_size = (num_features+1+2*7)*BytesPerInstWord; +#endif int features = 0; // create test area @@ -398,7 +403,7 @@ MacroAssembler* a = new MacroAssembler(&cb); // Emit code. - void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->emit_fd(); + void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->function_entry(); uint32_t *code = (uint32_t *)a->pc(); // Don't use R0 in ldarx. // Keep R3_ARG1 unmodified, it contains &field (see below). @@ -415,7 +420,7 @@ a->blr(); // Emit function to set one cache line to zero. Emit function descriptor and get pointer to it. - void (*zero_cacheline_func_ptr)(char*) = (void(*)(char*))(void *)a->emit_fd(); + void (*zero_cacheline_func_ptr)(char*) = (void(*)(char*))(void *)a->function_entry(); a->dcbz(R3_ARG1); // R3_ARG1 = addr a->blr();