Specific arity jit cleanup #4390

merged 4 commits into from Dec 15, 2016


None yet

1 participant

headius commented Dec 15, 2016

This PR cleans up method jit by only emitting one body regardless of whether there's a specific-arity path or not. Previously, both variable and specific paths were emitted in full. With this PR, the variable path will call the specific path. This reduces bytecode generated for a given method body by up to 50%, including all contained blocks and metaclass bodies.

headius added some commits Dec 15, 2016
@headius headius Add call protocol to script body and separate non-protocol metas. 4da4c16
@headius headius Additional fixes for top-level script protocol.
* Clear StaticScope's dynscope constructor when variable names are
* Clean up jitted top-level script boot logic.
@headius headius Encaptulate keyRest offset in Signature. 33dba52
@headius headius Emit only one body for jitted methods.
Previously, in order to support a specific-arity path for Ruby
method bodies, we emitted both a variable-arity version (with
arity checks) and a specific-arity version. This doubled the
amount of bytecode emitted for a given method body, and also
doubled the code generated for any contained blocks or metaclass
bodies. This commit modifies method jit to make the variable-arity
path just call the specific-arity path when present, reducing
generated bytecode by up to 50%.
@headius headius added this to the JRuby milestone Dec 15, 2016
headius commented Dec 15, 2016

This PR depends on #4388.

@headius headius merged commit 131e748 into jruby:master Dec 15, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
@headius headius deleted the headius:specific-arity-jit-cleanup branch Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment