Add partial sharing support to AOT.