204 __ push_oop(const_opr->as_jobject());
205 } else if (const_opr->type() == T_INT) {
206 __ push_jint(const_opr->as_jint());
207 } else {
208 ShouldNotReachHere();
209 }
210
211 } else {
212 ShouldNotReachHere();
213 }
214 }
215
216 void LIR_Assembler::pop(LIR_Opr opr) {
217 if (opr->is_single_cpu()) {
218 __ pop_reg(opr->as_register());
219 } else {
220 ShouldNotReachHere();
221 }
222 }
223
224 bool LIR_Assembler::is_literal_address(LIR_Address* addr) {
225 return addr->base()->is_illegal() && addr->index()->is_illegal();
226 }
227
228 //-------------------------------------------
229
230 Address LIR_Assembler::as_Address(LIR_Address* addr) {
231 return as_Address(addr, rscratch1);
232 }
233
234 Address LIR_Assembler::as_Address(LIR_Address* addr, Register tmp) {
235 if (addr->base()->is_illegal()) {
236 assert(addr->index()->is_illegal(), "must be illegal too");
237 AddressLiteral laddr((address)addr->disp(), relocInfo::none);
238 if (! __ reachable(laddr)) {
239 __ movptr(tmp, laddr.addr());
240 Address res(tmp, 0);
241 return res;
242 } else {
243 return __ as_Address(laddr);
|
204 __ push_oop(const_opr->as_jobject());
205 } else if (const_opr->type() == T_INT) {
206 __ push_jint(const_opr->as_jint());
207 } else {
208 ShouldNotReachHere();
209 }
210
211 } else {
212 ShouldNotReachHere();
213 }
214 }
215
216 void LIR_Assembler::pop(LIR_Opr opr) {
217 if (opr->is_single_cpu()) {
218 __ pop_reg(opr->as_register());
219 } else {
220 ShouldNotReachHere();
221 }
222 }
223
224 void LIR_Assembler::getfp(LIR_Opr opr) {
225 __ lea(opr->as_register_lo(), Address(rsp, initial_frame_size_in_bytes() + wordSize)); // + wordSize seems to be required to handle the push rbp before the sub of rsp
226 }
227
228 void LIR_Assembler::getsp(LIR_Opr opr) {
229 __ movptr(opr->as_register_lo(), rsp);
230 }
231
232 #if 0
233 void LIR_Assembler::getpc(LIR_Opr opr) {
234 const char *name + "cont_getPC";
235 address entry = StubRoutines::cont_getPC();
236 __ call_VM_leaf(entry, 0);
237 __ movptr(opr->as_register_lo(), rax);
238 }
239 #endif
240
241 bool LIR_Assembler::is_literal_address(LIR_Address* addr) {
242 return addr->base()->is_illegal() && addr->index()->is_illegal();
243 }
244
245 //-------------------------------------------
246
247 Address LIR_Assembler::as_Address(LIR_Address* addr) {
248 return as_Address(addr, rscratch1);
249 }
250
251 Address LIR_Assembler::as_Address(LIR_Address* addr, Register tmp) {
252 if (addr->base()->is_illegal()) {
253 assert(addr->index()->is_illegal(), "must be illegal too");
254 AddressLiteral laddr((address)addr->disp(), relocInfo::none);
255 if (! __ reachable(laddr)) {
256 __ movptr(tmp, laddr.addr());
257 Address res(tmp, 0);
258 return res;
259 } else {
260 return __ as_Address(laddr);
|