Introduction (0A)

Introduction Young Won Lim 1 9/3/14 Copyright () 2011-= 2014 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Please send corrections (or suggestions) to [email protected]. This document was produced by using OpenOffice.

Introduction Young Won Lim 2 9/3/14 source files Python source files (.java) (.py)

class Foo { def f(x): /* ... */ print x } ...

JVM () Java files files (.class/.) (.class/.jar)

...... iconst_0 istore_1 iaload iload_1 istore_1 jsr 19 jsr 19 iconst_0 Java source files Python source files iload_1 iaload (.java) (.py) ......

class Foo { def f(x): /* ... */ print x } ...

Intel x86 JVM ARM JVM Bytecode Bytecode verifier verifier javac jython Memory Memory manager manager JRE (garbage Interpreter / JRE (garbage Interpreter / Java bytecode files Java bytecode files collection) JIT compiler collection) JIT compiler (.class/.jar) (.class/.jar)

...... iconst_0 istore_1 iaload iload_1 Java APIs Java APIs istore_1 jsr 19 jsr 19 iconst_0 PC Operating system Mobile Operating system iload_1 iaload ......

CrackBerry

1 Q 2 W 3 O P E R T Y U I 4 A 5 6 ← S D F G H J K L alt 7 8 9 | Z X C V B N M $

aA 0 space SYM aA

Intel x86 JVM ARM JVM Bytecode Bytecode verifier verifier Memory Memory http://en.wikipedia.org/ manager manager JRE (garbage Interpreter / JRE (garbage Interpreter / collection) JIT compiler collection) JIT compiler Young Won Lim Class 3 7/21/09

Java APIs Java APIs

PC Operating system Mobile Operating system

CrackBerry

1 2 Q W 3 O P E R T Y U I 4 5 A S 6 ← D F G H J K L alt 7 8 9 | Z X C V B N M $

aA 0 space SYM aA Java Bytecode

A Java virtual machine (JVM) a process virtual machine that executes Java bytecode.

The code execution component of the Java platform.

Java bytecode the instruction set of the Java virtual machine.

for a instruction (), 1 ~ 2 for passing parameters, 0+ bytes

The 256 possible -long 198 are currently in use 51 are reserved for future use 3 are set aside as permanently unimplemented

an opcode (operation code) the portion of a machine language instruction that specifies the operation to be performed. http://en.wikipedia.org/

Young Won Lim Class 4 7/21/09 Java Bytecode Instructions

Instructions fall into a number of broad groups:

Load and store (e.g. aload_0, istore) Arithmetic and logic (e.g. ladd, fcmpl) Type conversion (e.g. i2b, d2i) Object creation and manipulation (new, putfield) Operand stack management (e.g. swap, dup2) Control transfer (e.g. ifeq, goto) Method invocation and return (e.g. invokespecial, areturn)

http://en.wikipedia.org/

Young Won Lim Class 5 7/21/09 javac

javac

http://en.wikipedia.org/

Young Won Lim Class 6 7/21/09

Machine code or machine language a set of instructions executed directly by a computer's central processing unit (CPU).

a load, a jump, or an ALU operation on a unit of data in a CPU register or memory. Every program directly executed by a CPU is made up of a series of such instructions.

http://en.wikipedia.org/

Young Won Lim Class 7 7/21/09 MIPS Machine Code Examples

http://en.wikipedia.org/

Young Won Lim Class 8 7/21/09 Intel Examples

http://en.wikipedia.org/

Young Won Lim Class 9 7/21/09

Java class file a file with the .class filename extension containing a Java bytecode produced by

from Java programming language source files (.java files) containing Java classes. If a source file has more than one class, each class is compiled into a separate class file.

http://en.wikipedia.org/

Young Won Lim Class 10 7/21/09 Java Platform

API

JVM

Young Won Lim Class 11 7/21/09 Java Edition

Java EE Java SE Java ME JVM Java ME VM Java Card VM Java FX

Young Won Lim Class 12 7/21/09 Java Programs

Java Applications Java Sublet Android Application Java Server Page Java Beans

Young Won Lim Class 13 7/21/09 JDK & JRE

Java Development Kit Java Runtime Environment

Young Won Lim Class 14 7/21/09 References

[1] Java in a nutshell, 4th ed, David Flanagan [2] An Introduction to Object-Oriented Programming with Java, C. Thomas, Wu [3] Power Java, I. K. Chun (in Korean)

Introduction Young Won Lim 15 9/3/14