Skip to content

Commit f810f67

Browse files
committed
Fixed style
1 parent 10a60c5 commit f810f67

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/control/TopLevelExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public Object execute(VirtualFrame frame) {
136136
assert !PArguments.isPythonFrame(frame);
137137
throw handlePythonException(e.getEscapedException());
138138
} catch (StackOverflowError e) {
139-
getContext().recoverFromSoe(e);
139+
getContext().reacquireGilAfterStackOverflow();
140140
PBaseException newException = PythonObjectFactory.getUncached().createBaseException(RecursionError, "maximum recursion depth exceeded", new Object[]{});
141141
PException pe = ExceptionHandlingStatementNode.wrapJavaException(e, this, newException);
142142
throw handlePythonException(pe.getEscapedException());

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement/ExceptionHandlingStatementNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ protected final PException wrapJavaExceptionIfApplicable(Throwable e) {
209209
return wrapJavaException(e, this, factory().createBaseException(SystemError, "%m", new Object[]{e}));
210210
}
211211
if (e instanceof StackOverflowError) {
212-
getContext().recoverFromSoe(e);
212+
getContext().reacquireGilAfterStackOverflow();
213213
return wrapJavaException(e, this, factory().createBaseException(RecursionError, "maximum recursion depth exceeded", new Object[]{}));
214214
}
215215
return null;

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,15 +1235,12 @@ public PythonNativeWrapper getSingletonNativeWrapper(PythonAbstractObject obj) {
12351235
return null;
12361236
}
12371237

1238-
public void recoverFromSoe(Throwable e) {
1239-
if (!ownsGil()) {
1240-
while (true) {
1241-
try {
1242-
acquireGil();
1243-
return;
1244-
} catch (InterruptedException ignored) {
1245-
// just keep trying
1246-
}
1238+
public void reacquireGilAfterStackOverflow() {
1239+
while (!ownsGil()) {
1240+
try {
1241+
acquireGil();
1242+
} catch (InterruptedException ignored) {
1243+
// just keep trying
12471244
}
12481245
}
12491246
}

0 commit comments

Comments
 (0)