Request for reviews (XL): 6829193: JSR 292 needs to support SPARC

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Apr 8 15:50:33 PDT 2010


Next new method is missing assert_different_registers:
MacroAssembler::load_method_handle_vmslots

New parameter receiver_can_be_null is not used in profile_virtual_call().

Could you rename Rtmp and Rdst into cache and tmp in

IntRtmperpreterMacroAssembler::get_index_at_bcp()

since it is confusing?
I known that get_{2|4}_byte_integer_at_bcp() use Rtmp and Rdst
but callers used cache and tmp.

MethodHandles::generate_method_handle_interpreter_entry():

!     Register tem = G5_method;
!     for (jint* pchase = methodOopDesc::method_type_offsets_chain(); (*pchase) != -1; pchase++) {
!       __ ld_ptr(tem, *pchase, G5_method_type);
!       tem = G5_method_type;       // yes, it's the same register...
             ^ it is loop invariant, why you put it inside?
!     }


MethodHandles::generate_method_handle_interpreter_entry() has next code but I don't see O1 initialization
and the comment says "O0, O1: garbage temps, blown away"

!   // given the MethodType, find out where the MH argument is buried
!   __ ld_ptr(G5_method_type, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch), O0_argslot);
!   __ ld(O0_argslot, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch), O0_argslot);
!   __ ld_ptr(__ argument_address(O0_argslot), G3_method_handle);
!
!   __ check_method_handle_type(G5_method_type, G3_method_handle, O1_scratch, wrong_method_type);
!   __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
!
!   return entry_point;
! }

Also MacroAssembler::load_method_handle_vmslots() has next code which looks similar to above but has the check "!= 0"

!   if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
!     // hoist vmslots into every mh to avoid dependent load chain
!     ld(    Address(mh_reg,    delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)),   vmslots_reg);
!   } else {
!     Register temp2_reg = vmslots_reg;
!     ld_ptr(Address(mh_reg,    delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)),      temp2_reg);
!     ld_ptr(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)),        temp2_reg);
!     ld(    Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
!   }

In verify_argslot() and other places where you are comparing 64 bit values (in 64 bit VM) you need to use brx() instead of br().

Vladimir

Christian Thalinger wrote:
> On Fri, 2010-03-19 at 20:35 +0100, Christian Thalinger wrote:
>> http://cr.openjdk.java.net/~twisti/6829193/webrev.01/
>>
>> There are unimplemented portions of the hotspot code for method
>> handles and invokedynamic specific to SPARC. They need to be filled
>> in.
>>
>> This change adds SPARC interpreter support.
>>
>> src/cpu/sparc/vm/assembler_sparc.cpp
>> src/cpu/sparc/vm/assembler_sparc.hpp
>> src/cpu/sparc/vm/interp_masm_sparc.cpp
>> src/cpu/sparc/vm/interp_masm_sparc.hpp
>> src/cpu/sparc/vm/interpreter_sparc.cpp
>> src/cpu/sparc/vm/methodHandles_sparc.cpp
>> src/cpu/sparc/vm/stubGenerator_sparc.cpp
>> src/cpu/sparc/vm/templateInterpreter_sparc.cpp
>> src/cpu/sparc/vm/templateTable_sparc.cpp
>> src/share/vm/prims/methodHandles.hpp
> 
> Can I get some reviews on this one?  As I'm sending out C1 and C2
> reviews today.
> 
> -- Christian
> 


More information about the hotspot-compiler-dev mailing list