-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b03
In trying to understand the class loading code in SystemDictionary, I'm forced to follow functions that have TRAPS as a parameter wondering what exception they can possibly throw, and why that exception isn't handled properly in the caller. Many of these functions do not throw an exception, and TRAPS is just a convenient way to pass the current thread. That's ok, but it's confusing.
The class loading code in SystemDictionary does call functions that throw exceptions but pass THREAD as the final parameter on purpose, to manage entries in the placeholder table. Ie, the entries need to be removed if an exception is thrown. So cleaning up the TRAPS arguments makes this more apparent.
Also there are a few invariants that I've also cleaned up. If you add a LOAD_SUPER entry to the placeholder table the class name is non-null, so one doesn't need a boolean argument to test and carry around in the placeholder table. And if there's an exception thrown from define_instance_class, we don't need to make a new exception for it.
These are some superficial cleanups that are helping me read this code.
The class loading code in SystemDictionary does call functions that throw exceptions but pass THREAD as the final parameter on purpose, to manage entries in the placeholder table. Ie, the entries need to be removed if an exception is thrown. So cleaning up the TRAPS arguments makes this more apparent.
Also there are a few invariants that I've also cleaned up. If you add a LOAD_SUPER entry to the placeholder table the class name is non-null, so one doesn't need a boolean argument to test and carry around in the placeholder table. And if there's an exception thrown from define_instance_class, we don't need to make a new exception for it.
These are some superficial cleanups that are helping me read this code.
- relates to
-
JDK-8258048 Placeholder hash code is the same as Dictionary hash code
-
- Resolved
-