comparison src/main/gov/nasa/jpf/vm/ClassLoaderInfo.java @ 23:db918c531e6d

streamlined class init, which was a mixed case of registerClass()/initializeClass() and pushRequiredClinits(). Now it is a single initializeClass(ti) method which combines the previous initializeClass(), pushRequiredClinits() and pushClinit() methods. The reason for combining these is the forthcoming replacement of separately locked clinits from different DirectCallStackFrames with a single synthetic frame that calls clinits from nested synchronized blocks. This is required to model hotspot, which does cause deadlocks with concurrent init of classes that cause subclass init during their clinit executions.
author Peter Mehlitz <Peter.C.Mehlitz@nasa.gov>
date Wed, 15 Apr 2015 22:40:21 -0700
parents 61d41facf527
children 6774e2e08d37
comparison
equal deleted inserted replaced
22:cd7880ab73c7 23:db918c531e6d
479 * an exception. NO STATIC BLOCKS / FIELDS ALLOWED 479 * an exception. NO STATIC BLOCKS / FIELDS ALLOWED
480 */ 480 */
481 public ClassInfo getInitializedClassInfo (String clsName, ThreadInfo ti){ 481 public ClassInfo getInitializedClassInfo (String clsName, ThreadInfo ti){
482 ClassInfo ci = getResolvedClassInfo(clsName); 482 ClassInfo ci = getResolvedClassInfo(clsName);
483 483
484 ci.registerClass(ti); // this is safe to call on already loaded classes
485
486 if (ci.initializeClass(ti)) { 484 if (ci.initializeClass(ti)) {
487 throw new ClinitRequired(ci); 485 throw new ClinitRequired(ci);
488 } 486 }
489 487
490 return ci; 488 return ci;