RFR: 8258408: SystemDictionary passes TRAPS to functions that don't throw exceptions [v2]
David Holmes
dholmes at openjdk.java.net
Fri Dec 18 04:18:58 UTC 2020
On Fri, 18 Dec 2020 02:14:44 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> // definer must notify any waiting threads
>> {
>> MutexLocker mu(THREAD, SystemDictionary_lock);
>> PlaceholderEntry* probe = placeholders()->get_entry(name_hash, name_h, loader_data);
>> assert(probe != NULL, "DEFINE_CLASS placeholder lost?");
>> if (!HAS_PENDING_EXCEPTION) {
>> probe->set_instance_klass(k);
>> }
>> probe->set_definer(NULL);
>> placeholders()->find_and_remove(name_hash, name_h, loader_data, PlaceholderTable::DEFINE_CLASS, THREAD);
>> SystemDictionary_lock->notify_all();
>> }
>
> old code vs. new code.
Right so my point is that in the new code:
probe->set_definer(NULL);
placeholders()->find_and_remove(p_index, p_hash, name_h, loader_data, PlaceholderTable::DEFINE_CLASS, THREAD);
SystemDictionary_lock->notify_all();
you can now call these while an exception is pending. Whether that is harmless or not depends on the details of that code. I poked around a little and it seems okay but it isn't at all obvious that it is okay.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1808
More information about the hotspot-dev
mailing list