src/cpu/ppc/vm/macroAssembler_ppc.hpp

changeset 6511
31e80afe3fed
parent 6495
67fa91961822
child 6512
fd1b9f02cc91
     1.1 --- a/src/cpu/ppc/vm/macroAssembler_ppc.hpp	Thu Feb 20 11:05:12 2014 +0100
     1.2 +++ b/src/cpu/ppc/vm/macroAssembler_ppc.hpp	Thu Mar 06 10:55:28 2014 -0800
     1.3 @@ -279,12 +279,12 @@
     1.4    // Push a frame of size `bytes'. No abi space provided.
     1.5    void push_frame(unsigned int bytes, Register tmp);
     1.6  
     1.7 -  // Push a frame of size `bytes' plus abi112 on top.
     1.8 -  void push_frame_abi112(unsigned int bytes, Register tmp);
     1.9 +  // Push a frame of size `bytes' plus abi_reg_args on top.
    1.10 +  void push_frame_reg_args(unsigned int bytes, Register tmp);
    1.11  
    1.12    // Setup up a new C frame with a spill area for non-volatile GPRs and additional
    1.13    // space for local variables
    1.14 -  void push_frame_abi112_nonvolatiles(unsigned int bytes, Register tmp);
    1.15 +  void push_frame_reg_args_nonvolatiles(unsigned int bytes, Register tmp);
    1.16  
    1.17    // pop current C frame
    1.18    void pop_frame();
    1.19 @@ -296,17 +296,31 @@
    1.20   private:
    1.21    address _last_calls_return_pc;
    1.22  
    1.23 +#if defined(ABI_ELFv2)
    1.24 +  // Generic version of a call to C function.
    1.25 +  // Updates and returns _last_calls_return_pc.
    1.26 +  address branch_to(Register function_entry, bool and_link);
    1.27 +#else
    1.28    // Generic version of a call to C function via a function descriptor
    1.29    // with variable support for C calling conventions (TOC, ENV, etc.).
    1.30    // updates and returns _last_calls_return_pc.
    1.31    address branch_to(Register function_descriptor, bool and_link, bool save_toc_before_call,
    1.32                      bool restore_toc_after_call, bool load_toc_of_callee, bool load_env_of_callee);
    1.33 +#endif
    1.34  
    1.35   public:
    1.36  
    1.37    // Get the pc where the last call will return to. returns _last_calls_return_pc.
    1.38    inline address last_calls_return_pc();
    1.39  
    1.40 +#if defined(ABI_ELFv2)
    1.41 +  // Call a C function via a function descriptor and use full C
    1.42 +  // calling conventions. Updates and returns _last_calls_return_pc.
    1.43 +  address call_c(Register function_entry);
    1.44 +  // For tail calls: only branch, don't link, so callee returns to caller of this function.
    1.45 +  address call_c_and_return_to_caller(Register function_entry);
    1.46 +  address call_c(address function_entry, relocInfo::relocType rt);
    1.47 +#else
    1.48    // Call a C function via a function descriptor and use full C
    1.49    // calling conventions. Updates and returns _last_calls_return_pc.
    1.50    address call_c(Register function_descriptor);
    1.51 @@ -315,6 +329,7 @@
    1.52    address call_c(const FunctionDescriptor* function_descriptor, relocInfo::relocType rt);
    1.53    address call_c_using_toc(const FunctionDescriptor* function_descriptor, relocInfo::relocType rt,
    1.54                             Register toc);
    1.55 +#endif
    1.56  
    1.57   protected:
    1.58  
    1.59 @@ -649,6 +664,11 @@
    1.60    void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
    1.61    void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line) {}
    1.62  
    1.63 +  // Convenience method returning function entry. For the ELFv1 case
    1.64 +  // creates function descriptor at the current address and returs
    1.65 +  // the pointer to it. For the ELFv2 case returns the current address.
    1.66 +  inline address function_entry();
    1.67 +
    1.68  #define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__)
    1.69  #define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__)
    1.70  

mercurial