hotspot/src/share/vm/oops/methodOop.cpp

Print this page




 917   cp->symbol_at_put(_imcp_invoke_signature,  signature);
 918   cp->string_at_put(_imcp_method_type_value, Universe::the_null_string());
 919   cp->set_pool_holder(holder());
 920 
 921   // set up the fancy stuff:
 922   cp->pseudo_string_at_put(_imcp_method_type_value, method_type());
 923   methodHandle m;
 924   {
 925     int flags_bits = (JVM_MH_INVOKE_BITS | JVM_ACC_PUBLIC | JVM_ACC_FINAL);
 926     methodOop m_oop = oopFactory::new_method(0, accessFlags_from(flags_bits),
 927                                              0, 0, 0, IsSafeConc, CHECK_(empty));
 928     m = methodHandle(THREAD, m_oop);
 929   }
 930   m->set_constants(cp());
 931   m->set_name_index(_imcp_invoke_name);
 932   m->set_signature_index(_imcp_invoke_signature);
 933   assert(is_method_handle_invoke_name(m->name()), "");
 934   assert(m->signature() == signature, "");
 935   assert(m->is_method_handle_invoke(), "");
 936 #ifdef CC_INTERP
 937   ResultTypeFinder rtf(signature());
 938   m->set_result_index(rtf.type());
 939 #endif
 940   m->compute_size_of_parameters(THREAD);
 941   m->set_exception_table(Universe::the_empty_int_array());
 942   m->init_intrinsic_id();
 943   assert(m->intrinsic_id() == vmIntrinsics::_invokeExact ||
 944          m->intrinsic_id() == vmIntrinsics::_invokeGeneric, "must be an invoker");
 945 
 946   // Finally, set up its entry points.
 947   assert(m->method_handle_type() == method_type(), "");
 948   assert(m->can_be_statically_bound(), "");
 949   m->set_vtable_index(methodOopDesc::nonvirtual_vtable_index);
 950   m->link_method(m, CHECK_(empty));
 951 
 952 #ifdef ASSERT
 953   // Make sure the pointer chase works.
 954   address p = (address) m();
 955   for (jint* pchase = method_type_offsets_chain(); (*pchase) != -1; pchase++) {
 956     p = *(address*)(p + (*pchase));
 957   }




 917   cp->symbol_at_put(_imcp_invoke_signature,  signature);
 918   cp->string_at_put(_imcp_method_type_value, Universe::the_null_string());
 919   cp->set_pool_holder(holder());
 920 
 921   // set up the fancy stuff:
 922   cp->pseudo_string_at_put(_imcp_method_type_value, method_type());
 923   methodHandle m;
 924   {
 925     int flags_bits = (JVM_MH_INVOKE_BITS | JVM_ACC_PUBLIC | JVM_ACC_FINAL);
 926     methodOop m_oop = oopFactory::new_method(0, accessFlags_from(flags_bits),
 927                                              0, 0, 0, IsSafeConc, CHECK_(empty));
 928     m = methodHandle(THREAD, m_oop);
 929   }
 930   m->set_constants(cp());
 931   m->set_name_index(_imcp_invoke_name);
 932   m->set_signature_index(_imcp_invoke_signature);
 933   assert(is_method_handle_invoke_name(m->name()), "");
 934   assert(m->signature() == signature, "");
 935   assert(m->is_method_handle_invoke(), "");
 936 #ifdef CC_INTERP
 937   ResultTypeFinder rtf(signature);
 938   m->set_result_index(rtf.type());
 939 #endif
 940   m->compute_size_of_parameters(THREAD);
 941   m->set_exception_table(Universe::the_empty_int_array());
 942   m->init_intrinsic_id();
 943   assert(m->intrinsic_id() == vmIntrinsics::_invokeExact ||
 944          m->intrinsic_id() == vmIntrinsics::_invokeGeneric, "must be an invoker");
 945 
 946   // Finally, set up its entry points.
 947   assert(m->method_handle_type() == method_type(), "");
 948   assert(m->can_be_statically_bound(), "");
 949   m->set_vtable_index(methodOopDesc::nonvirtual_vtable_index);
 950   m->link_method(m, CHECK_(empty));
 951 
 952 #ifdef ASSERT
 953   // Make sure the pointer chase works.
 954   address p = (address) m();
 955   for (jint* pchase = method_type_offsets_chain(); (*pchase) != -1; pchase++) {
 956     p = *(address*)(p + (*pchase));
 957   }