Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bummer we do need to walk dynscopes to find method we are defined in …
…so that if it happens to be from define_method we can prevent LJE since otherwise it would LJE by being marked as !definedWithinMethod (lexically it is within another closure and not a method). Ultimately, if/when cleanup happens here we should really entertain storing the lexical method dynscope (either from IRMethod or define_method) so we are not constantly doing this walking. If we did that then we could eliminate definedWithinMethod flag and also our search within dynscope for the method dynscope. At that point we would field access the method and make sure it is somewhere up stack to detect if the proc is a migrated proc or not. This last comment might make you think we could set a flag on the proc if it migrates but a proc can exist in n places at runtime.