Mercurial > hg > Members > kono > jpf-core
comparison src/peers/gov/nasa/jpf/vm/JPF_java_lang_System.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 |
comparison
equal
deleted
inserted
replaced
22:cd7880ab73c7 | 23:db918c531e6d |
---|---|
69 ThreadInfo ti = env.getThreadInfo(); | 69 ThreadInfo ti = env.getThreadInfo(); |
70 Instruction insn = ti.getPC(); | 70 Instruction insn = ti.getPC(); |
71 StackFrame frame = ti.getTopFrame(); | 71 StackFrame frame = ti.getTopFrame(); |
72 ClassInfo ci = ClassLoaderInfo.getSystemResolvedClassInfo("gov.nasa.jpf.ConsoleOutputStream"); | 72 ClassInfo ci = ClassLoaderInfo.getSystemResolvedClassInfo("gov.nasa.jpf.ConsoleOutputStream"); |
73 | 73 |
74 // it's not really used, but it would be hack'ish to use a class whose | |
75 // super class hasn't been initialized yet | |
76 if (!ci.isRegistered()) { | |
77 ci.registerClass(ti); | |
78 } | |
79 | |
80 if (ci.initializeClass(ti)) { | 74 if (ci.initializeClass(ti)) { |
81 env.repeatInvocation(); | 75 env.repeatInvocation(); |
82 return MJIEnv.NULL; | 76 return MJIEnv.NULL; |
83 } | 77 } |
84 | 78 |