• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

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

dongx

Lurker
Jun 3, 2011
1
0
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
}
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones