diff src/main/gov/nasa/jpf/vm/MJIEnv.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 caa0924e093d
children 6774e2e08d37
line wrap: on
line diff
--- a/src/main/gov/nasa/jpf/vm/MJIEnv.java	Tue Apr 14 15:01:25 2015 -0700
+++ b/src/main/gov/nasa/jpf/vm/MJIEnv.java	Wed Apr 15 22:40:21 2015 -0700
@@ -1038,7 +1038,7 @@
   }
   
   public ElementInfo newElementInfo (ClassInfo ci){
-    if (ci.pushRequiredClinits(ti)){
+    if (ci.initializeClass(ti)){
       throw new ClinitRequired(ci);
     }
     
@@ -1291,7 +1291,7 @@
    *  Do a repeatInvocation() in this case 
    */
   public boolean requiresClinitExecution(ClassInfo ci) {
-    return ci.pushRequiredClinits(ti);
+    return ci.initializeClass(ti);
   }
   
   /**
@@ -1744,7 +1744,7 @@
     // NOTE: we have to repeat no matter what, since this is called from
     // a handler context (if we only had to create a class object w/o
     // calling clinit, we can't just go on)
-    ci.pushRequiredClinits(ti);
+    ci.initializeClass(ti);
     repeatInvocation();
   }