{"id":44255271,"url":"https://github.com/saeg/asm-defuse","last_synced_at":"2026-02-10T16:24:38.619Z","repository":{"id":12303130,"uuid":"14934227","full_name":"saeg/asm-defuse","owner":"saeg","description":"ASM powered by definitions/uses analysis","archived":false,"fork":false,"pushed_at":"2025-06-28T13:47:28.000Z","size":676,"stargazers_count":37,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-16T21:34:40.363Z","etag":null,"topics":["asm","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saeg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-TEMPLATE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-12-04T19:58:06.000Z","updated_at":"2025-04-08T21:53:25.000Z","dependencies_parsed_at":"2024-04-09T18:48:19.744Z","dependency_job_id":"6d1a50d9-0e00-4874-afbb-fa3b11ef8ef5","html_url":"https://github.com/saeg/asm-defuse","commit_stats":null,"previous_names":["andrioli/asm-defuse"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/saeg/asm-defuse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeg%2Fasm-defuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeg%2Fasm-defuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeg%2Fasm-defuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeg%2Fasm-defuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saeg","download_url":"https://codeload.github.com/saeg/asm-defuse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeg%2Fasm-defuse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29307781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T16:09:25.305Z","status":"ssl_error","status_checked_at":"2026-02-10T16:08:52.170Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asm","java"],"created_at":"2026-02-10T16:24:36.064Z","updated_at":"2026-02-10T16:24:38.613Z","avatar_url":"https://github.com/saeg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASM-DefUse\n\n[ASM](http://asm.ow2.org/) powered by definitions/uses analysis\n\n[![Maven Central](https://img.shields.io/maven-central/v/br.usp.each.saeg/asm-defuse.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/br.usp.each.saeg/asm-defuse)\n\nASM-DefUse extends [ASM](http://asm.ow2.org/) analysis API with control- and data-flow algorithms for definition/uses analysis.\n\n## Requirements\n\n* Java 6\n\n## Setup\n\nIf you're using Maven just add this new dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ebr.usp.each.saeg\u003c/groupId\u003e\n    \u003cartifactId\u003easm-defuse\u003c/artifactId\u003e\n    \u003cversion\u003e${asm-defuse.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Control-flow analysis\n\nThe following code exemplify how to use `FlowAnalyzer` class\n```java\nMethodNode mn = ... // A regular MethodNode from ASM tree API\nFlowAnalyzer\u003cBasicValue\u003e analyzer = new FlowAnalyzer\u003cBasicValue\u003e(new BasicInterpreter());\nanalyzer.analyze(\"package/ClassName\", mn);\n\nint[][] successors = analyzer.getSuccessors();\nint[][] predecessors = analyzer.getPredecessors();\nint[][] basicBlocks = analyzer.getBasicBlocks();\nint[] leaders = analyzer.getLeaders();\n\nfor (int i = 0; i \u003c mn.instructions.size(); i++) {\n  // successors[i] array contains the indexes of the successors of instruction i\n  System.out.println(\"Instruction \" + i + \" has \" + successors[i].length + \" successors\");\n\n  // predecessors[i] array contains the indexes of the predecessors of instruction i\n  System.out.println(\"Instruction \" + i + \" has \" + predecessors[i].length + \" predecessors\");\n\n  System.out.println(\"Instruction \" + i + \" belongs to basic block \" + leaders[i]);\n}\nfor (int i = 0; i \u003c basicBlocks.length; i++) {\n  System.out.println(\"Basic block \" + i + \" contains \" + basicBlocks[i].length + \" instructions\");\n}\n```\n\n## Data-flow analysis\n\nThe following code exemplify how to use `DefUseAnalyzer` class\n```java\nMethodNode mn = ... // A regular MethodNode from ASM tree API\nDefUseAnalyzer analyzer = new DefUseAnalyzer();\nanalyzer.analyze(\"package/ClassName\", mn);\n\nVariable[] variables = analyzer.getVariables();\nDefUseFrame[] frames = analyzer.getDefUseFrames();\n\nSystem.out.println(\"This method contains \" + variables.length + \" variables\");\nfor (int i = 0; i \u003c mn.instructions.size(); i++) {\n  System.out.println(\"Instruction \" + i + \" contains definitions of \" + frames[i].getDefinitions());\n  System.out.println(\"Instruction \" + i + \" contains usage of \" + frames[i].getUses());\n}\n```\n\n## Definition-Use Chain\n\nThe following code exemplify how to compute `DefUseChain`\n```java\nMethodNode mn = ... // A regular MethodNode from ASM tree API\nDefUseInterpreter interpreter = new DefUseInterpreter();\nFlowAnalyzer\u003cValue\u003e flowAnalyzer = new FlowAnalyzer\u003cValue\u003e(interpreter);\nDefUseAnalyzer analyzer = new DefUseAnalyzer(flowAnalyzer, interpreter);\nanalyzer.analyze(\"package/ClassName\", mn);\n\nVariable[] variables = analyzer.getVariables();\nDefUseChain[] chains = new DepthFirstDefUseChainSearch().search(\n    analyzer.getDefUseFrames(),\n    analyzer.getVariables(),\n    flowAnalyzer.getSuccessors(),\n    flowAnalyzer.getPredecessors());\n\nSystem.out.println(\"This method contains \" + chains.length + \" Definition-Use Chains\");\nfor (int i = 0; i \u003c chains.length; i++) {\n  DefUseChain chain = chains[i];\n  System.out.println(\"Instruction \" + chain.def + \" define variable \" + variables[chain.var]);\n  System.out.println(\"Instruction \" + chain.use + \" uses variable \" + variables[chain.var]);\n  // There is a path between chain.def and chain.use that not redefine chain.var\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeg%2Fasm-defuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaeg%2Fasm-defuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeg%2Fasm-defuse/lists"}