Skip to content

Commit 0c6ebb3

Browse files
committed
opt GIL: TruffleObjectNativeWrapper
1 parent b593756 commit 0c6ebb3

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/TruffleObjectNativeWrapper.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -181,24 +181,14 @@ boolean isPointer(
181181

182182
@ExportMessage
183183
long asPointer(
184-
@Cached PAsPointerNode pAsPointerNode, @Exclusive @Cached GilNode gil) {
185-
boolean mustRelease = gil.acquire();
186-
try {
187-
return pAsPointerNode.execute(this);
188-
} finally {
189-
gil.release(mustRelease);
190-
}
184+
@Cached PAsPointerNode pAsPointerNode) {
185+
return pAsPointerNode.execute(this);
191186
}
192187

193188
@ExportMessage
194189
void toNative(
195-
@Cached ToNativeNode toNativeNode, @Exclusive @Cached GilNode gil) {
196-
boolean mustRelease = gil.acquire();
197-
try {
198-
toNativeNode.execute(this);
199-
} finally {
200-
gil.release(mustRelease);
201-
}
190+
@Cached ToNativeNode toNativeNode) {
191+
toNativeNode.execute(this);
202192
}
203193

204194
@ExportMessage
@@ -208,12 +198,7 @@ boolean hasNativeType() {
208198

209199
@ExportMessage
210200
Object getNativeType(
211-
@Cached PGetDynamicTypeNode getDynamicTypeNode, @Exclusive @Cached GilNode gil) {
212-
boolean mustRelease = gil.acquire();
213-
try {
214-
return getDynamicTypeNode.execute(this);
215-
} finally {
216-
gil.release(mustRelease);
217-
}
201+
@Cached PGetDynamicTypeNode getDynamicTypeNode) {
202+
return getDynamicTypeNode.execute(this);
218203
}
219204
}

0 commit comments

Comments
 (0)