没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
The Java
®
Virtual
Machine Specification
Java SE 9 Edition
Tim Lindholm
Frank Yellin
Gilad Bracha
Alex Buckley
2017-02-22
Specification: JSR-379 Java
®
SE 9 Release Contents ("Specification")
Version: 9
Status: Public Review
Release: March 2017
Copyright © 1997, 2017, Oracle America, Inc. and/or its affiliates.
500 Oracle Parkway, Redwood City, California 94065, U.S.A.
All rights reserved.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may
be trademarks of their respective owners.
The Specification provided herein is provided to you only under the Limited License Grant
included herein as Appendix A. Please see Appendix A, Limited License Grant.
iii
Table of Contents
1
Introduction 1
1.1 A Bit of History 1
1.2 The Java Virtual Machine 2
1.3 Organization of the Specification 3
1.4 Notation 4
1.5 Feedback 4
2
The Structure of the Java Virtual Machine 5
2.1 The class File Format 5
2.2 Data Types 6
2.3 Primitive Types and Values 6
2.3.1 Integral Types and Values 7
2.3.2 Floating-Point Types, Value Sets, and Values 8
2.3.3 The returnAddress Type and Values 10
2.3.4 The boolean Type 10
2.4 Reference Types and Values 11
2.5 Run-Time Data Areas 11
2.5.1 The pc Register 12
2.5.2 Java Virtual Machine Stacks 12
2.5.3 Heap 13
2.5.4 Method Area 13
2.5.5 Run-Time Constant Pool 14
2.5.6 Native Method Stacks 14
2.6 Frames 15
2.6.1 Local Variables 16
2.6.2 Operand Stacks 17
2.6.3 Dynamic Linking 18
2.6.4 Normal Method Invocation Completion 18
2.6.5 Abrupt Method Invocation Completion 18
2.7 Representation of Objects 19
2.8 Floating-Point Arithmetic 19
2.8.1 Java Virtual Machine Floating-Point Arithmetic and IEEE
754 19
2.8.2 Floating-Point Modes 20
2.8.3 Value Set Conversion 20
2.9 Special Methods 22
2.9.1 Instance Initialization Methods 22
2.9.2 Class Initialization Methods 22
2.9.3 Signature Polymorphic Methods 23
2.10 Exceptions 23
The Java
®
Virtual Machine Specification
iv
2.11 Instruction Set Summary 26
2.11.1 Types and the Java Virtual Machine 26
2.11.2 Load and Store Instructions 29
2.11.3 Arithmetic Instructions 30
2.11.4 Type Conversion Instructions 32
2.11.5 Object Creation and Manipulation 34
2.11.6 Operand Stack Management Instructions 34
2.11.7 Control Transfer Instructions 34
2.11.8 Method Invocation and Return Instructions 35
2.11.9 Throwing Exceptions 36
2.11.10 Synchronization 36
2.12 Class Libraries 37
2.13 Public Design, Private Implementation 37
3
Compiling for the Java Virtual Machine 39
3.1 Format of Examples 39
3.2 Use of Constants, Local Variables, and Control Constructs 40
3.3 Arithmetic 45
3.4 Accessing the Run-Time Constant Pool 46
3.5 More Control Examples 47
3.6 Receiving Arguments 50
3.7 Invoking Methods 51
3.8 Working with Class Instances 53
3.9 Arrays 55
3.10 Compiling Switches 57
3.11 Operations on the Operand Stack 59
3.12 Throwing and Handling Exceptions 60
3.13 Compiling finally 63
3.14 Synchronization 66
3.15 Annotations 67
4
The class File Format 69
4.1 The ClassFile Structure 70
4.2 The Internal Form of Names 74
4.2.1 Binary Class and Interface Names 74
4.2.2 Unqualified Names 75
4.3 Descriptors 75
4.3.1 Grammar Notation 75
4.3.2 Field Descriptors 76
4.3.3 Method Descriptors 77
4.4 The Constant Pool 78
4.4.1 The CONSTANT_Class_info Structure 79
4.4.2 The CONSTANT_Fieldref_info, CONSTANT_Methodref_info, and
CONSTANT_InterfaceMethodref_info Structures 80
4.4.3 The CONSTANT_String_info Structure 81
4.4.4 The CONSTANT_Integer_info and CONSTANT_Float_info
Structures 82
The Java
®
Virtual Machine Specification
v
4.4.5 The CONSTANT_Long_info and CONSTANT_Double_info
Structures 83
4.4.6 The CONSTANT_NameAndType_info Structure 85
4.4.7 The CONSTANT_Utf8_info Structure 85
4.4.8 The CONSTANT_MethodHandle_info Structure 87
4.4.9 The CONSTANT_MethodType_info Structure 89
4.4.10 The CONSTANT_InvokeDynamic_info Structure 89
4.5 Fields 90
4.6 Methods 92
4.7 Attributes 95
4.7.1 Defining and Naming New Attributes 101
4.7.2 The ConstantValue Attribute 101
4.7.3 The Code Attribute 102
4.7.4 The StackMapTable Attribute 106
4.7.5 The Exceptions Attribute 113
4.7.6 The InnerClasses Attribute 114
4.7.7 The EnclosingMethod Attribute 117
4.7.8 The Synthetic Attribute 118
4.7.9 The Signature Attribute 119
4.7.9.1 Signatures 120
4.7.10 The SourceFile Attribute 124
4.7.11 The SourceDebugExtension Attribute 124
4.7.12 The LineNumberTable Attribute 125
4.7.13 The LocalVariableTable Attribute 126
4.7.14 The LocalVariableTypeTable Attribute 128
4.7.15 The Deprecated Attribute 130
4.7.16 The RuntimeVisibleAnnotations Attribute 131
4.7.16.1 The element_value structure 133
4.7.17 The RuntimeInvisibleAnnotations Attribute 136
4.7.18 The RuntimeVisibleParameterAnnotations Attribute 137
4.7.19 The RuntimeInvisibleParameterAnnotations Attribute 139
4.7.20 The RuntimeVisibleTypeAnnotations Attribute 140
4.7.20.1 The target_info union 146
4.7.20.2 The type_path structure 150
4.7.21 The RuntimeInvisibleTypeAnnotations Attribute 154
4.7.22 The AnnotationDefault Attribute 155
4.7.23 The BootstrapMethods Attribute 156
4.7.24 The MethodParameters Attribute 158
4.8 Format Checking 160
4.9 Constraints on Java Virtual Machine Code 161
4.9.1 Static Constraints 161
4.9.2 Structural Constraints 165
4.10 Verification of class Files 168
4.10.1 Verification by Type Checking 170
4.10.1.1 Accessors for Java Virtual Machine Artifacts 172
4.10.1.2 Verification Type System 176
4.10.1.3 Instruction Representation 180
4.10.1.4 Stack Map Frames and Type Transitions 181
剩余585页未读,继续阅读
资源评论
铁锚
- 粉丝: 3506
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功