< prev index next >

src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp

Print this page
rev 53735 : AArch64 support for ValueTypes


 239       __ bind(L);
 240       _num_int_args++;
 241       break;
 242     }
 243  default:
 244    {
 245       __ add(r0, from(), Interpreter::local_offset_in_bytes(offset()));
 246       __ ldr(temp(), r0);
 247       Label L;
 248       __ cbnz(temp(), L);
 249       __ mov(r0, zr);
 250       __ bind(L);
 251       __ str(r0, Address(to(), _stack_offset));
 252       _stack_offset += wordSize;
 253       _num_int_args++;
 254       break;
 255    }
 256   }
 257 }
 258 




 259 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 260   // generate code to handle arguments
 261   iterate(fingerprint);
 262 
 263   // set the call format
 264   // n.b. allow extra 1 for the JNI_Env in c_rarg0
 265   unsigned int call_format = ((_num_int_args + 1) << 6) | (_num_fp_args << 2);
 266 
 267   switch (method()->result_type()) {
 268   case T_VOID:
 269     call_format |= MacroAssembler::ret_type_void;
 270     break;
 271   case T_FLOAT:
 272     call_format |= MacroAssembler::ret_type_float;
 273     break;
 274   case T_DOUBLE:
 275     call_format |= MacroAssembler::ret_type_double;
 276     break;
 277   default:
 278     call_format |= MacroAssembler::ret_type_integral;


 330       *_int_args++ = from_obj;
 331       _num_int_args++;
 332     } else {
 333       *_to++ = from_obj;
 334       _num_int_args++;
 335     }
 336   }
 337 
 338   virtual void pass_object()
 339   {
 340     intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
 341     _from -= Interpreter::stackElementSize;
 342 
 343     if (_num_int_args < Argument::n_int_register_parameters_c-1) {
 344       *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
 345       _num_int_args++;
 346     } else {
 347       *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 348       _num_int_args++;
 349     }





 350   }
 351 
 352   virtual void pass_float()
 353   {
 354     jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0));
 355     _from -= Interpreter::stackElementSize;
 356 
 357     if (_num_fp_args < Argument::n_float_register_parameters_c) {
 358       *_fp_args++ = from_obj;
 359       _num_fp_args++;
 360     } else {
 361       *_to++ = from_obj;
 362       _num_fp_args++;
 363     }
 364   }
 365 
 366   virtual void pass_double()
 367   {
 368     intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
 369     _from -= 2*Interpreter::stackElementSize;




 239       __ bind(L);
 240       _num_int_args++;
 241       break;
 242     }
 243  default:
 244    {
 245       __ add(r0, from(), Interpreter::local_offset_in_bytes(offset()));
 246       __ ldr(temp(), r0);
 247       Label L;
 248       __ cbnz(temp(), L);
 249       __ mov(r0, zr);
 250       __ bind(L);
 251       __ str(r0, Address(to(), _stack_offset));
 252       _stack_offset += wordSize;
 253       _num_int_args++;
 254       break;
 255    }
 256   }
 257 }
 258 
 259 void InterpreterRuntime::SignatureHandlerGenerator::pass_valuetype() {
 260    pass_object();
 261 }
 262 
 263 void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprint) {
 264   // generate code to handle arguments
 265   iterate(fingerprint);
 266 
 267   // set the call format
 268   // n.b. allow extra 1 for the JNI_Env in c_rarg0
 269   unsigned int call_format = ((_num_int_args + 1) << 6) | (_num_fp_args << 2);
 270 
 271   switch (method()->result_type()) {
 272   case T_VOID:
 273     call_format |= MacroAssembler::ret_type_void;
 274     break;
 275   case T_FLOAT:
 276     call_format |= MacroAssembler::ret_type_float;
 277     break;
 278   case T_DOUBLE:
 279     call_format |= MacroAssembler::ret_type_double;
 280     break;
 281   default:
 282     call_format |= MacroAssembler::ret_type_integral;


 334       *_int_args++ = from_obj;
 335       _num_int_args++;
 336     } else {
 337       *_to++ = from_obj;
 338       _num_int_args++;
 339     }
 340   }
 341 
 342   virtual void pass_object()
 343   {
 344     intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
 345     _from -= Interpreter::stackElementSize;
 346 
 347     if (_num_int_args < Argument::n_int_register_parameters_c-1) {
 348       *_int_args++ = (*from_addr == 0) ? NULL : (intptr_t)from_addr;
 349       _num_int_args++;
 350     } else {
 351       *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
 352       _num_int_args++;
 353     }
 354   }
 355 
 356   virtual void pass_valuetype() {
 357     // values are handled with oops, like objects
 358     pass_object();
 359   }
 360 
 361   virtual void pass_float()
 362   {
 363     jint from_obj = *(jint*)(_from+Interpreter::local_offset_in_bytes(0));
 364     _from -= Interpreter::stackElementSize;
 365 
 366     if (_num_fp_args < Argument::n_float_register_parameters_c) {
 367       *_fp_args++ = from_obj;
 368       _num_fp_args++;
 369     } else {
 370       *_to++ = from_obj;
 371       _num_fp_args++;
 372     }
 373   }
 374 
 375   virtual void pass_double()
 376   {
 377     intptr_t from_obj = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
 378     _from -= 2*Interpreter::stackElementSize;


< prev index next >