Add write barriers to use generational GC.