Inside the Java Virtual Machine

Inside the Java Virtual Machine

Acknowledgments

Introduction

Part One: Java's Architecture

1 Introduction to Java's Architecture

Why Java?
The Architecture
The Java Virtual Machine
The Class Loader Architecture
The Java Class File
The Java API
The Java Programming Language

Architectural Tradeoffs
Future Trends
On the CD-ROM
The Resources Page

2 Platform independence

Why Platform Independence?
Java's Architectural Support for Platform Independence
Scalability
Factors that Influence Platform Independence
The Java Platform
Native Methods
Other Factors

Seven Steps to Platform Independence
The Politics of Platform Independence
The Resources Page

3 Security

Why Security?
The Sandbox
The Class Loader Architecture
The Class File Verifier
Phase One: Internal Checks
Phase Two: Verification of Symbolic References

Safety Features Built Into the Java Virtual Machine
The Security Manager and the Java API
The Security API
Security Beyond the Architecture
The Resources Page

4 Network-mobility

Why Network Mobility?
A New Software Paradigm
Java's Architectural Support for Network-Mobility
The Applet: An Example of Network-Mobile Java
The Resources Page

Part Two: Java Internals

5 The Java Virtual Machine

What is a Java Virtual Machine?
The Lifetime of a Java Virtual Machine
The Architecture of the Java Virtual Machine
Data Types
Word Size
The Class Loader Subsystem
Loading, Linking and Initialization
The Primordial Class Loader
Class Loader Objects
Name Spaces

The Method Area
Type Information
The Constant Pool
Field Information
Method Information Class Variables
A Reference to Class ClassLoader
A Reference to Class Class
Method Tables
An Example of Method Area Use

The Heap
Garbage Collection
Object Representation
Array Representation

The Program Counter
The Java Stack
The Stack Frame
Local Variables
Operand Stack
Frame Data
Possible Implementations of the Java Stack

Native Method Stacks
Execution Engine
The Instruction Set
Execution Techniques
Threads

Native Method Interface

The Real Machine
Eternal Math: A Simulation
On the CD-ROM
The Resources Page

6 The Java Class File

What is a Java Class File?
What's in a Class File?
Special Strings
Fully Qualified Names
Simple Names
Descriptors

The Constant Pool
The CONSTANT_Utf8_info Table
The CONSTANT_Integer_info Table
The CONSTANT_Float_info Table
The CONSTANT_Long_info Table
The CONSTANT_Double_info Table
The CONSTANT_Class_info Table
The CONSTANT_String_info Table
The CONSTANT_Fieldref_info Table
The CONSTANT_Methodref_info Table
The CONSTANT_InterfaceMethodref_info Table
The CONSTANT_NameAndType_info Table

Fields
Methods
Attributes
The Code Attribute
The ConstantValue Attribute
The Exceptions Attribute
The InnerClasses Attribute
The LineNumberTable Attribute
The LocalVariableTable Attribute
The SourceFile Attribute
The Synthetic Attribute

Getting Loaded: A Simulation
On the CD-ROM
The Resources Page

7 The Lifetime of a Class

Class Loading, Linking, and Initialization
Loading
Verification
Preparation
Resolution
Initialization
The Class Initialization Method
Active versus Passive Use

The Lifetime of an Object
Class Instantiation
Garbage Collection and Finalization of Objects

Unloading and Finalization of Classes
On the CD-ROM
The Resources Page

8 The Linking Model

Dynamic Linking and Resolution
Resolution and Dynamic Extension
Constant Pool Resolution
Resolution of CONSTANT_Class_info Entries
Array Classes
Non-Array Classes and Interfaces

Resolution of CONSTANT_Fieldref_info Entries
Resolution of CONSTANT_Methodref_info Entries
Resolution of CONSTANT_InterfaceMethodref_info Entries
Resolution of CONSTANT_String_info Entries
Resolution of Other Types of Entries

Compile-Time Resolution of Constants
Direct References
_quick Instructions
Example: The Linking of the Salutation Application
Example: The Dynamic Extension of the Greet Application
Example: Unloading Unreachable Greeters
On the CD-ROM
The Resources Page

9 Garbage Collection

Why Garbage Collection?
Garbage Collection Algorithms
Reference Counting Collectors
Tracing Collectors
Compacting Collectors
Copying Collectors
Generational Collectors
Adaptive Collectors
Finalization
Heap of Fish: A Simulation
Allocate Fish
Assign References
Garbage Collect
Compact Heap

On the CD-ROM
The Resources Page

10 Stack and Local Variable Operations

Pushing Constants Onto the Stack
Generic Stack Operations
Pushing Local Variables Onto the Stack
Popping to Local Variables
The wide Instruction
Fibonacci Forever: A Simulation
On the CD-ROM
The Resources Page

11 Type Conversion

The Conversion Opcodes
Conversion Diversion: A Simulation
On the CD-ROM
The Resources Page

12 Integer Arithmetic

Two's Complement Arithmetic
Inner Int: A Java int Reveals its Inner Nature
Arithmetic Opcodes
Prime Time: A Simulation
On the CD-ROM
The Resources Page

13 Logic

The Logic Opcodes
Logical Results: A Simulation
On the CD-ROM
The Resources Page

14 Floating Point Arithmetic


Floating Point Numbers
Inner Float: A Java float Reveals its Inner Nature
The Floating Point Opcodes
Circle of Squares: A Simulation
On the CD-ROM
The Resources Page

15 Objects and Arrays


A Refresher on Objects and Arrays
Opcodes for Objects
Opcodes for Arrays
Three-Dimensional Array: A Simulation
On the CD-ROM
The Resources Page

16 Control Flow

Conditional Branching
Unconditional Branching
Conditional Branching with Tables
Saying Tomato: A Simulation
On the CD-ROM
The Resources Page

17 Exceptions

Throwing and Catching Exceptions
The Exception Table
Play Ball!: A Simulation
On the CD-ROM
The Resources Page

18 Finally Clauses

Miniature Subroutines
Asymmetrical Invocation and Return
Hop Around: A Simulation
On the CD-ROM
The Resources Page

19 Method Invocation and Return

Method Invocation
Invoking a Java Method
Invoking a Native Method

Other Forms of Method Invocation
The invokespecial instruction
invokespecial and <init()
invokespecial and Private Methods
invokespecial and super

The invokeinterface Instruction
Invocation Instructions and Speed
Examples of Method Invocation
Returning from Methods
On the CD-ROM
The Resources Page

20 Thread Synchronization

Monitors
Object Locking
Synchronization Support in the Instruction Set
Synchronized Statements
Synchronized Methods

Coordination Support in Class Object
On the CD-ROM
The Resources Page

Appendix A. Instructions by Opcode Mnemonic

Appendix B. Opcode Mnemonic by Functional Group

Appendix C. Opcode Mnemonic by Opcode

Appendix D. Slices of Pi: A Simulation of the Java Virtual Machine

Index

About the Author

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值