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

Move static code used at runtime by aot compiled modules to a separate package #552

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

andreaTP
Copy link
Collaborator

@andreaTP andreaTP commented Oct 2, 2024

Minor but "diff noisy" PR to get to #494

@@ -0,0 +1,6 @@
#!/bin/bash
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sneaked this in, can remove if requested.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this. Is there a way to run the tests from Maven without the diffs popping up individually in IntelliJ?

Copy link
Collaborator

@electrum electrum Oct 4, 2024

Choose a reason for hiding this comment

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

I dug through the docs and found you can set APPROVAL_TESTS_USE_REPORTER=AutoApproveReporter which seems to work when I tried from IntelliJ. So maybe we don't need this script?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for looking into it, I remove the script in this case.
But I need to add this note somewhere in the docs, otherwise I'm going to forget pretty quickly 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a way to run the tests from Maven without the diffs popping up individually in IntelliJ?

It was happening to me on a Mac, now on Linux is I don't have this horrific behavior anymore, but I can't recall if I did something about it ...

Copy link
Collaborator

@electrum electrum left a comment

Choose a reason for hiding this comment

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

Please remember to rebase as there were changes to AotMethods in #555

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could drop this annotation now. Previously, we had referenced methods in multiple places, and referenced them directly in the generated bytecode. Now that we're using Java reflection getMethod() to reference them, IntelliJ understands that the methods are used.

It was useful when I first added it, but isn't needed now.

@@ -104,7 +73,7 @@ public static void ELEM_DROP(AotContext ctx, AnnotatedInstruction ins, MethodVis
asm.visitVarInsn(Opcodes.ALOAD, ctx.instanceSlot());
asm.visitLdcInsn(index);
asm.visitInsn(Opcodes.ACONST_NULL);
emitInvokeVirtual(asm, INSTANCE_SET_ELEMENT);
emitInvokeVirtual(asm, AotMethodsRefs.INSTANCE_SET_ELEMENT);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep these static imported. It looks cleaner and makes the diff smaller.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In all honesty, I personally prefer this notation, but I'm not fussy on it.


public final class AotMethods {
public final class AotMethodsRefs {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's name this AotMethodRefs to avoid the double plural. It also directly matches the English:

  • AOT methods
  • AOT method references

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks 😅

@@ -0,0 +1,6 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this. Is there a way to run the tests from Maven without the diffs popping up individually in IntelliJ?

@andreaTP andreaTP merged commit 4a0dff5 into dylibso:main Oct 4, 2024
13 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