Skip to content

Commit bbb0cfd

Browse files
committed
Do not use profile in GraalHPyHandle.asPointer
1 parent 76a07c3 commit bbb0cfd

File tree

1 file changed

+5
-4
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy

1 file changed

+5
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/GraalHPyHandle.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ boolean isPointer(
8888
}
8989

9090
@ExportMessage
91-
long asPointer(
92-
@Exclusive @Cached ConditionProfile isNativeProfile) throws UnsupportedMessageException {
93-
if (!isPointer(isNativeProfile)) {
91+
long asPointer() throws UnsupportedMessageException {
92+
// note: we don't use a profile here since 'asPointer' is usually used right after
93+
// 'isPointer'
94+
if (!isPointer(ConditionProfile.getUncached())) {
9495
CompilerDirectives.transferToInterpreterAndInvalidate();
9596
throw UnsupportedMessageException.create();
9697
}
@@ -190,7 +191,7 @@ public GraalHPyHandle copy() {
190191
public void close(GraalHPyContext hpyContext, ConditionProfile isAllocatedProfile) {
191192
if (isPointer(isAllocatedProfile)) {
192193
try {
193-
hpyContext.releaseHPyHandleForObject((int) asPointer(isAllocatedProfile));
194+
hpyContext.releaseHPyHandleForObject((int) asPointer());
194195
id = -1;
195196
} catch (UnsupportedMessageException e) {
196197
CompilerDirectives.transferToInterpreterAndInvalidate();

0 commit comments

Comments
 (0)