Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8258408

SystemDictionary passes TRAPS to functions that don't throw exceptions



    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 17
    • 17
    • hotspot
    • 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.


        Issue Links



              coleenp Coleen Phillimore
              coleenp Coleen Phillimore
              0 Vote for this issue
              2 Start watching this issue