-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Refactoring module_function
#4931
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is clean but I do not think we want to pay resetting an additional field in Frame. This will have some measurable cost. We are trying to always prune down cost of frame management.
I wonder if we can somehow combine state of capture and this boolean together possibly something as icky as an Enum although maybe a module_function frame can also capture? bit flags combining would be another idea since neither flag is set by default. Just thinking out loud...
Remove `MODULE_FUNCTION` from `Visibility` and add `isModuleFunction` to `Frame`. Implementing `module_function` as `Visibility` makes the visibility of `foo` to be `MODULE_FUNCTION`: ``` Module.new do module_function define_method(:foo) {:foo} end ``` `module_function` is not a type of visibility but states of frames. So change to manage it on `Frame`.
97e89a6
to
6a9aa24
Compare
Introduce `FrameVisibility` to handle visibility of methods and frames separately.
I introduced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok with this change. I added @headius since changing Frame is our most sensitive class in our runtime.
I want to revert last commit, because last commit breaks many test cases... |
@yui-knk do you know why they failed? Removal of that enum value? |
We need to resolve what broke from this PR
@yui-knk I am unsure from reading comments what is needed to move forward on this PR? |
Remove
MODULE_FUNCTION
fromVisibility
andadd
isModuleFunction
toFrame
.Implementing
module_function
asVisibility
makes the visibility of
foo
to beMODULE_FUNCTION
:module_function
is not a type of visibilitybut states of frames. So change to manage it
on
Frame
.