CN102081546B - Memory optimization of virtual machine code by partitioning extraneous information - Google Patents

Memory optimization of virtual machine code by partitioning extraneous information Download PDF

Info

Publication number
CN102081546B
CN102081546B CN2010105432287A CN201010543228A CN102081546B CN 102081546 B CN102081546 B CN 102081546B CN 2010105432287 A CN2010105432287 A CN 2010105432287A CN 201010543228 A CN201010543228 A CN 201010543228A CN 102081546 B CN102081546 B CN 102081546B
Authority
CN
China
Prior art keywords
code
extraneous information
information
extraneous
virtual machine
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN2010105432287A
Other languages
Chinese (zh)
Other versions
CN102081546A (en
Inventor
H·W·亚当斯三世
S·C·弗利
C·E·赫利斯丘克
A·R·劳
P·D·希普顿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Publication of CN102081546A publication Critical patent/CN102081546A/en
Application granted granted Critical
Publication of CN102081546B publication Critical patent/CN102081546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A method, computer program product, and system for memory optimization by partitioning extraneous information from executable virtual machine code or interpreted code. The extraneous information may be stored separately, or accessed from the original code if needed for debugging or servicing the code in the field. This approach optimizes memory usage by reducing memory footprint while maintaining accessibility of the non-executable information for debugging and other processes necessary for servicing code in the field.

Description

Carry out the method and system of internal memory optimization virtual machine code by separating extraneous information
Technical field
The present invention relates generally to virtual machine code, relates in particular to by divide extraneous information from executable code and carrys out the internal memory optimization virtual machine code.
Background technology
The advantage of virtual machine technique is extensively approved.In these advantages, it is that it can move a plurality of virtual machines on the individual host platform that an advantage is arranged, and does like this and can use better hardware capabilities, guarantees that each user enjoys " complete " computer characteristic simultaneously.Along with the increase of computer software complexity and in daily life and business activity for the growth of the dependency degree of software systems, user's expectation has very high running software performance.Because software virtual machine normally for example moves in the system of memory-limited on PDA and this class internal memory of smart phone often are less than the wireless device of conventional computer system, therefore the performance of this software virtual machine is even more important.Thus, people make great efforts to reduce the internal memory that virtual machine code is used when operation, for example local function call is reduced to the function provided in minimum, restriction local code type, reduce the size of application and require efficient coding.For the Optimization Software performance, reducing memory usage is still a common-denominator target.
Summary of the invention
Therefore, embodiments of the invention comprise a kind of method, computer program and system for optimizing virtual machine or interpretive code, comprise: receive the code that comprises a plurality of programmed instruction and the first extraneous information, the language compilation for virtual machine operation for this code wherein, and wherein the first extraneous information be the first kind can not carry out information; Revise this code by the key assignments (key) that removes the first extraneous information and it is replaced to the position of quoting the first extraneous information; And carry out the code through revising, and if the event of request the first extraneous information occurs in operational process, in response to described event, with this key assignments, locate the extraneous information in described position, and load the first extraneous information from described position.
Especially, when the detailed description of considering in conjunction with the drawings hereinafter, can have a clear understanding of the above-mentioned and other feature and advantage of the embodiment of the present invention, wherein the same reference numerals in different accompanying drawings is used to indicate identical assembly.
The accompanying drawing explanation
Fig. 1 shows the block diagram according to the exemplary computer system that comprises virtual machine of the embodiment of the present invention.
Fig. 2 shows the block diagram according to the illustrative division of first embodiment of the invention and internal memory optimization processing.
Fig. 3 shows according to Fig. 2 of first embodiment of the invention and divides the block diagram of processing the effect that acts on illustration java class file.
Fig. 4 A and 4B show the process flow diagram according to the division of first embodiment of the invention and internal memory optimization processing.
Fig. 5 shows the block diagram that illustration is divided and internal memory optimization is processed according to second embodiment of the invention.
Fig. 6 shows according to Fig. 5 of second embodiment of the invention and divides the block diagram of processing the effect that acts on illustration java class file.
Fig. 7 A and 7B describe the process flow diagram of processing according to division and the internal memory optimization of second embodiment of the invention.
Embodiment
With reference now to accompanying drawing,, shown in Fig. 1 is an exemplary computer system according to the embodiment of the present invention.The computer system 10 that Fig. 1 shows comprises processor 12, internal memory 14, network adapter 16 and Java Virtual Machine 20, and all these assemblies all can be coupled in together communicatedly by system bus 18.Internal memory 14 can for example, be realized with any routine or other storer or memory device (RAM, buffer memory, flash memory etc.), and can comprise any suitable memory capacity.Network adapter 16 may be implemented as make computer system 10 can for example, by any amount of any suitable communication media (WAN, LAN, the Internet, in-house network, cable network, wireless network etc.) by shared drive or adopt other any suitable modes to come to communicate by letter with one or more other systems.The computer system of the present embodiment can comprise by means of any routine or other agreements and on network or other communication channels communication and any routine or other communication facilitiess that can use the connection (for example wired, wireless etc.) of any type to conduct interviews.
Java Virtual Machine 20 comprises various assemblies, for example Classloader 21, exception handler (exception handler) module 22, Report of Discrepancy module 23, the runtime engine 24, class libraries 27 and the internal memory 28 that comprise interpreter 25 and instant (JIT) compiler 26.It should be understood that, although the virtual machine 20 of discussing here is Java Virtual Machines, but the present invention is not limited to the Java technology, but can implement in conjunction with other technologies and virtual machine, for example when CPython virtual machine .NET and common statement operation, Parrot virtual machine, Rubinius virtual machine or other any suitable virtual machines.
Classloader 21 loading code, for example byte code files of java class (.class) or Java filing (.jar) file and so on, or CIL byte code files.This code packages has contained the programmed instruction compiled from any language that is applicable to using together with virtual machine, for instance, the language that is applicable to being combined with the CPython virtual machine comprises Python, the language that is applicable to being combined with Java Virtual Machine (JVM) comprises Java, Clojure, Fan, Groovy, IBMNetRexx, JavaFX Script, JavaScript, JRuby, Jython, JSchemeMacromedia ColdFusion, Rhino, Scala etc., the language that is applicable to using together with (CLR) when the .NET common statement moves comprises C#, C++/CLI, Cobra, F#, Fan, IronPython, IronRuby, J#, JScript.NET, managed JScript, Mondrian, Nemerle, VB.NET etc., the language that is applicable to using together with the Parrot virtual machine comprises Perl 6, and the language that is applicable to using together with the Rubinius virtual machine comprises Ruby.This language can be interpretative code or compiler language, and for instance, the language used together with JVM can be JavaScript or Groovy, wherein JavaScript is normally indicative, and Groovy is compiling property normally.
Computer system 10 both can adopt the form of disposal system to realize, also can adopt the form of software to realize.Computer system 10 can for example, by any amount of routine or other computer systems or equipment (terminal, personal computer is (as the IBM compatible, AppleMacIntosh, panel computer, laptop computer etc.) etc.), cell phone, personal digital assistant (Palm Pre for example, Treo, iPhone etc.) etc. realize, and can comprise any commercial operation system (AIX for example, Linux, OSX, Sun Solaris, Unix, Windows etc.) and any commercialization or customized software (browser software for example, communication software, Word etc.).These systems can comprise polytype demonstration and input equipment (for example keyboard, mouse, speech recognition etc.), in order to input and/or check information.If (for example, as the virtual mapping) in software, realized, computer system 10 both can for example, obtain on recordable media (magnetic, optics, floppy disk, DVD, CD etc.) so, for example also can adopt from information source, via the carrier wave of communication media (bulletin board, network, LAN, WAN, in-house network, the Internet etc.) download or the form of signal.
What Fig. 2-4 described is the different aspect of first embodiment of the invention.In the present embodiment, code is by isolating extraneous information and being divided by independent store additional information from executable code, and executable code can normal load thus, and extraneous information can only postpone to load in needs.When being kept for debugging and the accessibility of the extraneous information of serving necessary other processing is provided for the code in field, by reducing memory footprint, this scheme has been optimized memory usage.
Shown in Fig. 2 is can be divided and the internal memory optimization processing by the illustration of Fig. 1 System Implementation according to first embodiment of the invention.In this processing, the code 30 such as java class file or CIL code file is received by rear collector 40, and, in rear collector 40, the extraneous information in code 30 is identified.This extraneous information is to carry out information, for example Debugging message 221, annotation information 222 or source information 223.Produce the code 35 through revising by removing extraneous information, and extraneous information is kept to certain data storage location, for example database 60, share class buffer memory, nested inner classes or independently binary object, can revise code 30.In the code 35 through revising, insert for identifying the unique identification key assignments of described memory location.
In when operation, through the code 35 modification by normal load in virtual machine 20.If need this extraneous information when operation, the extraneous information of the needed appropriate type of particular task can be located and only be loaded to system.Give an example, if break down, abnormality processing process 22 and Report of Discrepancy mechanism 23 can request Debugging message 221 so, so that throw exception report mistake, but it does not need annotation information 222 and source information 223.Equally, if code has been used reflection, the process of reflecting can request source information 223 so, but can not ask Debugging message 221.In illustrated example, Report of Discrepancy mechanism 23 is Java stack trace method for reporting, and four information of the method request produce stack trace 70: class, method, file and line number.Usually, this information is inserted cacoplastic the time by virtual machine, but in these embodiments, and file and line number can be as the parts of Debugging message 221 and be removed, and described Debugging message is kept in database 60.Correspondingly, abnormality processing process 22 and Report of Discrepancy mechanism 23 use key assignments are found out the memory location 60 of having preserved Debugging message 221, then by loading Debugging message 221, fill storehouse tracking 70.
With reference now to Fig. 3,, the figure illustrates an illustrative java class file 30, wherein said java class file 30 has 10 fundamental components: magic number (magic number) 201, version 2 02, constant pool 203, access flag 204, this class 205, superclass 206, interface 207, field 208, method 209 and attribute 210.Attribute can comprise Debugging message 221, annotation information 222 and source information 223.Illustrative java class file 30 is modified by marking off extraneous information and extraneous information is kept to memory location 60 from programmed instruction, and in this example, described extraneous information is Debugging message 221, annotation information 222 and source information 223.In the java class file 35 through revising, extraneous information is replaced by key assignments 224, and wherein this key assignments sign is the memory location of this extraneous information of storage.
In the context of Jvava technology, Debugging message 221 can comprise following attribute:
SourceFile:(is according to class) there is no the source filename in path, for example a ClassName.java;
SourceDebugExtension: normally untapped;
LineNumberTable:(is according to method) supply the debugger single-step debug and the line number (the bytecode index-mapping is become to the line number in source file) with the printing line number for abnormal stack trace;
LocalVariableTable:(is according to method) when single-step debug for the title of the local variable of debugger; And
LocalVariableTypeTable:(is according to method) for general type (and only for general type), the type of the local variable in source file is different from the type in VM.For example, when source file type can be general hash table<integer, word string > time, virtual machine it will be appreciated that hash table.
For the normal operation of the programmed instruction in code, this information is not essential, and this is because it,, only for debugging and stack trace, and is inoperative in the process of working procedure.
In the context of Java technology, annotation information 222 can comprise following attribute:
AnnotationDefault;
RuntimeVisibleAnnotations;
RuntimeInvisibleAnnotations;
RuntimeVisibleParameterAnnotations; And
RuntimeInvisibleParameterAnnotations。
In addition, in the context of Java technology, source information 223 can comprise following attribute:
EnclosingMethod: identify local class around method;
Signature: sign is for general signature, field type and the method signature of class;
Deprecated: the project that sign is abandoned;
Synthetic: the project that the sign compiler produces; And
InnerClasses: identify inside and outside class relation (comprising nested and anonymous)
For the normal operation of the programmed instruction in code, this information is not essential, and this is not need this information because of the operation virtual machine.This information is usually only for reflection.Correspondingly, although remove the method that this information likely can have influence on a large amount of use reflections, in general, most program can not be subject to this impact that removes processing.
Forward now Fig. 4 A and 4B to, this figure has shown the processing 300 and 400 for division and internal memory optimization processing of the first embodiment synoptically.300 times outside can be when operation of processing carry out (for example, in loading classes), process 400 and normally carry out when operation.The system of Fig. 1 of take is example, and in processing 300, this system receives code in step 310, the code of for example resolving through preprocessor, and the extraneous information in the described code of step 320 sign.In step 330, system removes extraneous information from code, and the extraneous information removed is deposited in to a data memory location in step 340.In step 350, system is inserted a key assignments in code, in order to quote the position of described extraneous information.In a system, for example IBM J9 system, this processing can be carried out by certain instrument, for example Java optimizer (JAPT) generic operation instrument.
In optional step 360, system is rewritten code, so that it accesses extraneous information indirectly rather than directly, for example, by revising one or more in a plurality of programmed instruction, can tackle the abnormality processing process, and can use key assignments that it is redirected to memory location.This step is optional, this is because described process also can adopt other modes to carry out, for example revise the operation that class libraries changes local function, for example, in order to load pellucidly the extraneous information of storing, Throwable.getStackTrace (), Class.getDeclaredAnnotations () and Class.getGenericInterfaces ().Give an example, for stack trace, by revising class libraries, can be in StackTraceElement the storage program counter.This programmable counter is the index of the byte code instruction of index method call that the StackTraceElement representative has occurred, and it is used to find the line number in line number Debugging message structure.In optional step 370, through the code of revising, can be kept in memory buffer, share class buffer memory for example, ever after can be from the share class buffer memory loading classes, in order to reduce any load time loss.
As shown in Figure 4 B, when operation, system loads the code through revising in step 410, then determines whether to have occurred to need the event of extraneous information in step 420, and for example fault or reflection are processed.If it's not true, this is processed 400 and finishes.If any, so in step 430, system is located the expectation extraneous information in memory location with key assignments, and loads this information in step 440.Then, the internal memory optimization processing finishes, and system can be carried out by the extraneous information of fetching the operation of any expectation.The extraneous information of locating and loading can be one or more extraneous informations, for example previously described Debugging message, annotation information and source information.System can only load the needed extraneous information of specific purpose, for instance, if system is creating stack trace, it can be located and only load and fill the needed Debugging message of stack trace so, if perhaps system has been used reflection, so it can locate and only load and execution reflect needed source information.
What Fig. 5-7 described is the different aspect of second embodiment of the invention.In this embodiment, code is divided by isolating extraneous information and abandon extraneous information from executable code.If necessary, can load extraneous information from initial code.When being kept for debugging and the accessibility of the extraneous information of serving necessary other processing is provided for the code in field, by reducing memory footprint, this scheme has been optimized memory usage.
Shown in Fig. 5 is that the illustration that can be carried out by Fig. 1 system according to second embodiment of the invention is divided and the internal memory optimization processing.In this is processed, the customization Classloader 21 of the code 30 such as java class file or CIL code file in virtual machine 20 receives, and in virtual machine 20, the extraneous information in described code 30 is identified.This extraneous information is the information that can not carry out, for example Debugging message, annotation information or source information.Code 30 is to be modified by removing the code 35 that extraneous information produces through revising, and inserts the unique identification key assignments of the position for identifying initial code 30 in the code 35 through revising.
In when operation, through the code 35 modification by normal load in virtual machine 20.If need extraneous information when operation, the extraneous information of the needed appropriate type of particular task can be located and only be loaded to system.For instance, if break down, abnormality processing process 22 and Report of Discrepancy mechanism 23 can the request Debugging message so, so that throw exception report mistake, but it does not need annotation information and source information.Abnormality processing process 22 and Report of Discrepancy mechanism 23 use key assignments are found out the memory location of storing initial code 30, and load Debugging message from file, can fill stack trace thus.Equally, if code has been used reflection, the process of reflecting can request source information so, but can not ask Debugging message.If initial code produces or downloads from server, rather than exist in this locality, can again produce or download described initial code so.
With reference now to Fig. 6,, what this figure showed is the illustration java class file 30 with 10 fundametal components: magic number 201, version 2 02, constant pool 203, access flag 204, this class 205, superclass 206, interface 207, field 208, method 209 and attribute 210.Attribute can comprise Debugging message 221, annotation information 222 and source information 223.Illustrative java class file 30 is by marking off extraneous information and it is discarded in recycle bin 80 or collected garbage and is modified from programmed instruction, in this example, described extraneous information is Debugging message 221, annotation information 222 and source information 223.In the java class file 35 through revising, extraneous information is replaced by key assignments 224, this key assignments sign be storage source code 30 or can be from the position of for example by downloading it, fetching source code 30.
Forward now Fig. 7 A and 7B to, this figure generality has shown the division of the second embodiment and the processing 500 and 600 that internal memory optimization is processed.500 times outside can be when operation of processing carry out, or can for example, by system (in loading classes) when the operation, be carried out.Processing 600 is normally carried out when operation.The system of Fig. 1 of take is example, and in processing 500, this system loads initial code in step 510, the code that for example Classloader loads, and in step 520 extraneous information in authentication code.In step 530, system removes extraneous information from code, and in step 540, a key assignments is inserted to described code, so as reference stores comprise extraneous information initial code or can be for the position of fetching described code.In the system of for example IBM J9 system, this processing can be carried out by certain instrument, Java optimizer (JAPT) generic operation instrument for example, or when operation, and when it can be by operation, the J9 system is carried out as the part of expansion loading processing.When being carried out by runtime system, what through the code of revising, represent is the code that is kept at virtual machine inside and is kept at alternatively buffer memory inside.
In optional step 550, system is rewritten described code, so that it accesses extraneous information indirectly rather than directly, for instance, by revising one or more in a plurality of programmed instruction, can tackle the abnormality processing process, and can use key assignments that it is redirected to the code of storage.This step is optional, this is because described process also can adopt other modes to carry out, for example revise the operation that class libraries changes local function, for example, in order to load extraneous information, Throwable.getStackTrace (), Class.getDeclaredAnnotations () and Class.getGenericInterfaces () from stored code pellucidly.Give an example, for stack trace, by revising class libraries, can be in StackTraceElement the storage program counter.This programmable counter is the index of the byte code instruction of index method call that the StackTraceElement representative has occurred, and it is used to find the line number in line number Debugging message structure.In optional step 560, can be stored into memory buffer through the code of revising, for example the share class buffer memory can load described class ever after from the share class buffer memory, in order to reduce the load time loss.
As shown in Figure 7 B, when operation, system loads the code through revising in step 610, then determines whether to have occurred to need the event of extraneous information in step 620, and for example fault or reflection are processed.If it's not true, this is processed 600 and finishes.If any, so in step 630, system is located the storing initial code or can be fetched the expectation extraneous information the position of initial code from it with key assignments, and loads this information in step 640.Then, the internal memory optimization processing finishes, and system can be carried out by the extraneous information of fetching the operation of any expectation.The extraneous information of locating and loading can be one or more extraneous informations, for example previously described Debugging message, annotation information and source information.System can only load the needed extraneous information of specific purpose, for instance, if system is creating stack trace, it can be located and only load and fill the needed Debugging message of stack trace so, if perhaps system has been used reflection, so it can locate and only load and execution reflect needed source information.
It should be appreciated by those skilled in the art that these aspects of the present invention can be used as system, method or computer program and realize.Correspondingly, the embodiment that these aspects of the present invention can adopt the form (comprising firmware, resident software, microcode etc.) of the form of devices at full hardware embodiment, full implement software example or combine the software and hardware aspect realizes, all these can be referred to as " circuit ", " module " or " system " here.In addition, these aspects of the present invention can adopt in the form that has comprised the computer program of realizing on one or more computer-readable mediums of computer readable program code.
Can use any combination of one or more computer-readable mediums.Computer-readable medium can be computer-readable signal media or computer-readable recording medium.For instance, computer-readable medium can be electronics, magnetic, optics, electromagnetism, infrared or semiconductor system, device or equipment, and also or aforementioned every any combination, but it is not limited to this.The example more specifically of computer-readable recording medium (non exhaustive list) comprises following: the electrical connection with one or more circuit, the portable computer video disc, hard disk, random access memory (RAM), ROM (read-only memory) (ROM), Erarable Programmable Read only Memory (EPROM or flash memory), optical fiber, Portable, compact type ROM (read-only memory) (CD-ROM), optical storage apparatus, magnetic storage apparatus, or aforementioned every any appropriate combination.In the linguistic context of this document, computer-readable recording medium can be that any comprise or stored can be for the tangible medium of instruction execution system, device or equipment or the program be combined with it.
The computer-readable signal media can comprise the propagation data signal that those have comprised computer readable program code, and wherein for instance, described signal can be in base band or as the part of carrier wave.This transmitting signal can adopt any in various ways, including, but not limited to electromagnetic signal, light signal or its any suitable combination.The computer-readable signal media can be computer-readable recording medium but can transmit, propagate or transmit any computer-readable medium for the program of instruction execution system, device or equipment or combination with it not.The program code be included on computer-readable medium can transmit with any appropriate medium, including, but not limited to wireless, wired, optical cable, RF etc., or aforementioned every any combination.
For the computer program code of operation of carrying out various aspects of the present invention, can write with any combination of one or more programming languages, comprise: OO programming language, for example Java, Smalltalk, C++ etc., and the conventional programming language, for example " C " programming language or similarly programming language.Program code both can move fully on subscriber computer, also can part move on subscriber computer, can also partly at subscriber computer and part, on remote computer, move as the stand alone software bag, or move on remote computer or server fully.In the later case, remote computer can be by comprising LAN (Local Area Network) (LAN) or wide area network (WAN) the network of any type with subscriber computer, be connected, or can (for example, by using the Internet of Internet service provider) be connected with outer computer.
Should be appreciated that, the software that is used for the computer system of the embodiment of the present invention can be implemented with the computerese of any expectation, and can according to the process flow diagram shown in the functional descriptions comprised in instructions and accompanying drawing, be developed by the those of ordinary skill of computer realm.As example, this software can be realized with C#, C++, Python, Java or PHP programming language.Further, mainly refer to about any quoting of the software of carrying out various functions computer system or the processor of carrying out these functions under software control here.
As an alternative, the computer system of the embodiment of the present invention can realize with hardware and/or other treatment circuits of any type.The difference in functionality of computer system can adopt any mode to be distributed in any amount of software module or unit, processing or computer system and/or circuit, its Computer or disposal system both can adopt in local each other mode and dispose, perhaps adopt mode away from each other to dispose, and be can for example, by any suitable communication media communication (LAN, WAN, in-house network, the Internet, hardware, modulator-demodular unit connect, wireless etc.).
These aspects of the present invention are with reference to describing according to the process flow diagram illustration of the embodiment of the present invention and/or the block diagram of method, device (system) and computer program.Should be appreciated that each square frame in process flow diagram illustration and/or block diagram and any combination of the square frame in process flow diagram illustration and/or block diagram can be implemented by computer program instructions.These computer program instructions can be provided for the processor of multi-purpose computer, special purpose computer or other programmable data processing device, to produce a machine, the means of the function that makes the instruction of the processor operation of computer or other programmable data processing device create to stipulate for one or more square frames of implementing procedure figure and/or block diagram/operation.
These computer programs can also be kept in computer-readable medium, wherein said medium can instruct computing machine, other programmable data treating apparatus or other equipment to operate in a particular manner, so that be kept at the goods that instruction in computer-readable medium produces include instruction, wherein this instruction is implemented is the function stipulated in one or more square frames of process flow diagram and/or block diagram/operation.Computer program instructions can also be loaded in computing machine, other programmable data treating apparatus or other equipment, in order to carry out the sequence of operations step on computing machine, other programmable devices or other equipment, thereby produce computer-implemented processing, thus, the instruction moved on computing machine or other programmable devices is provided for the function stipulated in one or more square frames of implementing procedure figure and/or block diagram/operation.
The disposal system that is applicable to storage and/or executive routine code can be implemented by any routine or other computing machines or disposal system, wherein said system preferably has been equipped with display or monitor, basis (for example comprising processor, internal memory and/or inside or external communication device (for example modulator-demodular unit, network interface card etc.) and optional input equipment (for example keyboard, mouse or other input equipments)).This system can comprise at least one processor that directly or indirectly is coupled to memory part by system bus.Memory part can be included in the local storage used in the process of actual executive routine code, mass storage, and by for certain program code at least, providing interim storage to reduce the buffer memory that must from mass storage, fetch the number of times of code in operational process.I/O or I/O equipment (including, but not limited to keyboard, display, indicating equipment etc.) both can be directly coupled to system, I/O controller that also can be by between two parties and indirectly be coupled to system.Network adapter can also be coupled to system, so that system can be coupled to by privately owned or public network between two parties other disposal systems or remote printer or memory device.Modulator-demodular unit, cable modem and Ethernet card are only a small amount of adapters in current available network adapter.
Process flow diagram in accompanying drawing and block diagram show framework, function and the operation of the embodiments possible of system according to different embodiments of the invention, method and computer program product.In this connection, each square frame in process flow diagram or block diagram can represent module, segmentation or a code section, the one or more executable instructions that comprise the logic function for implementing one or more appointments.It is noted that, in the embodiment of some replacements, the function marked in square frame is not likely occurring in sequence of providing according to accompanying drawing.For example, two square frame reality that show continuously are likely to move in the mode of basic while, or these square frames sometimes can be according to contrary order operation, and this point depends on related function.Should be noted that, the combination of the square frame in each square frame in block diagram and/or process flow diagram illustration and square frame and/or process flow diagram illustration can be implemented by the hardware based dedicated system of the function put rules into practice or operation, or is implemented by the combination of specialized hardware and computer instruction.
Term used herein is intended to describe specific embodiment, rather than the present invention is limited.Unless clear regulation otherwise in context, otherwise singulative used herein " ", " one ", " being somebody's turn to do " have also comprised plural form.Should be appreciated that in addition, the term used in this instructions " comprise " and/or " comprising " regulation be to have feature, integral body, step, operation, parts and/or the assembly state, but do not get rid of existence or the interpolation of one or more features, integral body, step, operation, parts, assembly and/or its group.
The equivalent that corresponding construction in following claim, material, operation and all devices or step add functional part is intended to comprise any structure, material or the operation that combines to carry out function with other claimed parts of special requirement protection.Description of the invention provides for illustration and description purpose, but is not limited in disclosed invention form.For a person skilled in the art, in the situation that do not depart from the scope of the present invention and spirit, a lot of modifications and changes are all apparent.Selecting and describing these embodiment is for principle of the present invention and practical application are described best, and makes other those of ordinary skill of this area can understand the different embodiments of the invention that have from the contemplated matched different alter modes of special-purpose.

Claims (23)

1. one kind for optimizing the method for virtual machine or interpretive code, comprising:
The code that reception comprises a plurality of programmed instruction and the first extraneous information, the language compilation for the virtual machine operation for wherein said code, and wherein said the first extraneous information be the first kind can not carry out information;
Revise described code by the key assignments that removes described the first extraneous information and it is replaced to the position of quoting described the first extraneous information, wherein said position is with one of upper/lower positions: preserve the first extraneous information remove memory location, preserve the memory location of the code of the first extraneous information, the position that can fetch the code of described the first extraneous information, described key assignments is for identifying described position; And
Carry out the code through revising, and if the event of described the first extraneous information of request occurs in operational process, in response to described event, with described key assignments, locate the first extraneous information in described position, and load described the first extraneous information from described position.
2. method according to claim 1, wherein said event is fault, and the described first kind can not execution information be Debugging message.
3. method according to claim 2 also comprises:
Revise one or more in described a plurality of programmed instruction, so that interception abnormality processing process, and the position of using key assignments that described abnormality processing process is redirected to described the first extraneous information.
4. method according to claim 1, wherein said code comprises the second extraneous information, and wherein said the second extraneous information be Second Type can not carry out information, and the first and second types can not execution information be different.
5. method according to claim 4, wherein Second Type can not execution information be source information or annotation information.
6. method according to claim 1, wherein said code is java class file or Java filing (JAR) file, and described a plurality of programmed instruction is the Java byte code instruction.
7. method according to claim 1, wherein said code is the .NET code file, and described a plurality of programmed instruction is public intermediate language (CIL) byte code instruction.
8. method according to claim 1, wherein said language is interpretative code.
9. method according to claim 1, wherein said position is the memory location of preserving the first extraneous information removed, and described method also comprises:
The first extraneous information removed is kept in the memory location of the first extraneous information that described preservation removes.
10. method according to claim 1, wherein said position is the memory location of preserving the code of the first extraneous information, and wherein said loading comprises from the memory location loading code of the code of described preservation the first extraneous information.
11. method according to claim 1, wherein said position is the position that can fetch the code of described the first extraneous information, and wherein said loading comprises from the described position that can fetch the code of described the first extraneous information and fetches code.
12. one kind for optimizing the system of virtual machine or interpretive code, comprising:
For receiving the code that comprises a plurality of programmed instruction and the first extraneous information, the language compilation for the virtual machine operation for wherein said code, and wherein said the first extraneous information is the device that can not carry out information of the first kind;
For by the key assignments that removes described the first extraneous information and it is replaced to the position of quoting described the first extraneous information, revising described code, wherein said position is with one of upper/lower positions: preserve the first extraneous information remove memory location, preserve the memory location of the code of the first extraneous information, the position that can fetch the code of described the first extraneous information, described key assignments is for identifying the device of described position; And
For carrying out the code through revising, and if the event of described the first extraneous information of request occurs in operational process, in response to described event, with described key assignments, locate the first extraneous information in described position, and load the device of described the first extraneous information from described position.
13. system according to claim 12, wherein said event is fault, and the described first kind can not execution information be Debugging message.
14. system according to claim 13 also comprises:
For revising the one or more of described a plurality of programmed instruction, so that interception abnormality processing process, and use key assignments that described abnormality processing process is redirected to the device of the position of described the first extraneous information.
15. system according to claim 12, wherein said code comprises the second extraneous information, and wherein said the second extraneous information be Second Type can not carry out information, and the first and second types can not execution information be different.
16. system according to claim 15, wherein Second Type can not execution information be source information or annotation information.
17. system according to claim 12, wherein said code is java class file or Java filing (JAR) file, and described a plurality of programmed instruction is the Java byte code instruction.
18. system according to claim 12, wherein said code is the .NET code file, and described a plurality of programmed instruction is public intermediate language (CIL) byte code instruction.
19. system according to claim 12, wherein said language is interpretative code.
20. system according to claim 12, wherein said position is the memory location of preserving the first extraneous information removed, and described system also comprises:
Be kept at the device of the memory location of the first extraneous information that described preservation removes for first extraneous information that will remove.
21. system according to claim 12, wherein said position is the memory location of preserving the code of the first extraneous information, and wherein said loading comprises from the memory location loading code of the code of described preservation the first extraneous information.
22. system according to claim 12, wherein said position is the position that can fetch the code of described the first extraneous information, and wherein said loading comprises from the described position that can fetch the code of described the first extraneous information and fetches code.
23. system according to claim 12, (CLR) virtual machine or Java Virtual Machine (JVM) when wherein said virtual machine is the common statement operation.
CN2010105432287A 2009-11-30 2010-11-15 Memory optimization of virtual machine code by partitioning extraneous information Active CN102081546B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US12/627,206 2009-11-30
US12/627,206 US8627303B2 (en) 2009-11-30 2009-11-30 Memory optimization of virtual machine code by partitioning extraneous information

Publications (2)

Publication Number Publication Date
CN102081546A CN102081546A (en) 2011-06-01
CN102081546B true CN102081546B (en) 2013-12-18

Family

ID=44069822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105432287A Active CN102081546B (en) 2009-11-30 2010-11-15 Memory optimization of virtual machine code by partitioning extraneous information

Country Status (4)

Country Link
US (1) US8627303B2 (en)
JP (1) JP5602597B2 (en)
KR (1) KR101699981B1 (en)
CN (1) CN102081546B (en)

Families Citing this family (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8701088B2 (en) * 2010-05-28 2014-04-15 Red Hat, Inc. Generating backtracing information for software debugging of software programs running on virtual machines
JP5466601B2 (en) * 2010-08-31 2014-04-09 インターナショナル・ビジネス・マシーンズ・コーポレーション Code generation method, system and program
US8375443B1 (en) * 2011-09-27 2013-02-12 Google Inc. Code annotations for preventing access to unsafe functionality
US9183113B2 (en) 2011-09-29 2015-11-10 Oracle International Corporation Debugging analysis in running multi-user systems
US9027075B2 (en) * 2011-09-29 2015-05-05 Oracle International Corporation Enforcing security rules at runtime
US9111033B2 (en) 2012-04-17 2015-08-18 International Business Machines Corporation Compiling source code for debugging with user preferred snapshot locations
US8910126B2 (en) 2012-04-18 2014-12-09 International Business Machines Corporation Compiling source code for debugging with variable value restoration based on debugging user activity
US9274772B2 (en) * 2012-08-13 2016-03-01 Microsoft Technology Licensing, Llc. Compact type layouts
US9122794B2 (en) 2012-10-30 2015-09-01 Oracle International Corporation System and method for debugging domain specific languages
US9104797B1 (en) * 2013-03-21 2015-08-11 Intuit Inc. Efficient cloud-based annotation of crash reports
CN103413069B (en) * 2013-07-08 2016-09-07 北京深思数盾科技股份有限公司 A kind of method of the software protecting object oriented language to write
CN103413073B (en) * 2013-07-09 2016-01-20 北京深思数盾科技有限公司 A kind of method and apparatus protecting JAVA executable program
CN103413075B (en) * 2013-07-10 2016-05-04 北京深思数盾科技股份有限公司 A kind of method and apparatus of protecting JAVA executable program by virtual machine
US9146834B2 (en) 2013-08-22 2015-09-29 Oracle International Corporation Targeted cloud-based debugging
US9721092B2 (en) 2014-03-27 2017-08-01 International Busines Machines Corporation Monitoring an application in a process virtual machine
US9772865B2 (en) * 2015-02-23 2017-09-26 Futurewei Technologies, Inc. On-demand loading of dynamic scripting language code for reduced memory usage
WO2016153377A1 (en) * 2015-03-26 2016-09-29 Emc Corporation Smart logging of trace data for storage systems
JP2018523218A (en) * 2015-07-17 2018-08-16 エンハンス,インク. Method and system for modifying machine instructions in compiled software
US9626171B2 (en) 2015-07-24 2017-04-18 Oracle International Corporation Composing a module system and a non-module system
US10078497B2 (en) 2015-07-24 2018-09-18 Oracle International Corporation Bridging a module system and a non-module system
GB2541400B (en) * 2015-08-17 2017-11-15 Advanced Risc Mach Ltd Tracing of exception handling events
US10104090B2 (en) * 2015-08-25 2018-10-16 Oracle International Corporation Restrictive access control for modular reflection
US10191753B2 (en) 2016-03-30 2019-01-29 Oracle International Corporation Generating verification metadata and verifying a runtime type based on verification metadata
US10394528B2 (en) 2016-03-30 2019-08-27 Oracle International Corporation Returning a runtime type loaded from an archive in a module system
US10387142B2 (en) 2016-09-16 2019-08-20 Oracle International Corporation Using annotation processors defined by modules with annotation processors defined by non-module code
US10360008B2 (en) 2016-09-16 2019-07-23 Oracle International Corporation Metadata application constraints within a module system based on modular encapsulation
JP6845429B2 (en) 2017-03-15 2021-03-17 富士通株式会社 Compiler program, information processing device and compilation method
US10848410B2 (en) 2017-03-29 2020-11-24 Oracle International Corporation Ranking service implementations for a service interface
WO2021021126A1 (en) 2019-07-30 2021-02-04 Hewlett-Packard Development Company, L.P. Hash map of executable control blocks
CN112566307B (en) * 2019-09-10 2022-11-04 酷矽半导体科技(上海)有限公司 Safety display system and safety display method
JP2023018290A (en) * 2021-07-27 2023-02-08 富士通株式会社 Analysis program, analysis apparatus, and analysis method
CN115328690B (en) * 2022-10-13 2023-02-17 北京登临科技有限公司 Exception handling method, computer readable medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1387265A1 (en) * 2002-08-02 2004-02-04 Telefonaktiebolaget L M Ericsson (Publ) Optimised code generation
CN1499363A (en) * 2002-10-24 2004-05-26 国际商业机器公司 Method and device for setting break point on regulating integrated executable program of isomeric system structure
CN1531680A (en) * 2001-02-09 2004-09-22 Ħ��������˾ Device and method for realizing changes in program control stream
EP1491999A2 (en) * 2003-06-26 2004-12-29 Microsoft Corporation Software development infrastructure
CN101042671A (en) * 2007-04-24 2007-09-26 上海华龙信息技术开发中心 Debugging system used for digital signal processor and debug method thereof
CN101162439A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 Method for realizing hardware register based on built-in applied system

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3352893B2 (en) * 1996-12-11 2002-12-03 株式会社日立製作所 Debug information creation method, debug method and debug system
WO2000034866A1 (en) * 1998-12-07 2000-06-15 Sony Corporation Computer, recording medium storing exception-handling program, and method of exception handling
JP2001236243A (en) * 2000-02-22 2001-08-31 Nec Microsystems Ltd Debug method and recording medium with program for debug recorded
JP4192519B2 (en) * 2002-07-24 2008-12-10 株式会社日立製作所 Information processing method and apparatus
AU2002363920A1 (en) * 2002-10-29 2004-05-25 Freescale Semiconductor, Inc. Method and apparatus for selectively optimizing interpreted language code
US7631356B2 (en) * 2005-04-08 2009-12-08 Microsoft Corporation System and method for foreign code detection
US8453132B2 (en) * 2006-07-28 2013-05-28 Hewlett-Packard Development Company, L.P. System and method for recompiling code based on locality domain and thread affinity in NUMA computer systems
US7475214B2 (en) * 2006-08-16 2009-01-06 International Business Machines Corporation Method and system to optimize java virtual machine performance
US8286152B2 (en) * 2007-08-22 2012-10-09 International Business Machines Corporation Systems, methods, and computer products for just-in-time compilation for virtual machine environments for fast application startup and maximal run-time performance
US20090172648A1 (en) * 2007-12-28 2009-07-02 Gerginov Georgi A Byte code analysis library

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1531680A (en) * 2001-02-09 2004-09-22 Ħ��������˾ Device and method for realizing changes in program control stream
EP1387265A1 (en) * 2002-08-02 2004-02-04 Telefonaktiebolaget L M Ericsson (Publ) Optimised code generation
CN1499363A (en) * 2002-10-24 2004-05-26 国际商业机器公司 Method and device for setting break point on regulating integrated executable program of isomeric system structure
EP1491999A2 (en) * 2003-06-26 2004-12-29 Microsoft Corporation Software development infrastructure
CN101162439A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 Method for realizing hardware register based on built-in applied system
CN101042671A (en) * 2007-04-24 2007-09-26 上海华龙信息技术开发中心 Debugging system used for digital signal processor and debug method thereof

Also Published As

Publication number Publication date
JP5602597B2 (en) 2014-10-08
KR20110060822A (en) 2011-06-08
JP2011118901A (en) 2011-06-16
CN102081546A (en) 2011-06-01
KR101699981B1 (en) 2017-01-26
US20110131561A1 (en) 2011-06-02
US8627303B2 (en) 2014-01-07

Similar Documents

Publication Publication Date Title
CN102081546B (en) Memory optimization of virtual machine code by partitioning extraneous information
KR102059705B1 (en) Adaptive portable libraries
US10620926B2 (en) Linking optimized entry points for local-use-only function pointers
US10585652B2 (en) Compiling optimized entry points for local-use-only function pointers
US10223087B2 (en) Comparisons in function pointer localization
US10606574B2 (en) Executing optimized local entry points and function call sites
US10209972B2 (en) Executing optimized local entry points
US10579353B2 (en) Loading optimized local entry points for local-use-only function pointers
US10360005B2 (en) Local function call tailoring for function pointer calls
US10534594B2 (en) Optimized entry points and local function call tailoring for function pointers
US9170825B2 (en) Interface method resolution for virtual extension methods
US10268465B2 (en) Executing local function call site optimization
CN110059456B (en) Code protection method, code protection device, storage medium and electronic equipment
US20180113689A1 (en) Local Function Call Site Optimization
US20210089282A1 (en) Memory ordering annotations for binary emulation
CN114138281A (en) Compiling method, device, equipment and medium of software engineering
US10936290B2 (en) Compile-time folding of assumed constant values
US20240256236A1 (en) Annotation aware efficient application build management
US11157252B2 (en) Assessment of the benefit of post-inlining program transformation in inlining decisions
US20150220310A1 (en) Object field optimization
Prat et al. Trade Study of Scripting Languages for Avionics Systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant