1. Download our Official Android App: Forums for Android!

Apps What is " code " " ins ", " outs ", " registers ", " insns size " in the Dalvik bytecode?

Discussion in 'Android Development' started by dongx, Jun 3, 2011.

  1. dongx

    dongx Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jun 3, 2011

    Jun 3, 2011
    1
    0
    5
    What is " code ", " registers ", " ins ", " outs ", " insns size " in the Dalvik bytecode?

    DALVIK BYTECODE:
    Processing 'classes.dex'...
    Opened 'classes.dex', DEX version '035'
    Class #0 -
    Class descriptor : 'LHelloWorld;'
    Access flags : 0x0001 (PUBLIC)
    Superclass : 'Ljava/lang/Object;'
    Interfaces -
    Static fields -
    Instance fields -
    Direct methods -
    #0 : (in LHelloWorld;)
    name : '<init>'
    type : '()V'
    access : 0x10001 (PUBLIC CONSTRUCTOR)
    code -
    registers : 1
    ins : 1
    outs : 1
    insns size : 4 16-bit code units
    000138: |[000138] HelloWorld.<init:mad:)V
    000148: 7010 0300 0000 |0000: invoke-direct {v0}, Ljava/lang/Object;.<init:mad:)V // method@0003
    00014e: 0e00 |0003: return-void
    catches : (none)
    positions :
    0x0000 line=5
    locals :
    0x0000 - 0x0004 reg=0 this LHelloWorld;

    #1 : (in LHelloWorld;)
    name : 'main'
    type : '([Ljava/lang/String;)V'
    access : 0x0009 (PUBLIC STATIC)
    code -
    registers : 3
    ins : 1
    outs : 2
    insns size : 8 16-bit code units
    000150: |[000150] HelloWorld.main:([Ljava/lang/String;)V
    000160: 6200 0000 |0000: sget-object v0, Ljava/lang/System;.out:Ljava/io/PrintStream; // field@0000
    000164: 1a01 0100 |0002: const-string v1, "Hello, world" // string@0001
    000168: 6e20 0200 1000 |0004: invoke-virtual {v0, v1}, Ljava/io/PrintStream;.println:(Ljava/lang/String;)V // method@0002
    00016e: 0e00 |0007: return-void
    catches : (none)
    positions :
    0x0000 line=7
    0x0007 line=8
    locals :
    0x0000 - 0x0008 reg=2 args [Ljava/lang/String;

    Virtual methods -
    source_file_idx : 2 (HelloWorld.java)
    ------------------------------------------------------------------------------------
    JAVA SOURCE:
    public class HelloWorld {
    public static void main(String[] args){
    System.out.println("Hello, world");
    }
    }
    ------------------------------------------------------------------------------------
    JAVA BYTECODE:
    // class version 50.0 (50)
    // access flags 0x21
    public class HelloWorld {

    // compiled from: HelloWorld.java

    // access flags 0x1
    public <init>() : void
    L0
    LINENUMBER 5 L0
    ALOAD 0: this
    INVOKESPECIAL Object.<init>() : void
    RETURN
    L1
    LOCALVARIABLE this HelloWorld L0 L1 0
    MAXSTACK = 1
    MAXLOCALS = 1

    // access flags 0x9
    public static main(String[]) : void
    L0
    LINENUMBER 7 L0
    GETSTATIC System.out : PrintStream
    LDC "Hello, world"
    INVOKEVIRTUAL PrintStream.println(String) : void
    L1
    LINENUMBER 8 L1
    RETURN
    L2
    LOCALVARIABLE args String[] L0 L2 0
    MAXSTACK = 2
    MAXLOCALS = 1
    }
     

    Advertisement

Share This Page

Loading...