Skip to content

Commit

Permalink
Use PointerBase instead of raw pointers.
Browse files Browse the repository at this point in the history
  • Loading branch information
chumer committed Apr 27, 2023
1 parent 76c9108 commit d92736a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public TruffleHostEnvironment lookup(ResolvedJavaType forType) {
return environment;
}
}
ResolvedJavaType runtimeType = LibGraal.asResolvedJavaType(JNIUtil.GetObjectClass(env, runtimeLocalRef).rawValue());
ResolvedJavaType runtimeType = LibGraal.asResolvedJavaType(JNIUtil.GetObjectClass(env, runtimeLocalRef));
if (runtimeType == null) {
throw GraalError.shouldNotReachHere("The object class needs to be available for a Truffle runtime object.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ public static <T extends PointerBase> T getJObjectValue(HotSpotObjectConstant co
/**
* @see HotSpotJVMCIRuntime#asResolvedJavaType(long)
*/
public static HotSpotResolvedJavaType asResolvedJavaType(long rawPointerValue) {
public static HotSpotResolvedJavaType asResolvedJavaType(PointerBase pointer) {
if (asResolvedJavaType == null) {
return null;
}
try {
return (HotSpotResolvedJavaType) asResolvedJavaType.invoke(runtime(), rawPointerValue);
return (HotSpotResolvedJavaType) asResolvedJavaType.invoke(runtime(), pointer.rawValue());
} catch (Throwable throwable) {
throw new InternalError(throwable);
}
Expand Down

0 comments on commit d92736a

Please sign in to comment.