Skip to content

Commit 020447a

Browse files
committed
[GR-18019] Enable a few JDK11 gates for Python on SVM and JVM
PullRequest: graalpython/643
2 parents eb74504 + 2b7262d commit 020447a

File tree

5 files changed

+26
-17
lines changed

5 files changed

+26
-17
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ overlay: "91be9b2632f293b113131237d17087c52276ac3e" }
1+
{ overlay: "40e901c4387faded24d822e9df8575816439204a" }

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/Python3Core.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ public SourceSection getSourceSection() {
668668
}
669669

670670
@Override
671+
@TruffleBoundary
671672
public RuntimeException raiseInvalidSyntax(Node location, String message, Object... arguments) {
672673
PBaseException instance;
673674
instance = factory().createBaseException(SyntaxError, message, arguments);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PosixModuleBuiltins.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ PTuple waitpid(VirtualFrame frame, int pid, int options) {
14871487
} else {
14881488
throw raise(PythonBuiltinClassType.NotImplementedError, "Only 0 or WNOHANG are supported for waitpid");
14891489
}
1490-
} catch (ArrayIndexOutOfBoundsException e) {
1490+
} catch (IndexOutOfBoundsException e) {
14911491
throw raiseOSError(frame, OSErrorEnum.ESRCH.getNumber());
14921492
} catch (InterruptedException e) {
14931493
throw raiseOSError(frame, OSErrorEnum.EINTR.getNumber());
@@ -1969,7 +1969,7 @@ PNone kill(VirtualFrame frame, int pid, int signal,
19691969
if (isNode.execute(signal, value)) {
19701970
try {
19711971
context.getResources().sigterm(pid);
1972-
} catch (ArrayIndexOutOfBoundsException e) {
1972+
} catch (IndexOutOfBoundsException e) {
19731973
throw raiseOSError(frame, OSErrorEnum.ESRCH.getNumber());
19741974
}
19751975
return PNone.NONE;
@@ -1980,7 +1980,7 @@ PNone kill(VirtualFrame frame, int pid, int signal,
19801980
if (isNode.execute(signal, value)) {
19811981
try {
19821982
context.getResources().sigkill(pid);
1983-
} catch (ArrayIndexOutOfBoundsException e) {
1983+
} catch (IndexOutOfBoundsException e) {
19841984
throw raiseOSError(frame, OSErrorEnum.ESRCH.getNumber());
19851985
}
19861986
return PNone.NONE;
@@ -1990,7 +1990,7 @@ PNone kill(VirtualFrame frame, int pid, int signal,
19901990
if (isNode.execute(signal, dfl)) {
19911991
try {
19921992
context.getResources().sigdfl(pid);
1993-
} catch (ArrayIndexOutOfBoundsException e) {
1993+
} catch (IndexOutOfBoundsException e) {
19941994
throw raiseOSError(frame, OSErrorEnum.ESRCH.getNumber());
19951995
}
19961996
return PNone.NONE;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixResources.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,34 +393,42 @@ private int nextFreePid() {
393393
}
394394
}
395395

396+
private Process getChild(int pid) throws IndexOutOfBoundsException {
397+
if (pid < 0) {
398+
throw new IndexOutOfBoundsException("we do not support process groups");
399+
} else {
400+
return children.get(pid);
401+
}
402+
}
403+
396404
@TruffleBoundary(allowInlining = true)
397-
public void sigdfl(int pid) throws ArrayIndexOutOfBoundsException {
398-
children.get(pid); // just for the side-effect
405+
public void sigdfl(int pid) throws IndexOutOfBoundsException {
406+
getChild(pid); // just for the side-effect
399407
}
400408

401409
@TruffleBoundary(allowInlining = true)
402-
public void sigterm(int pid) throws ArrayIndexOutOfBoundsException {
403-
Process process = children.get(pid);
410+
public void sigterm(int pid) throws IndexOutOfBoundsException {
411+
Process process = getChild(pid);
404412
process.destroy();
405413
}
406414

407415
@TruffleBoundary(allowInlining = true)
408-
public void sigkill(int pid) throws ArrayIndexOutOfBoundsException {
409-
Process process = children.get(pid);
416+
public void sigkill(int pid) throws IndexOutOfBoundsException {
417+
Process process = getChild(pid);
410418
process.destroyForcibly();
411419
}
412420

413421
@TruffleBoundary(allowInlining = true)
414-
public int waitpid(int pid) throws ArrayIndexOutOfBoundsException, InterruptedException {
415-
Process process = children.get(pid);
422+
public int waitpid(int pid) throws IndexOutOfBoundsException, InterruptedException {
423+
Process process = getChild(pid);
416424
int exitStatus = process.waitFor();
417425
children.set(pid, null);
418426
return exitStatus;
419427
}
420428

421429
@TruffleBoundary(allowInlining = true)
422-
public int exitStatus(int pid) throws ArrayIndexOutOfBoundsException {
423-
Process process = children.get(pid);
430+
public int exitStatus(int pid) throws IndexOutOfBoundsException {
431+
Process process = getChild(pid);
424432
if (process.isAlive()) {
425433
return Integer.MIN_VALUE;
426434
} else {

mx.graalpython/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
},
4545
{
4646
"name": "sulong",
47-
"version": "4354931603c8c632ec0a168b0f1b808416230d89",
47+
"version": "2e92894481917d92f170a713a9f03f99db600fe6",
4848
"subdir": True,
4949
"urls": [
5050
{"url": "https://github.com/oracle/graal", "kind": "git"},
5151
]
5252
},
5353
{
5454
"name": "regex",
55-
"version": "4354931603c8c632ec0a168b0f1b808416230d89",
55+
"version": "2e92894481917d92f170a713a9f03f99db600fe6",
5656
"subdir": True,
5757
"urls": [
5858
{"url": "https://github.com/oracle/graal", "kind": "git"},

0 commit comments

Comments
 (0)