Package ghidra.pcode.emu.jit.gen
Record Class ExceptionHandler
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.ExceptionHandler
- Record Components:
op- the op which may cause an exceptionblock- the block containing the oplabel- the label at the start of the handler
public record ExceptionHandler(PcodeOp op, JitControlFlowModel.JitBlock block, org.objectweb.asm.Label label)
extends Record
A requested exception handler
When an exception occurs, we must retire all of the variables before we pop the
run method's frame. We also write out the program counter and
disassembly context so that the emulator can resume appropriately. After that, we re-throw the
exception.
When the code generator knows the code it's emitting can cause a user exception, e.g., the Direct
invocation of a userop, and there are live variables in scope, then it should request a handler
(via JitCodeGenerator.requestExceptionHandler(DecodedPcodeOp, JitBlock)) and surround the
code in a try-catch on Throwable directing it to this handler.
-
Constructor Summary
ConstructorsConstructorDescriptionExceptionHandler(PcodeOp op, JitControlFlowModel.JitBlock block) Construct a handler, generating a new labelExceptionHandler(PcodeOp op, JitControlFlowModel.JitBlock block, org.objectweb.asm.Label label) Creates an instance of aExceptionHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.voidgenerateRunCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv) Emit the handler's code into therunmethod.final inthashCode()Returns a hash code value for this object.org.objectweb.asm.Labellabel()Returns the value of thelabelrecord component.op()Returns the value of theoprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ExceptionHandler
Construct a handler, generating a new label- Parameters:
op- the op which may cause an exceptionblock- the block containing the op
-
ExceptionHandler
public ExceptionHandler(PcodeOp op, JitControlFlowModel.JitBlock block, org.objectweb.asm.Label label) Creates an instance of aExceptionHandlerrecord class.
-
-
Method Details
-
generateRunCode
Emit the handler's code into therunmethod.- Parameters:
gen- the code generatorrv- the visitor for therunmethod
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
op
Returns the value of theoprecord component.- Returns:
- the value of the
oprecord component
-
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
label
public org.objectweb.asm.Label label()Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-