/** * Search the frame stack for the given JumpTarget. Return true if it is * found and false otherwise. Skip the given number of frames before * beginning the search. * * @param target The JumpTarget to search for * @param skipFrames The number of frames to skip before searching * @return */ public boolean isJumpTargetAlive(int target, int skipFrames) { for (int i = frameIndex - skipFrames; i >= 0; i--) { if (frameStack[i].getJumpTarget() == target) return true; } return false; }
/** * Search the frame stack for the given JumpTarget. Return true if it is * found and false otherwise. Skip the given number of frames before * beginning the search. * * @param target The JumpTarget to search for * @param skipFrames The number of frames to skip before searching * @return */ public boolean isJumpTargetAlive(int target, int skipFrames) { for (int i = frameIndex - skipFrames; i >= 0; i--) { if (frameStack[i].getJumpTarget() == target) return true; } return false; }
public int getFrameJumpTarget() { return getCurrentFrame().getJumpTarget(); }
public int getFrameJumpTarget() { return getCurrentFrame().getJumpTarget(); }
public IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject self, Block passedBlock) { assert args != null; Block newBlock; // bind to new self, if given if (self == null) { newBlock = block; } else { newBlock = block.cloneBlockAndFrame(); newBlock.getBinding().setSelf(self); } int jumpTarget = newBlock.getBinding().getFrame().getJumpTarget(); try { return newBlock.call(context, args, passedBlock); } catch (NullPointerException npe) { npe.printStackTrace(); throw npe; } catch (JumpException.BreakJump bj) { return handleBreakJump(getRuntime(), newBlock, bj, jumpTarget); } catch (JumpException.ReturnJump rj) { return handleReturnJump(context, rj, jumpTarget); } catch (JumpException.RetryJump rj) { return handleRetryJump(getRuntime(), rj); } }
public IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject self, Block passedBlock) { assert args != null; Block newBlock; // bind to new self, if given if (self == null) { newBlock = block; } else { newBlock = block.cloneBlockAndFrame(); newBlock.getBinding().setSelf(self); } int jumpTarget = newBlock.getBinding().getFrame().getJumpTarget(); try { return newBlock.call(context, args, passedBlock); } catch (JumpException.BreakJump bj) { return handleBreakJump(getRuntime(), newBlock, bj, jumpTarget); } catch (JumpException.ReturnJump rj) { return handleReturnJump(context, rj, jumpTarget); } catch (JumpException.RetryJump rj) { return handleRetryJump(getRuntime(), rj); } }