Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepend must set method's "defined class" to the new bottom. #4250

Merged
merged 1 commit into from Oct 30, 2016

Conversation

headius
Copy link
Member

@headius headius commented Oct 26, 2016

@headius
Copy link
Member Author

headius commented Oct 26, 2016

Note that I could not find any code in MRI that does this method-table-walking, so I'm confused how they realign methods to the new hierarchy. This appears to pass specs, but travis is a bit red right now.

@headius
Copy link
Member Author

headius commented Oct 30, 2016

I'm going to merge this. The method-walking already was occurring and this just adds an additional bit of state.

I believe MRI does not need to walk the method table because their method structs do not contain the originating class. Instead, when they search the method table, they produce a separate struct specific to that method table and its host class. Basically, they lazily determine what we store as implClass based on where the method is actually found at runtime.

We may want to adopt this approach in the future. I believe this would help fix the problems we have with method table cloning + super going up the wrong hierarchy. cc @enebo @subbuss.

@headius headius added this to the JRuby 9.1.6.0 milestone Oct 30, 2016
@headius headius merged commit f2b3a17 into jruby:master Oct 30, 2016
@headius headius deleted the methods_have_owners branch October 30, 2016 17:53
floehopper added a commit to freerange/mocha that referenced this pull request Oct 31, 2016
This is to see whether jruby/jruby#4250 has solved the problem in #274.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Aug 31, 2017
## 1.3.0

* Ensure all tests run individually - thanks to @chrisroos (#267)
* Update Travis CI build status badge to show master branch status (#264)
* Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)
* Fix pretty printing of quotes in `String#mocha_inspect` (#215 & #223)
* Add release instructions to README - thanks to @chrisroos (70a5febd &
  3c664df7)
* Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)
* Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos
  (8f58eddf)
* Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 &
  eca7560c)
* Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)
* Add latest stable version of JRuby to Travis CI build matrix (#288)
* Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)
* Deprecate passing block to mock object constructor (#290)
* Add a known issue to README for Ruby bug 12876 (#276)
* Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga
  (#297)
* Fix `Mocha::ParameterMatchers#includes` for `Array` values - thanks to
  @timcraft (#302)
* Use faster container-based virtual environments for Travis CI builds (#305)
* Rename `Mocha::ParameterMatchers::QueryStringMatches` to `QueryString` (#306)
* Handle blank parameter value for query string matcher - thanks to @weynsee
  (#303 & #304)
* Rename `Mocha::ParameterMatchers::QueryString` -> `EquivalentUri` (#307)
* Use `do ... end` instead of `{ ... }` in acceptance tests - thanks to
  @chrisroos (#294)
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.

None yet

1 participant