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

(funcall (java:jfield org.armedbear.lisp.Function FUNCTION_CLASS_BYTE… #437

Conversation

alanruttenberg
Copy link
Collaborator

…S) function) vs (java:jcall getFunctionClassBytes classloader class), which didn't work in all cases

…S) function) vs (java:jcall getFunctionClassBytes classloader class), which didn't work in all cases
Copy link
Collaborator

@easye easye left a comment

Choose a reason for hiding this comment

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

  1. Rework and move change to probing available disassemblers to a separate commit.

  2. Explain/change why calling getFunctionClassBytes() should be modified.

(eval-when (:load-toplevel)
(defvar *available-disassemblers*
(let ((files
(directory (merge-pathnames
Copy link
Collaborator

Choose a reason for hiding this comment

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

One cannot assume the presences of a the ABCL-INTROSPECT in the core implementation. Additionally, the presence of the function in a file does not necessarily mean the assembler is available, as it might have unsatisfied Maven load dependencies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there aren't any disassemblers then available-disassemblers will be nil. It's a directory probe which simply fails. The require loads the appropriate system, which resolves the maven dependencies.

@@ -149,7 +165,9 @@ SYS:*DISASSEMBLERS*."
(if (or (java:jinstance-of-p classloader "org.armedbear.lisp.MemoryClassLoader")
(java:jinstance-of-p classloader "org.armedbear.lisp.FaslClassLoader"))
(disassemble-bytes
(java:jcall "getFunctionClassBytes" classloader class))
(funcall (java:jfield "org.armedbear.lisp.Function" "FUNCTION_CLASS_BYTES") function)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this better than calling getFunctionClassBytes on the classloader? Perhaps it is an additional strategy, rather than a strict replacement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getFunctionClassBytes didn't work sometimes and I couldn't figure out why, but this works. Should be tracked down. By someone else ;-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

So, we should modify by adding the strategy to an (or (ignore-errors [CASE A]) (ignore-errors … clause as it will break even less often…

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's fine with me.

@easye
Copy link
Collaborator

easye commented Feb 10, 2022

Contains changes from #43

easye added a commit to easye/abcl that referenced this pull request Mar 10, 2022
@easye
Copy link
Collaborator

easye commented Mar 10, 2022

I separated out the FUNCALL fallback into #462.

The dependency on the ABCL-INTROSPECT contrib should not be present in the core ANSI code, so if you wish to rework that as part of a load of ABCL-INTROSPECT, I will consider such a patch separately.

@easye easye closed this Mar 10, 2022
easye added a commit that referenced this pull request May 23, 2022
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.

None yet

2 participants