You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JBMC: Modified the instrumentation of monitorexit/enter instructions
The monitorenter and monitorexit instructions are used by the JVM to
coordinate access to an object in the context of multiple threads.
We have previously added two methods to the object model that use a
counter to implement a reentrant lock. Calls to
'org.cprover.CProver.atomicBegin:()V"' and
'org.cprover.CProver.atomicEnd:()V' ensure that multiple threads do
not race in the access/modification of this counter.
In-order to support synchronization blocks, when the
monitorexit/moniitorenter bytecode instruction is executed JBMC must
call the aforementioned object model. To this end, this commit makes
the following changes:
1. Transforms the monitorenter and monitorexit bytecode instructions
into function-calls to the object model. Specifically,
'java.lang.Object.monitorenter:(Ljava/lang/Object;)V' and
'java.lang.Object.monitorexit:(Ljava/lang/Object;)V'.
2. Transforms 'org.cprover.CProver.atomicBegin:()V"' and
'org.cprover.CProver.atomicEnd:()V' into the appropriate
codet instructions.
Added the appropriate target-handlers if monitorenter or monitorexit
are in the context of a try-catch block.
0 commit comments