src/cpu/ppc/vm/vm_version_ppc.cpp

changeset 6511
31e80afe3fed
parent 6495
67fa91961822
child 6515
71a71b0bc844
     1.1 --- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Feb 20 11:05:12 2014 +0100
     1.2 +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Mar 06 10:55:28 2014 -0800
     1.3 @@ -24,7 +24,8 @@
     1.4   */
     1.5  
     1.6  #include "precompiled.hpp"
     1.7 -#include "assembler_ppc.inline.hpp"
     1.8 +#include "asm/assembler.inline.hpp"
     1.9 +#include "asm/macroAssembler.inline.hpp"
    1.10  #include "compiler/disassembler.hpp"
    1.11  #include "memory/resourceArea.hpp"
    1.12  #include "runtime/java.hpp"
    1.13 @@ -168,7 +169,7 @@
    1.14  
    1.15    uint32_t *code = (uint32_t *)a->pc();
    1.16    // Emit code.
    1.17 -  void (*test1)() = (void(*)())(void *)a->emit_fd();
    1.18 +  void (*test1)() = (void(*)())(void *)a->function_entry();
    1.19  
    1.20    Label l1;
    1.21  
    1.22 @@ -242,7 +243,7 @@
    1.23    a->blr();
    1.24  
    1.25    // Emit code.
    1.26 -  void (*test2)() = (void(*)())(void *)a->emit_fd();
    1.27 +  void (*test2)() = (void(*)())(void *)a->function_entry();
    1.28    // uint32_t *code = (uint32_t *)a->pc();
    1.29  
    1.30    Label l2;
    1.31 @@ -383,8 +384,12 @@
    1.32  #endif // COMPILER2
    1.33  
    1.34  void VM_Version::determine_features() {
    1.35 +#if defined(ABI_ELFv2)
    1.36 +  const int code_size = (num_features+1+2*7)*BytesPerInstWord; // TODO(asmundak): calculation is incorrect.
    1.37 +#else
    1.38    // 7 InstWords for each call (function descriptor + blr instruction).
    1.39    const int code_size = (num_features+1+2*7)*BytesPerInstWord;
    1.40 +#endif
    1.41    int features = 0;
    1.42  
    1.43    // create test area
    1.44 @@ -398,7 +403,7 @@
    1.45    MacroAssembler* a = new MacroAssembler(&cb);
    1.46  
    1.47    // Emit code.
    1.48 -  void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->emit_fd();
    1.49 +  void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->function_entry();
    1.50    uint32_t *code = (uint32_t *)a->pc();
    1.51    // Don't use R0 in ldarx.
    1.52    // Keep R3_ARG1 unmodified, it contains &field (see below).
    1.53 @@ -415,7 +420,7 @@
    1.54    a->blr();
    1.55  
    1.56    // Emit function to set one cache line to zero. Emit function descriptor and get pointer to it.
    1.57 -  void (*zero_cacheline_func_ptr)(char*) = (void(*)(char*))(void *)a->emit_fd();
    1.58 +  void (*zero_cacheline_func_ptr)(char*) = (void(*)(char*))(void *)a->function_entry();
    1.59    a->dcbz(R3_ARG1); // R3_ARG1 = addr
    1.60    a->blr();
    1.61  

mercurial