7012648: move JSR 292 to package java.lang.invoke and adjust names

Package and class renaming only; delete unused methods and classes

Reviewed-by: twisti
This commit is contained in:
John R Rose 2011-03-11 22:34:57 -08:00
parent 6146dffe45
commit f6344076f2
43 changed files with 640 additions and 582 deletions

View File

@ -3179,7 +3179,7 @@ void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_re
Label& wrong_method_type) {
assert_different_registers(mtype_reg, mh_reg, temp_reg);
// compare method type against that of the receiver
RegisterOrConstant mhtype_offset = delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg);
RegisterOrConstant mhtype_offset = delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg);
load_heap_oop(mh_reg, mhtype_offset, temp_reg);
cmp(temp_reg, mtype_reg);
br(Assembler::notEqual, false, Assembler::pn, wrong_method_type);
@ -3195,14 +3195,14 @@ void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register m
Register temp_reg) {
assert_different_registers(vmslots_reg, mh_reg, temp_reg);
// load mh.type.form.vmslots
if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
if (java_lang_invoke_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);
ld( Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
} else {
Register temp2_reg = vmslots_reg;
load_heap_oop(Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg);
load_heap_oop(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);
load_heap_oop(Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg);
load_heap_oop(Address(temp2_reg, delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, temp_reg)), temp2_reg);
ld( Address(temp2_reg, delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
}
}
@ -3213,7 +3213,7 @@ void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_
// pick out the interpreted side of the handler
// NOTE: vmentry is not an oop!
ld_ptr(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg);
ld_ptr(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg);
// off we go...
ld_ptr(temp_reg, MethodHandleEntry::from_interpreted_entry_offset_in_bytes(), temp_reg);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1188,7 +1188,7 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
__ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH
__ lduh(max_stack, O3); // Full size expression stack
guarantee(!EnableMethodHandles, "no support yet for java.dyn.MethodHandle"); //6815692
guarantee(!EnableMethodHandles, "no support yet for java.lang.invoke.MethodHandle"); //6815692
//6815692//if (EnableMethodHandles)
//6815692// __ inc(O3, methodOopDesc::extra_stack_entries());
__ sll(O3, LogBytesPerWord, O3);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -260,7 +260,7 @@ address InterpreterGenerator::generate_abstract_entry(void) {
// Method handle invoker
// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
// Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
address InterpreterGenerator::generate_method_handle_entry(void) {
if (!EnableMethodHandles) {
return generate_abstract_entry();

View File

@ -112,8 +112,8 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
}
// given the MethodType, find out where the MH argument is buried
__ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O4_argslot);
__ ldsw( Address(O4_argslot, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O4_argslot);
__ load_heap_oop(Address(O0_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, O1_scratch)), O4_argslot);
__ ldsw( Address(O4_argslot, __ delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O4_argslot);
__ add(Gargs, __ argument_offset(O4_argslot, 1), O4_argbase);
// Note: argument_address uses its input as a scratch register!
__ ld_ptr(Address(O4_argbase, -Interpreter::stackElementSize), G3_method_handle);
@ -141,10 +141,10 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
// load up an adapter from the calling type (Java weaves this)
Register O2_form = O2_scratch;
Register O3_adapter = O3_scratch;
__ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O2_form);
// load_heap_oop(Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
__ load_heap_oop(Address(O0_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, O1_scratch)), O2_form);
// load_heap_oop(Address(O2_form, __ delayed_value(java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
// deal with old JDK versions:
__ add( Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
__ add( Address(O2_form, __ delayed_value(java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter);
__ cmp(O3_adapter, O2_form);
Label sorry_no_invoke_generic;
__ brx(Assembler::lessUnsigned, false, Assembler::pn, sorry_no_invoke_generic);
@ -376,16 +376,16 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt
// which conversion op types are implemented here?
int MethodHandles::adapter_conversion_ops_supported_mask() {
return ((1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY)
|(1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW)
|(1<<sun_dyn_AdapterMethodHandle::OP_CHECK_CAST)
|(1<<sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM)
|(1<<sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM)
|(1<<sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS)
|(1<<sun_dyn_AdapterMethodHandle::OP_ROT_ARGS)
|(1<<sun_dyn_AdapterMethodHandle::OP_DUP_ARGS)
|(1<<sun_dyn_AdapterMethodHandle::OP_DROP_ARGS)
//|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
return ((1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
//|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
);
// FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
}
@ -413,22 +413,22 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
const Register O1_actual = O1;
const Register O2_required = O2;
guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
guarantee(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
// Some handy addresses:
Address G5_method_fie( G5_method, in_bytes(methodOopDesc::from_interpreted_offset()));
Address G5_method_fce( G5_method, in_bytes(methodOopDesc::from_compiled_offset()));
Address G3_mh_vmtarget( G3_method_handle, java_dyn_MethodHandle::vmtarget_offset_in_bytes());
Address G3_mh_vmtarget( G3_method_handle, java_lang_invoke_MethodHandle::vmtarget_offset_in_bytes());
Address G3_dmh_vmindex( G3_method_handle, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes());
Address G3_dmh_vmindex( G3_method_handle, java_lang_invoke_DirectMethodHandle::vmindex_offset_in_bytes());
Address G3_bmh_vmargslot( G3_method_handle, sun_dyn_BoundMethodHandle::vmargslot_offset_in_bytes());
Address G3_bmh_argument( G3_method_handle, sun_dyn_BoundMethodHandle::argument_offset_in_bytes());
Address G3_bmh_vmargslot( G3_method_handle, java_lang_invoke_BoundMethodHandle::vmargslot_offset_in_bytes());
Address G3_bmh_argument( G3_method_handle, java_lang_invoke_BoundMethodHandle::argument_offset_in_bytes());
Address G3_amh_vmargslot( G3_method_handle, sun_dyn_AdapterMethodHandle::vmargslot_offset_in_bytes());
Address G3_amh_argument ( G3_method_handle, sun_dyn_AdapterMethodHandle::argument_offset_in_bytes());
Address G3_amh_conversion(G3_method_handle, sun_dyn_AdapterMethodHandle::conversion_offset_in_bytes());
Address G3_amh_vmargslot( G3_method_handle, java_lang_invoke_AdapterMethodHandle::vmargslot_offset_in_bytes());
Address G3_amh_argument ( G3_method_handle, java_lang_invoke_AdapterMethodHandle::argument_offset_in_bytes());
Address G3_amh_conversion(G3_method_handle, java_lang_invoke_AdapterMethodHandle::conversion_offset_in_bytes());
const int java_mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
@ -453,7 +453,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ mov(O5_savedSP, SP); // Cut the stack back to where the caller started.
Label L_no_method;
// FIXME: fill in _raise_exception_method with a suitable sun.dyn method
// FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method
__ set(AddressLiteral((address) &_raise_exception_method), G5_method);
__ ld_ptr(Address(G5_method, 0), G5_method);
__ tst(G5_method);

View File

@ -3303,7 +3303,7 @@ void TemplateTable::invokedynamic(int byte_no) {
__ sll(Rret, LogBytesPerWord, Rret);
__ ld_ptr(Rtemp, Rret, Rret); // get return address
__ load_heap_oop(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);
__ load_heap_oop(G5_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);
__ null_check(G3_method_handle);
// Adjust Rret first so Llast_SP can be same as Rret

View File

@ -7831,7 +7831,7 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad
void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg,
Register temp_reg,
Label& wrong_method_type) {
Address type_addr(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg));
Address type_addr(mh_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg));
// compare method type against that of the receiver
if (UseCompressedOops) {
load_heap_oop(temp_reg, type_addr);
@ -7851,14 +7851,14 @@ void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register m
Register temp_reg) {
assert_different_registers(vmslots_reg, mh_reg, temp_reg);
// load mh.type.form.vmslots
if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
if (java_lang_invoke_MethodHandle::vmslots_offset_in_bytes() != 0) {
// hoist vmslots into every mh to avoid dependent load chain
movl(vmslots_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)));
movl(vmslots_reg, Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmslots_offset_in_bytes, temp_reg)));
} else {
Register temp2_reg = vmslots_reg;
load_heap_oop(temp2_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)));
load_heap_oop(temp2_reg, Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)));
movl(vmslots_reg, Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)));
load_heap_oop(temp2_reg, Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg)));
load_heap_oop(temp2_reg, Address(temp2_reg, delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, temp_reg)));
movl(vmslots_reg, Address(temp2_reg, delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)));
}
}
@ -7873,7 +7873,7 @@ void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_
// pick out the interpreted side of the handler
// NOTE: vmentry is not an oop!
movptr(temp_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg)));
movptr(temp_reg, Address(mh_reg, delayed_value(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes, temp_reg)));
// off we go...
jmp(Address(temp_reg, MethodHandleEntry::from_interpreted_entry_offset_in_bytes()));

View File

