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 aMultiLocalPartrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidgenerateLoadCode(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.voidgenerateStoreCode(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 inthashCode()Returns a hash code value for this object.local()Returns the value of thelocalrecord component.intshift()Returns the value of theshiftrecord component.final StringtoString()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 therunmethod- Implementation Notes:
- We must keep temporary values in a variable of the larger of the local's or the expected type, otherwise bits may get dropped while positioning the value.
-
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
dupordup2before 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 therunmethod- Implementation Notes:
- We must keep temporary values in a variable of the larger of the local's or the expected type, otherwise bits may get dropped while positioning the value.
-
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 thelocalrecord component.- Returns:
- the value of the
localrecord component
-
shift
public int shift()Returns the value of theshiftrecord component.- Returns:
- the value of the
shiftrecord component
-