Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -296,6 +296,13 @@ private <T> T getFieldValue0(String name, Class<T> type, T notPresent, String in
return type.cast(convertValue(name, type, entry.value, inCppType));
}

private boolean typeEquals(String t1, String t2) {
if (t1.equals("int64_t") && t2.equals("intx")) {
return true;
}
return t1.equals(t2);
}

/**
* Gets a C++ field.
*
Expand All @@ -315,7 +322,7 @@ private VMField getField(String name, String cppType, boolean required) {
}

// Make sure the native type is still the type we expect.
if (cppType != null && !cppType.equals(entry.type)) {
if (cppType != null && !typeEquals(cppType, entry.type)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have conditional code in Graal (e.g. here) to deal with type changes in vmstructs so there's no need to fix it here. I'd prefer to not have this code do type aliasing like this as it might hide other changes we need to make in Graal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, if you can fix it in Graal, that would be great. Thanks!

throw new JVMCIError("expected type " + cppType + " but VM field " + name + " is of type " + entry.type);
}
return entry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -52,5 +52,8 @@ public TestHotSpotVMConfig(HotSpotVMConfigStore config, Architecture arch) {
public final int maxOopMapStackOffset = getFieldValue("CompilerToVM::Data::_max_oop_map_stack_offset", Integer.class, "int");
public final int heapWordSize = getConstant("HeapWordSize", Integer.class);

// Check field with intx declaration is the same as int64_t.
public final int heldMonitorCountOffset = getFieldOffset("JavaThread::_held_monitor_count", Integer.class, "int64_t");

public final boolean ropProtection;
}