[ruby-core:85491] Re: [ruby-cvs:69220] nobu:r62039 (trunk): compile.c: unnecessary freezing

From: Nobuyoshi Nakada <nobu@...>
Date: 2018-02-10 01:02:24 UTC
List: ruby-core #85491
On 2018/02/03 16:30, Eric Wong wrote:
> [email protected] 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:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next