Skip to content

Full JIT support for pattern matching#8026

Merged
enebo merged 4 commits intojruby:masterfrom
headius:pattern_jit
Nov 30, 2023
Merged

Full JIT support for pattern matching#8026
enebo merged 4 commits intojruby:masterfrom
headius:pattern_jit

Conversation

@headius
Copy link
Member

@headius headius commented Nov 29, 2023

Mostly just missing a few operations in the JIT, but I will throw some optimization work in here too.

@headius headius added this to the JRuby 9.4.6.0 milestone Nov 29, 2023
@headius headius marked this pull request as draft November 29, 2023 03:37
This implements the following operations:

* Integer, to push a native int
* AsFixnum, to construct a RubyFixnum from an int
* ARRAY_LENGTH runtime helper to retrieve array's length as an int
* BIntInstr for branch operations against two ints

To support these, the following logic was added to manage int
local variables on the JVM stack:

* TemporaryIntVariable: similar to the prototype unboxed variables
  but stored boxed in the Object[] temp array in the interpreter.
  The JIT knows to use int when dealing with this type of var.
* int-based temps used by the pattern logic are switched to
  TemporaryIntVariable.

A few minor utility functions are added to SkinnyMethodAdapter,
including the oddly missing icmp_ge.
@enebo enebo merged commit 4907cad into jruby:master Nov 30, 2023
@headius headius deleted the pattern_jit branch December 1, 2023 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants