Package ghidra.pcode.emu.jit.analysis
Record Class JitAllocationModel.MultiLocalPart
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.analysis.JitAllocationModel.MultiLocalPart
- Record Components:
local
- the local variable allocated to this partshift
- the number of bytes and direction to shift
- Enclosing class:
JitAllocationModel
public static record JitAllocationModel.MultiLocalPart(JitAllocationModel.JvmLocal local, int shift)
extends Record
A portion of a multi-local variable handler.
This portion is allocated in a JVM local. When loading with a positive shift, the value is shifted to the right to place it into position.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLocalPart
(JitAllocationModel.JvmLocal local, int shift) Creates an instance of aMultiLocalPart
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
generateLoadCode
(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv) Emit bytecode to load the value from this local and position it in a value on the JVM stack.void
generateStoreCode
(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv) Emit bytecode to extract this part from the value on the JVM stack and store it in the local variable.final int
hashCode()
Returns a hash code value for this object.local()
Returns the value of thelocal
record component.int
shift()
Returns the value of theshift
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
generateLoadCode
public void generateLoadCode(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv) Emit bytecode to load the value from this local and position it in a value on the JVM stack.If multiple parts are to be combined, the caller should emit a bitwise or after all loads but the first.
- Parameters:
gen
- the code generatortype
- the p-code type of the value expected on the stack by the proceeding bytecode, which may be to load additional partsrv
- the visitor for therun
method
-
generateStoreCode
public void generateStoreCode(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv) Emit bytecode to extract this part from the value on the JVM stack and store it in the local variable.If multiple parts are to be stored, the caller should emit a
dup
ordup2
before all stores but the last.- Parameters:
gen
- the code generatortype
- the p-code type of the value expected on the stack by the proceeding bytecode, which may be to load additional partsrv
- the visitor for therun
method
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
local
Returns the value of thelocal
record component.- Returns:
- the value of the
local
record component
-
shift
public int shift()Returns the value of theshift
record component.- Returns:
- the value of the
shift
record component
-