Skip to content

enumerator review for better compatibility#5834

Merged
kares merged 26 commits intojruby:masterfrom
kares:enumerator-review
Aug 19, 2019
Merged

enumerator review for better compatibility#5834
kares merged 26 commits intojruby:masterfrom
kares:enumerator-review

Conversation

@kares
Copy link
Member

@kares kares commented Aug 14, 2019

this work builts upon #5672, which introduced the enumerator.rb library used by Rubinius ...
here, we're now adjusting parts for better compatibility with MRI's implementation.

just a note that the enumerator.rb introduced wasn't a drop in replacement and (already) required modifications on JRuby's end (Fiber state sharing) to make it usable. the gist of the lib stays the same.

changes are motivated by getting compatibility improved - 50 passing specs, 11 untagged MRI tests

also, due some Enumerator code being triggered during boot by RGs - we rather avoid reflecting on JRuby's internal classes (hasn't triggered the parts with JI loading but still)

kares added 26 commits August 14, 2019 18:13
since JRuby uses that API (for internal LAZY_WITH_NO_BLOCK)
to be able to handle all required cases e.g. pass block size
otherwise we're leaking using fibers (see 6c232ab)

with support for `enum.feed(value)` which causes a bit of (enumerator's
__call__ internal) duplication
when alias-ing a method this wasn't accurate
... as otherwise arg handling would cause regressions
otherwise the ONE_REQUIRED caused the logic to unwrap [1]
showed up with ironed out args processing in Enumerator!
@headius
Copy link
Member

headius commented Aug 18, 2019

Wow, lots of commits. I'll have a look.

Copy link
Member

@headius headius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@kares kares added this to the JRuby 9.2.9.0 milestone Aug 19, 2019
@kares kares merged commit 182d624 into jruby:master Aug 19, 2019
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