diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2021-09-24 16:57:53 -0400 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:41 -0400 |
| commit | a09adac2d76342fd4a0d97905b3397758689c817 (patch) | |
| tree | b36da7570712769a9c129c95df71761ab0d59104 /spec/ruby/core/array | |
| parent | 79015926eb81ac93700146d42c343f568d3ddfbb (diff) | |
Add specialization for String#to_s on plain strings
When calling "to_s" on an instance of String, the method simply returns
self. In this situation most of the work comes from setting up the
method call. It turns out that both railsbench and liquid-render do this
a lot.
When generating code for opt_send_without_block, we already generate a
known class guard, so we can detect when the receiver is a String
instance. Since gen_send_cfunc() is also used for gen_invokesuper(), and
gen_invokesuper() doesn't generate a known class guard, a new nullable
parameter for specialized codegen function is added.
Closes GH-245
Diffstat (limited to 'spec/ruby/core/array')
0 files changed, 0 insertions, 0 deletions
