[go: up one dir, main page]

WO2003001374A2 - Representation de types de donnees java dans des machines virtuelles - Google Patents

Representation de types de donnees java dans des machines virtuelles Download PDF

Info

Publication number
WO2003001374A2
WO2003001374A2 PCT/US2002/020110 US0220110W WO03001374A2 WO 2003001374 A2 WO2003001374 A2 WO 2003001374A2 US 0220110 W US0220110 W US 0220110W WO 03001374 A2 WO03001374 A2 WO 03001374A2
Authority
WO
WIPO (PCT)
Prior art keywords
java
references
array
representation
data type
Prior art date
Application number
PCT/US2002/020110
Other languages
English (en)
Other versions
WO2003001374A3 (fr
Inventor
Stepan Sokolov
David Wallman
Original Assignee
Sun Microsystems, Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sun Microsystems, Inc. filed Critical Sun Microsystems, Inc.
Priority to AU2002312585A priority Critical patent/AU2002312585A1/en
Publication of WO2003001374A2 publication Critical patent/WO2003001374A2/fr
Publication of WO2003001374A3 publication Critical patent/WO2003001374A3/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented

Definitions

  • the present invention relates generally to object-based high level programming environments, and more particularly, to techniques for tracking references to objects defined in object-based high level programming environments.
  • High level languages such as "C” provide a level of abstraction from the underlying computer architecture and their success is well evidenced from the fact that most computer applications are now written in a high level language.
  • the Web is an interface protocol for the Internet which allows communication of diverse computer platforms through a graphical interface.
  • Computers communicating over the Web are able to download and execute small applications called applets.
  • applets may be executed on a diverse assortment of computer platforms, the applets are typically executed by a JavaTM virtual machine.
  • the Java programming language is a language that is designed to be portable enough to be executed on a wide range of computers ranging from small devices (e.g., pagers, cell phones and smart cards) up to supercomputers.
  • Computer programs written in the Java programming language (and other languages) may be compiled into Java Bytecode instructions that are suitable for execution by a Java virtual machine implementation.
  • the Java virtual machine is commonly implemented in software by means of an interpreter for the Java virtual machine instruction set but, in general, may be software, hardware, or both.
  • a particular Java virtual machine implementation and corresponding support libraries together constitute a Java runtime environment.
  • Computer programs in the Java programming language are arranged in one or more classes or interfaces (referred to herein jointly as classes or class files). Such programs are generally platform, i.e., hardware and operating system, independent. As such, these computer programs may be executed without modification on any computer that is able to run an implementation of the Java runtime environment.
  • class file format Object-oriented classes written in the Java programming language are compiled to a particular binary format called the "class file format.”
  • the class file includes various components associated with a single class. These components can be, for example, methods and/or interfaces associated with the class.
  • the class file format can include a significant amount of ancillary information that is associated with the class.
  • the class file format (as well as the general operation of the Java virtual machine) is described in some detail in The Java Virtual Machine Specification, Second Edition, by Tim Lindholm and Frank Yellin, which is hereby incorporated herein by reference.
  • Fig. 1 A shows a progression of a simple piece of Java source code through execution by an interpreter, the Java virtual machine.
  • Java source code 101 includes the classic Hello World program written in Java.
  • the source code is then input into a Bytecode compiler 103 that compiles the source code into Bytecodes.
  • the Bytecodes are virtual machine instructions as they will be executed by a software emulated computer. Typically, virtual machine instructions are generic (i.e., not designed for any specific microprocessor or computer architecture) but this is not required.
  • the Bytecode compiler outputs a Java class file 105 that includes the Bytecodes for the Java program.
  • the Java class file is input into a Java virtual machine 107.
  • the Java virtual machine is an interpreter that decodes and executes the Bytecodes in the Java class file.
  • the Java virtual machine is an interpreter, but is commonly referred to as a virtual machine as it emulates a microprocessor or computer architecture in software (e.g., the microprocessor or computer architecture may not exist in hardware).
  • the data types supported by the Java programming language are supported by Java virtual machine implementations.
  • the primitive Java data types are relatively simpler and include integral types (e.g., byte, short, int, long, char).
  • the values of the integral types of the Java virtual machines are the same as those for the integral types of the Java programming language.
  • the reference data types have values that can be references to dynamically created class instances, or arrays (or class instances, or arrays that implement interfaces).
  • the reference data types are internally represented by the virtual machine. In any case, the virtual machine needs to represent data types for various reasons, for example, to represent method signatures.
  • a method signature describes the parameters and return type of a particular method.
  • Fig. 1 B depicts a method signature 120 in an internal method representation 122 which is generated by a virtual machine.
  • the method signature 120 corresponds to a method "foo" 124.
  • the method foo 124 has four parameters, namely, "byte”, "java.lang.string”, “double” and
  • the signature 120 represents the data type of these four parameters.
  • the character "B” indicates that the first parameter is a "byte” type
  • "Ljava/Iang/string” indicates that the second parameters is a "string” type
  • "D” indicates that the third parameter is a "double” type
  • "Ljava/uti l/date” indicates that the fourth parameter is a "date” type.
  • string and date represent reference data types. Accordingly, there may be a need to access the string and date classes in order to execute the method. In other words, there may be a need to locate the internal representation for classes associated with the reference data types (e.g., string and date data types).
  • the present invention relates to representation of Java data types in virtual machines. Accordingly, the invention provides improved techniques for representation of Java data types in virtual machines.
  • signatures of Java methods can be represented in arrays of references.
  • each of the references in an array represents a parameter for a Java method.
  • a signature can be represented as an array of references, wherein each reference in the array can reference a Java type indicator or an internal class representation.
  • the Java type indicator represents a Java primitive type (e.g., byte, integer, double, etc.)
  • the internal class representation is typically the representation of a Java class as represented in a virtual machine.
  • an array organization allows for more efficient access to information.
  • the invention allows for the internal class representations to be directly accessed from the method signature representation. This allows for quick access to the internal class representations from the signature, and therefore, less processing is needed to execute methods. As a result, the invention can improve the performance of virtual machines, especially those operating with limited resources.
  • one embodiment of the invention includes one or more data type indicators.
  • Each one of the data type indicators represents a Java primitive type and an array of references.
  • at least one reference in the array of references is referencing one of the one or more data type indicators.
  • one embodiment of the invention includes an array of references.
  • Each reference in the array of references represents a parameter for a Java method such that an i th entry of the array of references corresponds to an i th parameter of the Java method, where i is a positive integer.
  • Each one of references of the array of references reference a Java type indicator associated with a Java primitive type or an internal class representation associated with a Java class.
  • one embodiment of the invention includes the acts of: determining whether a parameter has a primitive Java data type; assigning a reference in an array of references to a data type indicator that represents a Java primitive data type when the determining determines that the parameter has a primitive Java data type; and assigning a reference in an array of references to an internal class representation associated with a Java class when the determining determines that the parameter does not have a primitive data type.
  • one embodiment of the invention includes computer program code for determining whether a parameter has a primitive Java data type; computer program code for assigning a reference in an array of references to a data type indicator that represents a Java primitive data type when the determining determines that the parameter has a primitive Java data type; and computer program code for assigning a reference in an array of references to an internal class representation associated with a Java class when the the parameter does not have a primitive data type.
  • Fig. 1A shows a progression of a simple piece of Java source code through execution by an interpreter, the Java virtual machine.
  • Fig. 1 B depicts a method signature in an internal method representation which is generated by a virtual machine.
  • Fig. 2A-B illustrate Java data type representation in accordance with one embodiment of the invention.
  • Fig. 2C depicts a representation of a method's signature in accordance with one embodiment of the invention.
  • Fig. 3 illustrates how a method signature may be represented in accordance with one embodiment of the invention.
  • Fig. 4 depicts several method signature representations in accordance with one embodiment of the invention.
  • Fig. 5 illustrates a method of representing a signature for a Java method with one or more parameters in accordance with one embodiment of the invention.
  • signatures of Java methods can be represented in arrays of references.
  • each of the references in an array represents a parameter for a Java method.
  • a signature can be represented as an array of references, wherein each reference in the array can reference a Java type indicator or an internal class representation.
  • the Java type indicator represents a Java primitive type (e.g., byte, integer, double, etc.)
  • the internal class representation is typically the representation of a Java class as represented in a virtual machine.
  • an array organization allows for more efficient access to information.
  • the invention allows for the internal class representations to be accessed directly from the method signature representation. This allows for quick access to the internal class representations from the signature, and therefore, less processing is needed to execute methods.
  • the invention can improve the performance of virtual machines, especially those operating with limited resources (e.g., embedded systems).
  • Fig. 2A illustrates a Java data type representation 200 in accordance with one embodiment of the invention.
  • the Java data type representation 200 includes an array of references (e.g., pointers) 202 which include a series of references represented as entries 1 to M. Each of these entries can reference a data type indicator. For example, entry 1 of the array of references 202 can reference (e.g., point to) a data type indicator I.
  • each of the primitive Java data types can be represented by the data type indicators 1 to N (i.e., be set to a particular value, for example, a string or an integer value to indicate a particular type).
  • data type indicators 1 , 2, 3, and 4 can respectively represent the Java byte, integer, double, and character types.
  • each of the entries of the array of references 202 can reference a primitive data type indicator.
  • an entry in an array of references 210 can also reference an internal class representation.
  • an array of references can also be used to represent reference Java data types.
  • reference arrays can be used to, among other things, represent method's signatures.
  • Fig. 2C depicts a representation of a method's signature 220 in accordance with one embodiment of the invention.
  • the method's signature 220 represents a signature for a method with three parameters. Each of these parameters is represented by an entry in the array of references 222.
  • entries 1 , 2, and 3 of the array of references 222 respectively reference data type indicator 1 , internal class representation 1 , and data type indicator 3.
  • parameters 1 , 2, and 3 of the method represented by the method signature 220 respectively have data types represented by data type indicator 1 , internal class representation 1 , and data type indicator 3.
  • Fig. 3 illustrates how the method signature 102 of Fig. 1 may be represented in accordance with one embodiment of the invention.
  • the internal class representations can be accessed directly from the method signature representation in accordance with one embodiment of the invention. This allows quick access to the internal class representations from the signature. As will be appreciated, less processing is needed to execute methods since internal representations can be accessed directly.
  • method signature 220 allows for efficient access to various parameters of method signatures.
  • a particular parameter can be easily accessed by using the appropriate index (i.e., the third parameter is the 3rd index, the fifth parameter is the 5 th index in the array, and so on).
  • the appropriate index i.e., the third parameter is the 3rd index, the fifth parameter is the 5 th index in the array, and so on.
  • method signatures can be represented in an efficient manner in accordance with one aspect of the invention. It should also be noted that entries of different signature methods can reference the same data type indicator or internal class representation. In fact, there is a need to allocate one data type indicator for each Java data type.
  • Fig. 4 depicts several method signature representations in accordance with one embodiment of the invention.
  • Each of the method signature representations 402, 404, 406, 408 and 410 represent an array of references.
  • each of the internal class representations 1 and 2 can be referenced by two or more array reference entries. These array entries can be entries of the same array of references (e.g., method signature 410).
  • array entries in two different method signatures can reference the same data type indicator or internal class representation (e.g., entries in method signature representation 408 and 410 reference the internal class representation 2).
  • Fig. 5 illustrates a method 500 of representing a signature for a Java method with one or more parameters in accordance with one embodiment of the invention.
  • the method 500 can be implemented, for example, in a Java virtual machine, to represent parameters of Java methods as an array of references. Each of the parameters of the Java method can be represented as a reference in the array of references.
  • the first parameter of the Java method is identified.
  • a primitive Java data type e.g., Byte, Integer, etc.
  • the method 500 proceeds to operation 512 where the appropriate internal class representation for the parameter is identified.
  • the method 500 proceeds to operation 514 where the reference representing the parameter in the array of references is set to the internal class representation.
  • the method 500 proceeds to operation 508 where it is determined whether there are more parameters to process. Thereafter, the method 500 proceeds in the same manner as discussed above. When it is determined that the method does not have any more parameters to process, the method 500 ends.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

L'invention concerne des techniques améliorées permettant de représenter des types de données Java dans des machines virtuelles. Ces techniques sont mises en oeuvre afin de représenter des signatures de procédés Java sous forme d'ensembles de références. Chacune des références d'un ensemble peut représenter un paramètre de procédé Java. De ce fait, une signature peut être représentée sous forme d'un ensemble de références, chaque référence de cet ensemble pouvant référencer un indicateur de type Java ou une représentation de classe interne. Ledit indicateur de type Java représente un type de primitive Java (par exemple, un octet, un entier, un double, etc.). La représentation de classe interne est généralement la représentation d'une classe Java telle qu'elle est représentée dans une machine virtuelle. Comme on peut le constater, une organisation sous forme d'ensembles permet d'accéder plus efficacement à des informations. Contrairement aux techniques classiques, il n'est pas nécessaire de démarrer au début de la signature et de la lire séquentiellement pour trouver un type de données de paramètre particulier. En outre, il est possible d'accéder à des représentations de classes internes directement à partir de la représentation de signature du procédé, ce qui permet d'accéder rapidement à ces représentations, et requiert moins de traitement pour exécuter les procédés. De ce fait, la performance de ces machines virtuelles, notamment celles qui fonctionnent avec des ressources limitées peut être améliorée.
PCT/US2002/020110 2001-06-20 2002-06-20 Representation de types de donnees java dans des machines virtuelles WO2003001374A2 (fr)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU2002312585A AU2002312585A1 (en) 2001-06-20 2002-06-20 Representation of java data types in virtual machines

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US09/886,530 US7181724B2 (en) 2001-06-20 2001-06-20 Representation of Java® data types in virtual machines
US09/886,530 2001-06-20

Publications (2)

Publication Number Publication Date
WO2003001374A2 true WO2003001374A2 (fr) 2003-01-03
WO2003001374A3 WO2003001374A3 (fr) 2003-12-04

Family

ID=25389201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2002/020110 WO2003001374A2 (fr) 2001-06-20 2002-06-20 Representation de types de donnees java dans des machines virtuelles

Country Status (3)

Country Link
US (1) US7181724B2 (fr)
AU (1) AU2002312585A1 (fr)
WO (1) WO2003001374A2 (fr)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6948156B2 (en) * 2001-10-24 2005-09-20 Sun Microsystems, Inc. Type checking in java computing environments
US7386841B2 (en) * 2003-11-06 2008-06-10 International Business Machines Corporation Technique for determining a target data type in a heterogeneous multi-level environment
WO2007109921A1 (fr) * 2006-03-28 2007-10-04 Intel Corporation Procédés et appareil de mise en oeuvre de procédé de conversion dit ''thunking' à base d'annotation
US20090138849A1 (en) * 2007-10-30 2009-05-28 Microsoft Corporation Enhanced Prompting in a Visual Editor
CN102375740A (zh) * 2010-08-26 2012-03-14 上海科泰世纪科技有限公司 手持装置及利用其实现Java组件与自定义构件互操作的方法
US10521204B2 (en) 2015-11-04 2019-12-31 Oracle International Corporation Existential type packing for structurally-restricted existential types
US11809839B2 (en) 2022-01-18 2023-11-07 Robert Lyden Computer language and code for application development and electronic and optical communication

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5367685A (en) * 1992-12-22 1994-11-22 Firstperson, Inc. Method and apparatus for resolving data references in generated code
US6006230A (en) * 1997-01-15 1999-12-21 Sybase, Inc. Database application development system with improved methods for distributing and executing objects across multiple tiers
US6106569A (en) * 1997-08-14 2000-08-22 International Business Machines Corporation Method of developing a software system using object oriented technology
US6581206B2 (en) * 1999-11-12 2003-06-17 Sun Microsystems, Inc. Computer program language subset validation
US6711576B1 (en) * 2000-06-12 2004-03-23 Sun Microsystems, Inc. Method and apparatus for implementing compact type signatures in a virtual machine environment
US20020078255A1 (en) * 2000-10-17 2002-06-20 Shankar Narayan Pluggable instantiable distributed objects
US6961933B2 (en) * 2001-10-24 2005-11-01 Sun Microsystems, Inc. Representation of Java data types in virtual machines

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
T. LINDHOLM, F. YELLIN: "The Java virtual machine specification" [Online] 5 August 1997 (1997-08-05), SUN MICROSYSTEMS , XP002247444 Retrieved from the Internet: <URL:http://www.sunsite.ee/java/vmspec/> [retrieved on 2003-07-14] page 13 *

Also Published As

Publication number Publication date
WO2003001374A3 (fr) 2003-12-04
US20020199169A1 (en) 2002-12-26
AU2002312585A1 (en) 2003-01-08
US7181724B2 (en) 2007-02-20

Similar Documents

Publication Publication Date Title
US7003778B2 (en) Exception handling in java computing environments
US6964033B2 (en) Object band customization of Java runtime environments
US7020874B2 (en) Techniques for loading class files into virtual machines
JP2005501334A (ja) Javaコンピューティング環境におけるJavaマクロインストラクションの生成のためのフレームワーク
US6754796B2 (en) Frameworks for implementation of java heaps
US6948156B2 (en) Type checking in java computing environments
US7181724B2 (en) Representation of Java® data types in virtual machines
US7036120B2 (en) Two tier clusters for representation of objects in Java programming environments
US7117489B2 (en) Optional attribute generator for customized Java programming environments
US20030005020A1 (en) Initialization of Java classes in Java virtual machine environments
US6961933B2 (en) Representation of Java data types in virtual machines
US7065747B2 (en) Identifying references to objects during bytecode verification
US6751790B2 (en) Frameworks for efficient representation of string objects in Java programming environments
US7082597B2 (en) Representation of objects in a Java programming environment
US7197750B2 (en) Java Bytecode instruction for determining hashcode values
US6934726B2 (en) Storing and retrieving of field descriptors in Java computing environments
US6996824B2 (en) Frameworks for efficient representation of string objects in Java programming environments
US20030041319A1 (en) Java bytecode instruction for retrieving string representations of java objects

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A2

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ OM PH PL PT RO RU SD SE SG SI SK SL TJ TM TN TR TT TZ UA UG UZ VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A2

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
ENP Entry into the national phase

Ref document number: 2004106552

Country of ref document: RU

Kind code of ref document: A

Ref document number: 2004106553

Country of ref document: RU

Kind code of ref document: A

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

122 Ep: pct application non-entry in european phase
NENP Non-entry into the national phase

Ref country code: JP

WWW Wipo information: withdrawn in national office

Country of ref document: JP