java - Splitting InsnList into basic blocks -


in asm tree api, have insnlist, containing list of instructions in method.

i want split basic blocks: sequence of instructions such each instruction except last 1 has 1 successor, , such no instruction except first 1 can target of jump.

how accomplish this?

in java 7+ stack frames included in method opcodes. iterate through method's insnlist , make blocks split each frameinsn.

example:

list<insnlist> l = lists.newlist(); insnlist il = new insnlist(); (abstractinsnnode ain : method.instructions.toarray()) {     if (ain.gettype == abstractinsnnode.frame){         l.add(il);         il = new insnlist();     } else {         il.add(ain);     } } 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -