Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JACOBIN-610 Alleviate some of anomalies that jacotest case JACOBIN-0433-HexFormat is exposing #256

Merged
merged 9 commits into from
Nov 18, 2024

Conversation

texadactyl
Copy link
Collaborator

@texadactyl texadactyl commented Nov 17, 2024

  • Added java/nio/charset/StandardCharsets.<clinit>()V as a trapFunction in otherModules.go.
  • Trap HexFormat functions that reference character sets.
  • Use uint8 slice type instead of int8 in the G-function for HexFormat.<clinit>. BALOAD and object.ArrayLength cannot handle slices of int8. I suspect other op codes are in the same boat. Also, these are not 1-byte signed integers.
  • jdk/internal/util/ArraysSupport.<clinit> needs a call to clinitGeneric.
  • Added last 2 static fields: HEX_FORMAT and EMPTY_BYTES.
  • Implemented toString() as a G-function.
  • Implemented toHexDigits() as G-functions for byte, char, int, long, and short.
  • Implemented formatHex([B) as a G-function.

@texadactyl texadactyl changed the title jacobin-610 Alleviate some of anomalies that jacotest case JACOBIN-0433-HexFormat is exposing JACOBIN-610 Alleviate some of anomalies that jacotest case JACOBIN-0433-HexFormat is exposing Nov 17, 2024
@texadactyl
Copy link
Collaborator Author

At this point in JACOBIN-0433-HexFormat:

HexFormat.ofDelimiter(:) instantiated ok
java.lang.UnsupportedOperationException: INVOKEVIRTUAL: Native method requested: jdk/internal/misc/Unsafe.getLong(Ljava/lang/Object;J)J
  at jdk/internal/misc/Unsafe.getLongUnaligned(Unsafe.java:3523)
  at jdk/internal/util/ArraysSupport.vectorizedMismatch(ArraysSupport.java:130)
  at jdk/internal/util/ArraysSupport.mismatch(ArraysSupport.java:342)
  at java/util/Arrays.equals(Arrays.java:2666)
  at java/util/HexFormat.toString(HexFormat.java:1081)
  at main.main(main.java:7)

Implementing HexFormat.toString() as a G-function will get past this failure.

Copy link
Owner

@platypusguy platypusguy left a comment

Choose a reason for hiding this comment

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

I'm not sure about this edit. We need to be able to handle Java bytes (i.e., int8) at every point in the process where bytes might be accessed. I update BALOAD earlier to work with arrays of int8.

@texadactyl
Copy link
Collaborator Author

@platypusguy
There are probably 2 different issues. It's true that earlier, I got into trouble with both BALOAD and arrays.go object.ArrayLength(). However, bytes are not signed integers; they're unsigned in the context of integers. I think that uint8 is most appropriate in HexFormat.

@texadactyl
Copy link
Collaborator Author

JACOBIN-0433-HexFormat now passes.

@platypusguy platypusguy merged commit d3b8e3b into platypusguy:main Nov 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants