All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opalj.br.instructions.ALOAD.scala Maven / Gradle / Ivy

The newest version!
/* BSD 2-Clause License - see OPAL/LICENSE for details. */
package org.opalj
package br
package instructions

/**
 * Load reference from local variable.
 *
 * @author Michael Eichberg
 */
case class ALOAD(lvIndex: Int) extends ALoadInstruction with ExplicitLocalVariableIndex {

    final def opcode: Opcode = ALOAD.opcode

    final def mnemonic: String = ALOAD.mnemonic

    override def equals(other: Any): Boolean = other match {
        case that: ALOAD => this.lvIndex == that.lvIndex
        case _           => false
    }

    override def hashCode: Int = ALOAD.opcode * 449 + lvIndex

    override def toString: String = s"ALOAD($lvIndex)"
}
object ALOAD extends InstructionMetaInformation {

    final val opcode = 25

    final val mnemonic = "aload"

    def canonicalRepresentation(lvIndex: Int): LoadLocalVariableInstruction = {
        lvIndex match {
            case 0 => ALOAD_0
            case 1 => ALOAD_1
            case 2 => ALOAD_2
            case 3 => ALOAD_3
            case _ => new ALOAD(lvIndex)
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy