< prev index next >

src/share/vm/code/vmreg.hpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CODE_VMREG_HPP
  26 #define SHARE_VM_CODE_VMREG_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/globalDefinitions.hpp"
  30 #include "asm/register.hpp"
  31 
  32 #ifdef COMPILER2
  33 #include "opto/adlcVMDeps.hpp"
  34 #include "utilities/ostream.hpp"
  35 #if defined ADGLOBALS_MD_HPP
  36 # include ADGLOBALS_MD_HPP
  37 #elif defined TARGET_ARCH_MODEL_x86_32
  38 # include "adfiles/adGlobals_x86_32.hpp"
  39 #elif defined TARGET_ARCH_MODEL_x86_64
  40 # include "adfiles/adGlobals_x86_64.hpp"


  41 #elif defined TARGET_ARCH_MODEL_sparc
  42 # include "adfiles/adGlobals_sparc.hpp"
  43 #elif defined TARGET_ARCH_MODEL_zero
  44 # include "adfiles/adGlobals_zero.hpp"
  45 #elif defined TARGET_ARCH_MODEL_ppc_64
  46 # include "adfiles/adGlobals_ppc_64.hpp"
  47 #endif
  48 #endif
  49 
  50 //------------------------------VMReg------------------------------------------
  51 // The VM uses 'unwarped' stack slots; the compiler uses 'warped' stack slots.
  52 // Register numbers below VMRegImpl::stack0 are the same for both.  Register
  53 // numbers above stack0 are either warped (in the compiler) or unwarped
  54 // (in the VM).  Unwarped numbers represent stack indices, offsets from
  55 // the current stack pointer.  Warped numbers are required during compilation
  56 // when we do not yet know how big the frame will be.
  57 
  58 class VMRegImpl;
  59 typedef VMRegImpl* VMReg;
  60 


 138     // VMReg res = VMRegImpl::as_VMReg(value() + offset);
 139     VMReg res = stack2reg(reg2stack() + offset);
 140     assert(res->is_stack(), "must be");
 141     return res;
 142   }
 143 
 144   // Convert register numbers to stack slots and vice versa
 145   static VMReg stack2reg( int idx ) {
 146     return (VMReg) (intptr_t) (stack0->value() + idx);
 147   }
 148 
 149   uintptr_t reg2stack() {
 150     assert( is_stack(), "Not a stack-based register" );
 151     return value() - stack0->value();
 152   }
 153 
 154   static void set_regName();
 155 
 156 #ifdef TARGET_ARCH_x86
 157 # include "vmreg_x86.hpp"



 158 #endif
 159 #ifdef TARGET_ARCH_sparc
 160 # include "vmreg_sparc.hpp"
 161 #endif
 162 #ifdef TARGET_ARCH_zero
 163 # include "vmreg_zero.hpp"
 164 #endif
 165 #ifdef TARGET_ARCH_arm
 166 # include "vmreg_arm.hpp"
 167 #endif
 168 #ifdef TARGET_ARCH_ppc
 169 # include "vmreg_ppc.hpp"
 170 #endif
 171 
 172 
 173 };
 174 
 175 //---------------------------VMRegPair-------------------------------------------
 176 // Pairs of 32-bit registers for arguments.
 177 // SharedRuntime::java_calling_convention will overwrite the structs with




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CODE_VMREG_HPP
  26 #define SHARE_VM_CODE_VMREG_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/globalDefinitions.hpp"
  30 #include "asm/register.hpp"
  31 
  32 #ifdef COMPILER2
  33 #include "opto/adlcVMDeps.hpp"
  34 #include "utilities/ostream.hpp"
  35 #if defined ADGLOBALS_MD_HPP
  36 # include ADGLOBALS_MD_HPP
  37 #elif defined TARGET_ARCH_MODEL_x86_32
  38 # include "adfiles/adGlobals_x86_32.hpp"
  39 #elif defined TARGET_ARCH_MODEL_x86_64
  40 # include "adfiles/adGlobals_x86_64.hpp"
  41 #elif defined TARGET_ARCH_MODEL_aarch64
  42 # include "adfiles/adGlobals_aarch64.hpp"
  43 #elif defined TARGET_ARCH_MODEL_sparc
  44 # include "adfiles/adGlobals_sparc.hpp"
  45 #elif defined TARGET_ARCH_MODEL_zero
  46 # include "adfiles/adGlobals_zero.hpp"
  47 #elif defined TARGET_ARCH_MODEL_ppc_64
  48 # include "adfiles/adGlobals_ppc_64.hpp"
  49 #endif
  50 #endif
  51 
  52 //------------------------------VMReg------------------------------------------
  53 // The VM uses 'unwarped' stack slots; the compiler uses 'warped' stack slots.
  54 // Register numbers below VMRegImpl::stack0 are the same for both.  Register
  55 // numbers above stack0 are either warped (in the compiler) or unwarped
  56 // (in the VM).  Unwarped numbers represent stack indices, offsets from
  57 // the current stack pointer.  Warped numbers are required during compilation
  58 // when we do not yet know how big the frame will be.
  59 
  60 class VMRegImpl;
  61 typedef VMRegImpl* VMReg;
  62 


 140     // VMReg res = VMRegImpl::as_VMReg(value() + offset);
 141     VMReg res = stack2reg(reg2stack() + offset);
 142     assert(res->is_stack(), "must be");
 143     return res;
 144   }
 145 
 146   // Convert register numbers to stack slots and vice versa
 147   static VMReg stack2reg( int idx ) {
 148     return (VMReg) (intptr_t) (stack0->value() + idx);
 149   }
 150 
 151   uintptr_t reg2stack() {
 152     assert( is_stack(), "Not a stack-based register" );
 153     return value() - stack0->value();
 154   }
 155 
 156   static void set_regName();
 157 
 158 #ifdef TARGET_ARCH_x86
 159 # include "vmreg_x86.hpp"
 160 #endif
 161 #ifdef TARGET_ARCH_aarch64
 162 # include "vmreg_aarch64.hpp"
 163 #endif
 164 #ifdef TARGET_ARCH_sparc
 165 # include "vmreg_sparc.hpp"
 166 #endif
 167 #ifdef TARGET_ARCH_zero
 168 # include "vmreg_zero.hpp"
 169 #endif
 170 #ifdef TARGET_ARCH_arm
 171 # include "vmreg_arm.hpp"
 172 #endif
 173 #ifdef TARGET_ARCH_ppc
 174 # include "vmreg_ppc.hpp"
 175 #endif
 176 
 177 
 178 };
 179 
 180 //---------------------------VMRegPair-------------------------------------------
 181 // Pairs of 32-bit registers for arguments.
 182 // SharedRuntime::java_calling_convention will overwrite the structs with


< prev index next >