{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/14913","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/14913/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/14913/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/14913/events","html_url":"https://github.com/JuliaLang/julia/pull/14913","id":130751534,"number":14913,"title":"refactor LambdaInfo","user":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars.githubusercontent.com/u/330950?v=3","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-02T17:18:47Z","updated_at":"2016-02-05T21:13:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/14913","html_url":"https://github.com/JuliaLang/julia/pull/14913","diff_url":"https://github.com/JuliaLang/julia/pull/14913.diff","patch_url":"https://github.com/JuliaLang/julia/pull/14913.patch"},"body":"eventually, MethodInfo should be able to merge with Method in the MethodTable->defs\r\nand LambdaInfo (MethodSpecialization?) should be able to replace Method in the MethodTable->cache\r\n\r\nthe difference between these types is very small in usage (resulting in a small amount of code duplication), but previously `jl_lambda_info_t` and been performing two nearly completely independent functionalities, identified only by which fields were active. this is a minor but annoying breaking internal change, so I figured doing it on the heals of the big renaming of LambdaStaticData was perhaps the best time to consider this.\r\n\r\nthe savings is small, but not entirely insignificant (~2% of sysimg)"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/180555663","html_url":"https://github.com/JuliaLang/julia/pull/14913#issuecomment-180555663","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/14913","id":180555663,"user":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars.githubusercontent.com/u/330950?v=3","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T21:13:08Z","updated_at":"2016-02-05T21:13:08Z","body":"I've now tried roughy 4 different variations on this idea to try out some different combinations of field divisions. fwiw, the current situation is roughly:\r\n\r\n```julia\r\ntype Method\r\n  next::Method\r\n  sig::Type\r\n  # fields for (cache) + reference to LambdaInfo (cache)\r\n  # fields for (def) + reference to LambdaInfo (def)\r\nend\r\n\r\ntype LambdaInfo\r\n  ast\r\n  # fields for (cache) + reference to LambdaInfo (def)\r\n  # fields for (def)\r\nend\r\n\r\n# where (def) means reached as an entry from MethodTable.defs\r\n# and (cache) means reached as an entry from MethodTable.cache\r\n```\r\n\r\nthe commits vary in how they rearrange the fields among various old and new types. for example, the design of the latest commit (a202fd1 \"merge LambdaInfo and MethodList, but split off AstInfo\") is:\r\n```julia\r\ntype Method # one entry in a MethodTable of a Function\r\n  next::Method\r\n  sig::Type\r\n  code::AstInfo\r\n  # fields for def\r\nend # was LambdaInfo (def) + Method (def)\r\n\r\ntype AstInfo # a syntax tree\r\n  def::Method\r\n  ast\r\n  # metadata for ast\r\nend # was `linfo.ast`\r\n\r\ntype LambdaInfo # an executable thunk (also may be one entry in a cache)\r\n  next::LambdaInfo\r\n  sig::Type\r\n  rettype::Type\r\n  func # code (e.g. an AstInfo, but could be #undef for a builtin)\r\n  sparam_vals # really a closure-env\r\n  fptrs::Ptr{Void}\r\nend # was LambdaInfo (cache) + Method (cache)\r\n```"}}