收藏 分享(赏)

java虚拟机规范en.pdf

上传人:wenkunet 文档编号:7729 上传时间:2018-05-27 格式:PDF 页数:606 大小:2.10MB
下载 相关 举报
java虚拟机规范en.pdf_第1页
第1页 / 共606页
java虚拟机规范en.pdf_第2页
第2页 / 共606页
java虚拟机规范en.pdf_第3页
第3页 / 共606页
java虚拟机规范en.pdf_第4页
第4页 / 共606页
java虚拟机规范en.pdf_第5页
第5页 / 共606页
点击查看更多>>
资源描述

1、The Java VirtualMachine SpecificationJava SE 7 EditionTim LindholmFrank YellinGilad BrachaAlex Buckley2013-02-28Specification: JSR-000924 Java Virtual Machine Specification (“Specification“)Version: 7Status: Final ReleaseRelease: July 2011Copyright 1997, 2013, Oracle America, Inc. and/or its affilia

2、tes. All rights reserved.500 Oracle Parkway, Redwood City, California 94065, U.S.A.Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names maybe trademarks of their respective owners.The Specification provided herein is provided to you only under the Limited License Gr

3、antincluded herein as Appendix A. Please see Appendix A, Limited License Grant.iiiTable of ContentsPreface to the Java SE 7 Edition xiPreface to the Second Edition xiiiPreface to the First Edition xv1 Introduction 11.1 A Bit of History 11.2 The Java Virtual Machine 21.3 Summary of Chapters 31.4 Nota

4、tion 42 The Structure of the Java Virtual Machine 52.1 The class File Format 52.2 Data Types 62.3 Primitive Types and Values 62.3.1 Integral Types and Values 72.3.2 Floating-Point Types, Value Sets, and Values 82.3.3 The returnAddress Type and Values 102.3.4 The boolean Type 102.4 Reference Types an

5、d Values 112.5 Run-Time Data Areas 112.5.1 The pc Register 122.5.2 Java Virtual Machine Stacks 122.5.3 Heap 132.5.4 Method Area 132.5.5 Run-Time Constant Pool 142.5.6 Native Method Stacks 142.6 Frames 152.6.1 Local Variables 162.6.2 Operand Stacks 172.6.3 Dynamic Linking 182.6.4 Normal Method Invoca

6、tion Completion 182.6.5 Abrupt Method Invocation Completion 182.7 Representation of Objects 192.8 Floating-Point Arithmetic 192.8.1 Java Virtual Machine Floating-Point Arithmetic and IEEE754 192.8.2 Floating-Point Modes 20The Java Virtual Machine Specificationiv2.8.3 Value Set Conversion 202.9 Speci

7、al Methods 212.10 Exceptions 232.11 Instruction Set Summary 252.11.1 Types and the Java Virtual Machine 262.11.2 Load and Store Instructions 292.11.3 Arithmetic Instructions 302.11.4 Type Conversion Instructions 322.11.5 Object Creation and Manipulation 342.11.6 Operand Stack Management Instructions

8、 342.11.7 Control Transfer Instructions 342.11.8 Method Invocation and Return Instructions 352.11.9 Throwing Exceptions 362.11.10 Synchronization 362.12 Class Libraries 372.13 Public Design, Private Implementation 373 Compiling for the Java Virtual Machine 393.1 Format of Examples 393.2 Use of Const

9、ants, Local Variables, and Control Constructs 403.3 Arithmetic 453.4 Accessing the Run-Time Constant Pool 463.5 More Control Examples 473.6 Receiving Arguments 493.7 Invoking Methods 503.8 Working with Class Instances 533.9 Arrays 553.10 Compiling Switches 573.11 Operations on the Operand Stack 583.

10、12 Throwing and Handling Exceptions 593.13 Compiling finally 633.14 Synchronization 663.15 Annotations 674 The class File Format 694.1 The ClassFile Structure 704.2 The Internal Form of Names 754.2.1 Binary Class and Interface Names 754.2.2 Unqualified Names 754.3 Descriptors and Signatures 754.3.1

11、Grammar Notation 764.3.2 Field Descriptors 764.3.3 Method Descriptors 784.3.4 Signatures 794.4 The Constant Pool 824.4.1 The CONSTANT_Class_info Structure 83The Java Virtual Machine Specificationv4.4.2 The CONSTANT_Fieldref_info, CONSTANT_Methodref_info, andCONSTANT_InterfaceMethodref_info Structure

12、s 844.4.3 The CONSTANT_String_info Structure 864.4.4 The CONSTANT_Integer_info and CONSTANT_Float_infoStructures 864.4.5 The CONSTANT_Long_info and CONSTANT_Double_infoStructures 884.4.6 The CONSTANT_NameAndType_info Structure 894.4.7 The CONSTANT_Utf8_info Structure 904.4.8 The CONSTANT_MethodHandl

13、e_info Structure 924.4.9 The CONSTANT_MethodType_info Structure 934.4.10 The CONSTANT_InvokeDynamic_info Structure 944.5 Fields 954.6 Methods 974.7 Attributes 1004.7.1 Defining and Naming New Attributes 1024.7.2 The ConstantValue Attribute 1034.7.3 The Code Attribute 1044.7.4 The StackMapTable Attri

14、bute 1074.7.5 The Exceptions Attribute 1154.7.6 The InnerClasses Attribute 1164.7.7 The EnclosingMethod Attribute 1194.7.8 The Synthetic Attribute 1204.7.9 The Signature Attribute 1204.7.10 The SourceFile Attribute 1214.7.11 The SourceDebugExtension Attribute 1224.7.12 The LineNumberTable Attribute

