You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Sian January <si...@googlemail.com> on 2010/10/19 14:50:04 UTC

Re: How to get the 'CodeAttribute' in class file?

Hi Wang,

Unless you're actually working on the VM itself I would suggest using
some kind of bytecode manipulation utility such as ASM or BCEL.

Regards,

Sian



2010/10/13 Wang Di <wa...@fudan.edu.cn>:
> Hi all:
>
>         We have add annotation(CodeAttribute) for a method into class file,
> and we can dump these information with javap. For instance,
>
>
>
> public static void main(java.lang.String[]);
>
>  Code:
>
>   Stack=2, Locals=2, Args_size=1
>
>   0:   new     #647; //class java/util/Properties
>
>   3:   dup
>
>   4:   invokespecial   #644; //Method java/util/Properties."<init>":()V
>
>   7:   astore_1
>
>   8:   aload_0
>
>   9:   aload_1
>
>   10:  invokestatic    #283; //Method
> spec/harness/CommandLineParser.parseArgs:([Ljava/lang/String;Ljava/util/Prop
> erties;)Z
>
>   13:  ifne    17
>
>   16:  return
>
>   17:  aload_1
>
>   18:  invokestatic    #176; //Method
> runBenchmarkSuite:(Ljava/util/Properties;)V
>
>   21:  return
>
>  CodeAttribute: length = 0x5
>
>   00 01 00 00 00
>
>
>
>         How can we get these info in Harmony VM? Is there some interface
> exited?
>
>
>
> Many thanks!
>
> =====================================
>
> Wang Di
>
> Fudan University        201203
> No.825 Zhangheng Road, Shanghai
>
>
>
>
>
>



-- 
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU