< prev index next >

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Print this page




 499 
 500 // load cpool->resolved_klass_at(index)
 501 void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass) {
 502   // int value = *(Rcpool->int_at_addr(which));
 503   // int resolved_klass_index = extract_low_short_from_int(value);
 504   add(Roffset, Rcpool, Roffset);
 505 #if defined(VM_LITTLE_ENDIAN)
 506   lhz(Roffset, sizeof(ConstantPool), Roffset);     // Roffset = resolved_klass_index
 507 #else
 508   lhz(Roffset, sizeof(ConstantPool) + 2, Roffset); // Roffset = resolved_klass_index
 509 #endif
 510 
 511   ld(Rklass, ConstantPool::resolved_klasses_offset_in_bytes(), Rcpool); // Rklass = Rcpool->_resolved_klasses
 512 
 513   sldi(Roffset, Roffset, LogBytesPerWord);
 514   addi(Roffset, Roffset, Array<Klass*>::base_offset_in_bytes());
 515   isync(); // Order load of instance Klass wrt. tags.
 516   ldx(Rklass, Rklass, Roffset);
 517 }
 518 
 519 void InterpreterMacroAssembler::load_resolved_method_at_index(int byte_no,
 520                                                               Register cache,
 521                                                               Register method) {
 522   const int method_offset = in_bytes(
 523     ConstantPoolCache::base_offset() +
 524       ((byte_no == TemplateTable::f2_byte)
 525        ? ConstantPoolCacheEntry::f2_offset()
 526        : ConstantPoolCacheEntry::f1_offset()));
 527 
 528   ld(method, method_offset, cache); // get f1 Method*
 529 }
 530 
 531 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 532 // a subtype of super_klass. Blows registers Rsub_klass, tmp1, tmp2.
 533 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Register Rsuper_klass, Register Rtmp1,
 534                                                   Register Rtmp2, Register Rtmp3, Label &ok_is_subtype) {
 535   // Profile the not-null value's klass.
 536   profile_typecheck(Rsub_klass, Rtmp1, Rtmp2);
 537   check_klass_subtype(Rsub_klass, Rsuper_klass, Rtmp1, Rtmp2, ok_is_subtype);
 538   profile_typecheck_failed(Rtmp1, Rtmp2);
 539 }
 540 
 541 // Separate these two to allow for delay slot in middle.
 542 // These are used to do a test and full jump to exception-throwing code.
 543 
 544 // Check that index is in range for array, then shift index by index_shift,
 545 // and put arrayOop + shifted_index into res.
 546 // Note: res is still shy of address by array offset into object.
 547 
 548 void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex,
 549                                                         int index_shift, Register Rtmp, Register Rres) {
 550   // Check that index is in range for array, then shift index by index_shift,




 499 
 500 // load cpool->resolved_klass_at(index)
 501 void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass) {
 502   // int value = *(Rcpool->int_at_addr(which));
 503   // int resolved_klass_index = extract_low_short_from_int(value);
 504   add(Roffset, Rcpool, Roffset);
 505 #if defined(VM_LITTLE_ENDIAN)
 506   lhz(Roffset, sizeof(ConstantPool), Roffset);     // Roffset = resolved_klass_index
 507 #else
 508   lhz(Roffset, sizeof(ConstantPool) + 2, Roffset); // Roffset = resolved_klass_index
 509 #endif
 510 
 511   ld(Rklass, ConstantPool::resolved_klasses_offset_in_bytes(), Rcpool); // Rklass = Rcpool->_resolved_klasses
 512 
 513   sldi(Roffset, Roffset, LogBytesPerWord);
 514   addi(Roffset, Roffset, Array<Klass*>::base_offset_in_bytes());
 515   isync(); // Order load of instance Klass wrt. tags.
 516   ldx(Rklass, Rklass, Roffset);
 517 }
 518 












 519 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 520 // a subtype of super_klass. Blows registers Rsub_klass, tmp1, tmp2.
 521 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Register Rsuper_klass, Register Rtmp1,
 522                                                   Register Rtmp2, Register Rtmp3, Label &ok_is_subtype) {
 523   // Profile the not-null value's klass.
 524   profile_typecheck(Rsub_klass, Rtmp1, Rtmp2);
 525   check_klass_subtype(Rsub_klass, Rsuper_klass, Rtmp1, Rtmp2, ok_is_subtype);
 526   profile_typecheck_failed(Rtmp1, Rtmp2);
 527 }
 528 
 529 // Separate these two to allow for delay slot in middle.
 530 // These are used to do a test and full jump to exception-throwing code.
 531 
 532 // Check that index is in range for array, then shift index by index_shift,
 533 // and put arrayOop + shifted_index into res.
 534 // Note: res is still shy of address by array offset into object.
 535 
 536 void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex,
 537                                                         int index_shift, Register Rtmp, Register Rres) {
 538   // Check that index is in range for array, then shift index by index_shift,


< prev index next >