On 2018/02/03 16:30, Eric Wong wrote:
> nobu / ruby-lang.org wrote:
>>   https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62039
>>
>>   Log:
>>     compile.c: unnecessary freezing
>>
>>     * compile.c (iseq_peephole_optimize): get rid of freezing
>>       dynamically created string to be duplicated immediately.
>
> We don't need to check for String#+@ redefinitions?

Redefined method will be called.
The only difference should be that the receiver is frozen or not.

> Considering String#+@ and String#-@ look like syntax elements
> and are relatively new; can get rid of redefinition check in
> opt_str_uminus?

If we add `opt_str_uplus`, it will consume TOS without operands,
whereas `opt_str_uminus` has an operand but no stack.
I think `opt_str_uminus` is misnamed (and `opt_str_freeze` too).

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>