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

[GR-34476] Add member interop objects and declared member APIs. #9783

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

graalvmbot
Copy link
Collaborator

Introducing member objects and declared members.

A member is not a String name, but an interop object. Members can still be read/written/invoked/... using a string (interop string) name. Object members provide better member identification in case of overloaded members.
getMembers() is deprecated and replaced with getMemberObjects(). No internal objects any more. We'll have a "tools view" instead in the future.

Declared members are members declared by a meta-object. They allow an interop reflection.

Static members are provided via getStaticReceiver(), static members are independent on a particular instance.

Interop Changes

New interop messages:

  • Replacement of getMembers() and read/write/invoke/remove messages take a , or an :

    • getMemberObjects(Object receiver)
    • isMemberReadable(Object receiver, Object memberOrString)
    • isMemberWritable(Object receiver, Object memberOrString)
    • isMemberModifiable(Object receiver, Object memberOrString)
    • isMemberInsertable(Object receiver, Object memberOrString)
    • isMemberInvokable(Object receiver, Object memberOrString)
    • isMemberRemovable(Object receiver, Object memberOrString)
    • readMember(Object receiver, Object memberOrString)
    • writeMember(Object receiver, Object memberOrString)
    • removeMember(Object receiver, Object memberOrString)
    • invokeMember(Object receiver, Object memberOrString, Object... args)
    • hasMemberReadSideEffects(Object receiver, Object memberOrString)
    • hasMemberWriteSideEffects(Object receiver, Object memberOrString)
    • final isMemberExisting(Object receiver, Object memberOrString)
  • Static receiver (provides static members):

    • hasStaticReceiver(Object receiver)
    • getStaticReceiver(Object receiver)
  • New Declared Members (on a meta-object only):

    • hasDeclaredMembers(Object metaObject)
    • getDeclaredMembers(Object metaObject)
  • New Member namespace:

    • isMember(Object member)
    • getMemberSimpleName(Object member)
    • getMemberQualifiedName(Object member)
    • isMemberKindField(Object member)
    • isMemberKindMethod(Object member)
    • isMemberKindMetaObject(Object member)
    • hasMemberSignature(Object member)
    • getMemberSignature(Object member) array of
  • New signature element namespace:

    • isSignatureElement(Object signatureElement)
    • hasSignatureElementName(Object signatureElement)
    • getSignatureElementName(Object signatureElement)
    • hasSignatureElementMetaObject(Object signatureElement)
    • getSignatureElementMetaObject(Object signatureElement)
  • Exceptions

    • UnknownMemberException.create(Object memberOrString)

Deprecate

  • getMembers(Object receiver, boolean internal)
  • writeMember(Object receiver, String identifier)
  • readMember(Object receiver, String identifier)
  • removeMember(Object receiver, String identifier)
  • invokeMember(Object receiver, String identifier, Object... args)
  • isMemberWritable(Objct receiver, String identifier)
  • isMemberReadable(Objct receiver, String identifier)
  • isMemberInvokable(Objct receiver, String identifier)
  • isMemberInsertable(Objct receiver, String identifier)
  • isMemberRemovable(Object receiver, String identifier)
  • isMemberInternal(Object receiver, String identifier) -- no internal members any more
  • hasMemberReadSideEffects(Objct receiver, String identifier)
  • hasMemberWriteSideEffects(Objct receiver, String identifier)
  • UnknownIdentifierException

 

Value Changes

  • Replacement for String identifieds

    • hasMember(Object member)
    • Value getMember(Object member)
    • void putMember(Object member, Object value)
    • boolean removeMember(Object member)
    • boolean canInvokeMember(Object member)
    • Value invokeMember(Object member, Object... arguments)
  • New methods that take a member

    • boolean hasMemberReadSideEffects(Object member)
    • boolean hasMemberPutSideEffects(Object member)
  • Declared Members

    • boolean hasDeclaredMembers()
    • Value getDeclaredMembers()
    • boolean hasStaticProvider()
    • Value getStaticProvider()
  • New member methods

    • Value getMembers()
    • boolean isMember()
    • String getMemberSimpleName()
    • String getMemberQualifiedName()
    • boolean isMemberKindField()
    • boolean isMemberKindMethod()
    • boolean isMemberKindMetaObject()
    • boolean hasMemberSignature()
    • Value getMemberSignature()
    • boolean hasDeclaringMetaObject()
    • Value getDeclaringMetaObject()
  • Signature

    • isSignatureElement()
    • hasSignatureElementName()
    • getSignatureElementName()
    • hasSignatureElementMetaObject()
    • getSignatureElementMetaObject()

 

DebugValue Changes

New Methods:

  • getMembers()
  • isMember()
  • getMemberValue()
  • getMemberQualifiedName()
  • getMemberSimpleName()
  • isMemberKindField()
  • isMemberKindMethod()
  • isMemberKindMetaObject()
  • getMemberSignature()
  • isSignatureElement()
  • getSignatureElementName()
  • getSignatureElementMetaObject()
  • getStaticReceiver()
  • getMetaParents()
  • getDeclaringMetaObject()

Deprecated:

  • getProperties()

 

Adoption

  • HostLanguage
  • SL
  • Chrome Inspector
  • DAP (TBD)

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 30, 2024
@graalvmbot graalvmbot force-pushed the mentlicher/GR-34476_InspectView branch from 94fc1fa to 3a15063 Compare October 14, 2024 14:37
@graalvmbot graalvmbot force-pushed the mentlicher/GR-34476_InspectView branch 3 times, most recently from d990342 to 952798e Compare October 18, 2024 21:25
@graalvmbot graalvmbot force-pushed the mentlicher/GR-34476_InspectView branch from 952798e to 43790b6 Compare October 18, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants