-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c321cfb
commit 4f7ee87
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...m/src/sample-approximations/java/org/usvm/samples/approximations/TestVMApproximation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.usvm.samples.approximations; | ||
|
||
import org.jacodb.approximation.annotation.Approximate; | ||
|
||
import java.util.Map; | ||
|
||
@SuppressWarnings("ALL") | ||
@Approximate(jdk.internal.misc.VM.class) | ||
public class TestVMApproximation { | ||
|
||
// the init level when the VM is fully initialized | ||
private static final int JAVA_LANG_SYSTEM_INITED = 1; | ||
private static final int MODULE_SYSTEM_INITED = 2; | ||
private static final int SYSTEM_LOADER_INITIALIZING = 3; | ||
private static final int SYSTEM_BOOTED = 4; | ||
private static final int SYSTEM_SHUTDOWN = 5; | ||
|
||
|
||
// 0, 1, 2, ... | ||
private static volatile int initLevel = 0; | ||
private static final Object lock = new Object(); | ||
|
||
private static long directMemory = 64 * 1024 * 1024; | ||
|
||
// buffers, allocated by ByteBuffer.allocateDirect, to be page aligned. | ||
private static boolean pageAlignDirectMemory; | ||
|
||
private static Map<String, String> savedProps; | ||
|
||
/* Current count of objects pending for finalization */ | ||
private static volatile int finalRefCount; | ||
|
||
/* Peak count of objects pending for finalization */ | ||
private static volatile int peakFinalRefCount; | ||
|
||
/* The threadStatus field is set by the VM at state transition | ||
* in the hotspot implementation. Its value is set according to | ||
* the JVM TI specification GetThreadState function. | ||
*/ | ||
private static final int JVMTI_THREAD_STATE_ALIVE = 0x0001; | ||
private static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002; | ||
private static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004; | ||
private static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400; | ||
private static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010; | ||
private static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters