1、BRITISH STANDARD BS ISO/IEC 20970:2002 Information technology Programming languages, their environments and system software interfaces JEFF file format ICS 35.060 BS ISO/IEC 20970:2002 This British Standard, having been prepared under the direction of the DISC Board, was published under the authorit
2、y of the Standards Policy and Strategy Committee on 7 August 2002 BSI 7 August 2002 ISBN 0 580 40192 8 National foreword This British Standard reproduces verbatim ISO/IEC 20970:2002 and implements it as the UK national standard. The UK participation in its preparation was entrusted to Technical Comm
3、ittee IST/5, Programming languages, their environments and system software interfaces, which has the responsibility to: A list of organizations represented on this committee can be obtained on request to its secretary. Cross-references The British Standards which implement international or European
4、publications referred to in this document may be found in the BSI Catalogue under the section entitled “International Standards Correspondence Index”, or by using the “Search” facility of the BSI Electronic Catalogue or of British Standards Online. This publication does not purport to include all th
5、e necessary provisions of a contract. Users are responsible for their correct application. Compliance with a British Standard does not of itself confer immunity from legal obligations. aid enquirers to understand the text; present to the responsible international/European committee any enquiries on
6、the interpretation, or proposals for change, and keep the UK interests informed; monitor related international and European developments and promulgate them in the UK. Summary of pages This document comprises a front cover, an inside front cover, the ISO/IEC title page, pages ii to vi, pages 1 to 41
7、 and a back cover. The BSI copyright date displayed in this document indicates when the document was last issued. Amendments issued since publication Amd. No. Date Comments Reference number ISO/IEC 20970:2002(E) OSI2002 CEI/INTERNATIONAL STANDARD ISO/IEC 20970 First edition 2002-07-01 Information te
8、chnology Programming languages, their environments and system software interfaces JEFF file format Technologies de linformation Langages de programmation, leurs environnements et interfaces de logiciel systme Format de fichier JEFF BSISO/IEC20970:2002 SIEI/OC E(2002:07902) remialcsid FDP ihTs PDf Fi
9、lm ec yatnoiame nt deddebyfepcase. Ica nccnadrow eitA hebods licsneilop gnic,y tihs file mya eb irptnde ro ivwede btu slahl ton eb idetde lnuses teh tyfepcase wihch era mededdeb era licsnet dei dna osntlalt no dec ehmotupfrep remroit gnide ehti.gn Iwod nnlidaogn thsi f,eli trapise cactpe tniereh teh
10、 sersnoptilibiy fo ton fnirA gnignisebod cilsnecilop gniy. I ehTStneC OS larecrtetaira cactpes l oniibality in tihs .aera Ai ebods t armedakra fo AS ebodystmes Icntaropro.de teDials fo teh sfotwera cudorpts sut dec ortaet eihs PDf Filc ef eb nai dnuot nlareneG eh Ifnler otait evt of ehil;e tP ehDc-F
11、rtaeino maraptesre wtpo ereimizf deirp rotni.gn Evc yresah era t neebkat nesne ot erutah teh file is siutlbae fro sue yb ISO mmereb dobeinI .s hte lnuikletneve y ttah lborp ame lertait gni ot is f,dnuo lpsaei efnmro ttneC ehlar Sceterirata ta tserdda ehs igleb nevwo. I S/OIE2002 C Athgir lls serevr.
12、de selnUs towrehise scepfi,dei trap on fo thsi cilbuptam noiay eb cudorperde ro tuzilide ni yna fomr ro yb nam ysnae, lecetinorc ro mceinahcla, icnlidutohp gncoiypom dna gnicrfoilm, wittuoh mrepissii now nritif gnrmo ietI rehSta O tserdda ehs lebwo I roSOs memydob reb it nc ehtnuofo yr tseuqer eht.r
13、e ISc Oirypothg fofice saCsop etla65 e 02 aveneG 1121-HC leT. 11 10 947 22 14 + xaF 74 90 947 22 14 + E-mial coirypthgis.oc h Web.www iso.ch ii IS/OIEA 2002 Cllr ithgsser devreBSISO/IEC20970:2002iiSIEI/OC E(2002:07902) I S/OIEA 2002 Cll irthgs seredevr iiiContents Page Forewordv 0 Introductionvi 0.1
14、 What is JEFF. vi 0.1.1 Benefits vi 1 Scope and normative references 1 1.1 Scope .1 1.2 Normative references.1 1.3 Definitions.2 2 Data Types 3 2.1 Basic Types3 2.2 Language Types.3 2.3 Strings 3 2.3.1 Definition .3 2.3.2 Comparison.3 2.3.3 Representation3 2.4 Specific Types 4 2.4.1 Access Flags.4 2
15、.4.2 Type Descriptor.5 2.4.3 Offsets.7 3 File Structure 8 3.1 Definitions.8 3.1.1 Fully Qualified Names .8 3.1.2 Internal Classes and External Classes .8 3.1.3 Fields and Methods.8 3.1.4 Field Position.9 3.2 Conventions10 3.2.1 Notations .10 3.2.2 Byte Order.10 3.2.3 Alignment and Padding .10 3.3 De
16、finition of the File Structures 11 3.3.1 File Header11 3.3.2 Class Section 14 3.3.2.1 Class Header .14 3.3.2.2 Interface Table.16 3.3.2.3 Referenced Class Table 16 3.3.2.4 Internal Field Table 17 3.3.2.5 Internal Method Table17 3.3.2.6 Referenced Field Table19 3.3.2.7 Referenced Method Table .19 3.3
17、.2.8 Bytecode Block Structure.20 3.3.2.9 Exception Table List.21 3.3.2.10 Constant Data Section.21 3.3.3 Attributes Section 23 3.3.3.1 Attribute Type.24 3.3.3.2 Class Attributes24 3.3.3.3 Attribute Table25 3.3.4 Symbolic Data Section 25 3.3.5 Constant Data Pool .27 3.3.5.1 Constant Data Pool Structu
18、re 27 3.3.5.2 Descriptor.27 3.3.5.3 Method Descriptor28 3.3.6 Digital Signature28 BSISO/IEC20970:2002iiiSIEI/OC E(2002:07902) vi I S/OIEA 2002 Cll irthgs seredevr4 Bytecodes. 29 4.1 Principles 29 4.2 Translations 29 4.2.1 The tableswitch Opcode30 4.2.2 The lookupswitch Opcode.30 4.2.3 The new Opcode
19、.31 4.2.4 Opcodes With a Class Operand .31 4.2.5 The newarray Opcode.32 4.2.6 The multianewarray Opcode .32 4.2.7 Field Opcodes .32 4.2.8 Method Opcodes.33 4.2.9 The ldc Opcodes .34 4.2.10 The wide Opcodes .34 4.2.11 The wide iinc Opcode35 4.2.12 Jump Opcodes 35 4.2.13 Long Jump Opcodes .36 4.2.14 T
20、he sipush Opcode .36 4.2.15 The newconstarray Opcode 37 4.3 Unchanged Instructions37 4.3.1 One-Byte Instructions37 4.3.2 Two-bytes Instructions 39 4.4 Complete Opcode Mnemonics by Opcode.39 5 Restrictions 41 BSISO/IEC20970:2002ivSIEI/OC E(2002:07902) I S/OIEA 2002 Cll irthgs seredevr vForeword ISO (
21、the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees
22、 established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work.
23、In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 3. The main task of the joint technical committee is to prepare International Standa
24、rds. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. Attention is drawn to the possibility that some of the elements
25、 of this International Standard may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC 20970 was prepared by J Consortium and was adopted, under the PAS procedure, by Joint Technical Committee ISO/IEC JTC 1, Information t
26、echnology, in parallel with its approval by national bodies of ISO and IEC. J Consortium, Inc. (“J Consortium”) has granted permission to ISO and IEC to use the trademark JEFF for products that comply with ISO/IEC 20970. Thus, implementers of ISO/IEC 20970 may use the J Consortiums JEFF trademark in
27、 connection with products that fully meet the requirements of ISO/IEC 20970. BSISO/IEC20970:2002vSIEI/OC E(2002:07902) iv I S/OIEA 2002 Cll irthgs seredevr0 Introduction 0.1 What is JEFF This International Standard describes the JEFF File Format. This format is designed to download and store on a pl
28、atform object oriented programs written in portable code. The distribution of applications is not the target of this specification. The goal of this International Standard is to provide a ready-for-execution format allowing programs to be executed directly from static memory, thus avoiding the neces
29、sity to recopy classes into dynamic runtime memory for execution. The constraints put on the design of JEFF are the following: Any set of class files must be translatable into a single JEFF file. JEFF must be a ready-for-execution format. A virtual machine can use it efficiently, directly from stati
30、c memory (ROM, flash memory). No copy in dynamic runtime memory or extra data modification shall be needed. All the standard behaviors and features of a virtual machine such as Java virtual machine must be reproducible using JEFF. In particular, JEFF must facilitate “symbolic linking” of classes. Th
31、e replacement of a class definition by another class definition having a compatible signature (same class name, same fields and same method signatures) must not require any modifications in the other class definitions. The main consequences of these choices are: A JEFF file can contain several class
32、es from several packages. The content can be a complete application, parts of it, or only one class. To allow “symbolic linking” of classes, the references between classes must be kept at the symbolic level, even within a single JEFF file. The binary content of a JEFF file is adapted to be efficient
33、ly read by a wide range of processors (with different byte orders, alignments, etc.). JEFF is also a highly efficient format for the dynamic downloading of class definitions to dynamic memory (RAM). 0.1.1 Benefits JEFF is a file format standard, which allows storing on-platform non pre-linked classe
34、s in a form that does not require any modification for efficient execution. JEFF exhibits a large range of benefits: The first of these benefits is that classes represented with JEFF can be executed directly from storage memory, without requiring any loading into runtime memory in order to be transl
35、ated in a format adequate for execution. This results in a dramatic economy of runtime memory: programs with a size of several hundreds of kilobytes may then be executed with only a few kilobytes of dynamic runtime memory thanks to JEFF. The second benefit of JEFF is the saving of the processing tim
36、e usually needed at the start of an execution to load into dynamic memory the stored classes. The third benefit is that JEFF does not require the classes to be pre-linked, hence fully preserving the flexibility of portable code technologies. With JEFF, programs can be updated on-platform by the mere
37、 replacement of some individual classes without requiring to replace the complete program. This provides a decisive advantage over previously proposed “ready-for-execution“ formats providing only pre-linked programs. A last benefit of JEFF is that it allows a compact storage of programs, twice small
38、er than usual class file format, and this without any compression. BSISO/IEC20970:2002viNITERNATNOIAL STANDARD SIEI/OC E(2002:07902)I S/OIEA 2002 Cll irthgs seredevr 1Information technology Programming languages, their environments and system software interfaces JEFF file format 1 Scope and normativ
39、e references 1.1 Scope This International Standard can be used with benefits on all kinds of platform. This International Standards most immediate interest is for deploying portable applications on small footprint devices. This International Standard provides dramatic savings of dynamic memory and e
40、xecution time without sacrificing any of the flexibility usually attached to the use of non-pre-linked portable code. This International Standard is especially important to provide a complete solution to execute portable programs of which code size is bigger than the available dynamic memory. This I
41、nternational Standard is also very important when fast reactivity of programs is important. By avoiding the extra-processing related to loading into dynamic memory and formatting classes at runtime, this International Standard provides a complete answer to the problem of class-loading slow-down. The
42、se benefits are particularly interesting for small devices supporting financial applications. Such applications are often complex and relying on code of significant size, while the pressure of the market often imposes to these devices to be of a low price and, consequently, to be very small footprin
43、t platforms. In addition, to not impose unacceptable delays to customers, it is important these applications do not waste time in loading classes into dynamic memory when they are launched but, on the contrary, to be immediately actively processing the transaction with no delay. When using smart car
44、ds, there are also some loose real-time constraints that are better handled if it can be granted that no temporary freezing of processing can occur due to class loading. This International Standard can also be of great benefit for devices dealing with real-time applications. In this case, avoiding t
45、he delays due to class loading can play an important role to satisfy real-time constraints. 1.2 Normative references The following normative documents contain provisions which, through reference in this text, constitute provisions of this International Standard. For dated references, subsequent amen
46、dments to, or revisions of, any of these publications do not apply. However, parties to agreements based on this International Standard are encouraged to investigate the possibility of applying the most recent editions of the normative documents indicated below. For undated references, the latest ed
47、ition of the normative document referred to applies. Members of ISO and IEC maintain registers of currently valid International Standards. 1 IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems BSISO/IEC20970:20021SIEI/OC E(2002:07902) 2 ISO/IEC 2002 All rights reserved2 ISO/I
48、EC 10646-1:2000, Information technology Universal Multiple-Octet Coded Character Set (UCS) Part 1: Architecture and Basic Multilingual Plane 3 ISO/IEC 10646-2:2001, Information technology Universal Multiple-Octet Coded Character Set (UCS) Part 2: Supplementary Planes 4 ISO/IEC 10646-1:2000/FDAM 1, M
49、athematical symbols and other characters NOTE This International Standard is a self-contained specification of the JEFF format standard. However, to ease the understanding of this specification, the reading of the following document is recommended as informative reference: The Java Virtual Machine Specification, Second Edition, by Tim Lindholm and Frank Yellin, 496 pages, Addison Wesley, April 1999, ISBN 0201