cherry-pick https://github.com/ruby/ruby/pull/1525
cherry-pick https://github.com/ruby/ruby/pull/1525

pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler,pmq20/ruby-compiler