Project

General

Profile

« Previous | Next » 

Revision b6f543d4

Added by jhawthorn (John Hawthorn) over 3 years ago

YJIT: Introduce jit_putobject (#5179)

  • YJIT: Introduce jit_putobject

This extracts the logic previously inside gen_putobject to a more
reusable helper method jit_putobject.

The motivation for this is that it both simplifies the implementation of
other instructions, and other instructions can reuse the optimized
behaviour for 32-bit special constants (most importantly
opt_getinlinecache).

This commit also expands the optimization to use a mov directly to
memory when we encounter a 32-bit immediate constant. Previously it
covered fixnums and Qtrue/Qfalse, now it will cover any SPECIAL_CONST_P
value which can be represented as a 32-bit immediate. Notably, this
includes static symbols, and Qnil.

  • Style touchups and a comment

  • delete empty line

Co-authored-by: Alan Wu