2693
2694 // Class initialization barrier for static methods
2695 if (VM_Version::supports_fast_class_init_checks() && bytecode() == Bytecodes::_invokestatic) {
2696 const Register method = temp;
2697 const Register klass = temp;
2698 const Register thread = LP64_ONLY(r15_thread) NOT_LP64(noreg);
2699 assert(thread != noreg, "x86_32 not supported");
2700
2701 __ movptr(method, Address(cache, in_bytes(ResolvedMethodEntry::method_offset())));
2702 __ load_method_holder(klass, method);
2703 __ clinit_barrier(klass, thread, nullptr /*L_fast_path*/, &L_clinit_barrier_slow);
2704 }
2705 }
2706
2707 void TemplateTable::resolve_cache_and_index_for_field(int byte_no,
2708 Register cache,
2709 Register index) {
2710 const Register temp = rbx;
2711 assert_different_registers(cache, index, temp);
2712
2713 Label resolved;
2714
2715 Bytecodes::Code code = bytecode();
2716 switch (code) {
2717 case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
2718 case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
2719 default: break;
2720 }
2721
2722 assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
2723 __ load_field_entry(cache, index);
2724 if (byte_no == f1_byte) {
2725 __ load_unsigned_byte(temp, Address(cache, in_bytes(ResolvedFieldEntry::get_code_offset())));
2726 } else {
2727 __ load_unsigned_byte(temp, Address(cache, in_bytes(ResolvedFieldEntry::put_code_offset())));
2728 }
2729 __ cmpl(temp, code); // have we resolved this bytecode?
2730 __ jcc(Assembler::equal, resolved);
2731
2732 // resolve first time through
2733 address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
2734 __ movl(temp, code);
2735 __ call_VM(noreg, entry, temp);
2736 // Update registers with resolved info
2737 __ load_field_entry(cache, index);
2738
2739 __ bind(resolved);
2740 }
2741
2742 void TemplateTable::load_resolved_field_entry(Register obj,
2743 Register cache,
2744 Register tos_state,
2745 Register offset,
2746 Register flags,
2747 bool is_static = false) {
2748 assert_different_registers(cache, tos_state, flags, offset);
2749
2750 // Field offset
2751 __ load_sized_value(offset, Address(cache, in_bytes(ResolvedFieldEntry::field_offset_offset())), sizeof(int), true /*is_signed*/);
2752
2753 // Flags
2754 __ load_unsigned_byte(flags, Address(cache, in_bytes(ResolvedFieldEntry::flags_offset())));
2755
2756 // TOS state
2757 __ load_unsigned_byte(tos_state, Address(cache, in_bytes(ResolvedFieldEntry::type_offset())));
2758
2759 // Klass overwrite register
|
2693
2694 // Class initialization barrier for static methods
2695 if (VM_Version::supports_fast_class_init_checks() && bytecode() == Bytecodes::_invokestatic) {
2696 const Register method = temp;
2697 const Register klass = temp;
2698 const Register thread = LP64_ONLY(r15_thread) NOT_LP64(noreg);
2699 assert(thread != noreg, "x86_32 not supported");
2700
2701 __ movptr(method, Address(cache, in_bytes(ResolvedMethodEntry::method_offset())));
2702 __ load_method_holder(klass, method);
2703 __ clinit_barrier(klass, thread, nullptr /*L_fast_path*/, &L_clinit_barrier_slow);
2704 }
2705 }
2706
2707 void TemplateTable::resolve_cache_and_index_for_field(int byte_no,
2708 Register cache,
2709 Register index) {
2710 const Register temp = rbx;
2711 assert_different_registers(cache, index, temp);
2712
2713 Label L_clinit_barrier_slow;
2714 Label resolved;
2715
2716 Bytecodes::Code code = bytecode();
2717 switch (code) {
2718 case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
2719 case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
2720 default: break;
2721 }
2722
2723 assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
2724 __ load_field_entry(cache, index);
2725 if (byte_no == f1_byte) {
2726 __ load_unsigned_byte(temp, Address(cache, in_bytes(ResolvedFieldEntry::get_code_offset())));
2727 } else {
2728 __ load_unsigned_byte(temp, Address(cache, in_bytes(ResolvedFieldEntry::put_code_offset())));
2729 }
2730 __ cmpl(temp, code); // have we resolved this bytecode?
2731 __ jcc(Assembler::equal, resolved);
2732
2733 // resolve first time through
2734 __ bind(L_clinit_barrier_slow);
2735 address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
2736 __ movl(temp, code);
2737 __ call_VM(noreg, entry, temp);
2738 // Update registers with resolved info
2739 __ load_field_entry(cache, index);
2740
2741 __ bind(resolved);
2742
2743 // Class initialization barrier for static fields
2744 if (VM_Version::supports_fast_class_init_checks() &&
2745 (bytecode() == Bytecodes::_getstatic || bytecode() == Bytecodes::_putstatic)) {
2746 const Register field_holder = temp;
2747 const Register thread = LP64_ONLY(r15_thread) NOT_LP64(noreg);
2748 assert(thread != noreg, "x86_32 not supported");
2749
2750 __ movptr(field_holder, Address(cache, in_bytes(ResolvedFieldEntry::field_holder_offset())));
2751 __ clinit_barrier(field_holder, thread, nullptr /*L_fast_path*/, &L_clinit_barrier_slow);
2752 }
2753 }
2754
2755 void TemplateTable::load_resolved_field_entry(Register obj,
2756 Register cache,
2757 Register tos_state,
2758 Register offset,
2759 Register flags,
2760 bool is_static = false) {
2761 assert_different_registers(cache, tos_state, flags, offset);
2762
2763 // Field offset
2764 __ load_sized_value(offset, Address(cache, in_bytes(ResolvedFieldEntry::field_offset_offset())), sizeof(int), true /*is_signed*/);
2765
2766 // Flags
2767 __ load_unsigned_byte(flags, Address(cache, in_bytes(ResolvedFieldEntry::flags_offset())));
2768
2769 // TOS state
2770 __ load_unsigned_byte(tos_state, Address(cache, in_bytes(ResolvedFieldEntry::type_offset())));
2771
2772 // Klass overwrite register
|