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
-
toString
-
hashCode
-
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
-
block
-
label
-