comparison src/share/vm/oops/cpCacheOop.cpp @ 1507:cd5dbf694d45

6939134: JSR 292 adjustments to method handle invocation Summary: split MethodHandle.invoke into invokeExact and invokeGeneric; also clean up JVM-to-Java interfaces Reviewed-by: twisti
author jrose
date Sat, 01 May 2010 02:42:18 -0700
parents 389049f3f393
children c18cbe5936b8
comparison
equal deleted inserted replaced
1506:2338d41fbd81 1507:cd5dbf694d45
216 set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | method()->size_of_parameters()); 216 set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | method()->size_of_parameters());
217 set_bytecode_1(Bytecodes::_invokeinterface); 217 set_bytecode_1(Bytecodes::_invokeinterface);
218 } 218 }
219 219
220 220
221 void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, int extra_data) { 221 void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site,
222 methodOop method = (methodOop) java_dyn_CallSite::vmmethod(call_site()); 222 methodHandle signature_invoker) {
223 assert(method->is_method(), "must be initialized properly"); 223 int param_size = signature_invoker->size_of_parameters();
224 int param_size = method->size_of_parameters();
225 assert(param_size >= 1, "method argument size must include MH.this"); 224 assert(param_size >= 1, "method argument size must include MH.this");
226 param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic 225 param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic
227 if (Atomic::cmpxchg_ptr(call_site(), &_f1, NULL) == NULL) { 226 if (Atomic::cmpxchg_ptr(call_site(), &_f1, NULL) == NULL) {
228 // racing threads might be trying to install their own favorites 227 // racing threads might be trying to install their own favorites
229 set_f1(call_site()); 228 set_f1(call_site());
230 } 229 }
231 set_f2(extra_data); 230 //set_f2(0);
232 set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | param_size); 231 bool is_final = true;
232 assert(signature_invoker->is_final_method(), "is_final");
233 set_flags(as_flags(as_TosState(signature_invoker->result_type()), is_final, false, false, false, true) | param_size);
233 // do not do set_bytecode on a secondary CP cache entry 234 // do not do set_bytecode on a secondary CP cache entry
234 //set_bytecode_1(Bytecodes::_invokedynamic); 235 //set_bytecode_1(Bytecodes::_invokedynamic);
235 } 236 }
236 237
237 238