Skip to content

Commit 0882792

Browse files
committed
minor cleanups - add some final modifiers
1 parent c0da72a commit 0882792

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PClosureFunctionRootNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected PClosureFunctionRootNode(PythonLanguage language, FrameDescriptor fram
6060
this.signature = signature;
6161
}
6262

63-
public String[] getCellVars() {
63+
public final String[] getCellVars() {
6464
String[] cellVars = new String[cellVarSlots.length];
6565
for (int i = 0; i < cellVars.length; i++) {
6666
cellVars[i] = (String) cellVarSlots[i].getIdentifier();
@@ -69,7 +69,7 @@ public String[] getCellVars() {
6969
}
7070

7171
@Override
72-
public Signature getSignature() {
72+
public final Signature getSignature() {
7373
return signature;
7474
}
7575
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PClosureRootNode.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.oracle.graal.python.util.PythonUtils;
4747
import com.oracle.truffle.api.Assumption;
4848
import com.oracle.truffle.api.CompilerDirectives;
49+
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
4950
import com.oracle.truffle.api.frame.Frame;
5051
import com.oracle.truffle.api.frame.FrameDescriptor;
5152
import com.oracle.truffle.api.frame.FrameSlot;
@@ -55,8 +56,8 @@
5556
public abstract class PClosureRootNode extends PRootNodeWithFileName {
5657
private final Assumption singleContextAssumption;
5758
private final boolean annotationsAvailable;
58-
@CompilerDirectives.CompilationFinal(dimensions = 1) protected final FrameSlot[] freeVarSlots;
59-
@CompilerDirectives.CompilationFinal(dimensions = 1) protected PCell[] closure;
59+
@CompilationFinal(dimensions = 1) protected final FrameSlot[] freeVarSlots;
60+
@CompilationFinal(dimensions = 1) protected PCell[] closure;
6061
private final int length;
6162

6263
protected PClosureRootNode(PythonLanguage language, FrameDescriptor frameDescriptor, FrameSlot[] freeVarSlots, boolean hasAnnotations) {
@@ -67,7 +68,7 @@ protected PClosureRootNode(PythonLanguage language, FrameDescriptor frameDescrip
6768
this.annotationsAvailable = hasAnnotations;
6869
}
6970

70-
protected void addClosureCellsToLocals(Frame frame) {
71+
protected final void addClosureCellsToLocals(Frame frame) {
7172
PCell[] frameClosure = PArguments.getClosure(frame);
7273
if (frameClosure != null) {
7374
if (singleContextAssumption.isValid() && closure == null) {
@@ -95,20 +96,20 @@ protected void addClosureCellsToLocals(Frame frame) {
9596
}
9697
}
9798

98-
protected void addClosureCellsToLocalsLoop(Frame frame, PCell[] frameClosure) {
99+
protected final void addClosureCellsToLocalsLoop(Frame frame, PCell[] frameClosure) {
99100
for (int i = 0; i < length; i++) {
100101
frame.setObject(freeVarSlots[i], frameClosure[i]);
101102
}
102103
}
103104

104105
@ExplodeLoop
105-
protected void addClosureCellsToLocalsExploded(Frame frame, PCell[] frameClosure) {
106+
protected final void addClosureCellsToLocalsExploded(Frame frame, PCell[] frameClosure) {
106107
for (int i = 0; i < length; i++) {
107108
frame.setObject(freeVarSlots[i], frameClosure[i]);
108109
}
109110
}
110111

111-
public boolean hasFreeVars() {
112+
public final boolean hasFreeVars() {
112113
return freeVarSlots != null && freeVarSlots.length > 0;
113114
}
114115

0 commit comments

Comments
 (0)