# HG changeset patch # User Andreas Woess # Date 1425045342 -3600 # Node ID d344d76b7b6dbadf0ddba964c6c09d136add76c1 # Parent 4efe39251424b7fa61d931c44e44633cf0026504 Truffle: Node cleanup diff -r 4efe39251424 -r d344d76b7b6d graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Fri Feb 27 13:56:01 2015 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Fri Feb 27 14:55:42 2015 +0100 @@ -41,7 +41,6 @@ public abstract class Node implements NodeInterface, Cloneable { @CompilationFinal private Node parent; - @CompilationFinal private SourceSection sourceSection; /** @@ -573,11 +572,7 @@ public final void atomic(Runnable closure) { RootNode rootNode = getRootNode(); - if (rootNode != null) { - synchronized (rootNode) { - closure.run(); - } - } else { + synchronized (rootNode != null ? rootNode : GIL) { closure.run(); } } @@ -585,14 +580,10 @@ public final T atomic(Callable closure) { try { RootNode rootNode = getRootNode(); - if (rootNode != null) { - synchronized (rootNode) { - return closure.call(); - } - } else { + synchronized (rootNode != null ? rootNode : GIL) { return closure.call(); } - } catch (RuntimeException e) { + } catch (RuntimeException | Error e) { throw e; } catch (Exception e) { throw new RuntimeException(e); @@ -625,4 +616,6 @@ } return ""; } + + private static final Object GIL = new Object(); }