/** * Make sure the code arrays have at least the given size. */ private void ensureCodeLength(int newCodeLength) { if (code.length < newCodeLength) { // Add 20% to avoid extending the arrays too often. newCodeLength = newCodeLength * 6 / 5; code = ArrayUtil.extendArray(code, newCodeLength); oldInstructionOffsets = ArrayUtil.extendArray(oldInstructionOffsets, newCodeLength); instructionWriter.extend(newCodeLength); } }
/** * Make sure the code arrays have at least the given size. */ private void ensureCodeLength(int newCodeLength) { if (code.length < newCodeLength) { // Add 20% to avoid extending the arrays too often. newCodeLength = newCodeLength * 6 / 5; code = ArrayUtil.extendArray(code, newCodeLength); oldInstructionOffsets = ArrayUtil.extendArray(oldInstructionOffsets, newCodeLength); instructionWriter.extend(newCodeLength); } }
/** * Make sure the code arrays have at least the given size. */ private void ensureCodeLength(int newCodeLength) { if (code.length < newCodeLength) { // Add 20% to avoid extending the arrays too often. newCodeLength = newCodeLength * 6 / 5; code = ArrayUtil.extendArray(code, newCodeLength); oldInstructionOffsets = ArrayUtil.extendArray(oldInstructionOffsets, newCodeLength); instructionWriter.extend(newCodeLength); } }