274 break; 275 case 4: 276 __ lea(rax, src); 277 __ xorl(c_rarg5, c_rarg5); 278 __ cmpptr(src, 0); 279 __ cmov(Assembler::notEqual, c_rarg5, rax); 280 _num_int_args++; 281 break; 282 default: 283 __ lea(rax, src); 284 __ xorl(temp(), temp()); 285 __ cmpptr(src, 0); 286 __ cmov(Assembler::notEqual, temp(), rax); 287 __ movptr(Address(to(), _stack_offset), temp()); 288 _stack_offset += wordSize; 289 break; 290 } 291 #endif 292 } 293 294 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) { 295 // generate code to handle arguments 296 iterate(fingerprint); 297 298 // return result handler 299 __ lea(rax, ExternalAddress(Interpreter::result_handler(method()->result_type()))); 300 __ ret(0); 301 302 __ flush(); 303 } 304 305 306 // Implementation of SignatureHandlerLibrary 307 308 void SignatureHandlerLibrary::pd_set_handler(address handler) {} 309 310 311 #ifdef _WIN64 312 class SlowSignatureHandler 313 : public NativeSignatureIterator { 339 if (_num_args < Argument::n_int_register_parameters_c-1) { 340 *_reg_args++ = from_obj; 341 _num_args++; 342 } else { 343 *_to++ = from_obj; 344 } 345 } 346 347 virtual void pass_object() 348 { 349 intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0)); 350 _from -= Interpreter::stackElementSize; 351 if (_num_args < Argument::n_int_register_parameters_c-1) { 352 *_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 353 _num_args++; 354 } else { 355 *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 356 } 357 } 358 359 virtual void pass_float() 360 { 361 jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0)); 362 _from -= Interpreter::stackElementSize; 363 364 if (_num_args < Argument::n_float_register_parameters_c-1) { 365 assert((_num_args*2) < BitsPerWord, "_num_args*2 is out of range"); 366 *_reg_args++ = from_obj; 367 *_fp_identifiers |= ((intptr_t)0x01 << (_num_args*2)); // mark as float 368 _num_args++; 369 } else { 370 *_to++ = from_obj; 371 } 372 } 373 374 virtual void pass_double() 375 { 376 intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); 377 _from -= 2*Interpreter::stackElementSize; 378 432 433 if (_num_int_args < Argument::n_int_register_parameters_c-1) { 434 *_int_args++ = from_obj; 435 _num_int_args++; 436 } else { 437 *_to++ = from_obj; 438 } 439 } 440 441 virtual void pass_object() 442 { 443 intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0)); 444 _from -= Interpreter::stackElementSize; 445 446 if (_num_int_args < Argument::n_int_register_parameters_c-1) { 447 *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr; 448 _num_int_args++; 449 } else { 450 *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 451 } 452 } 453 454 virtual void pass_float() 455 { 456 jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0)); 457 _from -= Interpreter::stackElementSize; 458 459 if (_num_fp_args < Argument::n_float_register_parameters_c) { 460 *_fp_args++ = from_obj; 461 _num_fp_args++; 462 } else { 463 *_to++ = from_obj; 464 } 465 } 466 467 virtual void pass_double() 468 { 469 intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); 470 _from -= 2*Interpreter::stackElementSize; 471 | 274 break; 275 case 4: 276 __ lea(rax, src); 277 __ xorl(c_rarg5, c_rarg5); 278 __ cmpptr(src, 0); 279 __ cmov(Assembler::notEqual, c_rarg5, rax); 280 _num_int_args++; 281 break; 282 default: 283 __ lea(rax, src); 284 __ xorl(temp(), temp()); 285 __ cmpptr(src, 0); 286 __ cmov(Assembler::notEqual, temp(), rax); 287 __ movptr(Address(to(), _stack_offset), temp()); 288 _stack_offset += wordSize; 289 break; 290 } 291 #endif 292 } 293 294 void InterpreterRuntime::SignatureHandlerGenerator::pass_valuetype() { 295 pass_object(); 296 } 297 298 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) { 299 // generate code to handle arguments 300 iterate(fingerprint); 301 302 // return result handler 303 __ lea(rax, ExternalAddress(Interpreter::result_handler(method()->result_type()))); 304 __ ret(0); 305 306 __ flush(); 307 } 308 309 310 // Implementation of SignatureHandlerLibrary 311 312 void SignatureHandlerLibrary::pd_set_handler(address handler) {} 313 314 315 #ifdef _WIN64 316 class SlowSignatureHandler 317 : public NativeSignatureIterator { 343 if (_num_args < Argument::n_int_register_parameters_c-1) { 344 *_reg_args++ = from_obj; 345 _num_args++; 346 } else { 347 *_to++ = from_obj; 348 } 349 } 350 351 virtual void pass_object() 352 { 353 intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0)); 354 _from -= Interpreter::stackElementSize; 355 if (_num_args < Argument::n_int_register_parameters_c-1) { 356 *_reg_args++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 357 _num_args++; 358 } else { 359 *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 360 } 361 } 362 363 virtual void pass_valuetype() { 364 // values are handled with oops, like objects 365 pass_object(); 366 } 367 368 virtual void pass_float() 369 { 370 jint from_obj = *(jint *)(_from+Interpreter::local_offset_in_bytes(0)); 371 _from -= Interpreter::stackElementSize; 372 373 if (_num_args < Argument::n_float_register_parameters_c-1) { 374 assert((_num_args*2) < BitsPerWord, "_num_args*2 is out of range"); 375 *_reg_args++ = from_obj; 376 *_fp_identifiers |= ((intptr_t)0x01 << (_num_args*2)); // mark as float 377 _num_args++; 378 } else { 379 *_to++ = from_obj; 380 } 381 } 382 383 virtual void pass_double() 384 { 385 intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); 386 _from -= 2*Interpreter::stackElementSize; 387 441 442 if (_num_int_args < Argument::n_int_register_parameters_c-1) { 443 *_int_args++ = from_obj; 444 _num_int_args++; 445 } else { 446 *_to++ = from_obj; 447 } 448 } 449 450 virtual void pass_object() 451 { 452 intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0)); 453 _from -= Interpreter::stackElementSize; 454 455 if (_num_int_args < Argument::n_int_register_parameters_c-1) { 456 *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr; 457 _num_int_args++; 458 } else { 459 *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 460 } 461 } 462 463 virtual void pass_valuetype() { 464 // values are handled with oops, like objects 465 pass_object(); 466 } 467 468 virtual void pass_float() 469 { 470 jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0)); 471 _from -= Interpreter::stackElementSize; 472 473 if (_num_fp_args < Argument::n_float_register_parameters_c) { 474 *_fp_args++ = from_obj; 475 _num_fp_args++; 476 } else { 477 *_to++ = from_obj; 478 } 479 } 480 481 virtual void pass_double() 482 { 483 intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); 484 _from -= 2*Interpreter::stackElementSize; 485 |