< prev index next >

src/hotspot/share/code/vmreg.hpp

Print this page

124   VMReg bias(int offset) {
125     assert(is_stack(), "must be");
126     // VMReg res = VMRegImpl::as_VMReg(value() + offset);
127     VMReg res = stack2reg(reg2stack() + offset);
128     assert(res->is_stack(), "must be");
129     return res;
130   }
131 
132   // Convert register numbers to stack slots and vice versa
133   static VMReg stack2reg( int idx ) {
134     return (VMReg) (intptr_t) (stack0->value() + idx);
135   }
136 
137   uintptr_t reg2stack() {
138     assert( is_stack(), "Not a stack-based register" );
139     return value() - stack0->value();
140   }
141 
142   static void set_regName();
143 
144   static VMReg vmStorageToVMReg(int type, int index);
145 
146 #include CPU_HEADER(vmreg)
147 
148 };
149 
150 //---------------------------VMRegPair-------------------------------------------
151 // Pairs of 32-bit registers for arguments.
152 // SharedRuntime::java_calling_convention will overwrite the structs with
153 // the calling convention's registers.  VMRegImpl::Bad is returned for any
154 // unused 32-bit register.  This happens for the unused high half of Int
155 // arguments, or for 32-bit pointers or for longs in the 32-bit sparc build
156 // (which are passed to natives in low 32-bits of e.g. O0/O1 and the high
157 // 32-bits of O0/O1 are set to VMRegImpl::Bad).  Longs in one register & doubles
158 // always return a high and a low register, as do 64-bit pointers.
159 //
160 class VMRegPair {
161 private:
162   VMReg _second;
163   VMReg _first;
164 public:
165   void set_bad (                   ) { _second=VMRegImpl::Bad(); _first=VMRegImpl::Bad(); }

124   VMReg bias(int offset) {
125     assert(is_stack(), "must be");
126     // VMReg res = VMRegImpl::as_VMReg(value() + offset);
127     VMReg res = stack2reg(reg2stack() + offset);
128     assert(res->is_stack(), "must be");
129     return res;
130   }
131 
132   // Convert register numbers to stack slots and vice versa
133   static VMReg stack2reg( int idx ) {
134     return (VMReg) (intptr_t) (stack0->value() + idx);
135   }
136 
137   uintptr_t reg2stack() {
138     assert( is_stack(), "Not a stack-based register" );
139     return value() - stack0->value();
140   }
141 
142   static void set_regName();
143 


144 #include CPU_HEADER(vmreg)
145 
146 };
147 
148 //---------------------------VMRegPair-------------------------------------------
149 // Pairs of 32-bit registers for arguments.
150 // SharedRuntime::java_calling_convention will overwrite the structs with
151 // the calling convention's registers.  VMRegImpl::Bad is returned for any
152 // unused 32-bit register.  This happens for the unused high half of Int
153 // arguments, or for 32-bit pointers or for longs in the 32-bit sparc build
154 // (which are passed to natives in low 32-bits of e.g. O0/O1 and the high
155 // 32-bits of O0/O1 are set to VMRegImpl::Bad).  Longs in one register & doubles
156 // always return a high and a low register, as do 64-bit pointers.
157 //
158 class VMRegPair {
159 private:
160   VMReg _second;
161   VMReg _first;
162 public:
163   void set_bad (                   ) { _second=VMRegImpl::Bad(); _first=VMRegImpl::Bad(); }
< prev index next >