assembly - How to use the Frame in ASM(bytecode tool of Java)? What's meaning of every parameter of visitFrame/FrameNode? -


i'm busy writing compiler using asm 4.1. need compile intermediate language java bytecode. find asm 4.1 api says," in fact these nodes must(*) inserted before instruction node follows unconditionnal branch instruction such goto or throw, target of jump instruction, or starts exception handler block. " however, can't find usage of frame in asm guide("asm 4.0 java bytecode engineering library"). knows usage of frame? what's meaning of every parameter of visitframe/framenode? why "visitframe(opcodes.f_append,...)" @ time , "visitframe(opcodes.f_same,...)“ @ other time using asmifier? can't understand!! example, code below:

    int = 2;     int b = 3;     if(a == 3){         system.out.println("hello");     }else{         system.out.println(a);          if(b == 23){             system.out.println("world");         }else{             system.out.println(b);         }     } 

by using asmifier, can result(sorry, can't attach picture not enghou reputation), , there instruction this:"visitframe(opcodes.f_append,2, new object[]{opcodes.integer, opcodes.integer}, 0, null)" . tell me meaning of parameters?

thanks lot.

you can find detailed answer @ link below.

is there better explanation of stack map frames

java 1.7 introduced option speed class verification. frames have 2 parts: variables types , stack types. first frame determined method type description, initial ?store calls , method return type.

after each goto / jump call need provide updated description of stack map frames. in order save space, can use options same, append, etc. or can describe variables again specifying full array of variable types.

for example in catch section retrun stack type changed method return type exception class type caught exception.

if jump betveen different loop blocks goto commants, execution block of each loop might use different frame description variables used withing loop.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -