Skip to content

Commit 58cdb66

Browse files
Minor cleanups and documentation.
1 parent a0c943c commit 58cdb66

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsSubstrateSegfaultHandler.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public void afterRegistration(AfterRegistrationAccess access) {
5959
}
6060

6161
class WindowsSubstrateSegfaultHandler extends SubstrateSegfaultHandler {
62+
private static final int EX_READ = 0;
63+
private static final int EX_WRITE = 1;
64+
private static final int EX_EXECUTE = 8;
65+
6266
@Override
6367
protected void install() {
6468
/*
@@ -116,15 +120,15 @@ protected void printSignalInfo(Log log, PointerBase signalInfo) {
116120
int numParameters = exceptionRecord.NumberParameters();
117121
if ((exceptionCode == EXCEPTION_ACCESS_VIOLATION() || exceptionCode == EXCEPTION_IN_PAGE_ERROR()) && numParameters >= 2) {
118122
CLongPointer exInfo = exceptionRecord.ExceptionInformation();
119-
long exParam0 = exInfo.addressOf(0).read();
120-
if (exParam0 == 0) {
123+
long operation = exInfo.addressOf(0).read();
124+
if (operation == EX_READ) {
121125
log.string(", reading address");
122-
} else if (exParam0 == 1) {
126+
} else if (operation == EX_WRITE) {
123127
log.string(", writing address");
124-
} else if (exParam0 == 8) {
128+
} else if (operation == EX_EXECUTE) {
125129
log.string(", data execution prevention violation at address");
126130
} else {
127-
log.string(", ExceptionInformation=").zhex(exParam0);
131+
log.string(", ExceptionInformation=").zhex(operation);
128132
}
129133
log.string(" ").zhex(exInfo.addressOf(1).read());
130134
} else {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public static String stateToString(int codeInfoState) {
149149
case CodeInfo.STATE_CODE_CONSTANTS_LIVE:
150150
return "code constants live";
151151
case CodeInfo.STATE_NON_ENTRANT:
152-
return "non entrant";
152+
return "non-entrant";
153153
case CodeInfo.STATE_READY_FOR_INVALIDATION:
154154
return "ready for invalidation";
155155
case CodeInfo.STATE_PARTIALLY_FREED:

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/locks/VMLockSupport.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,16 @@
3232
import com.oracle.svm.core.log.Log;
3333

3434
public abstract class VMLockSupport {
35+
/**
36+
* Returns an array that contains all {@link VMMutex} objects that are present in the image or
37+
* null if that information is not available.
38+
*/
3539
public abstract VMMutex[] getMutexes();
3640

41+
/**
42+
* Returns an array that contains all {@link VMCondition} objects that are present in the image
43+
* or null if that information is not available.
44+
*/
3745
public abstract VMCondition[] getConditions();
3846

3947
public static class DumpVMMutexes extends DiagnosticThunk {

0 commit comments

Comments
 (0)