@ -231,7 +231,7 @@ address InterpreterGenerator::generate_abstract_entry(void) {
// Method handle invoker
// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
// Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
address InterpreterGenerator::generate_method_handle_entry(void) {
if (!EnableMethodHandles) {
return generate_abstract_entry();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -318,7 +318,7 @@ address InterpreterGenerator::generate_abstract_entry(void) {
// Method handle invoker
// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
// Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
address InterpreterGenerator::generate_method_handle_entry(void) {
if (!EnableMethodHandles) {
return generate_abstract_entry();

View File

@ -125,9 +125,9 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
}
// given the MethodType, find out where the MH argument is buried
__ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp)));
__ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, rdi_temp)));
Register rdx_vmslots = rdx_temp;
__ movl(rdx_vmslots, Address(rdx_temp, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, rdi_temp)));
__ movl(rdx_vmslots, Address(rdx_temp, __ delayed_value(java_lang_invoke_MethodTypeForm::vmslots_offset_in_bytes, rdi_temp)));
__ movptr(rcx_recv, __ argument_address(rdx_vmslots));
trace_method_handle(_masm, "invokeExact");
@ -154,11 +154,11 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
rcx_argslot, rbx_temp, rdx_temp);
// load up an adapter from the calling type (Java weaves this)
__ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, rdi_temp)));
__ load_heap_oop(rdx_temp, Address(rax_mtype, __ delayed_value(java_lang_invoke_MethodType::form_offset_in_bytes, rdi_temp)));
Register rdx_adapter = rdx_temp;
// __ load_heap_oop(rdx_adapter, Address(rdx_temp, java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes()));
// __ load_heap_oop(rdx_adapter, Address(rdx_temp, java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes()));
// deal with old JDK versions:
__ lea(rdi_temp, Address(rdx_temp, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, rdi_temp)));
__ lea(rdi_temp, Address(rdx_temp, __ delayed_value(java_lang_invoke_MethodTypeForm::genericInvoker_offset_in_bytes, rdi_temp)));
__ cmpptr(rdi_temp, rdx_temp);
Label sorry_no_invoke_generic;
__ jcc(Assembler::below, sorry_no_invoke_generic);
@ -371,16 +371,16 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt
// which conversion op types are implemented here?
int MethodHandles::adapter_conversion_ops_supported_mask() {
return ((1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY)
|(1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW)
|(1<<sun_dyn_AdapterMethodHandle::OP_CHECK_CAST)
|(1<<sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM)
|(1<<sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM)
|(1<<sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS)
|(1<<sun_dyn_AdapterMethodHandle::OP_ROT_ARGS)
|(1<<sun_dyn_AdapterMethodHandle::OP_DUP_ARGS)
|(1<<sun_dyn_AdapterMethodHandle::OP_DROP_ARGS)
//|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
return ((1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
//|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
);
// FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
}
@ -415,21 +415,21 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
const Register rarg2_required = LP64_ONLY(j_rarg2) NOT_LP64(rdi);
assert_different_registers(rarg0_code, rarg1_actual, rarg2_required, saved_last_sp);
guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
guarantee(java_lang_invoke_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
// some handy addresses
Address rbx_method_fie( rbx, methodOopDesc::from_interpreted_offset() );
Address rbx_method_fce( rbx, methodOopDesc::from_compiled_offset() );
Address rcx_mh_vmtarget( rcx_recv, java_dyn_MethodHandle::vmtarget_offset_in_bytes() );
Address rcx_dmh_vmindex( rcx_recv, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes() );
Address rcx_mh_vmtarget( rcx_recv, java_lang_invoke_MethodHandle::vmtarget_offset_in_bytes() );
Address rcx_dmh_vmindex( rcx_recv, java_lang_invoke_DirectMethodHandle::vmindex_offset_in_bytes() );
Address rcx_bmh_vmargslot( rcx_recv, sun_dyn_BoundMethodHandle::vmargslot_offset_in_bytes() );
Address rcx_bmh_argument( rcx_recv, sun_dyn_BoundMethodHandle::argument_offset_in_bytes() );
Address rcx_bmh_vmargslot( rcx_recv, java_lang_invoke_BoundMethodHandle::vmargslot_offset_in_bytes() );
Address rcx_bmh_argument( rcx_recv, java_lang_invoke_BoundMethodHandle::argument_offset_in_bytes() );
Address rcx_amh_vmargslot( rcx_recv, sun_dyn_AdapterMethodHandle::vmargslot_offset_in_bytes() );
Address rcx_amh_argument( rcx_recv, sun_dyn_AdapterMethodHandle::argument_offset_in_bytes() );
Address rcx_amh_conversion( rcx_recv, sun_dyn_AdapterMethodHandle::conversion_offset_in_bytes() );
Address rcx_amh_vmargslot( rcx_recv, java_lang_invoke_AdapterMethodHandle::vmargslot_offset_in_bytes() );
Address rcx_amh_argument( rcx_recv, java_lang_invoke_AdapterMethodHandle::argument_offset_in_bytes() );
Address rcx_amh_conversion( rcx_recv, java_lang_invoke_AdapterMethodHandle::conversion_offset_in_bytes() );
Address vmarg; // __ argument_address(vmargslot)
const int java_mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
@ -460,7 +460,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
Register rbx_method = rbx_temp;
Label L_no_method;
// FIXME: fill in _raise_exception_method with a suitable sun.dyn method
// FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method
__ movptr(rbx_method, ExternalAddress((address) &_raise_exception_method));
__ testptr(rbx_method, rbx_method);
__ jccb(Assembler::zero, L_no_method);

View File

@ -3110,7 +3110,7 @@ void TemplateTable::invokedynamic(int byte_no) {
__ profile_call(rsi);
}
__ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx)));
__ movptr(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx)));
__ null_check(rcx_method_handle);
__ prepare_to_jump_from_interpreted();
__ jump_to_method_handle_entry(rcx_method_handle, rdx);

View File

@ -3145,7 +3145,7 @@ void TemplateTable::invokedynamic(int byte_no) {
__ profile_call(r13);
}
__ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx)));
__ load_heap_oop(rcx_method_handle, Address(rax_callsite, __ delayed_value(java_lang_invoke_CallSite::target_offset_in_bytes, rcx)));
__ null_check(rcx_method_handle);
__ prepare_to_jump_from_interpreted();
__ jump_to_method_handle_entry(rcx_method_handle, rdx);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1156,7 +1156,7 @@ class LIR_OpJavaCall: public LIR_OpCall {
return
is_invokedynamic() // An invokedynamic is always a MethodHandle call site.
||
(method()->holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
(method()->holder()->name() == ciSymbol::java_lang_invoke_MethodHandle() &&
methodOopDesc::is_method_handle_invoke_name(method()->name()->sid()));
}

View File

@ -2512,7 +2512,7 @@ void LIRGenerator::do_Invoke(Invoke* x) {
__ load(new LIR_Address(tmp, call_site_offset, T_OBJECT), tmp);
// Load target MethodHandle from CallSite object.
__ load(new LIR_Address(tmp, java_dyn_CallSite::target_offset_in_bytes(), T_OBJECT), receiver);
__ load(new LIR_Address(tmp, java_lang_invoke_CallSite::target_offset_in_bytes(), T_OBJECT), receiver);
__ call_dynamic(target, receiver, result_register,
SharedRuntime::get_resolve_opt_virtual_call_stub(),

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,7 @@
// Return the target MethodHandle of this CallSite.
ciMethodHandle* ciCallSite::get_target() const {
VM_ENTRY_MARK;
oop method_handle_oop = java_dyn_CallSite::target(get_oop());
oop method_handle_oop = java_lang_invoke_CallSite::target(get_oop());
return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@
// ciCallSite
//
// The class represents a java.dyn.CallSite object.
// The class represents a java.lang.invoke.CallSite object.
class ciCallSite : public ciInstance {
public:
ciCallSite(instanceHandle h_i) : ciInstance(h_i) {}

View File

@ -177,7 +177,7 @@ static bool trust_final_non_static_fields(ciInstanceKlass* holder) {
// Never trust strangely unstable finals: System.out, etc.
return false;
// Even if general trusting is disabled, trust system-built closures in these packages.
if (holder->is_in_package("java/dyn") || holder->is_in_package("sun/dyn"))
if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke"))
return true;
return TrustFinalNonStaticFields;
}
@ -191,8 +191,9 @@ void ciField::initialize_from(fieldDescriptor* fd) {
// Check to see if the field is constant.
if (_holder->is_initialized() && this->is_final()) {
if (!this->is_static()) {
// A field can be constant if it's a final static field or if it's
// a final non-static field of a trusted class ({java,sun}.dyn).
// A field can be constant if it's a final static field or if
// it's a final non-static field of a trusted class (classes in
// java.lang.invoke and sun.invoke packages and subpackages).
if (trust_final_non_static_fields(_holder)) {
_is_constant = true;
return;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -769,7 +769,7 @@ int ciMethod::scale_count(int count, float prof_factor) {
// signature-polymorphic MethodHandle methods, invokeExact or invokeGeneric.
bool ciMethod::is_method_handle_invoke() const {
if (!is_loaded()) {
bool flag = (holder()->name() == ciSymbol::java_dyn_MethodHandle() &&
bool flag = (holder()->name() == ciSymbol::java_lang_invoke_MethodHandle() &&
methodOopDesc::is_method_handle_invoke_name(name()->sid()));
return flag;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,7 @@
// ciMethodHandle
//
// The class represents a java.dyn.MethodHandle object.
// The class represents a java.lang.invoke.MethodHandle object.
class ciMethodHandle : public ciInstance {
private:
ciMethod* _callee;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -342,9 +342,9 @@ ciObject* ciObjectFactory::create_new_object(oop o) {
return new (arena()) ciMethodData(h_md);
} else if (o->is_instance()) {
instanceHandle h_i(THREAD, (instanceOop)o);
if (java_dyn_CallSite::is_instance(o))
if (java_lang_invoke_CallSite::is_instance(o))
return new (arena()) ciCallSite(h_i);
else if (java_dyn_MethodHandle::is_instance(o))
else if (java_lang_invoke_MethodHandle::is_instance(o))
return new (arena()) ciMethodHandle(h_i);
else
return new (arena()) ciInstance(h_i);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -380,7 +380,7 @@ ciKlass* ciBytecodeStream::get_declared_method_holder() {
bool ignore;
// report as InvokeDynamic for invokedynamic, which is syntactically classless
if (cur_bc() == Bytecodes::_invokedynamic)
return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_InvokeDynamic(), false);
return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_InvokeDynamic(), false);
return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder);
}

View File

@ -2806,11 +2806,11 @@ void ClassFileParser::java_lang_Class_fix_post(int* next_nonstatic_oop_offset_pt
// Force MethodHandle.vmentry to be an unmanaged pointer.
// There is no way for a classfile to express this, so we must help it.
void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
void ClassFileParser::java_lang_invoke_MethodHandle_fix_pre(constantPoolHandle cp,
typeArrayHandle fields,
FieldAllocationCount *fac_ptr,
TRAPS) {
// Add fake fields for java.dyn.MethodHandle instances
// Add fake fields for java.lang.invoke.MethodHandle instances
//
// This is not particularly nice, but since there is no way to express
// a native wordSize field in Java, we must do it at this level.
@ -2830,7 +2830,7 @@ void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
if (AllowTransitionalJSR292 && word_sig_index == 0) return;
if (word_sig_index == 0)
THROW_MSG(vmSymbols::java_lang_VirtualMachineError(),
"missing I or J signature (for vmentry) in java.dyn.MethodHandle");
"missing I or J signature (for vmentry) in java.lang.invoke.MethodHandle");
// Find vmentry field and change the signature.
bool found_vmentry = false;
@ -2870,7 +2870,7 @@ void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
if (AllowTransitionalJSR292 && !found_vmentry) return;
if (!found_vmentry)
THROW_MSG(vmSymbols::java_lang_VirtualMachineError(),
"missing vmentry byte field in java.dyn.MethodHandle");
"missing vmentry byte field in java.lang.invoke.MethodHandle");
}
@ -3235,14 +3235,18 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
java_lang_Class_fix_pre(&methods, &fac, CHECK_(nullHandle));
}
// adjust the vmentry field declaration in java.dyn.MethodHandle
if (EnableMethodHandles && class_name == vmSymbols::java_dyn_MethodHandle() && class_loader.is_null()) {
java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
// adjust the vmentry field declaration in java.lang.invoke.MethodHandle
if (EnableMethodHandles && class_name == vmSymbols::java_lang_invoke_MethodHandle() && class_loader.is_null()) {
java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
}
if (AllowTransitionalJSR292 &&
EnableMethodHandles && class_name == vmSymbols::java_dyn_MethodHandle() && class_loader.is_null()) {
java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
}
if (AllowTransitionalJSR292 &&
EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) {
// allow vmentry field in MethodHandleImpl also
java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
java_lang_invoke_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle));
}
// Add a fake "discovered" field if it is not present

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -162,9 +162,9 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
// Adjust the next_nonstatic_oop_offset to place the fake fields
// before any Java fields.
void java_lang_Class_fix_post(int* next_nonstatic_oop_offset);
// Adjust the field allocation counts for java.dyn.MethodHandle to add
// Adjust the field allocation counts for java.lang.invoke.MethodHandle to add
// a fake address (void*) field.
void java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
void java_lang_invoke_MethodHandle_fix_pre(constantPoolHandle cp,
typeArrayHandle fields,
FieldAllocationCount *fac_ptr, TRAPS);

View File

@ -2198,35 +2198,35 @@ void java_lang_ref_SoftReference::set_clock(jlong value) {
}
// Support for java_dyn_MethodHandle
// Support for java_lang_invoke_MethodHandle
int java_dyn_MethodHandle::_type_offset;
int java_dyn_MethodHandle::_vmtarget_offset;
int java_dyn_MethodHandle::_vmentry_offset;
int java_dyn_MethodHandle::_vmslots_offset;
int java_lang_invoke_MethodHandle::_type_offset;
int java_lang_invoke_MethodHandle::_vmtarget_offset;
int java_lang_invoke_MethodHandle::_vmentry_offset;
int java_lang_invoke_MethodHandle::_vmslots_offset;
int sun_dyn_MemberName::_clazz_offset;
int sun_dyn_MemberName::_name_offset;
int sun_dyn_MemberName::_type_offset;
int sun_dyn_MemberName::_flags_offset;
int sun_dyn_MemberName::_vmtarget_offset;
int sun_dyn_MemberName::_vmindex_offset;
int java_lang_invoke_MemberName::_clazz_offset;
int java_lang_invoke_MemberName::_name_offset;
int java_lang_invoke_MemberName::_type_offset;
int java_lang_invoke_MemberName::_flags_offset;
int java_lang_invoke_MemberName::_vmtarget_offset;
int java_lang_invoke_MemberName::_vmindex_offset;
int sun_dyn_DirectMethodHandle::_vmindex_offset;
int java_lang_invoke_DirectMethodHandle::_vmindex_offset;
int sun_dyn_BoundMethodHandle::_argument_offset;
int sun_dyn_BoundMethodHandle::_vmargslot_offset;
int java_lang_invoke_BoundMethodHandle::_argument_offset;
int java_lang_invoke_BoundMethodHandle::_vmargslot_offset;
int sun_dyn_AdapterMethodHandle::_conversion_offset;
int java_lang_invoke_AdapterMethodHandle::_conversion_offset;
void java_dyn_MethodHandle::compute_offsets() {
void java_lang_invoke_MethodHandle::compute_offsets() {
klassOop k = SystemDictionary::MethodHandle_klass();
if (k != NULL && EnableMethodHandles) {
bool allow_super = false;
if (AllowTransitionalJSR292) allow_super = true; // temporary, to access sun.dyn.MethodHandleImpl
compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_dyn_MethodType_signature(), allow_super);
compute_offset(_vmtarget_offset, k, vmSymbols::vmtarget_name(), vmSymbols::object_signature(), allow_super);
compute_offset(_vmentry_offset, k, vmSymbols::vmentry_name(), vmSymbols::machine_word_signature(), allow_super);
if (AllowTransitionalJSR292) allow_super = true; // temporary, to access java.dyn.MethodHandleImpl
compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_lang_invoke_MethodType_signature(), allow_super);
compute_offset(_vmtarget_offset, k, vmSymbols::vmtarget_name(), vmSymbols::object_signature(), allow_super);
compute_offset(_vmentry_offset, k, vmSymbols::vmentry_name(), vmSymbols::machine_word_signature(), allow_super);
// Note: MH.vmslots (if it is present) is a hoisted copy of MH.type.form.vmslots.
// It is optional pending experiments to keep or toss.
@ -2234,7 +2234,7 @@ void java_dyn_MethodHandle::compute_offsets() {
}
}
void sun_dyn_MemberName::compute_offsets() {
void java_lang_invoke_MemberName::compute_offsets() {
klassOop k = SystemDictionary::MemberName_klass();
if (k != NULL && EnableMethodHandles) {
compute_offset(_clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature());
@ -2246,14 +2246,14 @@ void sun_dyn_MemberName::compute_offsets() {
}
}
void sun_dyn_DirectMethodHandle::compute_offsets() {
void java_lang_invoke_DirectMethodHandle::compute_offsets() {
klassOop k = SystemDictionary::DirectMethodHandle_klass();
if (k != NULL && EnableMethodHandles) {
compute_offset(_vmindex_offset, k, vmSymbols::vmindex_name(), vmSymbols::int_signature(), true);
}
}
void sun_dyn_BoundMethodHandle::compute_offsets() {
void java_lang_invoke_BoundMethodHandle::compute_offsets() {
klassOop k = SystemDictionary::BoundMethodHandle_klass();
if (k != NULL && EnableMethodHandles) {
compute_offset(_vmargslot_offset, k, vmSymbols::vmargslot_name(), vmSymbols::int_signature(), true);
@ -2261,22 +2261,22 @@ void sun_dyn_BoundMethodHandle::compute_offsets() {
}
}
void sun_dyn_AdapterMethodHandle::compute_offsets() {
void java_lang_invoke_AdapterMethodHandle::compute_offsets() {
klassOop k = SystemDictionary::AdapterMethodHandle_klass();
if (k != NULL && EnableMethodHandles) {
compute_offset(_conversion_offset, k, vmSymbols::conversion_name(), vmSymbols::int_signature(), true);
}
}
oop java_dyn_MethodHandle::type(oop mh) {
oop java_lang_invoke_MethodHandle::type(oop mh) {
return mh->obj_field(_type_offset);
}
void java_dyn_MethodHandle::set_type(oop mh, oop mtype) {
void java_lang_invoke_MethodHandle::set_type(oop mh, oop mtype) {
mh->obj_field_put(_type_offset, mtype);
}
int java_dyn_MethodHandle::vmslots(oop mh) {
int java_lang_invoke_MethodHandle::vmslots(oop mh) {
int vmslots_offset = _vmslots_offset;
if (vmslots_offset != 0) {
#ifdef ASSERT
@ -2291,7 +2291,7 @@ int java_dyn_MethodHandle::vmslots(oop mh) {
}
// if MH.vmslots exists, hoist into it the value of type.form.vmslots
void java_dyn_MethodHandle::init_vmslots(oop mh) {
void java_lang_invoke_MethodHandle::init_vmslots(oop mh) {
int vmslots_offset = _vmslots_offset;
if (vmslots_offset != 0) {
mh->int_field_put(vmslots_offset, compute_vmslots(mh));
@ -2300,20 +2300,20 @@ void java_dyn_MethodHandle::init_vmslots(oop mh) {
// fetch type.form.vmslots, which is the number of JVM stack slots
// required to carry the arguments of this MH
int java_dyn_MethodHandle::compute_vmslots(oop mh) {
int java_lang_invoke_MethodHandle::compute_vmslots(oop mh) {
oop mtype = type(mh);
if (mtype == NULL) return 0; // Java code would get NPE
oop form = java_dyn_MethodType::form(mtype);
oop form = java_lang_invoke_MethodType::form(mtype);
if (form == NULL) return 0; // Java code would get NPE
return java_dyn_MethodTypeForm::vmslots(form);
return java_lang_invoke_MethodTypeForm::vmslots(form);
}
// fetch the low-level entry point for this mh
MethodHandleEntry* java_dyn_MethodHandle::vmentry(oop mh) {
MethodHandleEntry* java_lang_invoke_MethodHandle::vmentry(oop mh) {
return (MethodHandleEntry*) mh->address_field(_vmentry_offset);
}
void java_dyn_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) {
void java_lang_invoke_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) {
assert(_vmentry_offset != 0, "must be present");
// This is always the final step that initializes a valid method handle:
@ -2327,123 +2327,123 @@ void java_dyn_MethodHandle::set_vmentry(oop mh, MethodHandleEntry* me) {
/// MemberName accessors
oop sun_dyn_MemberName::clazz(oop mname) {
oop java_lang_invoke_MemberName::clazz(oop mname) {
assert(is_instance(mname), "wrong type");
return mname->obj_field(_clazz_offset);
}
void sun_dyn_MemberName::set_clazz(oop mname, oop clazz) {
void java_lang_invoke_MemberName::set_clazz(oop mname, oop clazz) {
assert(is_instance(mname), "wrong type");
mname->obj_field_put(_clazz_offset, clazz);
}
oop sun_dyn_MemberName::name(oop mname) {
oop java_lang_invoke_MemberName::name(oop mname) {
assert(is_instance(mname), "wrong type");
return mname->obj_field(_name_offset);
}
void sun_dyn_MemberName::set_name(oop mname, oop name) {
void java_lang_invoke_MemberName::set_name(oop mname, oop name) {
assert(is_instance(mname), "wrong type");
mname->obj_field_put(_name_offset, name);
}
oop sun_dyn_MemberName::type(oop mname) {
oop java_lang_invoke_MemberName::type(oop mname) {
assert(is_instance(mname), "wrong type");
return mname->obj_field(_type_offset);
}
void sun_dyn_MemberName::set_type(oop mname, oop type) {
void java_lang_invoke_MemberName::set_type(oop mname, oop type) {
assert(is_instance(mname), "wrong type");
mname->obj_field_put(_type_offset, type);
}
int sun_dyn_MemberName::flags(oop mname) {
int java_lang_invoke_MemberName::flags(oop mname) {
assert(is_instance(mname), "wrong type");
return mname->int_field(_flags_offset);
}
void sun_dyn_MemberName::set_flags(oop mname, int flags) {
void java_lang_invoke_MemberName::set_flags(oop mname, int flags) {
assert(is_instance(mname), "wrong type");
mname->int_field_put(_flags_offset, flags);
}
oop sun_dyn_MemberName::vmtarget(oop mname) {
oop java_lang_invoke_MemberName::vmtarget(oop mname) {
assert(is_instance(mname), "wrong type");
return mname->obj_field(_vmtarget_offset);
}
void sun_dyn_MemberName::set_vmtarget(oop mname, oop ref) {
void java_lang_invoke_MemberName::set_vmtarget(oop mname, oop ref) {
assert(is_instance(mname), "wrong type");
mname->obj_field_put(_vmtarget_offset, ref);
}
int sun_dyn_MemberName::vmindex(oop mname) {
int java_lang_invoke_MemberName::vmindex(oop mname) {
assert(is_instance(mname), "wrong type");
return mname->int_field(_vmindex_offset);
}
void sun_dyn_MemberName::set_vmindex(oop mname, int index) {
void java_lang_invoke_MemberName::set_vmindex(oop mname, int index) {
assert(is_instance(mname), "wrong type");
mname->int_field_put(_vmindex_offset, index);
}
oop java_dyn_MethodHandle::vmtarget(oop mh) {
oop java_lang_invoke_MethodHandle::vmtarget(oop mh) {
assert(is_instance(mh), "MH only");
return mh->obj_field(_vmtarget_offset);
}
void java_dyn_MethodHandle::set_vmtarget(oop mh, oop ref) {
void java_lang_invoke_MethodHandle::set_vmtarget(oop mh, oop ref) {
assert(is_instance(mh), "MH only");
mh->obj_field_put(_vmtarget_offset, ref);
}
int sun_dyn_DirectMethodHandle::vmindex(oop mh) {
int java_lang_invoke_DirectMethodHandle::vmindex(oop mh) {
assert(is_instance(mh), "DMH only");
return mh->int_field(_vmindex_offset);
}
void sun_dyn_DirectMethodHandle::set_vmindex(oop mh, int index) {
void java_lang_invoke_DirectMethodHandle::set_vmindex(oop mh, int index) {
assert(is_instance(mh), "DMH only");
mh->int_field_put(_vmindex_offset, index);
}
int sun_dyn_BoundMethodHandle::vmargslot(oop mh) {
int java_lang_invoke_BoundMethodHandle::vmargslot(oop mh) {
assert(is_instance(mh), "BMH only");
return mh->int_field(_vmargslot_offset);
}
oop sun_dyn_BoundMethodHandle::argument(oop mh) {
oop java_lang_invoke_BoundMethodHandle::argument(oop mh) {
assert(is_instance(mh), "BMH only");
return mh->obj_field(_argument_offset);
}
int sun_dyn_AdapterMethodHandle::conversion(oop mh) {
int java_lang_invoke_AdapterMethodHandle::conversion(oop mh) {
assert(is_instance(mh), "AMH only");
return mh->int_field(_conversion_offset);
}
void sun_dyn_AdapterMethodHandle::set_conversion(oop mh, int conv) {
void java_lang_invoke_AdapterMethodHandle::set_conversion(oop mh, int conv) {
assert(is_instance(mh), "AMH only");
mh->int_field_put(_conversion_offset, conv);
}
// Support for java_dyn_MethodType
// Support for java_lang_invoke_MethodType
int java_dyn_MethodType::_rtype_offset;
int java_dyn_MethodType::_ptypes_offset;
int java_dyn_MethodType::_form_offset;
int java_lang_invoke_MethodType::_rtype_offset;
int java_lang_invoke_MethodType::_ptypes_offset;
int java_lang_invoke_MethodType::_form_offset;
void java_dyn_MethodType::compute_offsets() {
void java_lang_invoke_MethodType::compute_offsets() {
klassOop k = SystemDictionary::MethodType_klass();
if (k != NULL) {
compute_offset(_rtype_offset, k, vmSymbols::rtype_name(), vmSymbols::class_signature());
compute_offset(_ptypes_offset, k, vmSymbols::ptypes_name(), vmSymbols::class_array_signature());
compute_offset(_form_offset, k, vmSymbols::form_name(), vmSymbols::java_dyn_MethodTypeForm_signature());
compute_offset(_form_offset, k, vmSymbols::form_name(), vmSymbols::java_lang_invoke_MethodTypeForm_signature());
}
}
void java_dyn_MethodType::print_signature(oop mt, outputStream* st) {
void java_lang_invoke_MethodType::print_signature(oop mt, outputStream* st) {
st->print("(");
objArrayOop pts = ptypes(mt);
for (int i = 0, limit = pts->length(); i < limit; i++) {
@ -2453,7 +2453,7 @@ void java_dyn_MethodType::print_signature(oop mt, outputStream* st) {
java_lang_Class::print_signature(rtype(mt), st);
}
Symbol* java_dyn_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAPS) {
Symbol* java_lang_invoke_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAPS) {
ResourceMark rm;
stringStream buffer(128);
print_signature(mt, &buffer);
@ -2468,80 +2468,80 @@ Symbol* java_dyn_MethodType::as_signature(oop mt, bool intern_if_not_found, TRAP
return name;
}
oop java_dyn_MethodType::rtype(oop mt) {
oop java_lang_invoke_MethodType::rtype(oop mt) {
assert(is_instance(mt), "must be a MethodType");
return mt->obj_field(_rtype_offset);
}
objArrayOop java_dyn_MethodType::ptypes(oop mt) {
objArrayOop java_lang_invoke_MethodType::ptypes(oop mt) {
assert(is_instance(mt), "must be a MethodType");
return (objArrayOop) mt->obj_field(_ptypes_offset);
}
oop java_dyn_MethodType::form(oop mt) {
oop java_lang_invoke_MethodType::form(oop mt) {
assert(is_instance(mt), "must be a MethodType");
return mt->obj_field(_form_offset);
}
oop java_dyn_MethodType::ptype(oop mt, int idx) {
oop java_lang_invoke_MethodType::ptype(oop mt, int idx) {
return ptypes(mt)->obj_at(idx);
}
int java_dyn_MethodType::ptype_count(oop mt) {
int java_lang_invoke_MethodType::ptype_count(oop mt) {
return ptypes(mt)->length();
}
// Support for java_dyn_MethodTypeForm
// Support for java_lang_invoke_MethodTypeForm
int java_dyn_MethodTypeForm::_vmslots_offset;
int java_dyn_MethodTypeForm::_erasedType_offset;
int java_dyn_MethodTypeForm::_genericInvoker_offset;
int java_lang_invoke_MethodTypeForm::_vmslots_offset;
int java_lang_invoke_MethodTypeForm::_erasedType_offset;
int java_lang_invoke_MethodTypeForm::_genericInvoker_offset;
void java_dyn_MethodTypeForm::compute_offsets() {
void java_lang_invoke_MethodTypeForm::compute_offsets() {
klassOop k = SystemDictionary::MethodTypeForm_klass();
if (k != NULL) {
compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true);
compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_dyn_MethodType_signature(), true);
compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_dyn_MethodHandle_signature(), true);
compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_lang_invoke_MethodType_signature(), true);
compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_lang_invoke_MethodHandle_signature(), true);
if (_genericInvoker_offset == 0) _genericInvoker_offset = -1; // set to explicit "empty" value
}
}
int java_dyn_MethodTypeForm::vmslots(oop mtform) {
int java_lang_invoke_MethodTypeForm::vmslots(oop mtform) {
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
return mtform->int_field(_vmslots_offset);
}
oop java_dyn_MethodTypeForm::erasedType(oop mtform) {
oop java_lang_invoke_MethodTypeForm::erasedType(oop mtform) {
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
return mtform->obj_field(_erasedType_offset);
}
oop java_dyn_MethodTypeForm::genericInvoker(oop mtform) {
oop java_lang_invoke_MethodTypeForm::genericInvoker(oop mtform) {
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
return mtform->obj_field(_genericInvoker_offset);
}
// Support for java_dyn_CallSite
// Support for java_lang_invoke_CallSite
int java_dyn_CallSite::_target_offset;
int java_lang_invoke_CallSite::_target_offset;
void java_dyn_CallSite::compute_offsets() {
void java_lang_invoke_CallSite::compute_offsets() {
if (!EnableInvokeDynamic) return;
klassOop k = SystemDictionary::CallSite_klass();
if (k != NULL) {
compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature());
compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
}
}
oop java_dyn_CallSite::target(oop site) {
oop java_lang_invoke_CallSite::target(oop site) {
return site->obj_field(_target_offset);
}
void java_dyn_CallSite::set_target(oop site, oop target) {
void java_lang_invoke_CallSite::set_target(oop site, oop target) {
site->obj_field_put(_target_offset, target);
}
@ -2881,16 +2881,16 @@ void JavaClasses::compute_offsets() {
java_lang_Thread::compute_offsets();
java_lang_ThreadGroup::compute_offsets();
if (EnableMethodHandles) {
java_dyn_MethodHandle::compute_offsets();
sun_dyn_MemberName::compute_offsets();
sun_dyn_DirectMethodHandle::compute_offsets();
sun_dyn_BoundMethodHandle::compute_offsets();
sun_dyn_AdapterMethodHandle::compute_offsets();
java_dyn_MethodType::compute_offsets();
java_dyn_MethodTypeForm::compute_offsets();
java_lang_invoke_MethodHandle::compute_offsets();
java_lang_invoke_MemberName::compute_offsets();
java_lang_invoke_DirectMethodHandle::compute_offsets();
java_lang_invoke_BoundMethodHandle::compute_offsets();
java_lang_invoke_AdapterMethodHandle::compute_offsets();
java_lang_invoke_MethodType::compute_offsets();
java_lang_invoke_MethodTypeForm::compute_offsets();
}
if (EnableInvokeDynamic) {
java_dyn_CallSite::compute_offsets();
java_lang_invoke_CallSite::compute_offsets();
}
java_security_AccessControlContext::compute_offsets();
// Initialize reflection classes. The layouts of these classes

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -794,11 +794,11 @@ class java_lang_ref_SoftReference: public java_lang_ref_Reference {
};
// Interface to java.dyn.MethodHandle objects
// Interface to java.lang.invoke.MethodHandle objects
class MethodHandleEntry;
class java_dyn_MethodHandle: AllStatic {
class java_lang_invoke_MethodHandle: AllStatic {
friend class JavaClasses;
private:
@ -839,7 +839,7 @@ class java_dyn_MethodHandle: AllStatic {
static int vmslots_offset_in_bytes() { return _vmslots_offset; }
};
class sun_dyn_DirectMethodHandle: public java_dyn_MethodHandle {
class java_lang_invoke_DirectMethodHandle: public java_lang_invoke_MethodHandle {
friend class JavaClasses;
private:
@ -864,7 +864,7 @@ class sun_dyn_DirectMethodHandle: public java_dyn_MethodHandle {
static int vmindex_offset_in_bytes() { return _vmindex_offset; }
};
class sun_dyn_BoundMethodHandle: public java_dyn_MethodHandle {
class java_lang_invoke_BoundMethodHandle: public java_lang_invoke_MethodHandle {
friend class JavaClasses;
private:
@ -891,7 +891,7 @@ public:
static int vmargslot_offset_in_bytes() { return _vmargslot_offset; }
};
class sun_dyn_AdapterMethodHandle: public sun_dyn_BoundMethodHandle {
class java_lang_invoke_AdapterMethodHandle: public java_lang_invoke_BoundMethodHandle {
friend class JavaClasses;
private:
@ -942,14 +942,14 @@ class sun_dyn_AdapterMethodHandle: public sun_dyn_BoundMethodHandle {
};
// Interface to sun.dyn.MemberName objects
// Interface to java.lang.invoke.MemberName objects
// (These are a private interface for Java code to query the class hierarchy.)
class sun_dyn_MemberName: AllStatic {
class java_lang_invoke_MemberName: AllStatic {
friend class JavaClasses;
private:
// From java.dyn.MemberName:
// From java.lang.invoke.MemberName:
// private Class<?> clazz; // class in which the method is defined
// private String name; // may be null if not yet materialized
// private Object type; // may be null if not yet materialized
@ -1018,9 +1018,9 @@ class sun_dyn_MemberName: AllStatic {
};
// Interface to java.dyn.MethodType objects
// Interface to java.lang.invoke.MethodType objects
class java_dyn_MethodType: AllStatic {
class java_lang_invoke_MethodType: AllStatic {
friend class JavaClasses;
private:
@ -1052,7 +1052,7 @@ class java_dyn_MethodType: AllStatic {
static int form_offset_in_bytes() { return _form_offset; }
};
class java_dyn_MethodTypeForm: AllStatic {
class java_lang_invoke_MethodTypeForm: AllStatic {
friend class JavaClasses;
private:
@ -1075,9 +1075,9 @@ class java_dyn_MethodTypeForm: AllStatic {
};
// Interface to java.dyn.CallSite objects
// Interface to java.lang.invoke.CallSite objects
class java_dyn_CallSite: AllStatic {
class java_lang_invoke_CallSite: AllStatic {
friend class JavaClasses;
private:

View File

@ -2450,7 +2450,7 @@ methodOop SystemDictionary::find_method_handle_invoke(Symbol* name,
}
}
// Ask Java code to find or construct a java.dyn.MethodType for the given
// Ask Java code to find or construct a java.lang.invoke.MethodType for the given
// signature, as interpreted relative to the given class loader.
// Because of class loader constraints, all method handle usage must be
// consistent with this loader.
@ -2504,25 +2504,33 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
}
assert(arg == npts, "");
// call sun.dyn.MethodHandleNatives::findMethodType(Class rt, Class[] pts) -> MethodType
// call java.lang.invoke.MethodHandleNatives::findMethodType(Class rt, Class[] pts) -> MethodType
JavaCallArguments args(Handle(THREAD, rt()));
args.push_oop(pts());
JavaValue result(T_OBJECT);
Symbol* findMethodHandleType_signature = vmSymbols::findMethodHandleType_signature();
if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodType_klass()->name() == vmSymbols::java_dyn_MethodType()) {
findMethodHandleType_signature = vmSymbols::findMethodHandleType_TRANS_signature();
}
JavaCalls::call_static(&result,
SystemDictionary::MethodHandleNatives_klass(),
vmSymbols::findMethodHandleType_name(),
vmSymbols::findMethodHandleType_signature(),
findMethodHandleType_signature,
&args, CHECK_(empty));
Handle method_type(THREAD, (oop) result.get_jobject());
if (for_invokeGeneric) {
// call sun.dyn.MethodHandleNatives::notifyGenericMethodType(MethodType) -> void
// call java.lang.invoke.MethodHandleNatives::notifyGenericMethodType(MethodType) -> void
JavaCallArguments args(Handle(THREAD, method_type()));
JavaValue no_result(T_VOID);
Symbol* notifyGenericMethodType_signature = vmSymbols::notifyGenericMethodType_signature();
if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodType_klass()->name() == vmSymbols::java_dyn_MethodType()) {
notifyGenericMethodType_signature = vmSymbols::notifyGenericMethodType_TRANS_signature();
}
JavaCalls::call_static(&no_result,
SystemDictionary::MethodHandleNatives_klass(),
vmSymbols::notifyGenericMethodType_name(),
vmSymbols::notifyGenericMethodType_signature(),
notifyGenericMethodType_signature,
&args, THREAD);
if (HAS_PENDING_EXCEPTION) {
// If the notification fails, just kill it.
@ -2563,7 +2571,7 @@ Handle SystemDictionary::link_method_handle_constant(KlassHandle caller,
THROW_MSG_(vmSymbols::java_lang_LinkageError(), "bad signature", empty);
}
// call sun.dyn.MethodHandleNatives::linkMethodHandleConstant(Class caller, int refKind, Class callee, String name, Object type) -> MethodHandle
// call java.lang.invoke.MethodHandleNatives::linkMethodHandleConstant(Class caller, int refKind, Class callee, String name, Object type) -> MethodHandle
JavaCallArguments args;
args.push_oop(caller->java_mirror()); // the referring class
args.push_int(ref_kind);
@ -2571,15 +2579,19 @@ Handle SystemDictionary::link_method_handle_constant(KlassHandle caller,
args.push_oop(name());
args.push_oop(type());
JavaValue result(T_OBJECT);
Symbol* linkMethodHandleConstant_signature = vmSymbols::linkMethodHandleConstant_signature();
if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodHandle_klass()->name() == vmSymbols::java_dyn_MethodHandle()) {
linkMethodHandleConstant_signature = vmSymbols::linkMethodHandleConstant_TRANS_signature();
}
JavaCalls::call_static(&result,
SystemDictionary::MethodHandleNatives_klass(),
vmSymbols::linkMethodHandleConstant_name(),
vmSymbols::linkMethodHandleConstant_signature(),
linkMethodHandleConstant_signature,
&args, CHECK_(empty));
return Handle(THREAD, (oop) result.get_jobject());
}
// Ask Java code to find or construct a java.dyn.CallSite for the given
// Ask Java code to find or construct a java.lang.invoke.CallSite for the given
// name and signature, as interpreted relative to the given class loader.
Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
Symbol* name,
@ -2590,13 +2602,13 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
TRAPS) {
Handle empty;
guarantee(bootstrap_method.not_null() &&
java_dyn_MethodHandle::is_instance(bootstrap_method()),
java_lang_invoke_MethodHandle::is_instance(bootstrap_method()),
"caller must supply a valid BSM");
Handle caller_mname = MethodHandles::new_MemberName(CHECK_(empty));
MethodHandles::init_MemberName(caller_mname(), caller_method());
// call sun.dyn.MethodHandleNatives::makeDynamicCallSite(bootm, name, mtype, info, caller_mname, caller_pos)
// call java.lang.invoke.MethodHandleNatives::makeDynamicCallSite(bootm, name, mtype, info, caller_mname, caller_pos)
oop name_str_oop = StringTable::intern(name, CHECK_(empty)); // not a handle!
JavaCallArguments args(Handle(THREAD, bootstrap_method()));
args.push_oop(name_str_oop);
@ -2609,6 +2621,9 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodHandleNatives_klass()->name() == vmSymbols::sun_dyn_MethodHandleNatives()) {
makeDynamicCallSite_signature = vmSymbols::makeDynamicCallSite_TRANS_signature();
}
if (AllowTransitionalJSR292 && SystemDictionaryHandles::MethodHandleNatives_klass()->name() == vmSymbols::java_dyn_MethodHandleNatives()) {
makeDynamicCallSite_signature = vmSymbols::makeDynamicCallSite_TRANS2_signature();
}
JavaCalls::call_static(&result,
SystemDictionary::MethodHandleNatives_klass(),
vmSymbols::makeDynamicCallSite_name(),
@ -2616,7 +2631,7 @@ Handle SystemDictionary::make_dynamic_call_site(Handle bootstrap_method,
&args, CHECK_(empty));
oop call_site_oop = (oop) result.get_jobject();
assert(call_site_oop->is_oop()
/*&& java_dyn_CallSite::is_instance(call_site_oop)*/, "must be sane");
/*&& java_lang_invoke_CallSite::is_instance(call_site_oop)*/, "must be sane");
if (TraceMethodHandles) {
#ifndef PRODUCT
tty->print_cr("Linked invokedynamic bci=%d site="INTPTR_FORMAT":", caller_bci, call_site_oop);

View File

@ -144,18 +144,18 @@ class SymbolPropertyTable;
template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \
\
/* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
template(MethodHandle_klass, java_dyn_MethodHandle, Pre_JSR292) \
template(MemberName_klass, java_dyn_MemberName, Pre_JSR292) \
template(MethodHandleImpl_klass, java_dyn_MethodHandleImpl, Pre_JSR292) /* AllowTransitionalJSR292 ONLY */ \
template(MethodHandleNatives_klass, java_dyn_MethodHandleNatives, Pre_JSR292) \
template(AdapterMethodHandle_klass, java_dyn_AdapterMethodHandle, Pre_JSR292) \
template(BoundMethodHandle_klass, java_dyn_BoundMethodHandle, Pre_JSR292) \
template(DirectMethodHandle_klass, java_dyn_DirectMethodHandle, Pre_JSR292) \
template(MethodType_klass, java_dyn_MethodType, Pre_JSR292) \
template(MethodTypeForm_klass, java_dyn_MethodTypeForm, Pre_JSR292) \
template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Pre_JSR292) \
template(Linkage_klass, java_dyn_Linkage, Pre_JSR292) \
template(CallSite_klass, java_dyn_CallSite, Pre_JSR292) \
template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \
template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \
template(MethodHandleImpl_klass, sun_dyn_MethodHandleImpl, Opt) /* AllowTransitionalJSR292 ONLY */ \
template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \
template(AdapterMethodHandle_klass, java_lang_invoke_AdapterMethodHandle, Pre_JSR292) \
template(BoundMethodHandle_klass, java_lang_invoke_BoundMethodHandle, Pre_JSR292) \
template(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Pre_JSR292) \
template(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292) \
template(MethodTypeForm_klass, java_lang_invoke_MethodTypeForm, Pre_JSR292) \
template(WrongMethodTypeException_klass, java_lang_invoke_WrongMethodTypeException, Pre_JSR292) \
template(Linkage_klass, java_lang_invoke_Linkage, Opt) /* AllowTransitionalJSR292 ONLY */ \
template(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292) \
/* Note: MethodHandle must be first, and CallSite last in group */ \
\
template(StringBuffer_klass, java_lang_StringBuffer, Pre) \
@ -482,18 +482,18 @@ public:
Handle loader2, bool is_method, TRAPS);
// JSR 292
// find the java.dyn.MethodHandles::invoke method for a given signature
// find the java.lang.invoke.MethodHandles::invoke method for a given signature
static methodOop find_method_handle_invoke(Symbol* name,
Symbol* signature,
KlassHandle accessing_klass,
TRAPS);
// ask Java to compute a java.dyn.MethodType object for a given signature
// ask Java to compute a java.lang.invoke.MethodType object for a given signature
static Handle find_method_handle_type(Symbol* signature,
KlassHandle accessing_klass,
bool for_invokeGeneric,
bool& return_bcp_flag,
TRAPS);
// ask Java to compute a java.dyn.MethodHandle object for a given CP entry
// ask Java to compute a java.lang.invoke.MethodHandle object for a given CP entry
static Handle link_method_handle_constant(KlassHandle caller,
int ref_kind, //e.g., JVM_REF_invokeVirtual
KlassHandle callee,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1671,13 +1671,19 @@ void ClassVerifier::verify_ldc(
VerificationType::long_type(),
VerificationType::long2_type(), CHECK_VERIFY(this));
} else if (tag.is_method_handle()) {
Symbol* methodHandle_name = vmSymbols::java_lang_invoke_MethodHandle();
if (AllowTransitionalJSR292 && !Universe::is_bootstrapping())
methodHandle_name = SystemDictionaryHandles::MethodHandle_klass()->name();
current_frame->push_stack(
VerificationType::reference_type(
vmSymbols::java_dyn_MethodHandle()), CHECK_VERIFY(this));
methodHandle_name), CHECK_VERIFY(this));
} else if (tag.is_method_type()) {
Symbol* methodType_name = vmSymbols::java_lang_invoke_MethodType();
if (AllowTransitionalJSR292 && !Universe::is_bootstrapping())
methodType_name = SystemDictionaryHandles::MethodType_klass()->name();
current_frame->push_stack(
VerificationType::reference_type(
vmSymbols::java_dyn_MethodType()), CHECK_VERIFY(this));
methodType_name), CHECK_VERIFY(this));
} else {
verify_error(bci, "Invalid index in ldc");
return;

View File

@ -229,39 +229,60 @@
template(base_name, "base") \
\
/* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \
template(java_dyn_InvokeDynamic, "java/dyn/InvokeDynamic") \
template(java_dyn_Linkage, "java/dyn/Linkage") \
template(java_dyn_CallSite, "java/dyn/CallSite") \
template(java_dyn_MethodHandle, "java/dyn/MethodHandle") \
template(java_dyn_MethodType, "java/dyn/MethodType") \
template(java_dyn_WrongMethodTypeException, "java/dyn/WrongMethodTypeException") \
template(java_dyn_MethodType_signature, "Ljava/dyn/MethodType;") \
template(java_dyn_MethodHandle_signature, "Ljava/dyn/MethodHandle;") \
template(java_lang_invoke_InvokeDynamic, "java/lang/invoke/InvokeDynamic") \
template(java_lang_invoke_Linkage, "java/lang/invoke/Linkage") \
template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \
template(java_lang_invoke_MethodHandle, "java/lang/invoke/MethodHandle") \
template(java_lang_invoke_MethodType, "java/lang/invoke/MethodType") \
template(java_lang_invoke_WrongMethodTypeException, "java/lang/invoke/WrongMethodTypeException") \
template(java_lang_invoke_MethodType_signature, "Ljava/lang/invoke/MethodType;") \
template(java_lang_invoke_MethodHandle_signature, "Ljava/lang/invoke/MethodHandle;") \
/* internal classes known only to the JVM: */ \
template(java_dyn_MethodTypeForm, "java/dyn/MethodTypeForm") \
template(java_dyn_MethodTypeForm_signature, "Ljava/dyn/MethodTypeForm;") \
template(java_dyn_MemberName, "java/dyn/MemberName") \
template(java_dyn_MethodHandleImpl, "java/dyn/MethodHandleImpl") \
template(java_dyn_MethodHandleNatives, "java/dyn/MethodHandleNatives") \
template(java_dyn_AdapterMethodHandle, "java/dyn/AdapterMethodHandle") \
template(java_dyn_BoundMethodHandle, "java/dyn/BoundMethodHandle") \
template(java_dyn_DirectMethodHandle, "java/dyn/DirectMethodHandle") \
template(java_lang_invoke_MethodTypeForm, "java/lang/invoke/MethodTypeForm") \
template(java_lang_invoke_MethodTypeForm_signature, "Ljava/lang/invoke/MethodTypeForm;") \
template(java_lang_invoke_MemberName, "java/lang/invoke/MemberName") \
template(java_lang_invoke_MethodHandleNatives, "java/lang/invoke/MethodHandleNatives") \
template(java_lang_invoke_AdapterMethodHandle, "java/lang/invoke/AdapterMethodHandle") \
template(java_lang_invoke_BoundMethodHandle, "java/lang/invoke/BoundMethodHandle") \
template(java_lang_invoke_DirectMethodHandle, "java/lang/invoke/DirectMethodHandle") \
/* temporary transitional public names from 6839872: */ \
template(java_dyn_InvokeDynamic, "java/dyn/InvokeDynamic") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_Linkage, "java/dyn/Linkage") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_CallSite, "java/dyn/CallSite") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MethodHandle, "java/dyn/MethodHandle") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MethodType, "java/dyn/MethodType") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_WrongMethodTypeException, "java/dyn/WrongMethodTypeException") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MethodType_signature, "Ljava/dyn/MethodType;") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MethodHandle_signature, "Ljava/dyn/MethodHandle;") /* AllowTransitionalJSR292 ONLY */ \
/* temporary transitional internal names from 6839872: */ \
template(java_dyn_MethodTypeForm, "java/dyn/MethodTypeForm") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MethodTypeForm_signature, "Ljava/dyn/MethodTypeForm;") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MemberName, "java/dyn/MemberName") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_MethodHandleNatives, "java/dyn/MethodHandleNatives") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_AdapterMethodHandle, "java/dyn/AdapterMethodHandle") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_BoundMethodHandle, "java/dyn/BoundMethodHandle") /* AllowTransitionalJSR292 ONLY */ \
template(java_dyn_DirectMethodHandle, "java/dyn/DirectMethodHandle") /* AllowTransitionalJSR292 ONLY */ \
/* temporary transitional internal names from EDR: */ \
template(sun_dyn_MemberName, "sun/dyn/MemberName") /* AllowTransitionalJSR292 ONLY */ \
template(sun_dyn_MethodHandleImpl, "sun/dyn/MethodHandleImpl") /* AllowTransitionalJSR292 ONLY */ \
template(sun_dyn_MethodHandleNatives, "sun/dyn/MethodHandleNatives") /* AllowTransitionalJSR292 ONLY */ \
template(sun_dyn_AdapterMethodHandle, "sun/dyn/AdapterMethodHandle") /* AllowTransitionalJSR292 ONLY */ \
template(sun_dyn_BoundMethodHandle, "sun/dyn/BoundMethodHandle") /* AllowTransitionalJSR292 ONLY */ \
template(sun_dyn_DirectMethodHandle, "sun/dyn/DirectMethodHandle") /* AllowTransitionalJSR292 ONLY */ \
/* internal up-calls made only by the JVM, via class sun.dyn.MethodHandleNatives: */ \
/* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */ \
template(findMethodHandleType_name, "findMethodHandleType") \
template(findMethodHandleType_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;") \
template(findMethodHandleType_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \
template(findMethodHandleType_TRANS_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;") /* AllowTransitionalJSR292 ONLY */ \
template(notifyGenericMethodType_name, "notifyGenericMethodType") \
template(notifyGenericMethodType_signature, "(Ljava/dyn/MethodType;)V") \
template(notifyGenericMethodType_signature, "(Ljava/lang/invoke/MethodType;)V") \
template(notifyGenericMethodType_TRANS_signature, "(Ljava/dyn/MethodType;)V") /* AllowTransitionalJSR292 ONLY */ \
template(linkMethodHandleConstant_name, "linkMethodHandleConstant") \
template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/dyn/MethodHandle;") \
template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;") \
template(linkMethodHandleConstant_TRANS_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/dyn/MethodHandle;") /* AllowTransitionalJSR292 ONLY */ \
template(makeDynamicCallSite_name, "makeDynamicCallSite") \
template(makeDynamicCallSite_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Ljava/dyn/MemberName;I)Ljava/dyn/CallSite;") \
template(makeDynamicCallSite_signature, "(Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;Ljava/lang/invoke/MemberName;I)Ljava/lang/invoke/CallSite;") \
template(makeDynamicCallSite_TRANS_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Lsun/dyn/MemberName;I)Ljava/dyn/CallSite;") /* AllowTransitionalJSR292 ONLY */ \
template(makeDynamicCallSite_TRANS2_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Ljava/dyn/MemberName;I)Ljava/dyn/CallSite;") /* AllowTransitionalJSR292 ONLY */ \
NOT_LP64( do_alias(machine_word_signature, int_signature) ) \
LP64_ONLY( do_alias(machine_word_signature, long_signature) ) \
\
@ -888,14 +909,15 @@
\
do_intrinsic(_invoke, java_lang_reflect_Method, invoke_name, object_object_array_object_signature, F_R) \
/* (symbols invoke_name and invoke_signature defined above) */ \
do_intrinsic(_checkSpreadArgument, java_dyn_MethodHandleNatives, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) \
do_intrinsic(_checkSpreadArgument_TRANS, sun_dyn_MethodHandleImpl, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) /* AllowTransitionalJSR292 ONLY */ \
do_intrinsic(_checkSpreadArgument, java_lang_invoke_MethodHandleNatives, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) \
do_intrinsic(_checkSpreadArgument_TRANS,sun_dyn_MethodHandleImpl, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) /* AllowTransitionalJSR292 ONLY */ \
do_intrinsic(_checkSpreadArgument_TRANS2,java_dyn_MethodHandleNatives, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) /* AllowTransitionalJSR292 ONLY */ \
do_name( checkSpreadArgument_name, "checkSpreadArgument") \
do_name( checkSpreadArgument_signature, "(Ljava/lang/Object;I)V") \
do_intrinsic(_invokeExact, java_dyn_MethodHandle, invokeExact_name, object_array_object_signature, F_RN) \
do_intrinsic(_invokeGeneric, java_dyn_MethodHandle, invokeGeneric_name, object_array_object_signature, F_RN) \
do_intrinsic(_invokeVarargs, java_dyn_MethodHandle, invokeVarargs_name, object_array_object_signature, F_R) \
do_intrinsic(_invokeDynamic, java_dyn_InvokeDynamic, star_name, object_array_object_signature, F_SN) \
do_intrinsic(_invokeExact, java_lang_invoke_MethodHandle, invokeExact_name, object_array_object_signature, F_RN) \
do_intrinsic(_invokeGeneric, java_lang_invoke_MethodHandle, invokeGeneric_name, object_array_object_signature, F_RN) \
do_intrinsic(_invokeVarargs, java_lang_invoke_MethodHandle, invokeVarargs_name, object_array_object_signature, F_R) \
do_intrinsic(_invokeDynamic, java_lang_invoke_InvokeDynamic, star_name, object_array_object_signature, F_SN) \
\
/* unboxing methods: */ \
do_intrinsic(_booleanValue, java_lang_Boolean, booleanValue_name, void_boolean_signature, F_R) \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -96,7 +96,7 @@ class AbstractInterpreter: AllStatic {
empty, // empty method (code: _return)
accessor, // accessor method (code: _aload_0, _getfield, _(a|i)return)
abstract, // abstract method (throws an AbstractMethodException)
method_handle, // java.dyn.MethodHandles::invoke
method_handle, // java.lang.invoke.MethodHandles::invoke
java_lang_math_sin, // implementation of java.lang.Math.sin (x)
java_lang_math_cos, // implementation of java.lang.Math.cos (x)
java_lang_math_tan, // implementation of java.lang.Math.tan (x)

View File

@ -369,7 +369,10 @@ IRT_ENTRY(void, InterpreterRuntime::throw_WrongMethodTypeException(JavaThread* t
}
// create exception
THROW_MSG(vmSymbols::java_dyn_WrongMethodTypeException(), message);
Symbol* java_lang_invoke_WrongMethodTypeException = vmSymbols::java_lang_invoke_WrongMethodTypeException();
if (AllowTransitionalJSR292)
java_lang_invoke_WrongMethodTypeException = SystemDictionaryHandles::WrongMethodTypeException_klass()->name();
THROW_MSG(java_lang_invoke_WrongMethodTypeException, message);
}
IRT_END
@ -794,7 +797,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
Handle info; // optional argument(s) in JVM_CONSTANT_InvokeDynamic
Handle bootm = SystemDictionary::find_bootstrap_method(caller_method, caller_bci,
main_index, info, CHECK);
if (!java_dyn_MethodHandle::is_instance(bootm())) {
if (!java_lang_invoke_MethodHandle::is_instance(bootm())) {
THROW_MSG(vmSymbols::java_lang_IllegalStateException(),
"no bootstrap method found for invokedynamic");
}

View File

@ -221,7 +221,7 @@ void LinkResolver::lookup_implicit_method(methodHandle& result,
// Make sure the Java part of the runtime has been booted up.
klassOop natives = SystemDictionary::MethodHandleNatives_klass();
if (natives == NULL || instanceKlass::cast(natives)->is_not_initialized()) {
Symbol* natives_name = vmSymbols::java_dyn_MethodHandleNatives();
Symbol* natives_name = vmSymbols::java_lang_invoke_MethodHandleNatives();
if (natives != NULL && AllowTransitionalJSR292) natives_name = Klass::cast(natives)->name();
SystemDictionary::resolve_or_fail(natives_name,
Handle(),
@ -300,7 +300,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle& re
}
void LinkResolver::resolve_dynamic_method(methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS) {
// The class is java.dyn.MethodHandle
// The class is java.lang.invoke.MethodHandle
resolved_klass = SystemDictionaryHandles::MethodHandle_klass();
Symbol* method_name = vmSymbols::invokeExact_name();

View File

@ -190,7 +190,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
);
void set_dynamic_call(
Handle call_site, // Resolved java.dyn.CallSite (f1)
Handle call_site, // Resolved java.lang.invoke.CallSite (f1)
methodHandle signature_invoker // determines signature information
);

View File

@ -2420,7 +2420,7 @@ void instanceKlass::oop_print_on(oop obj, outputStream* st) {
st->cr();
} else if (as_klassOop() == SystemDictionary::MethodType_klass()) {
st->print(BULLET"signature: ");
java_dyn_MethodType::print_signature(obj, st);
java_lang_invoke_MethodType::print_signature(obj, st);
st->cr();
}
}
@ -2451,7 +2451,7 @@ void instanceKlass::oop_print_value_on(oop obj, outputStream* st) {
}
} else if (as_klassOop() == SystemDictionary::MethodType_klass()) {
st->print(" = ");
java_dyn_MethodType::print_signature(obj, st);
java_lang_invoke_MethodType::print_signature(obj, st);
} else if (java_lang_boxing_object::is_instance(obj)) {
st->print(" = ");
java_lang_boxing_object::print(obj, st);

View File

@ -193,7 +193,7 @@ class instanceKlass: public Klass {
typeArrayOop _inner_classes;
// Implementors of this interface (not valid if it overflows)
klassOop _implementors[implementors_limit];
// invokedynamic bootstrap method (a java.dyn.MethodHandle)
// invokedynamic bootstrap method (a java.lang.invoke.MethodHandle)
oop _bootstrap_method; // AllowTransitionalJSR292 ONLY
// Annotations for this class, or null if none.
typeArrayOop _class_annotations;

View File

@ -865,7 +865,7 @@ bool methodOopDesc::is_method_handle_invoke_name(vmSymbols::SID name_sid) {
enum {
_imcp_invoke_name = 1, // utf8: 'invokeExact' or 'invokeGeneric'
_imcp_invoke_signature, // utf8: (variable Symbol*)
_imcp_method_type_value, // string: (variable java/dyn/MethodType, sic)
_imcp_method_type_value, // string: (variable java/lang/invoke/MethodType, sic)
_imcp_limit
};
@ -1091,7 +1091,8 @@ void methodOopDesc::init_intrinsic_id() {
vmSymbols::SID name_id = vmSymbols::find_sid(name());
if (name_id == vmSymbols::NO_SID) return;
vmSymbols::SID sig_id = vmSymbols::find_sid(signature());
if (klass_id != vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle)
if (klass_id != vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_MethodHandle)
&& !(klass_id == vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle) && AllowTransitionalJSR292)
&& sig_id == vmSymbols::NO_SID) return;
jshort flags = access_flags().as_short();
@ -1117,7 +1118,8 @@ void methodOopDesc::init_intrinsic_id() {
break;
// Signature-polymorphic methods: MethodHandle.invoke*, InvokeDynamic.*.
case vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle):
case vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_MethodHandle): // AllowTransitionalJSR292 ONLY
case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_MethodHandle):
if (is_static() || !is_native()) break;
switch (name_id) {
case vmSymbols::VM_SYMBOL_ENUM_NAME(invokeGeneric_name):
@ -1132,7 +1134,7 @@ void methodOopDesc::init_intrinsic_id() {
break;
}
break;
case vmSymbols::VM_SYMBOL_ENUM_NAME(java_dyn_InvokeDynamic):
case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_InvokeDynamic):
if (!is_static() || !is_native()) break;
id = vmIntrinsics::_invokeDynamic;
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -487,7 +487,7 @@ InlineTree *InlineTree::build_inline_tree_for_callee( ciMethod* callee_method, J
if (caller_jvms->method()->is_method_handle_adapter())
new_depth_adjust -= 1; // don't count actions in MH or indy adapter frames
else if (callee_method->is_method_handle_invoke()) {
new_depth_adjust -= 1; // don't count method handle calls from java.dyn implem
new_depth_adjust -= 1; // don't count method handle calls from java.lang.invoke implem
}
if (new_depth_adjust != 0 && PrintInlining) {
stringStream nm1; caller_jvms->method()->print_name(&nm1);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -199,7 +199,7 @@ JVMState* DynamicCallGenerator::generate(JVMState* jvms) {
Node* call_site = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw);
// Load the target MethodHandle from the CallSite object.
Node* target_mh_adr = kit.basic_plus_adr(call_site, call_site, java_dyn_CallSite::target_offset_in_bytes());
Node* target_mh_adr = kit.basic_plus_adr(call_site, call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
Node* target_mh = kit.make_load(kit.control(), target_mh_adr, TypeInstPtr::BOTTOM, T_OBJECT);
address resolve_stub = SharedRuntime::get_resolve_opt_virtual_call_stub();
@ -725,7 +725,7 @@ JVMState* PredictedDynamicCallGenerator::generate(JVMState* jvms) {
Node* call_site = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw);
// Load the target MethodHandle from the CallSite object.
Node* target_adr = kit.basic_plus_adr(call_site, call_site, java_dyn_CallSite::target_offset_in_bytes());
Node* target_adr = kit.basic_plus_adr(call_site, call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
Node* target_mh = kit.make_load(kit.control(), target_adr, TypeInstPtr::BOTTOM, T_OBJECT);
// Check if the MethodHandle is still the same.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -143,8 +143,8 @@ void Parse::do_get_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool
return;
}
else {
// final non-static field of a trusted class ({java,sun}.dyn
// classes).
// final non-static field of a trusted class (classes in
// java.lang.invoke and sun.invoke packages and subpackages).
if (obj->is_Con()) {
const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();
ciObject* constant_oop = oop_ptr->const_oop();

View File

@ -36,7 +36,7 @@
// MethodHandleChain
void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
if (!java_dyn_MethodHandle::is_instance(mh())) lose("bad method handle", CHECK);
if (!java_lang_invoke_MethodHandle::is_instance(mh())) lose("bad method handle", CHECK);
// set current method handle and unpack partially
_method_handle = mh;
@ -47,21 +47,21 @@ void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
_conversion = -1;
_last_invoke = Bytecodes::_nop; //arbitrary non-garbage
if (sun_dyn_DirectMethodHandle::is_instance(mh())) {
if (java_lang_invoke_DirectMethodHandle::is_instance(mh())) {
set_last_method(mh(), THREAD);
return;
}
if (sun_dyn_AdapterMethodHandle::is_instance(mh())) {
if (java_lang_invoke_AdapterMethodHandle::is_instance(mh())) {
_conversion = AdapterMethodHandle_conversion();
assert(_conversion != -1, "bad conv value");
assert(sun_dyn_BoundMethodHandle::is_instance(mh()), "also BMH");
assert(java_lang_invoke_BoundMethodHandle::is_instance(mh()), "also BMH");
}
if (sun_dyn_BoundMethodHandle::is_instance(mh())) {
if (java_lang_invoke_BoundMethodHandle::is_instance(mh())) {
if (!is_adapter()) // keep AMH and BMH separate in this model
_is_bound = true;
_arg_slot = BoundMethodHandle_vmargslot();
oop target = MethodHandle_vmtarget_oop();
if (!is_bound() || java_dyn_MethodHandle::is_instance(target)) {
if (!is_bound() || java_lang_invoke_MethodHandle::is_instance(target)) {
_arg_type = compute_bound_arg_type(target, NULL, _arg_slot, CHECK);
} else if (target != NULL && target->is_method()) {
methodOop m = (methodOop) target;
@ -102,10 +102,10 @@ BasicType MethodHandleChain::compute_bound_arg_type(oop target, methodOop m, int
// It is implied by the _vmentry code, and by the MethodType of the target.
BasicType arg_type = T_VOID;
if (target != NULL) {
oop mtype = java_dyn_MethodHandle::type(target);
oop mtype = java_lang_invoke_MethodHandle::type(target);
int arg_num = MethodHandles::argument_slot_to_argnum(mtype, arg_slot);
if (arg_num >= 0) {
oop ptype = java_dyn_MethodType::ptype(mtype, arg_num);
oop ptype = java_lang_invoke_MethodType::ptype(mtype, arg_num);
arg_type = java_lang_Class::as_BasicType(ptype);
}
} else if (m != NULL) {
@ -204,28 +204,28 @@ MethodHandleWalker::walk(TRAPS) {
int arg_slot = chain().adapter_arg_slot();
SlotState* arg_state = slot_state(arg_slot);
if (arg_state == NULL
&& conv_op > sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW) {
&& conv_op > java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW) {
lose("bad argument index", CHECK_(empty));
}
// perform the adapter action
switch (chain().adapter_conversion_op()) {
case sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY:
case java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY:
// No changes to arguments; pass the bits through.
break;
case sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW: {
case java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW: {
// To keep the verifier happy, emit bitwise ("raw") conversions as needed.
// See MethodHandles::same_basic_type_for_arguments for allowed conversions.
Handle incoming_mtype(THREAD, chain().method_type_oop());
oop outgoing_mh_oop = chain().vmtarget_oop();
if (!java_dyn_MethodHandle::is_instance(outgoing_mh_oop))
if (!java_lang_invoke_MethodHandle::is_instance(outgoing_mh_oop))
lose("outgoing target not a MethodHandle", CHECK_(empty));
Handle outgoing_mtype(THREAD, java_dyn_MethodHandle::type(outgoing_mh_oop));
Handle outgoing_mtype(THREAD, java_lang_invoke_MethodHandle::type(outgoing_mh_oop));
outgoing_mh_oop = NULL; // GC safety
int nptypes = java_dyn_MethodType::ptype_count(outgoing_mtype());
if (nptypes != java_dyn_MethodType::ptype_count(incoming_mtype()))
int nptypes = java_lang_invoke_MethodType::ptype_count(outgoing_mtype());
if (nptypes != java_lang_invoke_MethodType::ptype_count(incoming_mtype()))
lose("incoming and outgoing parameter count do not agree", CHECK_(empty));
for (int i = 0, slot = _outgoing.length() - 1; slot >= 0; slot--) {
@ -235,8 +235,8 @@ MethodHandleWalker::walk(TRAPS) {
klassOop in_klass = NULL;
klassOop out_klass = NULL;
BasicType inpbt = java_lang_Class::as_BasicType(java_dyn_MethodType::ptype(incoming_mtype(), i), &in_klass);
BasicType outpbt = java_lang_Class::as_BasicType(java_dyn_MethodType::ptype(outgoing_mtype(), i), &out_klass);
BasicType inpbt = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::ptype(incoming_mtype(), i), &in_klass);
BasicType outpbt = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::ptype(outgoing_mtype(), i), &out_klass);
assert(inpbt == arg.basic_type(), "sanity");
if (inpbt != outpbt) {
@ -254,8 +254,8 @@ MethodHandleWalker::walk(TRAPS) {
i++; // We need to skip void slots at the top of the loop.
}
BasicType inrbt = java_lang_Class::as_BasicType(java_dyn_MethodType::rtype(incoming_mtype()));
BasicType outrbt = java_lang_Class::as_BasicType(java_dyn_MethodType::rtype(outgoing_mtype()));
BasicType inrbt = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::rtype(incoming_mtype()));
BasicType outrbt = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::rtype(outgoing_mtype()));
if (inrbt != outrbt) {
if (inrbt == T_INT && outrbt == T_VOID) {
// See comments in MethodHandles::same_basic_type_for_arguments.
@ -267,7 +267,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_CHECK_CAST: {
case java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST: {
// checkcast the Nth outgoing argument in place
klassOop dest_klass = NULL;
BasicType dest = java_lang_Class::as_BasicType(chain().adapter_arg_oop(), &dest_klass);
@ -280,7 +280,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM: {
case java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM: {
// i2l, etc., on the Nth outgoing argument in place
BasicType src = chain().adapter_conversion_src_type(),
dest = chain().adapter_conversion_dest_type();
@ -305,7 +305,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM: {
case java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM: {
// checkcast to wrapper type & call intValue, etc.
BasicType dest = chain().adapter_conversion_dest_type();
ArgToken arg = arg_state->_arg;
@ -323,7 +323,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_PRIM_TO_REF: {
case java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF: {
// call wrapper type.valueOf
BasicType src = chain().adapter_conversion_src_type();
ArgToken arg = arg_state->_arg;
@ -339,7 +339,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS: {
case java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS: {
int dest_arg_slot = chain().adapter_conversion_vminfo();
if (!slot_has_argument(dest_arg_slot)) {
lose("bad swap index", CHECK_(empty));
@ -352,7 +352,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_ROT_ARGS: {
case java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS: {
int dest_arg_slot = chain().adapter_conversion_vminfo();
if (!slot_has_argument(dest_arg_slot) || arg_slot == dest_arg_slot) {
lose("bad rotate index", CHECK_(empty));
@ -378,7 +378,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_DUP_ARGS: {
case java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS: {
int dup_slots = chain().adapter_conversion_stack_pushes();
if (dup_slots <= 0) {
lose("bad dup count", CHECK_(empty));
@ -392,7 +392,7 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_DROP_ARGS: {
case java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS: {
int drop_slots = -chain().adapter_conversion_stack_pushes();
if (drop_slots <= 0) {
lose("bad drop count", CHECK_(empty));
@ -406,12 +406,12 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_COLLECT_ARGS: { //NYI, may GC
case java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS: { //NYI, may GC
lose("unimplemented", CHECK_(empty));
break;
}
case sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS: {
case java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS: {
klassOop array_klass_oop = NULL;
BasicType array_type = java_lang_Class::as_BasicType(chain().adapter_arg_oop(),
&array_klass_oop);
@ -469,8 +469,8 @@ MethodHandleWalker::walk(TRAPS) {
break;
}
case sun_dyn_AdapterMethodHandle::OP_FLYBY: //NYI, runs Java code
case sun_dyn_AdapterMethodHandle::OP_RICOCHET: //NYI, runs Java code
case java_lang_invoke_AdapterMethodHandle::OP_FLYBY: //NYI, runs Java code
case java_lang_invoke_AdapterMethodHandle::OP_RICOCHET: //NYI, runs Java code
lose("unimplemented", CHECK_(empty));
break;
@ -532,7 +532,7 @@ MethodHandleWalker::walk(TRAPS) {
//
void MethodHandleWalker::walk_incoming_state(TRAPS) {
Handle mtype(THREAD, chain().method_type_oop());
int nptypes = java_dyn_MethodType::ptype_count(mtype());
int nptypes = java_lang_invoke_MethodType::ptype_count(mtype());
_outgoing_argc = nptypes;
int argp = nptypes - 1;
if (argp >= 0) {
@ -541,7 +541,7 @@ void MethodHandleWalker::walk_incoming_state(TRAPS) {
for (int i = 0; i < nptypes; i++) {
klassOop arg_type_klass = NULL;
BasicType arg_type = java_lang_Class::as_BasicType(
java_dyn_MethodType::ptype(mtype(), i), &arg_type_klass);
java_lang_invoke_MethodType::ptype(mtype(), i), &arg_type_klass);
int index = new_local_index(arg_type);
ArgToken arg = make_parameter(arg_type, arg_type_klass, index, CHECK);
debug_only(arg_type_klass = (klassOop) NULL);
@ -555,7 +555,7 @@ void MethodHandleWalker::walk_incoming_state(TRAPS) {
// call make_parameter at the end of the list for the return type
klassOop ret_type_klass = NULL;
BasicType ret_type = java_lang_Class::as_BasicType(
java_dyn_MethodType::rtype(mtype()), &ret_type_klass);
java_lang_invoke_MethodType::rtype(mtype()), &ret_type_klass);
ArgToken ret = make_parameter(ret_type, ret_type_klass, -1, CHECK);
// ignore ret; client can catch it if needed
}
@ -630,7 +630,7 @@ MethodHandleCompiler::MethodHandleCompiler(Handle root, methodHandle callee, boo
// Get return type klass.
Handle first_mtype(THREAD, chain().method_type_oop());
// _rklass is NULL for primitives.
_rtype = java_lang_Class::as_BasicType(java_dyn_MethodType::rtype(first_mtype()), &_rklass);
_rtype = java_lang_Class::as_BasicType(java_lang_invoke_MethodType::rtype(first_mtype()), &_rklass);
if (_rtype == T_ARRAY) _rtype = T_OBJECT;
int params = _callee->size_of_parameters(); // Incoming arguments plus receiver.
@ -961,6 +961,9 @@ MethodHandleCompiler::make_invoke(methodOop m, vmIntrinsics::ID iid,
m = vmIntrinsics::method_for(iid);
if (m == NULL && iid == vmIntrinsics::_checkSpreadArgument && AllowTransitionalJSR292) {
m = vmIntrinsics::method_for(vmIntrinsics::_checkSpreadArgument_TRANS);
if (m == NULL)
// sun.dyn.MethodHandleImpl not found, look for java.dyn.MethodHandleNatives:
m = vmIntrinsics::method_for(vmIntrinsics::_checkSpreadArgument_TRANS2);
}
if (m == NULL) {
ArgToken zero;
@ -1402,7 +1405,7 @@ extern "C"
void print_method_handle(oop mh) {
if (!mh->is_oop()) {
tty->print_cr("*** not a method handle: "INTPTR_FORMAT, (intptr_t)mh);
} else if (java_dyn_MethodHandle::is_instance(mh)) {
} else if (java_lang_invoke_MethodHandle::is_instance(mh)) {
//MethodHandlePrinter::print(mh);
} else {
tty->print("*** not a method handle: ");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -48,13 +48,13 @@ private:
void set_last_method(oop target, TRAPS);
static BasicType compute_bound_arg_type(oop target, methodOop m, int arg_slot, TRAPS);
oop MethodHandle_type_oop() { return java_dyn_MethodHandle::type(method_handle_oop()); }
oop MethodHandle_vmtarget_oop() { return java_dyn_MethodHandle::vmtarget(method_handle_oop()); }
int MethodHandle_vmslots() { return java_dyn_MethodHandle::vmslots(method_handle_oop()); }
int DirectMethodHandle_vmindex() { return sun_dyn_DirectMethodHandle::vmindex(method_handle_oop()); }
oop BoundMethodHandle_argument_oop() { return sun_dyn_BoundMethodHandle::argument(method_handle_oop()); }
int BoundMethodHandle_vmargslot() { return sun_dyn_BoundMethodHandle::vmargslot(method_handle_oop()); }
int AdapterMethodHandle_conversion() { return sun_dyn_AdapterMethodHandle::conversion(method_handle_oop()); }
oop MethodHandle_type_oop() { return java_lang_invoke_MethodHandle::type(method_handle_oop()); }
oop MethodHandle_vmtarget_oop() { return java_lang_invoke_MethodHandle::vmtarget(method_handle_oop()); }
int MethodHandle_vmslots() { return java_lang_invoke_MethodHandle::vmslots(method_handle_oop()); }
int DirectMethodHandle_vmindex() { return java_lang_invoke_DirectMethodHandle::vmindex(method_handle_oop()); }
oop BoundMethodHandle_argument_oop() { return java_lang_invoke_BoundMethodHandle::argument(method_handle_oop()); }
int BoundMethodHandle_vmargslot() { return java_lang_invoke_BoundMethodHandle::vmargslot(method_handle_oop()); }
int AdapterMethodHandle_conversion() { return java_lang_invoke_AdapterMethodHandle::conversion(method_handle_oop()); }
public:
MethodHandleChain(Handle root, TRAPS)

File diff suppressed because it is too large Load Diff

View File

@ -37,8 +37,8 @@ class MethodHandleEntry;
class MethodHandles: AllStatic {
// JVM support for MethodHandle, MethodType, and related types
// in java.dyn and java.dyn.hotspot.
// See also javaClasses for layouts java_dyn_Method{Handle,Type,Type::Form}.
// in java.lang.invoke and sun.invoke.
// See also javaClasses for layouts java_lang_invoke_Method{Handle,Type,Type::Form}.
public:
enum EntryKind {
_raise_exception, // stub for error generation from other stubs
@ -54,21 +54,21 @@ class MethodHandles: AllStatic {
_bound_long_direct_mh,
_adapter_mh_first, // adapter sequence goes here...
_adapter_retype_only = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY,
_adapter_retype_raw = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW,
_adapter_check_cast = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_CHECK_CAST,
_adapter_prim_to_prim = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM,
_adapter_ref_to_prim = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM,
_adapter_prim_to_ref = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_PRIM_TO_REF,
_adapter_swap_args = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS,
_adapter_rot_args = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_ROT_ARGS,
_adapter_dup_args = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_DUP_ARGS,
_adapter_drop_args = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_DROP_ARGS,
_adapter_collect_args = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_COLLECT_ARGS,
_adapter_spread_args = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS,
_adapter_flyby = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_FLYBY,
_adapter_ricochet = _adapter_mh_first + sun_dyn_AdapterMethodHandle::OP_RICOCHET,
_adapter_mh_last = _adapter_mh_first + sun_dyn_AdapterMethodHandle::CONV_OP_LIMIT - 1,
_adapter_retype_only = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY,
_adapter_retype_raw = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW,
_adapter_check_cast = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST,
_adapter_prim_to_prim = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM,
_adapter_ref_to_prim = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM,
_adapter_prim_to_ref = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF,
_adapter_swap_args = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS,
_adapter_rot_args = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS,
_adapter_dup_args = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS,
_adapter_drop_args = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS,
_adapter_collect_args = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS,
_adapter_spread_args = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS,
_adapter_flyby = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_FLYBY,
_adapter_ricochet = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::OP_RICOCHET,
_adapter_mh_last = _adapter_mh_first + java_lang_invoke_AdapterMethodHandle::CONV_OP_LIMIT - 1,
// Optimized adapter types
@ -107,16 +107,16 @@ class MethodHandles: AllStatic {
static void set_enabled(bool z);
private:
enum { // import sun_dyn_AdapterMethodHandle::CONV_OP_*
CONV_OP_LIMIT = sun_dyn_AdapterMethodHandle::CONV_OP_LIMIT,
CONV_OP_MASK = sun_dyn_AdapterMethodHandle::CONV_OP_MASK,
CONV_VMINFO_MASK = sun_dyn_AdapterMethodHandle::CONV_VMINFO_MASK,
CONV_VMINFO_SHIFT = sun_dyn_AdapterMethodHandle::CONV_VMINFO_SHIFT,
CONV_OP_SHIFT = sun_dyn_AdapterMethodHandle::CONV_OP_SHIFT,
CONV_DEST_TYPE_SHIFT = sun_dyn_AdapterMethodHandle::CONV_DEST_TYPE_SHIFT,
CONV_SRC_TYPE_SHIFT = sun_dyn_AdapterMethodHandle::CONV_SRC_TYPE_SHIFT,
CONV_STACK_MOVE_SHIFT = sun_dyn_AdapterMethodHandle::CONV_STACK_MOVE_SHIFT,
CONV_STACK_MOVE_MASK = sun_dyn_AdapterMethodHandle::CONV_STACK_MOVE_MASK
enum { // import java_lang_invoke_AdapterMethodHandle::CONV_OP_*
CONV_OP_LIMIT = java_lang_invoke_AdapterMethodHandle::CONV_OP_LIMIT,
CONV_OP_MASK = java_lang_invoke_AdapterMethodHandle::CONV_OP_MASK,
CONV_VMINFO_MASK = java_lang_invoke_AdapterMethodHandle::CONV_VMINFO_MASK,
CONV_VMINFO_SHIFT = java_lang_invoke_AdapterMethodHandle::CONV_VMINFO_SHIFT,
CONV_OP_SHIFT = java_lang_invoke_AdapterMethodHandle::CONV_OP_SHIFT,
CONV_DEST_TYPE_SHIFT = java_lang_invoke_AdapterMethodHandle::CONV_DEST_TYPE_SHIFT,
CONV_SRC_TYPE_SHIFT = java_lang_invoke_AdapterMethodHandle::CONV_SRC_TYPE_SHIFT,
CONV_STACK_MOVE_SHIFT = java_lang_invoke_AdapterMethodHandle::CONV_STACK_MOVE_SHIFT,
CONV_STACK_MOVE_MASK = java_lang_invoke_AdapterMethodHandle::CONV_STACK_MOVE_MASK
};
static bool _enabled;
@ -471,7 +471,7 @@ class MethodHandles: AllStatic {
};
// Access methods for the "entry" field of a java.dyn.MethodHandle.
// Access methods for the "entry" field of a java.lang.invoke.MethodHandle.
// The field is primarily a jump target for compiled calls.
// However, we squirrel away some nice pointers for other uses,
// just before the jump target.

View File

@ -116,6 +116,7 @@ static JNINativeMethod lookup_special_native_methods[] = {
{ CC"Java_java_io_ObjectInputStream_setPrimitiveFieldValues", NULL, FN_PTR(JVM_SetPrimitiveFieldValues) }, // intercept ObjectInputStream setPrimitiveFieldValues for faster serialization
{ CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) },
{ CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },
{ CC"Java_sun_dyn_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, // AllowTransitionalJSR292
{ CC"Java_java_dyn_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, // AllowTransitionalJSR292
{ CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }