Moved save and restore logic for frames and locals into common_code_generator.rb