handle new global-env interface, cache analyzed code