ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:116368] [Ruby master Misc#20201] Should `opt_reverse` be renamed?
@ 2024-01-22 16:11 kddnewton (Kevin Newton) via ruby-core
  0 siblings, 0 replies; only message in thread
From: kddnewton (Kevin Newton) via ruby-core @ 2024-01-22 16:11 UTC (permalink / raw)
  To: ruby-core; +Cc: kddnewton (Kevin Newton)

Issue #20201 has been reported by kddnewton (Kevin Newton).

----------------------------------------
Misc #20201: Should `opt_reverse` be renamed?
https://bugs.ruby-lang.org/issues/20201

* Author: kddnewton (Kevin Newton)
* Status: Open
* Priority: Normal
----------------------------------------
When you use keywords with the &&= or ||= operator on a [] method call, it uses the `opt_reverse` instruction. For example:

``` ruby
h[foo: 1] &&= 2
```

This instruction is used regardless of if optimizations are on or off. (`--dump=insns_without_opt` and `RubyVM::InstructionSequence.compile_option = false` both don't turn it off.) e`opt_reverse` is also used within the peephole optimizer, so its naming makes sense in those cases.

Should the instruction be renamed `reverse`/`stack_reverse`?



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-22 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 16:11 [ruby-core:116368] [Ruby master Misc#20201] Should `opt_reverse` be renamed? kddnewton (Kevin Newton) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).