< prev index next >

src/hotspot/cpu/x86/interpreterRT_x86_64.cpp

Print this page




 273     break;
 274   case 4:
 275     __ lea(rax, src);
 276     __ xorl(c_rarg5, c_rarg5);
 277     __ cmpptr(src, 0);
 278     __ cmov(Assembler::notEqual, c_rarg5, rax);
 279     _num_int_args++;
 280     break;
 281   default:
 282     __ lea(rax, src);
 283     __ xorl(temp(), temp());
 284     __ cmpptr(src, 0);
 285     __ cmov(Assembler::notEqual, temp(), rax);
 286     __ movptr(Address(to(), _stack_offset), temp());
 287     _stack_offset += wordSize;
 288     break;
 289   }
 290 #endif
 291 }
 292 




 293 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 294   // generate code to handle arguments
 295   iterate(fingerprint);
 296 
 297   // return result handler
 298   __ lea(rax, ExternalAddress(Interpreter::result_handler(method()->result_type())));
 299   __ ret(0);
 300 
 301   __ flush();
 302 }
 303 
 304 
 305 // Implementation of SignatureHandlerLibrary
 306 
 307 void SignatureHandlerLibrary::pd_set_handler(address handler) {}
 308 
 309 
 310 #ifdef _WIN64
 311 class SlowSignatureHandler
 312   : public NativeSignatureIterator {


 338     if (_num_args < Argument::n_int_register_parameters_c-1) {
 339       *_reg_args++ = from_obj;
 340       _num_args++;
 341     } else {
 342       *_to++ = from_obj;
 343     }
 344   }
 345 
 346   virtual void pass_object()
 347   {
 348     intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
 349     _from -= Interpreter::stackElementSize;
 350     if (_num_args < Argument::n_int_register_parameters_c-1) {
 351       *_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 352       _num_args++;
 353     } else {
 354       *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 355     }
 356   }
 357 





 358   virtual void pass_float()
 359   {
 360     jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
 361     _from -= Interpreter::stackElementSize;
 362 
 363     if (_num_args < Argument::n_float_register_parameters_c-1) {
 364       assert((_num_args*2) < BitsPerWord, "_num_args*2 is out of range");
 365       *_reg_args++ = from_obj;
 366       *_fp_identifiers |= ((intptr_t)0x01 << (_num_args*2)); // mark as float
 367       _num_args++;
 368     } else {
 369       *_to++ = from_obj;
 370     }
 371   }
 372 
 373   virtual void pass_double()
 374   {
 375     intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
 376     _from -= 2*Interpreter::stackElementSize;
 377 


 431 
 432     if (_num_int_args < Argument::n_int_register_parameters_c-1) {
 433       *_int_args++ = from_obj;
 434       _num_int_args++;
 435     } else {
 436       *_to++ = from_obj;
 437     }
 438   }
 439 
 440   virtual void pass_object()
 441   {
 442     intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
 443     _from -= Interpreter::stackElementSize;
 444 
 445     if (_num_int_args < Argument::n_int_register_parameters_c-1) {
 446       *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
 447       _num_int_args++;
 448     } else {
 449       *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 450     }





 451   }
 452 
 453   virtual void pass_float()
 454   {
 455     jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0));
 456     _from -= Interpreter::stackElementSize;
 457 
 458     if (_num_fp_args < Argument::n_float_register_parameters_c) {
 459       *_fp_args++ = from_obj;
 460       _num_fp_args++;
 461     } else {
 462       *_to++ = from_obj;
 463     }
 464   }
 465 
 466   virtual void pass_double()
 467   {
 468     intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
 469     _from -= 2*Interpreter::stackElementSize;
 470 




 273     break;
 274   case 4:
 275     __ lea(rax, src);
 276     __ xorl(c_rarg5, c_rarg5);
 277     __ cmpptr(src, 0);
 278     __ cmov(Assembler::notEqual, c_rarg5, rax);
 279     _num_int_args++;
 280     break;
 281   default:
 282     __ lea(rax, src);
 283     __ xorl(temp(), temp());
 284     __ cmpptr(src, 0);
 285     __ cmov(Assembler::notEqual, temp(), rax);
 286     __ movptr(Address(to(), _stack_offset), temp());
 287     _stack_offset += wordSize;
 288     break;
 289   }
 290 #endif
 291 }
 292 
 293 void InterpreterRuntime::SignatureHandlerGenerator::pass_valuetype() {
 294   pass_object();
 295 }
 296 
 297 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 298   // generate code to handle arguments
 299   iterate(fingerprint);
 300 
 301   // return result handler
 302   __ lea(rax, ExternalAddress(Interpreter::result_handler(method()->result_type())));
 303   __ ret(0);
 304 
 305   __ flush();
 306 }
 307 
 308 
 309 // Implementation of SignatureHandlerLibrary
 310 
 311 void SignatureHandlerLibrary::pd_set_handler(address handler) {}
 312 
 313 
 314 #ifdef _WIN64
 315 class SlowSignatureHandler
 316   : public NativeSignatureIterator {


 342     if (_num_args < Argument::n_int_register_parameters_c-1) {
 343       *_reg_args++ = from_obj;
 344       _num_args++;
 345     } else {
 346       *_to++ = from_obj;
 347     }
 348   }
 349 
 350   virtual void pass_object()
 351   {
 352     intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
 353     _from -= Interpreter::stackElementSize;
 354     if (_num_args < Argument::n_int_register_parameters_c-1) {
 355       *_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 356       _num_args++;
 357     } else {
 358       *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 359     }
 360   }
 361 
 362   virtual void pass_valuetype() {
 363     // values are handled with oops, like objects
 364     pass_object();
 365   }
 366 
 367   virtual void pass_float()
 368   {
 369     jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
 370     _from -= Interpreter::stackElementSize;
 371 
 372     if (_num_args < Argument::n_float_register_parameters_c-1) {
 373       assert((_num_args*2) < BitsPerWord, "_num_args*2 is out of range");
 374       *_reg_args++ = from_obj;
 375       *_fp_identifiers |= ((intptr_t)0x01 << (_num_args*2)); // mark as float
 376       _num_args++;
 377     } else {
 378       *_to++ = from_obj;
 379     }
 380   }
 381 
 382   virtual void pass_double()
 383   {
 384     intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
 385     _from -= 2*Interpreter::stackElementSize;
 386 


 440 
 441     if (_num_int_args < Argument::n_int_register_parameters_c-1) {
 442       *_int_args++ = from_obj;
 443       _num_int_args++;
 444     } else {
 445       *_to++ = from_obj;
 446     }
 447   }
 448 
 449   virtual void pass_object()
 450   {
 451     intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
 452     _from -= Interpreter::stackElementSize;
 453 
 454     if (_num_int_args < Argument::n_int_register_parameters_c-1) {
 455       *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
 456       _num_int_args++;
 457     } else {
 458       *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 459     }
 460   }
 461 
 462   virtual void pass_valuetype() {
 463     // values are handled with oops, like objects
 464     pass_object();
 465   }
 466 
 467   virtual void pass_float()
 468   {
 469     jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0));
 470     _from -= Interpreter::stackElementSize;
 471 
 472     if (_num_fp_args < Argument::n_float_register_parameters_c) {
 473       *_fp_args++ = from_obj;
 474       _num_fp_args++;
 475     } else {
 476       *_to++ = from_obj;
 477     }
 478   }
 479 
 480   virtual void pass_double()
 481   {
 482     intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
 483     _from -= 2*Interpreter::stackElementSize;
 484 


< prev index next >