15、1234.7.13 The LocalVariableTable Attribute 1244.7.14 The LocalVariableTypeTable Attribute 1264.7.15 The Deprecated Attribute 1284.7.16 The RuntimeVisibleAnnotations attribute 1284.7.16.1 The element_value structure 1304.7.17 The RuntimeInvisibleAnnotations attribute 1334.7.18 The RuntimeVisibleParam

16、eterAnnotations attribute 1344.7.19 The RuntimeInvisibleParameterAnnotations attribute 1364.7.20 The AnnotationDefault attribute 1374.7.21 The BootstrapMethods attribute 1384.8 Format Checking 1404.9 Constraints on Java Virtual Machine code 1404.9.1 Static Constraints 1414.9.2 Structural Constraints

17、 1444.10 Verification of class Files 1484.10.1 Verification by Type Checking 1494.10.1.1 Accessors for Java Virtual Machine Artifacts 1524.10.1.2 Verification Type System 1554.10.1.3 Instruction Representation 1594.10.1.4 Stack Map Frame Representation 1604.10.1.5 Type Checking Abstract and Native M

18、ethods 166The Java Virtual Machine Specificationvi4.10.1.6 Type Checking Methods with Code 1674.10.1.7 Type Checking Load and Store Instructions 1744.10.1.8 Type Checking for protected Members 1764.10.1.9 Type Checking Instructions 1794.10.2 Verification by Type Inference 3274.10.2.1 The Process of

19、Verification by Type Inference 3274.10.2.2 The Bytecode Verifier 3284.10.2.3 Values of Types long and double 3304.10.2.4 Instance Initialization Methods and Newly CreatedObjects 3314.10.2.5 Exceptions and finally 3324.11 Limitations of the Java Virtual Machine 3345 Loading, Linking, and Initializing

20、 3375.1 The Run-Time Constant Pool 3375.2 Java Virtual Machine Startup 3405.3 Creation and Loading 3405.3.1 Loading Using the Bootstrap Class Loader 3425.3.2 Loading Using a User-defined Class Loader 3435.3.3 Creating Array Classes 3445.3.4 Loading Constraints 3445.3.5 Deriving a Class from a class

21、File Representation 3465.4 Linking 3475.4.1 Verification 3485.4.2 Preparation 3485.4.3 Resolution 3495.4.3.1 Class and Interface Resolution 3505.4.3.2 Field Resolution 3515.4.3.3 Method Resolution 3525.4.3.4 Interface Method Resolution 3535.4.3.5 Method Type and Method Handle Resolution 3545.4.3.6 C

22、all Site Specifier Resolution 3575.4.4 Access Control 3585.4.5 Method overriding 3595.5 Initialization 3595.6 Binding Native Method Implementations 3625.7 Java Virtual Machine Exit 3626 The Java Virtual Machine Instruction Set 3636.1 Assumptions: The Meaning of “Must“ 3636.2 Reserved Opcodes 3646.3

23、Virtual Machine Errors 3646.4 Format of Instruction Descriptions 365mnemonic 3666.5 Instructions 368aaload 369aastore 370The Java Virtual Machine Specificationviiaconst_null 372aload 373aload_ 374anewarray 375areturn 376arraylength 377astore 378astore_ 379athrow 380baload 382bastore 383bipush 384cal

24、oad 385castore 386checkcast 387d2f 389d2i 390d2l 391dadd 392daload 394dastore 395dcmp 396dconst_ 398ddiv 399dload 401dload_ 402dmul 403dneg 405drem 406dreturn 408dstore 409dstore_ 410dsub 411dup 412dup_x1 413dup_x2 414dup2 415dup2_x1 416dup2_x2 417f2d 419f2i 420f2l 421fadd 422faload 424fastore 425fc

25、mp 426fconst_ 428fdiv 429The Java Virtual Machine Specificationviiifload 431fload_ 432fmul 433fneg 435frem 436freturn 438fstore 439fstore_ 440fsub 441getfield 442getstatic 444goto 446goto_w 447i2b 448i2c 449i2d 450i2f 451i2l 452i2s 453iadd 454iaload 455iand 456iastore 457iconst_ 458idiv 459if_acmp 4

26、60if_icmp 461if 463ifnonnull 465ifnull 466iinc 467iload 468iload_ 469imul 470ineg 471instanceof 472invokedynamic 474invokeinterface 479invokespecial 482invokestatic 486invokevirtual 489ior 494irem 495ireturn 496ishl 497ishr 498istore 499istore_ 500The Java Virtual Machine Specificationixisub 501iush

27、r 502ixor 503jsr 504jsr_w 505l2d 506l2f 507l2i 508ladd 509laload 510land 511lastore 512lcmp 513lconst_ 514ldc 515ldc_w 517ldc2_w 519ldiv 520lload 521lload_ 522lmul 523lneg 524lookupswitch 525lor 527lrem 528lreturn 529lshl 530lshr 531lstore 532lstore_ 533lsub 534lushr 535lxor 536monitorenter 537monitorexit 539multianewarray 541new 543newarray 545nop 547pop 548pop2 549putfield 550putstatic 552ret 554return 555saload 556sastore 557sipush 558The Java Virtual Machine Specificationxswap 559tableswitch 560wide 5627 Opcode Mnemonics by Opcode 565Index 569A Limited License Grant 587

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 免费资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报