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

Consitent InvokeDynamic #79

Closed
JonathanxD opened this issue Aug 13, 2021 · 0 comments
Closed

Consitent InvokeDynamic #79

JonathanxD opened this issue Aug 13, 2021 · 0 comments

Comments

@JonathanxD
Copy link
Collaborator

JonathanxD commented Aug 13, 2021

Kores currently uses MethodInvokeSpec to specify a method invocation and lacks a FieldAccessSpec.

InvokeDynamic instruction supports specifying both fields and methods using MethodHandle and ASM uses Handle type to provide this information and differentation through tag argument using Opcodes prefixed with H_.

Also, Kores InvokeType, which is used to specify the invocation kind, lacks H_NEWINVOKESPECIAL, which is used to invoke constructors (<init> method) as specified in Reference Kinds section of Java MethodHandleInfo Documentation.

This document specifies new types for InvokeDynamic bootstrap arguments:

  • DynamicInvokeType
    • Same values as those ones provided by InvokeType and the additional NEW_INVOKE_SPECIAL.
  • FieldAccessKind
    • GET_FIELD
    • GET_STATIC
    • PUT_FIELD
    • PUT_STATIC
  • MethodInvokeHandleSpec
  • FieldAccessHandleSpec
  • DynamicConstantSpec

Also conversion from MethodInvokeSpec to MethodInvokeHandleSpec.

Compatibility

This will break compatibility with current code that relies on serialization.

Support

MethodInvokeSpec must still be supported by Kores-BytecodeWriter, in addition to the support to those new types.

JonathanxD added a commit to koresframework/Kores-BytecodeWriter that referenced this issue Aug 13, 2021
- Support for Java 11 Nest Based Access Control
- Default to Java 16 Major Version
- Use `invokedynamic` for String Concatenation for Java 9 or later .
- Consistent InvokeDynamic (koresframework/Kores#79).
  - Support Dynamic Constant
  - Support Field Specification
  - Better Method Specification
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

No branches or pull requests

1 participant