(Memory) Update instrumented codegen for memory script support.