Class PcodeInjectLibrary


  • public class PcodeInjectLibrary
    extends java.lang.Object
    • Field Detail

      • uniqueBase

        protected long uniqueBase
    • Constructor Detail

      • PcodeInjectLibrary

        public PcodeInjectLibrary​(PcodeInjectLibrary op2)
        Clone a library so that a Program can extend the library without modifying the base library from Language. InjectPayloads can be considered immutable and don't need to be cloned.
        Parameters:
        op2 - is the library to clone
    • Method Detail

      • clone

        public PcodeInjectLibrary clone()
        Overrides:
        clone in class java.lang.Object
        Returns:
        A clone of this library
      • getProgramPayloads

        public InjectPayloadSleigh[] getProgramPayloads()
        Returns:
        an array of all the program specific payloads (or null)
      • hasProgramPayload

        public boolean hasProgramPayload​(java.lang.String nm,
                                         int type)
        Determine if the given payload name and type exists and is an extension of the program.
        Parameters:
        nm - is the payload name
        type - is the payload type
        Returns:
        true if the program extension exists
      • isOverride

        public boolean isOverride​(java.lang.String nm,
                                  int type)
        Check if a specific payload has been overridden by a user extension
        Parameters:
        nm - is the name of the payload
        type - is the type of payload
        Returns:
        true if the payload is overridden
      • getPayload

        public InjectPayload getPayload​(int type,
                                        java.lang.String name)
      • parseInject

        public void parseInject​(InjectPayload payload)
                         throws SleighException
        Convert the XML string representation of the given payload to a ConstructTpl The payload should be unattached (not already installed in the library)
        Parameters:
        payload - is the given payload whose XML should be converted
        Throws:
        SleighException - if there is any parsing issue
      • adjustUniqueBase

        protected void adjustUniqueBase​(OpTpl[] opTemplates)
      • getCallFixupNames

        public java.lang.String[] getCallFixupNames()
        Returns:
        a list of names for all installed call-fixups
      • getCallotherFixupNames

        public java.lang.String[] getCallotherFixupNames()
        Returns:
        a list of names for all installed callother-fixups
      • hasUserDefinedOp

        public boolean hasUserDefinedOp​(java.lang.String name)
        Determine if the language has a given user-defined op. In which case, a CALLOTHER_FIXUP can be installed for it.
        Parameters:
        name - is the putative name of the user-defined op
        Returns:
        true if the user-defined op exists
      • registerInject

        protected void registerInject​(InjectPayload payload)
      • removeMechanismPayload

        protected boolean removeMechanismPayload​(java.lang.String nm)
        Remove a specific call mechanism payload.
        Parameters:
        nm - is the name of the payload
        Returns:
        true if a payload was successfully removed
      • uninstallProgramPayloads

        protected void uninstallProgramPayloads()
      • registerProgramInject

        protected void registerProgramInject​(java.util.List<InjectPayloadSleigh> userPayloads)
      • allocateInject

        public InjectPayload allocateInject​(java.lang.String sourceName,
                                            java.lang.String name,
                                            int tp)
        The main InjectPayload factory interface. This can be overloaded by derived libraries to produce custom dynamic payloads.
        Parameters:
        sourceName - is a description of the source of the payload
        name - is the formal name of the payload
        tp - is the type of payload: CALLFIXUP_TYPE, CALLOTHERFIXUP_TYPE, etc.
        Returns:
        the newly minted InjectPayload
      • saveCompilerSpecXml

        public void saveCompilerSpecXml​(java.lang.StringBuilder buffer)
        Save the parts of the inject library that come from the compiler spec to the output stream as XML tags
        Parameters:
        buffer - is the output stream
      • getConstantPool

        public ConstantPool getConstantPool​(Program program)
                                     throws java.io.IOException
        Get the constant pool associated with the given Program
        Parameters:
        program - is the given Program
        Returns:
        the ConstantPool associated with the Program
        Throws:
        java.io.IOException - for issues constructing the object
      • getUniqueBase

        protected long getUniqueBase()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object