Busy Java Developer's Guide to JVM Bytecode

Objectives

JVM Bytecode

From data to code

JVM Bytecode

JVM Bytecode Instruction Set

JVM Bytecode

Why use an intermediate language like this?

JVM Bytecode

JVM provides "managed environment"

JVM Bytecode

"So what? I know Java!"

Example1

<</home/runner/work/Slides/Slides/Content/JVM/Bytecode/code/Hello.java NOT FOUND>>
<</home/runner/work/Slides/Slides/Content/JVM/Bytecode/code/Hello.jbc NOT FOUND>>

JVMIS Design Principles

What drives the look-and-feel of JVM bytecode

JVMIS Design Principles

Smallest atom of code: class

JVMIS Design Principles

Stack-based, no registers

JVMIS Design Principles

Names are fully-qualified class names

JVMIS Opcodes

Organized loosely by function

JVM Instruction Set

Stack manipulation

JVM Instruction Set

Arithmetic operations

JVM Instruction Set

Branching, control flow

JVM Instruction Set

Object model instructions

JVMIS Code Structure

Not necessarily opcodes

JVM Instruction Set

Exception Handling

Quiz Time!

Test what you've learned!

Question

"How are inner classes implemented?"

Question

"What's the cost of using assert?"

Question

"How are generics implemented (in 1.5)?"

Question

"Lambdas: How are they implemented (in 1.8)?"

Question

"Lambdas: How do they capture references (in 1.8)?"

Summary

JVMIS is good to know

Resources

Books

Credentials

Who is this guy?