< prev index next >

src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp

Print this page




 242  default:
 243    {
 244       __ add(r0, from(), Interpreter::local_offset_in_bytes(offset()));
 245       __ ldr(temp(), r0);
 246       Label L;
 247       __ cbnz(temp(), L);
 248       __ mov(r0, zr);
 249       __ bind(L);
 250       __ str(r0, Address(to(), _stack_offset));
 251       _stack_offset += wordSize;
 252       _num_int_args++;
 253       break;
 254    }
 255   }
 256 }
 257 
 258 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 259   // generate code to handle arguments
 260   iterate(fingerprint);
 261 























 262   // return result handler
 263   __ lea(r0, ExternalAddress(Interpreter::result_handler(method()->result_type())));
 264   __ ret(lr);
 265 
 266   __ flush();
 267 }
 268 
 269 
 270 // Implementation of SignatureHandlerLibrary
 271 
 272 void SignatureHandlerLibrary::pd_set_handler(address handler) {}
 273 
 274 
 275 class SlowSignatureHandler
 276   : public NativeSignatureIterator {
 277  private:
 278   address   _from;
 279   intptr_t* _to;
 280   intptr_t* _int_args;
 281   intptr_t* _fp_args;


 352       *_to++ = from_obj;
 353       _num_fp_args++;
 354     }
 355   }
 356 
 357  public:
 358   SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to)
 359     : NativeSignatureIterator(method)
 360   {
 361     _from = from;
 362     _to   = to;
 363 
 364     _int_args = to - (method->is_static() ? 16 : 17);
 365     _fp_args =  to - 8;
 366     _fp_identifiers = to - 9;
 367     *(int*) _fp_identifiers = 0;
 368     _num_int_args = (method->is_static() ? 1 : 0);
 369     _num_fp_args = 0;
 370   }
 371 






















 372 };
 373 
 374 
 375 JRT_ENTRY(address,
 376           InterpreterRuntime::slow_signature_handler(JavaThread* thread,
 377                                                      Method* method,
 378                                                      intptr_t* from,
 379                                                      intptr_t* to))
 380   methodHandle m(thread, (Method*)method);
 381   assert(m->is_native(), "sanity check");
 382 
 383   // handle arguments
 384   SlowSignatureHandler ssh(m, (address)from, to);
 385   ssh.iterate(UCONST64(-1));



 386 
 387   // return result handler
 388   return Interpreter::result_handler(m->result_type());
 389 JRT_END


 242  default:
 243    {
 244       __ add(r0, from(), Interpreter::local_offset_in_bytes(offset()));
 245       __ ldr(temp(), r0);
 246       Label L;
 247       __ cbnz(temp(), L);
 248       __ mov(r0, zr);
 249       __ bind(L);
 250       __ str(r0, Address(to(), _stack_offset));
 251       _stack_offset += wordSize;
 252       _num_int_args++;
 253       break;
 254    }
 255   }
 256 }
 257 
 258 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 259   // generate code to handle arguments
 260   iterate(fingerprint);
 261 
 262   // set the call format
 263   // n.b. allow extra 1 for the JNI_Env in c_rarg0
 264   unsigned int call_format = ((_num_int_args + 1) << 6) | (_num_fp_args << 2);
 265 
 266   switch (method()->result_type()) {
 267   case T_VOID:
 268     call_format |= MacroAssembler::ret_type_void;
 269     break;
 270   case T_FLOAT:
 271     call_format |= MacroAssembler::ret_type_float;
 272     break;
 273   case T_DOUBLE:
 274     call_format |= MacroAssembler::ret_type_double;
 275     break;
 276   default:
 277     call_format |= MacroAssembler::ret_type_integral;
 278     break;
 279   }
 280 
 281   // // store the call format in the method
 282   // __ movw(r0, call_format);
 283   // __ str(r0, Address(rmethod, Method::call_format_offset()));
 284 
 285   // return result handler
 286   __ lea(r0, ExternalAddress(Interpreter::result_handler(method()->result_type())));
 287   __ ret(lr);
 288 
 289   __ flush();
 290 }
 291 
 292 
 293 // Implementation of SignatureHandlerLibrary
 294 
 295 void SignatureHandlerLibrary::pd_set_handler(address handler) {}
 296 
 297 
 298 class SlowSignatureHandler
 299   : public NativeSignatureIterator {
 300  private:
 301   address   _from;
 302   intptr_t* _to;
 303   intptr_t* _int_args;
 304   intptr_t* _fp_args;


 375       *_to++ = from_obj;
 376       _num_fp_args++;
 377     }
 378   }
 379 
 380  public:
 381   SlowSignatureHandler(const methodHandle& method, address from, intptr_t* to)
 382     : NativeSignatureIterator(method)
 383   {
 384     _from = from;
 385     _to   = to;
 386 
 387     _int_args = to - (method->is_static() ? 16 : 17);
 388     _fp_args =  to - 8;
 389     _fp_identifiers = to - 9;
 390     *(int*) _fp_identifiers = 0;
 391     _num_int_args = (method->is_static() ? 1 : 0);
 392     _num_fp_args = 0;
 393   }
 394 
 395   // n.b. allow extra 1 for the JNI_Env in c_rarg0
 396   unsigned int get_call_format()
 397   {
 398     unsigned int call_format = ((_num_int_args + 1) << 6) | (_num_fp_args << 2);
 399 
 400     switch (method()->result_type()) {
 401     case T_VOID:
 402       call_format |= MacroAssembler::ret_type_void;
 403       break;
 404     case T_FLOAT:
 405       call_format |= MacroAssembler::ret_type_float;
 406       break;
 407     case T_DOUBLE:
 408       call_format |= MacroAssembler::ret_type_double;
 409       break;
 410     default:
 411       call_format |= MacroAssembler::ret_type_integral;
 412       break;
 413     }
 414 
 415     return call_format;
 416   }
 417 };
 418 
 419 
 420 JRT_ENTRY(address,
 421           InterpreterRuntime::slow_signature_handler(JavaThread* thread,
 422                                                      Method* method,
 423                                                      intptr_t* from,
 424                                                      intptr_t* to))
 425   methodHandle m(thread, (Method*)method);
 426   assert(m->is_native(), "sanity check");
 427 
 428   // handle arguments
 429   SlowSignatureHandler ssh(m, (address)from, to);
 430   ssh.iterate(UCONST64(-1));
 431 
 432   // // set the call format
 433   // method->set_call_format(ssh.get_call_format());
 434 
 435   // return result handler
 436   return Interpreter::result_handler(m->result_type());
 437 JRT_END
< prev index next >