{"action":"created","issue":{"url":"https://api.github.com/repos/scala/scala/issues/4811","labels_url":"https://api.github.com/repos/scala/scala/issues/4811/labels{/name}","comments_url":"https://api.github.com/repos/scala/scala/issues/4811/comments","events_url":"https://api.github.com/repos/scala/scala/issues/4811/events","html_url":"https://github.com/scala/scala/pull/4811","id":112843413,"number":4811,"title":"More efficient way to compute maxLocals / maxStack","user":{"login":"lrytz","id":119636,"avatar_url":"https://avatars.githubusercontent.com/u/119636?v=3","gravatar_id":"","url":"https://api.github.com/users/lrytz","html_url":"https://github.com/lrytz","followers_url":"https://api.github.com/users/lrytz/followers","following_url":"https://api.github.com/users/lrytz/following{/other_user}","gists_url":"https://api.github.com/users/lrytz/gists{/gist_id}","starred_url":"https://api.github.com/users/lrytz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrytz/subscriptions","organizations_url":"https://api.github.com/users/lrytz/orgs","repos_url":"https://api.github.com/users/lrytz/repos","events_url":"https://api.github.com/users/lrytz/events{/privacy}","received_events_url":"https://api.github.com/users/lrytz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scala/scala/milestones/51","html_url":"https://github.com/scala/scala/milestones/2.12.0-M4","labels_url":"https://api.github.com/repos/scala/scala/milestones/51/labels","id":1337791,"number":51,"title":"2.12.0-M4","description":"Merge to 2.12.x\r\n\r\nPart 1:\r\n\r\n  - [ ] additional closure-specific heuristics for inliner (lukas)\r\n  - [ ] use default methods to FunctionN to interfaces (jason)\r\n  - [ ] use default methods to compile traits to interfaces (generalization of FunctionN task)\r\n  - [ ] compiler performance analysis after M2 (jason, lukas)\r\n  - [ ] enable SAM by default (adriaan)\r\n\r\nPart 2:\r\n\r\n  - [ ] improve wildcard inference, spec (adriaan)\r\n  - [ ] sbt build (seth)\r\n  - [ ] detuplify patmat optimization\r\n  - [ ] enable `-YclasspathImpl:flat` by default (seth)\r\n  - [ ] ensure we can safely remove genicode (sbt/ide/...) (lukas / seth)\r\n\r\nPart 3:\r\n\r\n  - [ ] intermediate implementation of SIP 23 (adriaan)\r\n  - [ ] structural type invocations using INDY? (jason)\r\n  - [ ] collections integration with Java 8 Streams (rex / adriaan)\r\n  - [ ] type lambda support (jason)\r\n  - [ ] desugar function literals for non-`FunctionN` SAM types to `Function` trees and indylambda (instead of creating an anonymous class during typer)\r\n","creator":{"login":"lrytz","id":119636,"avatar_url":"https://avatars.githubusercontent.com/u/119636?v=3","gravatar_id":"","url":"https://api.github.com/users/lrytz","html_url":"https://github.com/lrytz","followers_url":"https://api.github.com/users/lrytz/followers","following_url":"https://api.github.com/users/lrytz/following{/other_user}","gists_url":"https://api.github.com/users/lrytz/gists{/gist_id}","starred_url":"https://api.github.com/users/lrytz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrytz/subscriptions","organizations_url":"https://api.github.com/users/lrytz/orgs","repos_url":"https://api.github.com/users/lrytz/repos","events_url":"https://api.github.com/users/lrytz/events{/privacy}","received_events_url":"https://api.github.com/users/lrytz/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":5,"state":"open","created_at":"2015-10-05T09:46:45Z","updated_at":"2015-10-22T19:49:46Z","due_on":"2015-11-22T23:00:00Z","closed_at":null},"comments":1,"created_at":"2015-10-22T16:41:52Z","updated_at":"2015-10-23T09:02:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala/scala/pulls/4811","html_url":"https://github.com/scala/scala/pull/4811","diff_url":"https://github.com/scala/scala/pull/4811.diff","patch_url":"https://github.com/scala/scala/pull/4811.patch"},"body":"(This PR includes the commits of #4807)\r\n\r\nIn order to run an asm Analyzer, the maxLocals / maxStack values of\r\nthe method need to be computed. Asm doesn't provide an efficient\r\nbuilt-in for this purpose, but it computes these values while\r\nserializing a class.\r\n\r\nPreviously, we used to serialize the method just to compute the max's,\r\nwhich is inefficient. This commit implements a separate, efficient\r\ntraversal.\r\n\r\nThe computed values are also smaller, allowing to save space when\r\nrunning an Analyzer: asm Analyzers only allocate a single stack slot\r\nfor long/double values, while the JVM allocates two. The maxStack\r\ncomputed previously would always use two slots, which is not\r\nnecessary.\r\n\r\nThe new calculation was verified to be correct in the following way:\r\nas a test, i left the old computation in place, ran the new one in\r\naddition (in a special mode where the long/double values take two\r\nslots) and asserted equality. Bootstrapping and test suite passed.\r\n"},"comment":{"url":"https://api.github.com/repos/scala/scala/issues/comments/150520163","html_url":"https://github.com/scala/scala/pull/4811#issuecomment-150520163","issue_url":"https://api.github.com/repos/scala/scala/issues/4811","id":150520163,"user":{"login":"lrytz","id":119636,"avatar_url":"https://avatars.githubusercontent.com/u/119636?v=3","gravatar_id":"","url":"https://api.github.com/users/lrytz","html_url":"https://github.com/lrytz","followers_url":"https://api.github.com/users/lrytz/followers","following_url":"https://api.github.com/users/lrytz/following{/other_user}","gists_url":"https://api.github.com/users/lrytz/gists{/gist_id}","starred_url":"https://api.github.com/users/lrytz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrytz/subscriptions","organizations_url":"https://api.github.com/users/lrytz/orgs","repos_url":"https://api.github.com/users/lrytz/repos","events_url":"https://api.github.com/users/lrytz/events{/privacy}","received_events_url":"https://api.github.com/users/lrytz/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T09:02:10Z","updated_at":"2015-10-23T09:02:10Z","body":"Review by @retronym - tests should pass now"}}