< prev index next >
src/hotspot/share/runtime/sharedRuntime.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1997, 2019, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 2561,2573 ****
public:
AdapterHandlerTable()
: BasicHashtable<mtCode>(293, (DumpSharedSpaces ? sizeof(CDSAdapterHandlerEntry) : sizeof(AdapterHandlerEntry))) { }
// Create a new entry suitable for insertion in the table
! AdapterHandlerEntry* new_entry(AdapterFingerPrint* fingerprint, address i2c_entry, address c2i_entry, address c2i_value_entry, address c2i_value_ro_entry, address c2i_unverified_entry) {
AdapterHandlerEntry* entry = (AdapterHandlerEntry*)BasicHashtable<mtCode>::new_entry(fingerprint->compute_hash());
! entry->init(fingerprint, i2c_entry, c2i_entry, c2i_value_entry, c2i_value_ro_entry, c2i_unverified_entry);
if (DumpSharedSpaces) {
((CDSAdapterHandlerEntry*)entry)->init();
}
return entry;
}
--- 2561,2576 ----
public:
AdapterHandlerTable()
: BasicHashtable<mtCode>(293, (DumpSharedSpaces ? sizeof(CDSAdapterHandlerEntry) : sizeof(AdapterHandlerEntry))) { }
// Create a new entry suitable for insertion in the table
! AdapterHandlerEntry* new_entry(AdapterFingerPrint* fingerprint, address i2c_entry, address c2i_entry,
! address c2i_value_entry, address c2i_value_ro_entry,
! address c2i_unverified_entry, address c2i_unverified_value_entry) {
AdapterHandlerEntry* entry = (AdapterHandlerEntry*)BasicHashtable<mtCode>::new_entry(fingerprint->compute_hash());
! entry->init(fingerprint, i2c_entry, c2i_entry, c2i_value_entry, c2i_value_ro_entry,
! c2i_unverified_entry, c2i_unverified_value_entry);
if (DumpSharedSpaces) {
((CDSAdapterHandlerEntry*)entry)->init();
}
return entry;
}
*** 2706,2725 ****
// Pass wrong_method_abstract for the c2i transitions to return
// AbstractMethodError for invalid invocations.
address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
_abstract_method_handler = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(NULL),
StubRoutines::throw_AbstractMethodError_entry(),
! wrong_method_abstract, wrong_method_abstract, wrong_method_abstract, wrong_method_abstract);
}
AdapterHandlerEntry* AdapterHandlerLibrary::new_entry(AdapterFingerPrint* fingerprint,
address i2c_entry,
address c2i_entry,
address c2i_value_entry,
address c2i_value_ro_entry,
! address c2i_unverified_entry) {
! return _adapters->new_entry(fingerprint, i2c_entry, c2i_entry, c2i_value_entry, c2i_value_ro_entry, c2i_unverified_entry);
}
AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(const methodHandle& method) {
AdapterHandlerEntry* entry = get_adapter0(method);
if (method->is_shared()) {
--- 2709,2731 ----
// Pass wrong_method_abstract for the c2i transitions to return
// AbstractMethodError for invalid invocations.
address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
_abstract_method_handler = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(NULL),
StubRoutines::throw_AbstractMethodError_entry(),
! wrong_method_abstract, wrong_method_abstract, wrong_method_abstract,
! wrong_method_abstract, wrong_method_abstract);
}
AdapterHandlerEntry* AdapterHandlerLibrary::new_entry(AdapterFingerPrint* fingerprint,
address i2c_entry,
address c2i_entry,
address c2i_value_entry,
address c2i_value_ro_entry,
! address c2i_unverified_entry,
! address c2i_unverified_value_entry) {
! return _adapters->new_entry(fingerprint, i2c_entry, c2i_entry, c2i_value_entry, c2i_value_ro_entry, c2i_unverified_entry,
! c2i_unverified_value_entry);
}
AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(const methodHandle& method) {
AdapterHandlerEntry* entry = get_adapter0(method);
if (method->is_shared()) {
*** 2939,2949 ****
// Save a C heap allocated version of the signature for abstract methods with scalarized value type arguments
assert(ValueTypePassFieldsAsArgs && has_value_arg, "must have scalarized value type args");
address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
entry = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(NULL),
StubRoutines::throw_AbstractMethodError_entry(),
! wrong_method_abstract, wrong_method_abstract, wrong_method_abstract, wrong_method_abstract);
GrowableArray<SigEntry>* heap_sig = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<SigEntry>(sig_cc_ro.length(), true);
heap_sig->appendAll(&sig_cc_ro);
entry->set_sig_cc(heap_sig);
return entry;
}
--- 2945,2956 ----
// Save a C heap allocated version of the signature for abstract methods with scalarized value type arguments
assert(ValueTypePassFieldsAsArgs && has_value_arg, "must have scalarized value type args");
address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
entry = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(NULL),
StubRoutines::throw_AbstractMethodError_entry(),
! wrong_method_abstract, wrong_method_abstract, wrong_method_abstract,
! wrong_method_abstract, wrong_method_abstract);
GrowableArray<SigEntry>* heap_sig = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<SigEntry>(sig_cc_ro.length(), true);
heap_sig->appendAll(&sig_cc_ro);
entry->set_sig_cc(heap_sig);
return entry;
}
*** 3072,3081 ****
--- 3079,3089 ----
if (base == NULL) base = _c2i_entry;
assert(base <= _c2i_entry || _c2i_entry == NULL, "");
assert(base <= _c2i_value_entry || _c2i_value_entry == NULL, "");
assert(base <= _c2i_value_ro_entry || _c2i_value_ro_entry == NULL, "");
assert(base <= _c2i_unverified_entry || _c2i_unverified_entry == NULL, "");
+ assert(base <= _c2i_unverified_value_entry || _c2i_unverified_value_entry == NULL, "");
return base;
}
void AdapterHandlerEntry::relocate(address new_base) {
address old_base = base_address();
*** 3089,3098 ****
--- 3097,3108 ----
_c2i_value_entry += delta;
if (_c2i_value_ro_entry != NULL)
_c2i_value_ro_entry += delta;
if (_c2i_unverified_entry != NULL)
_c2i_unverified_entry += delta;
+ if (_c2i_unverified_value_entry != NULL)
+ _c2i_unverified_value_entry += delta;
assert(base_address() == new_base, "");
}
void AdapterHandlerEntry::deallocate() {
*** 3435,3447 ****
}
assert(false, "Should have found handler");
}
void AdapterHandlerEntry::print_adapter_on(outputStream* st) const {
! st->print_cr("AHE@" INTPTR_FORMAT ": %s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iVE: " INTPTR_FORMAT " c2iVROE: " INTPTR_FORMAT " c2iUE: " INTPTR_FORMAT,
p2i(this), fingerprint()->as_string(),
! p2i(get_i2c_entry()), p2i(get_c2i_entry()), p2i(get_c2i_value_entry()), p2i(get_c2i_value_ro_entry()), p2i(get_c2i_unverified_entry()));
}
#if INCLUDE_CDS
--- 3445,3459 ----
}
assert(false, "Should have found handler");
}
void AdapterHandlerEntry::print_adapter_on(outputStream* st) const {
! st->print_cr("AHE@" INTPTR_FORMAT ": %s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iVE: " INTPTR_FORMAT
! " c2iVROE: " INTPTR_FORMAT " c2iUE: " INTPTR_FORMAT " c2iUVE: " INTPTR_FORMAT,
p2i(this), fingerprint()->as_string(),
! p2i(get_i2c_entry()), p2i(get_c2i_entry()), p2i(get_c2i_value_entry()),
! p2i(get_c2i_value_ro_entry()), p2i(get_c2i_unverified_entry()), p2i(get_c2i_unverified_value_entry()));
}
#if INCLUDE_CDS
< prev index next >