956 #if INCLUDE_CDS |
956 #if INCLUDE_CDS |
957 // Called by class data sharing to remove any entry points (which are not shared) |
957 // Called by class data sharing to remove any entry points (which are not shared) |
958 void Method::unlink_method() { |
958 void Method::unlink_method() { |
959 _code = NULL; |
959 _code = NULL; |
960 |
960 |
961 assert(DumpSharedSpaces, "dump time only"); |
961 assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only"); |
962 // Set the values to what they should be at run time. Note that |
962 // Set the values to what they should be at run time. Note that |
963 // this Method can no longer be executed during dump time. |
963 // this Method can no longer be executed during dump time. |
964 _i2i_entry = Interpreter::entry_for_cds_method(this); |
964 _i2i_entry = Interpreter::entry_for_cds_method(this); |
965 _from_interpreted_entry = _i2i_entry; |
965 _from_interpreted_entry = _i2i_entry; |
966 |
966 |
|
967 if (DynamicDumpSharedSpaces) { |
|
968 assert(_from_compiled_entry != NULL, "sanity"); |
|
969 } else { |
|
970 // TODO: Simplify the adapter trampoline allocation for static archiving. |
|
971 // Remove the use of CDSAdapterHandlerEntry. |
|
972 CDSAdapterHandlerEntry* cds_adapter = (CDSAdapterHandlerEntry*)adapter(); |
|
973 constMethod()->set_adapter_trampoline(cds_adapter->get_adapter_trampoline()); |
|
974 _from_compiled_entry = cds_adapter->get_c2i_entry_trampoline(); |
|
975 assert(*((int*)_from_compiled_entry) == 0, |
|
976 "must be NULL during dump time, to be initialized at run time"); |
|
977 } |
|
978 |
967 if (is_native()) { |
979 if (is_native()) { |
968 *native_function_addr() = NULL; |
980 *native_function_addr() = NULL; |
969 set_signature_handler(NULL); |
981 set_signature_handler(NULL); |
970 } |
982 } |
971 NOT_PRODUCT(set_compiled_invocation_count(0);) |
983 NOT_PRODUCT(set_compiled_invocation_count(0);) |
972 |
|
973 CDSAdapterHandlerEntry* cds_adapter = (CDSAdapterHandlerEntry*)adapter(); |
|
974 constMethod()->set_adapter_trampoline(cds_adapter->get_adapter_trampoline()); |
|
975 _from_compiled_entry = cds_adapter->get_c2i_entry_trampoline(); |
|
976 assert(*((int*)_from_compiled_entry) == 0, "must be NULL during dump time, to be initialized at run time"); |
|
977 |
984 |
978 set_method_data(NULL); |
985 set_method_data(NULL); |
979 clear_method_counters(); |
986 clear_method_counters(); |
980 } |
987 } |
981 #endif |
988 #endif |