This e-book is the only way to break down the Java virtual machine


I collated advanced Java materials free of charge, covering Java, redis, mongodb, mysql, zookeeper, spring cloud, Dubbo high concurrency distributed course, a total of 30g, you need to get it yourself.


The charm of computer art lies in its preciseness and complexity. Whether it is a stock exchange or a chess game, all the underlying machine instructions required by all programs are limited if ten. From large UNIX machines to desktop PCs, everything is based on well-designed and elegant instruction sets. However, these instruction sets are not compatible, which makes the porting of programs very difficult, and the time required is even longer than the time of rewriting. So the concept of virtual machine came into being. Java virtual machine (JVM) implements unified language on multiple platforms, while. Net virtual machine (currently) implements multiple languages on a single platform. But in any case, they are abstract computers. Although they all have their own instruction set, their own memory system. But they are often simpler and clearer than actual hardware machines. The analysis of such a virtual machine is helpful to improve readers’ understanding of the underlying hardware and virtual machine platform.

Introduction to this book

This book describes the Java virtual machine, an abstract computer running all Java programs, and several core Java APIs closely related to the virtual machine. This book provides an in-depth overview of Java technology by analyzing and explaining, running examples, reference materials, and applets (which are interactive examples of the concepts described in this paper). It seems that Java programming language will become the next popular mainstream commercial software development language after C and C + +. One of the basic reasons for this is that Java architecture can help programmers adapt to the development of hardware environment, and Java has the feature of switching in hardware environment according to requirements, which are provided by Java virtual machine. The programming language revolution is driven by the development of hardware (and, of course, more). With the rapid development of hardware, it becomes cheaper and more powerful, and the software becomes more and more huge and complex. The transformation from assembly language to structured language (such as C), and to object-oriented language (such as C + +), is largely to meet the need to manage more complex software, and the increasingly powerful hardware makes the complexity possible.

Readers of this book

This book is mainly for students who want to understand java technology professional software development purpose and students. I assume that readers are already familiar with the Java language (but do not need to be proficient). Reading this book will help readers understand java programming in depth. If you are one of the few elites who write java compilers or Java virtual machine implementations, this book can be seen as a supplement to the Java virtual machine specification, which explains the specification.

Chapters 1-4 (parts – of this book) give an overview of the Java architecture, including the motivations behind the ejava architecture design. These chapters show how Java virtual machines relate to other components of the Java architecture (class files, APIs, and programming languages). If you want to have a basic understanding of Java technology, please read these chapters. Here is a summary of this section. Chapter 1 “Introduction to Java architecture” makes reasonable trade-offs on the overview and internal details of Java architecture. Chapter 2 “platform independence” discusses the exact meaning of platform independence. How the Java architecture supports this feature, and the steps to create platform independent Java programs. Chapter 3 “security”. Describes the built-in security model of Java core architecture, including a carefully crafted and operational example, which demonstrates the benefits of fine-grained access control in Java Security Framework version 1.2. Chapter 4, “network mobility”, discusses the new paradigm of network mobile software. Chapters 5-20 (the second part of this book) of the Java internal technology tutorial give a deep technical description of the internal work of Java virtual machine and related core Java API. These chapters will help readers understand the actual operation of Javu programs. The second part is organized as a tutorial with many examples. Here is a summary of this section. Chapter 5 gives an overview of Java virtual machine. Chapter 6, “Java class files,” is a complete tutorial and reference on the class file format. If you don’t pay attention to any of the Java class. F. Chapter 7 “the life cycle of a class” discusses the complete life cycle of a class in the AVA simulator, including the environment in which the class is unloaded. Chapter 8, “connection model”, explains Java’s connection model completely, including examples of using frnane() and class loader to dynamically extend javali applications with new types at runtime. Chapter 9, “garbage collection”, discusses garbage collection and termination (fnazain), explains what soft, weak and shadow references are, and also proposes how to use termination methods. Chapters 10-19 are tutorials on the Java virtual machine instruction set. Chapter 20, “thread synchronization,” explains what monitors are and how to use them to number thread safe jeva code. Class files and instruction set reference Chapter 6 is not only a tutorial for Java class files, but also a complete reference for class file formats. Similarly, chapters 10-20 form a tutorial for the Java virtual machine instruction set, and appendix a-c is a complete reference for the instruction set. If the reader needs to refer to the relevant instructions, please refer to these sections and appendices.

The first chapter introduces Java architecture: it introduces Java technology, gives an overview of Java architecture, and discusses why Java is important and its advantages and disadvantages.



The second chapter is platform independent: it shows how the jaw architecture enables programs to run on any platform, discusses the elements that determine the actual portability of Jav programs, and examines how to keep a balance between portability and performance.





Chapter 3 security: it gives a deep overview of the security model built into the Java core system, and traces the evolution of the Java security model, from sandbox of version 1.0 to code signature and verification of version 1.1, and then to fine-grained access control of version 12.



Chapter 4 network mobility: This paper examines the new paradigm of network mobile software brought by Java, and shows how Java architecture enables this function.



Chapter 5 Java virtual machine: gives a detailed overview of Java virtual machine internal system. The applet corresponding to this chapter on the CD-ROM attached to the book is called “eternal math”, which simulates the execution of a small piece of Java bytecode by a Java virtual machine.



Chapter 6 Java class file: describes the content of class file, including the structure and format of constant pool. This chapter can be used as a tutorial for Java clas file format and a complete reference for class files. The applet corresponding to this chapter on the CD attached to the book is called “Cetting; loaded”, which simulates the process of loading a Java CAS file in a Java virtual machine.




Chapter 7 type life cycle: track the life cycle of a type (class or interface) from its entry into the virtual machine to its final exit. It also discusses the process of loading, connecting, and initializing: how to create object samples, garbage collection and termination, and type offloading.




Chapter 8 connection model: This paper studies the Java connection model, describes the parent delegation model, constant pool resolution, namespace and load constraints of class loader. This chapter also shows how to use forname() and class loaders to dynamically extend Java applications at run time.



Chapter 9 garbage collection: describes several different technologies of garbage collection, and explains the working principle of garbage collection in the filter machine, including the discussion of train algorithm, soft reference, weak reference and shadow reference. The applet corresponding to this chapter is called “heapof fish”, which simulates a compressed, “mark and clear” garbage collection heap.



Chapter 10 stack and local variable operation: describes the Java virtual machine instructions used in the stack of operands, such as pressing a constant into the stack, performing common stack operations, passing values between local variables and stacks, and so on. The applet corresponding to the chapter on the CD attached to the book is “Fibonacci forever”, which simulates the process of Java virtual machine executing a method (the method generates Fibonacci sequence).



Chapter 11 type conversion: describes instructions for converting values between major types. The applet corresponding to the chapter on the CD-ROM attached to the book is “conversion diversion”, which simulates the process of Java virtual machine executing a method (it performs type conversion).




Chapter 12 integer operation: describes the integer algorithm in java simulation machine, explains the binary complement algorithm, and lists the instruction set for integer calculation. There are two applets corresponding to the chapter on the CD-ROM attached to the book. They describe the contents of the chapter in an interactive way: one is called “inner int”, which allows readers to check and operate binary complements; the other is called “prime time”, which simulates the process of Java virtual machine executing a method (it generates prime numbers).



Chapter 13 logic operation: describes the instruction of bit by bit operation and logic operation in Java virtual machine. These instructions include the operation code of decimal point shift and Boolean operation for integer. On the CD attached to the book: the applet corresponding to the chapter is called “logical results”, which simulates the process of Java virtual machine executing a method (the method uses some logical opcodes).



Chapter 14 floating point operation: This paper introduces the floating-point operation instructions in floating-point number and AVA virtual machine, including the discussion of strict keyword and the modified floating-point rules in Java virtual machine specification version 2. There are two applets that use interactive examples to illustrate the contents of this chapter on the CD-ROM. one is called “inner fpload”, which can be used to observe and operate various parts of floating-point numbers, and the other one named “circle of squares” can simulate Java virtual machine to execute a method (it uses floating-point operation code).



Chapter 15 objects and arrays: describes the Java virtual machine instructions for creating and manipulating objects and arrays. A virtual array named “Java array” is prepared for the initialization of the “virtual array”.



Chapter 16 control flow: it introduces the instructions that control the Java virtual machine to perform conditional or unconditional branch operations in the same method. An applet named “saying tomato” is prepared for this chapter in the CD attached with the book. It simulates the process of Java virtual machine executing a method. The method contains byte code to complete table jump (the compiled version of switch statement in Java source code)



Chapter 17 exception: it describes the way of bytecode realizing exception, the instruction of explicitly throwing exception, the exception table and the working mode of catch sentence. An applet named “play ball!” is prepared in the CD attached to the book, which simulates the process of Java virtual machine executing a method (it throws and catches exceptions).



Chapter 18 finally clause: introduces the implementation of finally clause in bytecode, and introduces the related instructions with examples. This chapter also describes some surprising features of the finally clause in Java source code, and explains them at the bytecode level. An applet named “hop around” is prepared in the CD attached to the book, which simulates the process of Java virtual machine executing a method (which contains a finally clause).



Chapter 19 method call and return: introduces the four instructions used by Java virtual machine to call methods and the environment in which they are used.



Chapter 20 thread synchronization: describes the monitor (java used to support synchronization mechanism), and describes the Java virtual machine to make them. This chapter also describes the instruction set’s support for monitors in terms of data locking and unlocking.


Recommended Today

The selector returned by ngrx store createselector performs one-step debugging of fetching logic

Test source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // […]