51
51
import com .oracle .graal .python .util .OverflowException ;
52
52
import com .oracle .truffle .api .CompilerDirectives ;
53
53
import com .oracle .truffle .api .dsl .Cached ;
54
- import com .oracle .truffle .api .dsl .Cached .Exclusive ;
54
+ import com .oracle .truffle .api .dsl .Cached .Shared ;
55
55
import com .oracle .truffle .api .interop .InteropLibrary ;
56
56
import com .oracle .truffle .api .interop .InvalidArrayIndexException ;
57
57
import com .oracle .truffle .api .interop .UnknownIdentifierException ;
76
76
*/
77
77
@ ExportLibrary (InteropLibrary .class )
78
78
@ ExportLibrary (NativeTypeLibrary .class )
79
+ @ SuppressWarnings ("static-method" )
79
80
public final class StructWrapperBaseWrapper extends PythonNativeWrapper {
80
81
public static final String NAME = "name" ;
81
82
public static final String OFFSET = "offset" ;
@@ -99,7 +100,7 @@ boolean hasMembers() {
99
100
}
100
101
101
102
@ ExportMessage
102
- protected Object getMembers (@ SuppressWarnings ("unused" ) boolean includeInternal ) {
103
+ Object getMembers (@ SuppressWarnings ("unused" ) boolean includeInternal ) {
103
104
return new InteropArray (new Object []{NAME , OFFSET , FUNCTION , WRAPPER , DOC , FLAGS , NAME_STROBJ });
104
105
}
105
106
@@ -120,10 +121,10 @@ boolean isMemberReadable(String member) {
120
121
}
121
122
122
123
@ ExportMessage
123
- protected Object readMember (String member ,
124
- @ Exclusive @ Cached GilNode gil ,
125
- @ Cached GetNativeNullNode getNativeNullNode ,
126
- @ Cached ToSulongNode toSulongNode ) throws UnknownIdentifierException {
124
+ Object readMember (String member ,
125
+ @ Shared ( "gil" ) @ Cached GilNode gil ,
126
+ @ Shared ( "getNativeNullNode" ) @ Cached GetNativeNullNode getNativeNullNode ,
127
+ @ Shared ( "toSulongNode" ) @ Cached ToSulongNode toSulongNode ) throws UnknownIdentifierException {
127
128
boolean mustRelease = gil .acquire ();
128
129
try {
129
130
switch (member ) {
@@ -168,9 +169,9 @@ boolean isArrayElementReadable(long index) {
168
169
169
170
@ ExportMessage
170
171
Object readArrayElement (long index ,
171
- @ Exclusive @ Cached GilNode gil ,
172
- @ Cached GetNativeNullNode getNativeNullNode ,
173
- @ Cached ToSulongNode toSulongNode ) throws InvalidArrayIndexException {
172
+ @ Shared ( "gil" ) @ Cached GilNode gil ,
173
+ @ Shared ( "getNativeNullNode" ) @ Cached GetNativeNullNode getNativeNullNode ,
174
+ @ Shared ( "toSulongNode" ) @ Cached ToSulongNode toSulongNode ) throws InvalidArrayIndexException {
174
175
boolean mustRelease = gil .acquire ();
175
176
try {
176
177
int i = PInt .intValueExact (index );
@@ -202,14 +203,14 @@ Object readArrayElement(long index,
202
203
203
204
@ ExportMessage
204
205
@ SuppressWarnings ("static-method" )
205
- protected boolean hasNativeType () {
206
+ boolean hasNativeType () {
206
207
// TODO implement native type
207
208
return false ;
208
209
}
209
210
210
211
@ ExportMessage
211
212
@ SuppressWarnings ("static-method" )
212
- public Object getNativeType () {
213
+ Object getNativeType () {
213
214
// TODO implement native type
214
215
return null ;
215
216
}
0 commit comments