/** * {@inheritDoc} * <p> * Generates call for {@link IHookDispatcher#dispatchBeforeCatch(long, Object)}. This method * expects exception object on stack that can be consumed. */ @Override protected void generateBeforeCatchCall() { // prepare for calls // we expect exception on stack so we must swap as exception is last argument in the call loadHookDispatcher(); swap(); // first push method id push(methodId); // can not just swap because method id is long, thus a bit of gymnastic // r-l-l2 dup2X1(); // l-l2-r-l-l2 pop2(); // l-l2-r :) // execute before catch mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, IInstrumenterConstant.IHOOK_DISPATCHER_INTERNAL_NAME, "dispatchBeforeCatch", IInstrumenterConstant.DISPATCH_BEFORE_CATCH_DESCRIPTOR, true); }