Skip to content

Commit

Permalink
[GR-10270] Add missing TO_NATIVE message implementations in Truffle NFI.
Browse files Browse the repository at this point in the history
PullRequest: graal/1642
  • Loading branch information
rschatz committed Jun 8, 2018
2 parents 1682b57 + 2c96cc9 commit 998bf86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ public TruffleObject access(LibFFIFunction receiver, String identifier, Object[]
}
}

@Resolve(message = "TO_NATIVE")
abstract static class ToNativeNode extends Node {

public NativePointer access(LibFFIFunction receiver) {
return receiver.getPointer();
}
}

@Resolve(message = "KEYS")
abstract static class LibFFIFunctionKeysNode extends Node {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public long access(NativePointer receiver) {
}
}

@Resolve(message = "TO_NATIVE")
abstract static class ToNativePointerNode extends Node {

public NativePointer access(NativePointer receiver) {
return receiver;
}
}

@Resolve(message = "UNBOX")
abstract static class UnboxNativePointerNode extends Node {

Expand Down

0 comments on commit 998bf86

Please sign in to comment.