[Mips] Use unique_ptr to manage ownership.