# HG changeset patch # User simonis # Date 1432050025 -7200 # Tue May 19 17:40:25 2015 +0200 # Node ID 3b62ff8fa9a53e0fe16b167d75b4bca2338c8f9d # Parent 4140f485ba2741521cf0596b5f8d7c4e9b195459 8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc" diff --git a/src/cpu/ppc/vm/assembler_ppc.hpp b/src/cpu/ppc/vm/assembler_ppc.hpp --- a/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/src/cpu/ppc/vm/assembler_ppc.hpp @@ -1134,15 +1134,15 @@ // Emit an address. inline address emit_addr(const address addr = NULL); -#if !defined(ABI_ELFv2) // Emit a function descriptor with the specified entry point, TOC, // and ENV. If the entry point is NULL, the descriptor will point // just past the descriptor. // Use values from friend functions as defaults. + // If we are running in a little-endian environment (i.e. if ABI_ELFv2 is + // defined) this function will emit no code and simply return the current PC) inline address emit_fd(address entry = NULL, address toc = (address) FunctionDescriptor::friend_toc, address env = (address) FunctionDescriptor::friend_env); -#endif ///////////////////////////////////////////////////////////////////////////////////// // PPC instructions diff --git a/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/src/cpu/ppc/vm/assembler_ppc.inline.hpp --- a/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -55,13 +55,15 @@ return start; } -#if !defined(ABI_ELFv2) // Emit a function descriptor with the specified entry point, TOC, and // ENV. If the entry point is NULL, the descriptor will point just // past the descriptor. +// If we are running in a little-endian environment (i.e. if ABI_ELFv2 is +// defined) this function will emit no code and simply return the current PC) inline address Assembler::emit_fd(address entry, address toc, address env) { FunctionDescriptor* fd = (FunctionDescriptor*)pc(); +#if !defined(ABI_ELFv2) assert(sizeof(FunctionDescriptor) == 3*sizeof(address), "function descriptor size"); (void)emit_addr(); @@ -71,10 +73,10 @@ fd->set_entry(entry == NULL ? pc() : entry); fd->set_toc(toc); fd->set_env(env); +#endif return (address)fd; } -#endif // Issue an illegal instruction. 0 is guaranteed to be an illegal instruction. inline void Assembler::illtrap() { Assembler::emit_int32(0); } diff --git a/src/cpu/ppc/vm/interpreterRT_ppc.cpp b/src/cpu/ppc/vm/interpreterRT_ppc.cpp --- a/src/cpu/ppc/vm/interpreterRT_ppc.cpp +++ b/src/cpu/ppc/vm/interpreterRT_ppc.cpp @@ -110,10 +110,8 @@ } void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) { -#if !defined(ABI_ELFv2) // Emit fd for current codebuffer. Needs patching! __ emit_fd(); -#endif // Generate code to handle arguments. iterate(fingerprint); diff --git a/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp --- a/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp +++ b/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp @@ -423,10 +423,6 @@ twi(traptoEqual | traptoGreaterThanUnsigned, a/*reg a*/, si16); } -#if defined(ABI_ELFv2) -inline address MacroAssembler::function_entry() { return pc(); } -#else inline address MacroAssembler::function_entry() { return emit_fd(); } -#endif #endif // CPU_PPC_VM_MACROASSEMBLER_PPC_INLINE_HPP