Skip to content

Pattern jit#8027

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

Pattern jit#8027
enebo merged 7 commits intojruby:masterfrom
enebo:pattern_jit

Conversation

@enebo
Copy link
Member

@enebo enebo commented Nov 30, 2023

This fixes problem in other PR and I just pushed to new one so I can throw in some other changes.

headius and others added 5 commits November 28, 2023 21:26
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 added this to the JRuby 9.4.6.0 milestone Nov 30, 2023
The jump/branch for post_args in array pattern matching I think was
creating some control flow the bytecode could not support.  I cannot
prove this but regardless the new code is much simpler and faster
as well.
@enebo enebo merged commit 9f3d11f into jruby:master Nov 30, 2023
@enebo enebo deleted the pattern_jit branch November 30, 2023 21: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