📄 introduction.doc.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>VM Spec Introduction </title>
</head>
<body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000>
<table width=100%><tr>
<td><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Preface.doc.html">Prev</a> | <a href="Concepts.doc.html">Next</a> | <a href="Lindholm.INDEX.html">Index</a></td><td align=right><i><i>The Java<sup><font size=-2>TM</font></sup> Virtual Machine Specification</i></i></td>
</tr></table>
<hr><br>
<a name="4558"></a>
<p><strong>CHAPTER 1 </strong></p>
<a name="4559"></a>
<h1>Introduction </h1>
<hr><p>
<a name="4560"></a>
<strong>A Bit of History
</strong><p><a name="4561"></a>
Java is a general-purpose concurrent object-oriented programming language. Its
syntax is similar to C and C++, but it omits many of the features that make C and
C++ complex, confusing, and unsafe. Java was initially developed to address the
problems of building software for networked consumer devices. It was designed to
support multiple host architectures and to allow secure delivery of software components. To meet these requirements, compiled Java code had to survive transport
across networks, operate on any client, and assure the client that it was safe to run.
<p><a name="3439"></a>
The popularization of the World Wide Web made these attributes of Java much more interesting. The Internet demonstrated how media-rich content could be made accessible in simple ways. Web browsers such as Mosaic enabled millions of people to roam the Net and made Web surfing part of popular culture. At last there was a medium where what you saw and heard was essentially the same whether you were using a Mac, PC, or UNIX machine, and whether you were connected to a high-speed network or a slow modem.<p>
<a name="3440"></a>
Web enthusiasts soon discovered that the content supported by the Web's HTML document format was too limited. HTML extensions, such as forms, only highlighted those limitations, while making it clear that no browser could include all the features users wanted. Extensibility was the answer.<p>
<a name="3441"></a>
Sun's HotJava browser showcases Java's interesting properties by making it possible to embed Java programs inside HTML pages. These programs, known as <em>applets</em>, are transparently downloaded into the HotJava browser along with the HTML pages in which they appear. Before being accepted by the browser, applets are carefully checked to make sure they are safe. Like HTML pages, compiled Java programs are network- and platform-independent. Applets behave the same way regardless of where they come from, or what kind of machine they are being loaded into and run on. <p>
<a name="3442"></a>
With Java as the extension language, a Web browser is no longer limited to a fixed set of capabilities. Programmers can write an applet once and it will run on any machine, anywhere. Visitors to Java-powered Web pages can use content found there with confidence that it will not damage their machine.<p>
<a name="3443"></a>
Java has demonstrated a new way to use the Internet to distribute software. This new paradigm goes beyond browsers. We think it is an innovation with the potential to change the course of computing. <p>
<a name="3057"></a>
<strong>The Java Virtual Machine
</strong><p><a name="2825"></a>
The Java Virtual Machine is the cornerstone of Sun's Java programming language. It
is the component of the Java technology responsible for Java's cross-platform delivery, the small size of its compiled code, and Java's ability to protect users from malicious programs.
<p><a name="3021"></a>
The Java Virtual Machine is an abstract computing machine. Like a real computing machine, it has an instruction set and uses various memory areas. It is reasonably common to implement a programming language using a virtual machine; the best-known virtual machine may be the P-Code machine of UCSD Pascal.<p>
<a name="3032"></a>
The first prototype implementation of the Java Virtual Machine, done at Sun Microsystems, Inc., emulated its instruction set in software on a handheld device that resembled a contemporary Personal Digital Assistant (PDA). Sun's current Java release, the Java Developer's Kit (JDK) version 1.0.2, emulates the Java Virtual Machine on Win32, MacOS, and Solaris platforms. However, the Java Virtual machine does not assume any particular implementation technology or host platform. It is not inherently interpreted, and it may just as well be implemented by compiling its instruction set to that of a real CPU, as for a conventional programming language. It may also be implemented in microcode, or directly in silicon.<p>
<a name="3087"></a>
The Java Virtual Machine knows nothing of the Java programming language, only of a particular file format, the <code>class</code> file format. A <code>class</code> file contains Java Virtual Machine instructions (or <i>bytecodes</i>) and a symbol table, as well as other ancillary information. <p>
<a name="3659"></a>
For the sake of security, the Java Virtual Machine imposes strong format and structural constraints on the code in a <code>class</code> file. However, any language with functionality that can be expressed in terms of a valid <code>class</code> file can be hosted by the Java Virtual Machine. Attracted by a generally available, machine-independent platform, implementors of other languages are turning to the Java Virtual Machine as a delivery vehicle for their languages. In the future, we will consider bounded extensions to the Java Virtual Machine to provide better support for other languages.<p>
<a name="4478"></a>
<hr><h2> Summary of Chapters</h2>
<a name="4479"></a>
The rest of this book is structured as follows:
<p><ul><a name="4480"></a>
<li>Chapter 2 gives an overview of Java concepts and terminology necessary for the rest of the book.
<a name="4481"></a>
<li>Chapter 3 gives an overview of the Java Virtual Machine.
<a name="4482"></a>
<li>Chapter 4 defines the <code>class</code> file format, a platform- and implementation-independent file format for compiled Java code.
<a name="4684"></a>
<li>Chapter 5 describes runtime management of the constant pool.
<a name="4483"></a>
<li>Chapter 6 describes the instruction set of the Java Virtual Machine, presenting the instructions in alphabetical order of opcode mnemonics.
<a name="4484"></a>
<li>Chapter 7 gives examples of compiling Java code into the instruction set of the Java Virtual Machine.
<a name="4660"></a>
<li>Chapter 8 describes Java Virtual Machine threads and their interaction with memory.
<a name="4485"></a>
<li>Chapter 9 describes an optimization used by Sun's implementation of the Java Virtual Machine. While not strictly part of the specification, it is a useful technique in itself, as well as an example of the sort of implementation technique that may be employed within a Java Virtual Machine implementation.
<a name="4486"></a>
<li>Chapter 10 gives a table of Java Virtual Machine opcode mnemonics indexed by opcode value.
</ul><a name="4488"></a>
<hr><h2> Use of Fonts</h2>
<a name="4489"></a>
In this book, fonts are used as follows:
<p><ul><a name="4490"></a>
<li>A <code>fixed</code> <code>width</code> font is used for code examples written in Java, Java Virtual Machine data types, exceptions, and errors.
<a name="4491"></a>
<li><em>Italic </em>is used for Java Virtual Machine "assembly language," its opcodes and operands, as well as items in the Java Virtual Machine's runtime data areas. It is also used to introduce new terms, and simply for emphasis.
</ul><a name="4476"></a>
<p>
<hr>
<!-- This inserts footnotes--><p>
<br>
<a href="VMSpecTOC.doc.html">Contents</a> | <a href="Preface.doc.html">Prev</a> | <a href="Concepts.doc.html">Next</a> | <a href="Lindholm.INDEX.html">Index</a>
<p>
<font size = -1>Java Virtual Machine Specification <br>
<!--(HTML generated by dkramer on March 31, 1997)-->
<!--
(HTML generated by dkramer on March 25, 1997)-->
<br>
<i><a href="Copyright.doc.html">Copyright © 1996, 1997 Sun Microsystems, Inc.</a>
All rights reserved</i>
<br>
Please send any comments or corrections to <a href="mailto:jvm@java.sun.com">jvm@java.sun.com</a>
</font>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -