4646import com .oracle .graal .python .util .PythonUtils ;
4747import com .oracle .truffle .api .Assumption ;
4848import com .oracle .truffle .api .CompilerDirectives ;
49+ import com .oracle .truffle .api .CompilerDirectives .CompilationFinal ;
4950import com .oracle .truffle .api .frame .Frame ;
5051import com .oracle .truffle .api .frame .FrameDescriptor ;
5152import com .oracle .truffle .api .frame .FrameSlot ;
5556public 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