46
46
import static com .oracle .graal .python .builtins .PythonBuiltinClassType .TypeError ;
47
47
import static com .oracle .graal .python .builtins .PythonBuiltinClassType .ValueError ;
48
48
49
- import com .oracle .graal .python .PythonLanguage ;
50
49
import com .oracle .graal .python .builtins .objects .buffer .PythonBufferAccessLibrary ;
51
50
import com .oracle .graal .python .builtins .objects .cext .capi .CExtNodes ;
52
51
import com .oracle .graal .python .builtins .objects .cext .capi .CExtNodes .PCallCapiFunction ;
62
61
import com .oracle .graal .python .lib .PyNumberAsSizeNode ;
63
62
import com .oracle .graal .python .nodes .ErrorMessages ;
64
63
import com .oracle .graal .python .nodes .PGuards ;
65
- import com .oracle .graal .python .nodes .PNodeWithContext ;
66
64
import com .oracle .graal .python .nodes .PNodeWithRaise ;
65
+ import com .oracle .graal .python .nodes .PNodeWithRaiseAndIndirectCall ;
67
66
import com .oracle .graal .python .nodes .PRaiseNode ;
68
67
import com .oracle .graal .python .nodes .call .CallNode ;
69
- import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
70
68
import com .oracle .graal .python .nodes .object .IsBuiltinClassProfile ;
71
69
import com .oracle .graal .python .nodes .util .CastToByteNode ;
72
70
import com .oracle .graal .python .runtime .ExecutionContext .IndirectCallContext ;
@@ -719,9 +717,13 @@ public static ToJavaBytesFortranOrderNode create() {
719
717
}
720
718
}
721
719
722
- @ GenerateUncached
723
- public abstract static class ReleaseNode extends PNodeWithContext {
724
- public abstract void execute (PMemoryView self );
720
+ public abstract static class ReleaseNode extends PNodeWithRaiseAndIndirectCall {
721
+
722
+ public final void execute (PMemoryView self ) {
723
+ execute (null , self );
724
+ }
725
+
726
+ public abstract void execute (VirtualFrame frame , PMemoryView self );
725
727
726
728
@ Specialization (guards = "self.getReference() == null" )
727
729
static void releaseSimple (PMemoryView self ,
@@ -731,12 +733,12 @@ static void releaseSimple(PMemoryView self,
731
733
}
732
734
733
735
@ Specialization (guards = {"self.getReference() != null" })
734
- static void releaseNative (PMemoryView self ,
736
+ void releaseNative (VirtualFrame frame , PMemoryView self ,
735
737
@ Cached ReleaseBufferNode releaseNode ,
736
738
@ Shared ("raise" ) @ Cached PRaiseNode raiseNode ) {
737
739
self .checkExports (raiseNode );
738
740
if (self .checkShouldReleaseBuffer ()) {
739
- releaseNode .execute (self .getLifecycleManager ());
741
+ releaseNode .execute (frame , this , self .getLifecycleManager ());
740
742
}
741
743
self .setReleased ();
742
744
}
@@ -747,12 +749,12 @@ public abstract static class ReleaseBufferNode extends Node {
747
749
748
750
public abstract void execute (BufferLifecycleManager buffer );
749
751
750
- public final void execute (VirtualFrame frame , PythonLanguage language , PythonBuiltinBaseNode caller , BufferLifecycleManager buffer ) {
751
- Object state = IndirectCallContext .enter (frame , language , caller . getContext (), caller );
752
+ public final void execute (VirtualFrame frame , PNodeWithRaiseAndIndirectCall caller , BufferLifecycleManager buffer ) {
753
+ Object state = IndirectCallContext .enter (frame , caller );
752
754
try {
753
755
execute (buffer );
754
756
} finally {
755
- IndirectCallContext .exit (frame , language , caller . getContext () , state );
757
+ IndirectCallContext .exit (frame , caller , state );
756
758
}
757
759
}
758
760
0 commit comments