/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ public LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Constructs a new instance that is a copy of the old instance. * * @param old instance to copy */ protected LabeledList(LabeledList old) { super(old.size()); labelToIndex = old.labelToIndex.mutableCopy(); int sz = old.size(); for (int i = 0; i < sz; i++) { Object one = old.get0(i); if (one != null) { set0(i, one); } } }
/** * Makes a frame for a subroutine start block, given that this is the * ending frame of one of the subroutine's calling blocks. Subroutine * calls may be nested and thus may have nested locals state, so we * start with an initial state as seen by the subroutine, but keep track * of the individual locals states that will be expected when the individual * subroutine calls return. * * @param subLabel label of subroutine start block * @param callerLabel {@code >=0;} label of the caller block where this frame * came from. * @return a new instance to begin a called subroutine. */ public Frame makeNewSubroutineStartFrame(int subLabel, int callerLabel) { IntList newSubroutines = subroutines.mutableCopy(); newSubroutines.add(subLabel); Frame newFrame = new Frame(locals.getPrimary(), stack, IntList.makeImmutable(subLabel)); return newFrame.mergeWithSubroutineCaller(this, subLabel, callerLabel); }
/** * Makes a frame for a subroutine start block, given that this is the * ending frame of one of the subroutine's calling blocks. Subroutine * calls may be nested and thus may have nested locals state, so we * start with an initial state as seen by the subroutine, but keep track * of the individual locals states that will be expected when the individual * subroutine calls return. * * @param subLabel label of subroutine start block * @param callerLabel {@code >=0;} label of the caller block where this frame * came from. * @return a new instance to begin a called subroutine. */ public Frame makeNewSubroutineStartFrame(int subLabel, int callerLabel) { IntList newSubroutines = subroutines.mutableCopy(); newSubroutines.add(subLabel); Frame newFrame = new Frame(locals.getPrimary(), stack, IntList.makeImmutable(subLabel)); return newFrame.mergeWithSubroutineCaller(this, subLabel, callerLabel); }
/** * Makes a frame for a subroutine start block, given that this is the * ending frame of one of the subroutine's calling blocks. Subroutine * calls may be nested and thus may have nested locals state, so we * start with an initial state as seen by the subroutine, but keep track * of the individual locals states that will be expected when the individual * subroutine calls return. * * @param subLabel label of subroutine start block * @param callerLabel {@code >=0;} label of the caller block where this frame * came from. * @return a new instance to begin a called subroutine. */ public Frame makeNewSubroutineStartFrame(int subLabel, int callerLabel) { IntList newSubroutines = subroutines.mutableCopy(); newSubroutines.add(subLabel); Frame newFrame = new Frame(locals.getPrimary(), stack, IntList.makeImmutable(subLabel)); return newFrame.mergeWithSubroutineCaller(this, subLabel, callerLabel); }
/** * Makes a frame for a subroutine start block, given that this is the * ending frame of one of the subroutine's calling blocks. Subroutine * calls may be nested and thus may have nested locals state, so we * start with an initial state as seen by the subroutine, but keep track * of the individual locals states that will be expected when the individual * subroutine calls return. * * @param subLabel label of subroutine start block * @param callerLabel {@code >=0;} label of the caller block where this frame * came from. * @return a new instance to begin a called subroutine. */ public Frame makeNewSubroutineStartFrame(int subLabel, int callerLabel) { IntList newSubroutines = subroutines.mutableCopy(); newSubroutines.add(subLabel); Frame newFrame = new Frame(locals.getPrimary(), stack, IntList.makeImmutable(subLabel)); return newFrame.mergeWithSubroutineCaller(this, subLabel, callerLabel); }
/** * Makes a frame for a subroutine start block, given that this is the * ending frame of one of the subroutine's calling blocks. Subroutine * calls may be nested and thus may have nested locals state, so we * start with an initial state as seen by the subroutine, but keep track * of the individual locals states that will be expected when the individual * subroutine calls return. * * @param subLabel label of subroutine start block * @param callerLabel {@code >=0;} label of the caller block where this frame * came from. * @return a new instance to begin a called subroutine. */ public Frame makeNewSubroutineStartFrame(int subLabel, int callerLabel) { IntList newSubroutines = subroutines.mutableCopy(); newSubroutines.add(subLabel); Frame newFrame = new Frame(locals.getPrimary(), stack, IntList.makeImmutable(subLabel)); return newFrame.mergeWithSubroutineCaller(this, subLabel, callerLabel); }
/** * Makes a frame for a subroutine start block, given that this is the * ending frame of one of the subroutine's calling blocks. Subroutine * calls may be nested and thus may have nested locals state, so we * start with an initial state as seen by the subroutine, but keep track * of the individual locals states that will be expected when the individual * subroutine calls return. * * @param subLabel label of subroutine start block * @param callerLabel {@code >=0;} label of the caller block where this frame * came from. * @return a new instance to begin a called subroutine. */ public Frame makeNewSubroutineStartFrame(int subLabel, int callerLabel) { IntList newSubroutines = subroutines.mutableCopy(); newSubroutines.add(subLabel); Frame newFrame = new Frame(locals.getPrimary(), stack, IntList.makeImmutable(subLabel)); return newFrame.mergeWithSubroutineCaller(this, subLabel, callerLabel); }
/** * Replaces one of a block's successors with a different label. Constructs * an updated BasicBlock instance and places it in {@code newBlocks}. * * @param block block to replace * @param oldLabel label of successor to replace * @param newLabel label of new successor */ private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) { IntList newSuccessors = block.getSuccessors().mutableCopy(); int newPrimarySuccessor; newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel); newPrimarySuccessor = block.getPrimarySuccessor(); if (newPrimarySuccessor == oldLabel) { newPrimarySuccessor = newLabel; } newSuccessors.setImmutable(); BasicBlock newBB = new BasicBlock(block.getLabel(), block.getInsns(), newSuccessors, newPrimarySuccessor); newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB); } }
/** * Replaces one of a block's successors with a different label. Constructs * an updated BasicBlock instance and places it in {@code newBlocks}. * * @param block block to replace * @param oldLabel label of successor to replace * @param newLabel label of new successor */ private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) { IntList newSuccessors = block.getSuccessors().mutableCopy(); int newPrimarySuccessor; newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel); newPrimarySuccessor = block.getPrimarySuccessor(); if (newPrimarySuccessor == oldLabel) { newPrimarySuccessor = newLabel; } newSuccessors.setImmutable(); BasicBlock newBB = new BasicBlock(block.getLabel(), block.getInsns(), newSuccessors, newPrimarySuccessor); newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB); } }
/** * Replaces one of a block's successors with a different label. Constructs * an updated BasicBlock instance and places it in {@code newBlocks}. * * @param block block to replace * @param oldLabel label of successor to replace * @param newLabel label of new successor */ private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) { IntList newSuccessors = block.getSuccessors().mutableCopy(); int newPrimarySuccessor; newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel); newPrimarySuccessor = block.getPrimarySuccessor(); if (newPrimarySuccessor == oldLabel) { newPrimarySuccessor = newLabel; } newSuccessors.setImmutable(); BasicBlock newBB = new BasicBlock(block.getLabel(), block.getInsns(), newSuccessors, newPrimarySuccessor); newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB); } }
/** * Replaces one of a block's successors with a different label. Constructs * an updated BasicBlock instance and places it in {@code newBlocks}. * * @param block block to replace * @param oldLabel label of successor to replace * @param newLabel label of new successor */ private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) { IntList newSuccessors = block.getSuccessors().mutableCopy(); int newPrimarySuccessor; newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel); newPrimarySuccessor = block.getPrimarySuccessor(); if (newPrimarySuccessor == oldLabel) { newPrimarySuccessor = newLabel; } newSuccessors.setImmutable(); BasicBlock newBB = new BasicBlock(block.getLabel(), block.getInsns(), newSuccessors, newPrimarySuccessor); newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB); } }
/** * Replaces one of a block's successors with a different label. Constructs * an updated BasicBlock instance and places it in {@code newBlocks}. * * @param block block to replace * @param oldLabel label of successor to replace * @param newLabel label of new successor */ private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) { IntList newSuccessors = block.getSuccessors().mutableCopy(); int newPrimarySuccessor; newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel); newPrimarySuccessor = block.getPrimarySuccessor(); if (newPrimarySuccessor == oldLabel) { newPrimarySuccessor = newLabel; } newSuccessors.setImmutable(); BasicBlock newBB = new BasicBlock(block.getLabel(), block.getInsns(), newSuccessors, newPrimarySuccessor); newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB); } }
/** * Replaces one of a block's successors with a different label. Constructs * an updated BasicBlock instance and places it in {@code newBlocks}. * * @param block block to replace * @param oldLabel label of successor to replace * @param newLabel label of new successor */ private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) { IntList newSuccessors = block.getSuccessors().mutableCopy(); int newPrimarySuccessor; newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel); newPrimarySuccessor = block.getPrimarySuccessor(); if (newPrimarySuccessor == oldLabel) { newPrimarySuccessor = newLabel; } newSuccessors.setImmutable(); BasicBlock newBB = new BasicBlock(block.getLabel(), block.getInsns(), newSuccessors, newPrimarySuccessor); newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB); } }