WO2012053284A1 - オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラム - Google Patents

オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラム Download PDF

Info

Publication number
WO2012053284A1
WO2012053284A1 PCT/JP2011/069484 JP2011069484W WO2012053284A1 WO 2012053284 A1 WO2012053284 A1 WO 2012053284A1 JP 2011069484 W JP2011069484 W JP 2011069484W WO 2012053284 A1 WO2012053284 A1 WO 2012053284A1
Authority
WO
WIPO (PCT)
Prior art keywords
pointer
read
computer
exception
format
Prior art date
Application number
PCT/JP2011/069484
Other languages
English (en)
French (fr)
Inventor
怜 大平
Original Assignee
インターナショナル・ビジネス・マシーンズ・コーポレーション
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 インターナショナル・ビジネス・マシーンズ・コーポレーション filed Critical インターナショナル・ビジネス・マシーンズ・コーポレーション
Priority to DE112011103536T priority Critical patent/DE112011103536T5/de
Priority to GB1307566.8A priority patent/GB2498484A/en
Publication of WO2012053284A1 publication Critical patent/WO2012053284A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1416Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F9/4493Object persistence

Definitions

  • the present invention relates to a technique for detecting access to an object stored in a memory of a computer, and more particularly to a technique for detecting access to an object having a modified object format.
  • the object format is, for example, the current Java TM virtual machine (Virtual Machine) implementation is fixed through program execution.
  • the fixed object format is, for example, the layout of headers and data fields, and their sizes.
  • reducing the memory footprint, memory bandwidth, cache misses, garbage collection (GC) frequency, and GC overhead will reduce the cost of the computer running the program. It is useful in. Therefore, the fixed object format (hereinafter also referred to as “ordinary object format” or “original object format”) is modified so as to reduce the cost, and can be applied to the program.
  • An object format (hereinafter also referred to as “modified object format”) has been developed (see FIGS. 4 to 6 below).
  • Patent Literature 1 relates to a method for effectively using a memory area by isolating an object that exists in a memory area and is not accessed for a predetermined period, and particularly relates to a method for isolating an object that exists in a heap memory.
  • Patent Document 1 if a user program accesses a semi-inaccessible area, control is transferred to a signal handler, and the accessed virtual memory address can be acquired in the signal handler. And clearing the flag by returning the object with the access flag set at the next GC to the normal heap memory area (paragraph 0114).
  • Patent Document 2 relates to a multitask control method and a storage medium capable of multitask processing (paragraph 0001).
  • Patent Document 2 describes that when an event such as an interrupt signal occurs and the signal handler detects the occurrence of an interrupt, the signal handler notifies the super signal thread of the occurrence of the interrupt event (paragraph 0064). .
  • Non-Patent Document 2 discloses an object compression method.
  • Non-Patent Document 3 discloses a method for accessing a permanent object.
  • An object of the present invention is to efficiently access an object stored in a computer memory.
  • an object of the present invention is to efficiently access an object having a modified object format.
  • the present invention provides a method for detecting access to an object, a computer program, and a computer.
  • the present invention converts the pointer into a pointer to the read / write protected area by operating a pointer to the object, and uses the fact that an exception occurs in response to an access request to the read / write protected area. It is characterized by performing reverse conversion from the pointer to the original pointer. Since the original pointer is recovered by the inverse transformation, it is possible to detect the object pointed to by the original pointer and to access the object pointed to by the original pointer.
  • the inverse transformation refers to an instruction in which an exception has occurred, acquires the operated pointer from the instruction in which the exception has occurred, and obtains the acquired pointer. It includes reverse conversion, and obtaining a pointer to the head of the object pointed to by the original pointer subjected to the reverse conversion. By obtaining a pointer to the head of the object pointed to by the inversely converted original pointer, it is possible to detect the object pointed to by the original pointer and to access the object pointed to by the original pointer. .
  • the object pointed to by the inversely converted original pointer (having the referenced header information) Processing suitable for the format (which is also an object) can be performed.
  • the process is, for example, decompression of a compressed object to be accessed or delayed allocation of an object to be accessed.
  • an exception is generated in response to an access request to the read / write protected area, and the original pointer is recovered. Therefore, the object accessed by the original pointer is efficiently accessed. It is possible. Further, according to the embodiment of the present invention, it is possible to obtain a pointer to the head of the object pointed to by the original pointer that has been inversely transformed, so that the object pointed to by the original pointer can be easily detected. is there. Further, according to the embodiment of the present invention, the header format of the object pointed to by the inversely converted original pointer is referred to, and processing suitable for the format of the object having the referenced header information is performed. Can be easily accessed even if it is modified differently than usual. This makes it possible to adopt a format that uses less memory than the normal object format, which further reduces the cost of the system or increases the processing speed.
  • FIG. 1 shows a basic block diagram of computer hardware in an embodiment of the present invention.
  • FIG. FIG. 2 shows a functional block diagram of a system having the functions of the computer hardware shown in FIG. 1 and according to an embodiment of the present invention.
  • An example of an object and a pointer to the object is shown.
  • An example of an object format in which a normal object format is transformed by compression will be described.
  • An example of an object format in which a normal object format is modified by specifying a character array using a pointer is shown.
  • An example of an object format in which a normal object format is transformed by field rearrangement is shown.
  • a method of accessing an object in a conventional object database method is shown.
  • a method for accessing a compressed object in a persistent object database method, which is a prior art is shown.
  • FIG. 4 illustrates a method for accessing an object when a pointer is converted to point to a read / write protected area according to an embodiment of the present invention.
  • Fig. 4 illustrates a method for accessing an object when a pointer is converted to point to a read / write protected area according to an embodiment of the present invention.
  • An example of converting a pointer to an object to point to a read / write protected area according to an embodiment of the present invention will be described.
  • 10 shows an example of a barrier pointer when the read / write protected area is the same size as the heap area according to an embodiment of the present invention.
  • 10 shows an example of a barrier pointer when the read / write protection area is smaller than the heap area according to an embodiment of the present invention.
  • FIG. 4 shows an example of a barrier pointer when the read / write protection area is an OS protection area according to an embodiment of the present invention.
  • 2 shows a flowchart of a method for detecting access to an object according to an embodiment of the present invention.
  • Fig. 5 shows a flowchart of an algorithm for handling a memory access exception using a slot for storing a pointer value to the beginning of an object according to an embodiment of the present invention.
  • 6 shows a flowchart of an algorithm for converting a pointer to an object to point to a read / write protected area in object allocation according to an embodiment of the present invention.
  • FIG. 6 shows a flowchart of an algorithm for converting a pointer to an object to point to a read / write protected area in garbage collection according to an embodiment of the present invention.
  • FIG. FIG. 18 shows a virtual address space in step 1701 (before starting GC) of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows a virtual address space in step 1703 of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows the virtual address space and the contents of element P and set S when processed through steps 1704 and 1705 of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows the virtual address space and the contents of element P and set S when processed through steps 1707, 1709 and 1710 of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows the virtual address space and the contents of element P and set S when processed through steps 1704, 1705, 1707, 1709 and 1710 of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows the virtual address space and the contents of element P and set S when processed through steps 1704, 1705, 1707 and 1708 of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows the virtual address space and the contents of elements P and set S when processed through steps 1708, 1709, 1710, 1704, 1705, 1707 and 1708 of FIG. 17, which is an embodiment of the present invention.
  • FIG. 18 shows the virtual address space and the contents of element P and set S when processed through steps 1709, 1710, 1704 and 1706 of FIG. FIG.
  • FIG. 6 illustrates an example of an operation of calling a signal handler to recover (reverse) an original pointer from a converted pointer according to an embodiment of the present invention.
  • FIG. 2 illustrates an example of a signal handler algorithm according to an embodiment of the present invention. The experimental result about the relationship between the frequency of access to an object and overhead according to the embodiment of the present invention is shown.
  • FIG. 1 shows a basic block diagram of computer hardware in an embodiment of the present invention.
  • the computer (101) includes a CPU (102) and a main memory (103), which are connected to a bus (104).
  • the CPU (102) is preferably based on a 32-bit or 64-bit architecture, for example, Intel Core i (TM) series, Core 2 (TM) series, Atom (TM) series, Xeon (TM).
  • the series Pentium (R) series, Celeron (R) series, AMD's Phenom (TM) series, Athlon (TM) series, Turion (TM) series or Empron (TM) may be used.
  • a display (106) for example, a liquid crystal display (LCD) can be connected to the bus (104) via a display controller (105).
  • LCD liquid crystal display
  • the display (106) displays information about a computer connected to a network via a communication line and information about software running on the computer with an appropriate graphic interface for managing the computer. Used for.
  • the bus (104) can also be connected via a SATA or IDE controller (107) to a storage device (108) such as a hard disk or silicon disk and a drive (109) such as a CD, DVD or BD drive.
  • a keyboard (111) and a mouse (112) can be connected to the bus (104) via a keyboard / mouse controller (110) or a USB bus (not shown).
  • the storage device (108) includes an operating system, a Java (registered trademark) processing environment such as J2EE, a Java (registered trademark) application, a Java (registered trademark) virtual machine (VM), and a Java (registered trademark) runtime (JIT). )
  • a program for providing a compiler, other programs, and data are stored in the main memory 103 so as to be loadable.
  • the drive (109) is used to install a program from a CD-ROM, DVD-ROM or BD to the storage device (108) as necessary.
  • the communication interface (114) follows, for example, the Ethernet (registered trademark) protocol.
  • the communication interface (114) is connected to the bus (104) via the communication controller (113) and plays a role of physically connecting the computer (101) to the communication line (115).
  • a network interface layer is provided for the TCP / IP communication protocol of the communication function of the system.
  • the communication line (115) may be a wired LAN environment or a wireless LAN environment based on a wireless LAN connection standard such as IEEE802.11a / b / g / n.
  • FIG. 2 shows a functional block diagram of the computer (201) having the hardware functions of the computer (101) shown in FIG. 1 and according to the embodiment of the present invention.
  • the computer (201) includes a conversion unit (211) and an inverse conversion unit (212) in addition to the CPU (102), the main memory (103), and the storage device (108) shown in FIG.
  • the computer (201) can further include a processing unit (213) and an execution unit (214).
  • the conversion unit (211) operates a pointer to the object to convert the pointer into a pointer that points to the read / write protected area.
  • the conversion unit (211) can perform the conversion processes shown in (1) to (3) below, for example.
  • (1) A constant offset value is added to the pointer to obtain a pointer (converted pointer) that points to the read / write protected area.
  • (2) The pointer to the object is shifted right by n bits (n is an integer), and a fixed offset value is added to obtain a read / write protected area (converted pointer).
  • the pointer to the object is shifted to the right by n bits (n is an integer), and the address of the read / write protection area is embedded in the empty left (upper) bit to indicate the read / write protection area (converted) Pointer).
  • the conversion unit (211) performs the conversion, for example, in object allocation or garbage collection.
  • the reverse conversion unit (212) performs reverse conversion from the converted pointer to the original pointer by using an exception that occurs in response to a request to access the read / write protected area.
  • the inverse conversion unit (212) refers to the instruction in which the exception has occurred, acquires the operated pointer from the instruction in which the exception has occurred, and acquires the acquired pointer. Is inversely converted to obtain a pointer to the head of the object pointed to by the inversely converted original pointer.
  • the inverse conversion unit (212) includes a register or slot number of a slot (also referred to as a pinning array slot) that stores an instruction address where an exception has occurred and a pointer value to the head of the object.
  • the operation pointer is obtained from the instruction address where the exception has occurred, and the obtained pointer is inversely converted, and the object pointed to by the inversely converted original pointer is obtained. Get a pointer to the beginning.
  • the inverse transform unit (212) includes: Corresponding to (1) to (3) performed by the conversion unit (211), inverse conversion processing shown in the following (1 ′) to (3 ′) can be performed.
  • (1 ′) An original pointer is obtained by subtracting a certain offset value from the pointer converted in (1) above.
  • (2 ′) A constant offset value is subtracted from the pointer converted in (2) above, and left-shifted by the same number of n bits as in (2) above to obtain the original pointer.
  • (3 ′) The pointer converted in (3) above is shifted left by the same n bits as in (3) to obtain the original pointer.
  • the processing unit (213) refers to the header information of the object pointed to by the inversely converted original pointer, and performs processing suitable for the format of the object having the referenced header information.
  • a process suitable for the format is, for example, decompression of a compressed object or delayed allocation of a character array.
  • the execution unit (214) performs processing suitable for the format, and then accesses the object pointed to by the inversely converted original pointer.
  • FIG. 3 shows an example of an object and a pointer to the object.
  • An “object” is a specific object of an abstract procedure on a program, and is an object generated from an allocation location of an object described in the program.
  • the “object” is allocated in a memory, for example, in a heap area when the program is executed.
  • An “object” is generated from a class, for example.
  • the “object” may exist in the heap area even when the execution of the program is interrupted or completed, for example.
  • the heap area is not an entire heap area used for a program, but a part of the entire heap area and an area to which objects are allocated.
  • the heap area is, for example, a heap area targeted for GC.
  • Object typically includes a header and at least one field (see FIGS. 4 and 6 below).
  • the header is a part that holds information on the object itself, embedded in the object, and includes information on the size and type of the object, for example.
  • the field is a part accessible to the user of the object, and has two types of data, for example, a pointer and a non-pointer.
  • a pointer is a value that refers to a certain location in a memory area. In many language processing systems, a pointer to an object refers to the start address of the object (see FIG. 3).
  • a non-pointer uses a value itself in programming, and includes a numerical value, a character, and / or a truth value.
  • Object is allocated on the memory area.
  • the GC moves or discards the arranged object depending on the situation.
  • the “object format” includes a so-called normal object format and an object format obtained by modifying the normal object format (hereinafter also referred to as “transformed object format”).
  • Normal Object Format is, for example, a format found during Java TM, C #, Script (PHP or Perl), Ruby, C, C ++, LISP, Python, or Haskell implementations and is particularly modified. A format that is not. In Java TM, the object format can only be seen during Java TM implementation (ie, in memory). The normal object format depends on the object class.
  • Modified object format means normal object format for the purpose of reducing memory footprint, memory bandwidth, cache misses, garbage collection frequency, and GC overhead Is a modified object format. Modifications of the object format are shown in FIGS. 4 to 6 below, but the present invention is not limited to these modifications.
  • Object X (311) has a pointer (321) therein.
  • the pointer (321) indicates access to the object A (312), and has the head address of the object A (312).
  • Object A (312) is also the target object of pointer (321).
  • the object A (312) may be either an object having a normal object format or a modified object format.
  • Object Y (331) has a pointer (341) therein.
  • the pointer (341) indicates access to the object B (332) and has the head address of the object B (332).
  • Object B (332) is also the target object of pointer (341).
  • Object B (332) has a pointer (342) therein.
  • the pointer (342) indicates access to the object C (333) and has the head address of the object C (333).
  • Object C (333) is also the target object of pointer (342). In this manner, the pointer is sequentially read, and access to another object is indicated from the read pointer.
  • Each of the object B (332) and the object C (333) may be an object having a normal object format or a modified object format.
  • FIG. 4 shows an example of an object format in which a normal object format is transformed by compression.
  • a character array character array (s)
  • ASCII ASCII
  • Object compression results in optimization of object access.
  • An object format (401) indicates a normal format.
  • An object format (402) indicates a format when the object format (401) is deformed by compression.
  • the object format (401) includes a header (411) and null value data fields (412, 414, 416 and 418) and an ASCII data field (413, 415, 417 and 419).
  • the object format (402) includes a header (421) and ASCII data fields (422-425).
  • the null data fields (412, 414, 416 and 418) of the object format (401) are deleted, and the ASCII data fields (413, 415, 417 and 417) are deleted. 419). Since the number of data fields in the modified object format (402) is four and the number of data fields in the object format (401) is eight, the data in the modified object format (402) The field is compressed to half the data field of the object format (401). In the modified object format (402), since the number of data fields is compressed, the cost of the memory can be reduced compared to the object format (401).
  • Non-Patent Document 2 There are many known methods for compressing objects (see Non-Patent Document 2).
  • FIG. 5 shows an example of an object format in which a normal object format is modified by specifying a character array using a pointer.
  • Specifying a character array using a pointer is generated, for example, when a plurality of string objects assigned to a certain part tend not to be accessed and these string objects are concatenated with other string objects.
  • the character array that can be connected is designated by using a pointer.
  • the assignment of character arrays using the pointer can occur lazily. Lazy allocation results in optimization of object access because it does not allocate the object until it is actually needed.
  • the object format (501) indicates a normal format.
  • An object format (502) indicates a format when the object format (501) is transformed.
  • the character array (512) and the character array (522) are assigned to different positions, the character array (512) and the character array (522) are combined to form a character array. (532) indicates that it is newly generated. The generation of the character array (532) can be delayed.
  • each of the character array (542) and the character array (552) has two pointers (562). And 563).
  • the modified object format (502) is different in that it has two pointers (562 and 563) instead of the character array (532) of the object format (501). Since the object format (502) has two pointers (562 and 563) instead of the character array (532), the cost of the memory can be reduced.
  • FIG. 6 shows an example of an object format in which a normal object format is transformed by field rearrangement.
  • Field relocation is, for example, when two or more fields in an object tend to be accessed at the same time in order to reduce data cache misses for the two or more fields. Or it indicates that more fields are co-located.
  • An object format (601) indicates a normal format.
  • the object format (602) indicates a format when the object format (601) is transformed.
  • the object format (601) includes a header (611) and data fields in the order of 1 to 6 (612 to 617).
  • the object format (602) includes a header (621) and data fields in the order of 1, 6, 3, 4, 5 and 2 (622 to 627).
  • the modified object format (602) is modified so that the data field 6 (623) is positioned adjacent to the data field 1 (622).
  • data field 1 (622) and data field 6 (623), which tend to be accessed at the same time, are modified so that they are located next to each other. Costs can be reduced.
  • FIG. 7 shows a method of accessing an object in a conventional object database method that is a prior art.
  • Access to an object using the persistent object database method has the following characteristics: (1) Monitoring of access to an object is in units of pages; (2) Cases where the method is suitable are in page units. And (3) the field of application of the scheme is mainly in the field of databases and disks, especially in swapping out / or swapping in.
  • the computer (201) accesses the object A by following the pointer from the object X (721).
  • the computer (201) uses the signal handler to stop the execution of all the threads and remove the protection of the read / write protected page (702).
  • the virtual address space (701) after removal of protection is shown in the lower part of FIG.
  • the computer (201) uses the signal handler to load the object A (741) from the disk or the remote machine into the memory, and resumes the execution of the program.
  • the computer (201) does not only include the object A (741) but also the object B (742) and the object that are in the same read / write protected page (702) as the object A (741). C (743) is also loaded onto the memory. Therefore, there is a demerit that the cost of the memory increases.
  • the computer (201) allocates a new read / write protection page (703) and the object A (741). ) Pointer to the read / write protected page (703).
  • the computer (201) allocates a new read / write protection page (703), and This indicates that the pointer of C (743) points to the read / write protected page (703).
  • FIG. 8 shows a method of accessing a compressed object in the conventional object database method.
  • the characteristics of the persistent object database method are as described above.
  • the computer (201) traces the pointer from the object X (821) as shown in the upper diagram of FIG.
  • the computer (201) uses the signal handler to stop the execution of all threads and remove the protection of the read / write protected page (802) (812).
  • the virtual address space (801) after removal of protection is shown in the lower part of FIG.
  • the computer (201) uses the signal handler to expand the compressed object A (822) onto the memory, and resumes the execution of the program.
  • FIGS. 9A and 9B show an access method to an object when a pointer is converted to point to a read / write protected area according to an embodiment of the present invention.
  • access to an object has the following characteristics: (1) Monitoring of access to an object is not a page unit but an individual object unit; (2) Case where the method is suitable Is the case where it is desired to monitor every object scattered in the heap, not when there is locality of access in page units; and (3)
  • the application field of the embodiment of the present invention is mainly object access. Profiling, object compression, object delay allocation, and object relocation.
  • FIG. 9A there is a virtual address space (901) on the memory of the computer (201). There is a read / write protected area (902) on the virtual address space (901). It is assumed that the pointer of the object X (921) indicates the address (922) of the read / write protected area (902), and the pointer of the compressed object A (923) indicates the address (924) of the read / write protected area (902). The pointer of the object Y (931) indicates the address (932) of the read / write protected area (902).
  • the pointer of the object X (921) is converted from the address indicating the compressed object A (923) (that is, the start address of the compressed object A) into the pointer indicating the read / write protected area (902). It is that you are. Further, the pointer of the compressed object A (923) is converted from the address indicating the compressed object B (925) (that is, the start address of the compressed object B) into the pointer indicating the read / write protected area (902). The pointer of the object Y (931) is converted from the address indicating the compressed object C (933) (that is, the start address of the compressed object C) to the pointer indicating the read / write protected area (902).
  • barrierize converting a pointer to a target object so as to point to a read / write protected area (code operation) is referred to as “barrierize”.
  • the barrier rise is performed in allocation or in the GC. This barrier rise can be performed on all objects in the embodiment of the present invention.
  • barrier pointer the pointer converted by the barrier rise is referred to as a “barrier pointer”.
  • the name barrier pointer was named by the present inventor. All accesses through the barrier pointer raise an exception.
  • FIG. 9B shows the virtual address space (901) after decompressing only the compressed object A (923). As shown in FIG.
  • the computer (201) traces the pointer from the object A (943). It is assumed that the point destination indicates the address (924) of the read / write protected area (902). Therefore, an access request to the read / write protection area (902) occurs. Since the point destination indicates the address of the read / write protected area (902), an exception occurs in response to the access request.
  • the computer (201) uses the signal handler to reversely convert the original pointer from the pointer of the object A (943). Then, the computer (201) decompresses only the compressed object B (925) to be accessed by using the signal handler. That is, the compressed object C (933) is not expanded. The computer (201) accesses the decompressed object B (925) (not shown) and resumes execution of the program.
  • the computer (201) has followed the pointer from the object Y (931). It is assumed that the point destination indicates the address (932) of the read / write protection area (902). Therefore, an access request to the read / write protection area (902) occurs. Since the point destination indicates the address of the read / write protected area (902), an exception occurs in response to the access request.
  • the computer (201) uses the signal handler to reversely convert the original pointer from the pointer of the object Y (931). Then, the computer (201) decompresses only the compressed object C (933) to be accessed by using the signal handler. The computer (201) accesses the expanded object C (933) (not shown) and resumes execution of the program.
  • FIG. 10 shows an example of converting a pointer to an object to point to a read / write protected area according to an embodiment of the present invention.
  • a pointer (1002) included in the object (1001) is a pointer to the object A (1005).
  • the pointer (1002) is a pointer before conversion.
  • the lower 2 or 3 bits (1004) thereof are zero, and the other bits indicate the address (1003) of the object to be accessed.
  • the address (1003) is, for example, the head address of the object A (1005).
  • the point that the lower 2 or 3 bits (1004) of the pointer (1002) is zero is used.
  • the pointer (1002) is converted into a pointer that points to the read / write protected area by performing the following bit manipulation of the pointer.
  • One example of such conversion is, for example, right-shifting the pointer (1002) by n bits (where n is an integer, eg, n is 2 or 3) and read / write protected to the left (upper) bits that are free This is done by setting a pointer to the area.
  • the pointer (1012) is a pointer generated by the above conversion.
  • the number of upper n bits (1013) is the same as the number of bits shifted to the right.
  • the other bits (1014) are the same as the bit (1003).
  • the head (1013) of the pointer (1012) indicates the address (1015) of the read / write protected area.
  • the read / write protected area is, for example, a memory area generated by a specific language (for example, a read / write protected area outside the heap of Java TM), for example, an OS memory area.
  • the read / write protected area can be, for example, an address that causes an exception. For example, when 32-bit Linux (trademark) is installed in the computer, the read / write protected area is 0xC0000000 and above. The read / write protected area cannot be accessed by the user. In addition, the address of the read / write protected area according to the programming language implemented by the computer can be used.
  • the use of a read / write protected area in barrier rise eliminates the need to assign pointers to real memory (real memory), and merely reserves and protects virtual memory areas. There is a point. Also, according to an embodiment of the present invention, there is an advantage that it is not necessary to reserve a virtual memory area in the user space.
  • the pointer (1012) is inversely converted by performing the following bit manipulation of the pointer.
  • the pointer of the object X (1021) points to the start address of the object A. That is, the converted pointer is inversely converted to the original pointer.
  • the inverse transformation shifts the pointer (1012) to the left by n bits (n is an integer, for example, n is 2 or 3), and the left-shifted left (lower) bit (1024) is left. This is done by setting zero.
  • a pointer (1022) (that is, the same as the pointer 1002) is generated from the pointer (1012), and access to the target object A (1025) can be detected.
  • FIGS. 11 to 13 below show examples of various barrier pointers according to the embodiment of the present invention.
  • FIGS. 11 to 13 is a memory layout
  • the barrier pointer of FIG. 11 is a basic barrier pointer
  • FIGS. 12 to 13 are extended barrier pointers.
  • those skilled in the art may optionally use the barrier pointers of FIGS. 11-13 and the barrier pointers of other embodiments.
  • FIG. 11 shows an example of a barrier pointer in the case where the read / write protected area is the same size as the heap area according to the embodiment of the present invention.
  • the virtual address space (1101) there is a Java (trademark) heap area (1111) and a read / write protected area (1112).
  • the original pointer is indicated by arrow (1121) and the barrier pointer is indicated by arrow (1122).
  • the read / write protected area (1112) is reserved so as to have the same address size as the Java TM heap area (1111). Implementation is simplified by using the same address size.
  • a constant offset between the Java TM heap area (1111) and the read / write protected area (1112) is added to the pointer.
  • a certain offset is reduced in the unvarialization.
  • the offset is constant during Java TM VM initialization and program execution.
  • Most OSs have a system call to reserve a read / write protected virtual address area.
  • the read / write protected area (1112) does not require real memory allocation.
  • Recent OSs do not allocate real memory to virtual pages until the contents of real memory are first accessed by a program.
  • the read / write protected area (1112) is used only to generate an exception. Therefore, the contents of the read / write protected area (1112) are never accessed from the outside, and real memory is not required.
  • the Java TM heap area (1111) is dynamically expanded, the read / write protected area (1112) must be expanded as well.
  • the size of the read / write protected area (1112) is made to match the maximum size of the Java TM heap area (1111). Note that the size of the read / write protected area (1112) may not be smaller than the size of the Java TM heap area (1111).
  • the barrier rise can be performed in object allocation (see FIG. 16 below) or in GC (see FIG. 17 below). Barrierization at the time of object allocation is useful for profiling or optimizing an object allocated at a certain allocation site. In order for the barrier pointer to work correctly, it is important that all pointers pointing to the target object are barrierized. Since only one pointer in the register points to the allocated object immediately after allocation, it is sufficient to vary the register in the generated JIT code or in a modified interpreter. In contrast, barrier rise in GC is suitable for profiling or optimizing long live objects. In the embodiment of the present invention, among the barrier rise and unvariate rise methods shown in FIGS. 11 to 13, the barrier rise and unvariate rise methods shown in FIG. 11 are the most basic methods.
  • FIG. 12 shows an example of the barrier pointer when the read / write protected area is smaller than the heap area according to the embodiment of the present invention.
  • the original pointer is indicated by an arrow (1221) and the barrier pointer is indicated by an arrow (1222).
  • the objects used in FIG. 12 are aligned in units of 8 bytes, for example. In a general CPU design, for example, if 8-byte data is read from an address that is not 8-byte aligned, overhead is required.
  • the size of the read / write protected area (1112) is set to be equal to or larger than the maximum size of the Java (trademark) heap area (1111).
  • the virtual address space (1101) is a limited resource.
  • the additional area in the virtual address also increases translation lookaside buffer (TLB) misses. Therefore, it is preferable to make the read / write protected area as small as possible.
  • the read / write protected area (1212) is reserved so as to be smaller than the Java (trademark) heap area (1211).
  • the read / write protected area (1212) may be one-eighth the size of the Java TM heap area (1211).
  • barrier rise the pointer is shifted right by n bits and an offset is added.
  • unvarialization a certain offset is reduced, and n bits are shifted to the left.
  • Barrier rise is performed in object allocation or GC, as in the example of FIG.
  • the Java TM VM can take advantage of the fact that all Java TM objects are aligned on 8-byte boundaries. Since the last 3 bits of each object pointer are zero, a right shift of 3 bits is possible without losing any information. Accordingly, the size of the read / write protected area (1212) can be one-eighth the size of the Java TM heap area (1211), as described above.
  • the barrier pointer can be expressed by the following Equation 1.
  • Equation 1 can be represented in a simplified form as represented by Equation 2 below.
  • FIG. 13 shows an example of a barrier pointer when the read / write protection area is an OS protection area according to an embodiment of the present invention.
  • FIG. 13 shows a method of reducing the size of the read / write protected area by a method different from FIG.
  • the original pointer is indicated by arrow (1321) and the barrier pointer is indicated by arrow (1322).
  • FIG. 13 shows an example of a barrier pointer when the read / write protection area is an OS protection area according to an embodiment of the present invention.
  • FIG. 13 shows a method of reducing the size of the read / write protected area by a method different from FIG.
  • the Linux (trademark) OS area (1312) occupies a quarter of the virtual address space (1301) according to the specification of the Linux (trademark) OS program, and from OxC0 ... 000 Start. The user cannot access this Linux (trademark) OS area (1312).
  • an address indicating the head of the Linux (registered trademark) OS area (1312) is set in two vacant bits after being shifted to the right by the number of n bits of the pointer (11 in the example of FIG. 13). On the other hand, in unvarialization, n bits of the pointer are shifted to the left. Java TM VM does not need to reserve a read / write protected area in the user space.
  • the OS typically reserves half or quarter of the virtual address space.
  • the OS typically occupies 1 / 16th of a 4 GB virtual address space. This means that the Java TM VM can reserve 256 MB elsewhere to reserve the read / write protected area. Barrier rise is performed in object allocation or GC, as in the example of FIG.
  • FIG. 14 shows a flowchart of a method for detecting access to an object according to an embodiment of the present invention.
  • the computer (201) starts an algorithm for detecting access to an object.
  • the conversion unit (211) performs a code operation on the pointer to the object (target object) to convert the pointer into a pointer that points to the read / write protected area.
  • the mode of conversion of the pointer is as described in the description of the conversion unit (211).
  • the total value exceeds the read / write protected area it is only necessary to give up the barrier rise, so this object cannot be converted into a format different from the normal format.
  • step 1403 when an exception occurs during access to the read / write protected area, the computer (201) detects a memory access exception and activates a signal handler. If an exception has occurred, the process proceeds to step 1404. On the other hand, if no exception has occurred, the system waits for the exception to occur. Note that the computer (201) performs the following steps 1404 to 1410 using the activated signal handler.
  • step 1404 the computer (201) uses the signal handler to check whether the data address where the exception has occurred is a data address in the read / write protected area.
  • the occurrence of the exception is, for example, the occurrence of a segmentation fault. If the data address where the exception occurred is a data address in the read / write protected area, the process proceeds to step 1405. On the other hand, if the data address where the exception occurred is not a data address in the read / write protected area, the process proceeds to step 1406.
  • step 1405 the inverse conversion unit (212) uses the signal handler to change the pointer that has been converted according to the fact that the data address where the exception has occurred is a data address in the read / write protection area. Reverse conversion from to the original pointer.
  • the embodiment of the inverse conversion of the pointer is as described in the description of the inverse conversion unit (212). The operation of the inverse conversion unit (212) will be described in more detail below.
  • the signal handler needs to obtain a pointer to the beginning of the object that should have been accessed. This is because the computer (201) reads the header of the original object from the pointer to the head of the original object, and decompresses the compressed object when the original object is compressed. This is because it is necessary to decide. To obtain a pointer to the beginning of the original object, the signal handler does the following: Generally, the computer (201) can know the address of the instruction in which an exception has occurred by using the signal hand. When the instruction at the address is read out, for example, the computer (201) is represented in the format represented by the following formula 4. An instruction is obtained (see the detailed description of the invention corresponding to FIG. 18 below).
  • the computer (201) can read the register value when an exception occurs using the signal hand, the contents of the "register containing the pointer value" in the above format are read. Can do. Therefore, the JIT compiler or interpreter is modified so that the instruction for accessing the object has the format shown in the following equation 5.
  • the computer (201) reads out the instruction represented by Expression 2 using the signal hand, and further reads out “the pointer value to the head of the object”. Since the “pointer value to the beginning of the object” is actually a barrier pointer, the computer (201) performs unvarialization on the “pointer value to the beginning of the object” using the signal hand. As a result, the computer (201) can obtain a pointer value to the head of the original object.
  • the computer (201) performs the inverse transformation by reading and unvariating the base_reg_object_head (detailed description of the invention corresponding to FIG. 18). See the description).
  • the inverse conversion is performed by shifting the converted pointer to the left by the same n bits as the right shift of the n bits by n 140.
  • the inverse conversion refers to, for example, an instruction in which an exception has occurred, acquires a pointer to the head of the object in which the pointer has been converted from the instruction in which the exception has occurred, and reversely converts the acquired pointer. This is done by obtaining a pointer to the beginning of the original object.
  • the processing unit (213) confirms whether processing according to the object is necessary with reference to, for example, the header information of the object. For example, a code for identifying compression or delay allocation is written in the header of the object. For example, when “0” is written in a specific field of the header, it means a normal format, and when “1” is written in the field, it means a compressed format, and in the same field. When “2” is written, it means a format in which allocation is delayed. If processing according to the object is necessary, the processing proceeds to step 1409. On the other hand, if the process according to the object is not necessary, the process proceeds to step 1410.
  • the processing unit (213) uses the signal handler to refer to the header information of the object pointed to by the inversely converted original pointer, and performs processing suitable for the format of the object.
  • the processing suitable for the format of the object includes, for example, logging access to the object, returning the object to the original format, and accessing the field of the object in the new format.
  • logging access to an object it is possible to use the method for detecting access to an object, which is an embodiment of the present invention, even in program optimization.
  • Returning an object to its original form means, for example, decompressing the compressed object when the object to be accessed is compressed, or delaying assignment of the character array to be accessed.
  • step 1410 the execution unit (214) uses the signal handler to access the object pointed to by the original pointer after the inverse transformation. Then, the processing returns to step 1403.
  • step 1406 the computer (201) uses the signal handler to determine that the exception is an unauthorized access when the data address where the exception occurred is not a data address in the read / write protected area. And processing according to the unauthorized access. This processing is, for example, acquisition of a memory dump.
  • step 1407 the computer (201) ends the algorithm for detecting access to the object.
  • FIG. 15 shows a flowchart of an algorithm for handling memory access exceptions using pinning array slots, in accordance with an embodiment of the present invention.
  • step 1405 executed by the inverse transform unit (212)
  • unvarialization is performed using an expression [register containing the pointer value to the head of the object, offset] (see Expression 5).
  • the pointer value to the head of the original object can be obtained.
  • this algorithm can be used when there is access to an array object. Note that the algorithm of FIG. 15 differs from the algorithm of FIG.
  • Access to the array object can be an instruction sequence represented by the following equations 6-8.
  • Register X Pointer value to the beginning of the array object
  • the pointer value of Expression 6 is a barrier pointer
  • Such a value of the register X is referred to as an internal pointer because it indicates not the beginning of the object but the inside. Therefore, for access to such an array object, the JIT compiler or interpreter is modified so that it is accessed as represented by the following equations 9-12.
  • the pointer value to the head of the array object is stored in the pinning array slot (pinning_array_slot).
  • the pinning array slot is an area for storing a pointer value to the head of the object.
  • a pinning array slot is actually a slot in another register or stack.
  • a correspondence table is created from the instruction address of Equation 12 to the corresponding pinning array slot register or slot register or slot number. The signal handler draws the correspondence table using the address of the instruction in which the exception occurred as a key. If there is a corresponding pinning array slot, the pointer value to the head of the array object is read from the corresponding pinning array slot.
  • the read pointer value is a barrier pointer
  • the pointer value to the head of the original array object can be obtained by performing unvarialization.
  • This pinning array slot is already supported by, for example, Java TM VM, for example, as an internal pointer-aware GC, to allow the GC to move the object.
  • the internal pointer-aware GC is a GC that can handle a pointer pointing to the inside of an object. Therefore, there is actually no need to modify the JIT compiler or interpreter.
  • the above correspondence table needs to be newly prepared in the embodiment of the present invention.
  • the correspondence table itself becomes large and does not consume too much memory.
  • step 1501 the computer (201) starts an algorithm for handling a memory access exception using a signal handler. After the start of the algorithm, an exception occurs in accessing the read / write protected area, the signal handler is called, and the signal handler is executed.
  • step 1502 when an exception occurs during access to the read / write protected area, the computer (201) detects the exception and activates the signal handler. If an exception has occurred, the process proceeds to step 1503. On the other hand, if no exception has occurred, the system waits for the exception to occur. Note that the computer (201) performs the following steps 1503 to 1513 using the activated signal handler.
  • step 1503 the computer (201) uses the signal handler to check whether the data address where the exception has occurred is a data address in the read / write protected area.
  • the occurrence of the exception is, for example, the occurrence of a segmentation violation (also referred to as a segmentation fault).
  • a segmentation violation is a specific error condition that occurs during software execution, and is not allowed to access a location in memory, or in an unauthorized manner (eg, trying to write to a read-only location or operating system Occurs when trying to access a location in memory.
  • the process proceeds to step 1504.
  • the process proceeds to step 1505.
  • step 1504 the computer (201) uses the signal handler to determine whether there is a pinning array slot corresponding to the instruction address at which the exception occurred. Each such access is associated with a stack slot that contains a pointer to the head of the array object. This associated slot is referred to as a pinning array slot, as described above. Each instruction is associated with the pinning array slot. If there is a pinning array slot, the process proceeds to step 1507.
  • step 1507 the computer (201) reads the barrier pointer corresponding to the head address of the original object from the pinning array slot using the signal handler.
  • step 1510 the computer (201) reversely converts the read barrier pointer using the signal handler to obtain the head address of the original object.
  • the inverse transformation is as described above.
  • the computer (201) refers to the header information of the object pointed to by the inversely converted original pointer using the signal handler, and performs processing suitable for the format of the object.
  • the processing suitable for the format of the object includes, for example, logging access to the object, returning the object to the original format, and accessing the field of the object in the new format. Returning the object to the original form means, for example, when the object is compressed, expanding the compressed object, or allocating the character array in a delayed manner.
  • step 1512 the computer (201) uses the signal handler to access the object pointed to by the original pointer after the inverse transformation. Then, the process proceeds to step 1513.
  • step 1513 the computer (201) ends the algorithm for handling the memory access exception using the signal handler.
  • step 1505 the computer (201) uses the signal handler to determine that the exception is an illegal access if the data address where the exception occurred is not a data address in the read / write protected area. And processing according to the unauthorized access. This processing is, for example, acquisition of a memory dump.
  • step 1506 the computer (201) ends the algorithm for detecting access to the object using the signal handler.
  • step 1508 the computer (201) uses the signal handler to decode the instruction at the instruction address at which the exception has occurred, and reads the base register number into the memory.
  • the computer (201) can use the signal handler to read all register values when an exception occurs.
  • step 1509 the computer (201) reads the register value corresponding to the base register number read in step 1508 into the memory using the signal handler.
  • the read register value is a barrier pointer corresponding to the head address of the original object.
  • the process proceeds to step 1510, and as described above, the read register value (which is a barrier pointer) is inversely converted to obtain the head address of the original object.
  • FIG. 16 and FIG. 17 show examples of various barrierizing algorithms according to the embodiment of the present invention.
  • the barrier rise is executed in step 1402 of FIG.
  • FIG. 16 shows a flowchart of an algorithm for variableizing object allocation according to an embodiment of the present invention.
  • Steps 1601 to 1604 in FIG. 16 are one embodiment of the processing performed in step 1402 in FIG.
  • the computer (201) starts barrier rise.
  • the computer (201) allocates an object to the heap memory. Immediately after the object is allocated, there is only one pointer that points to the allocated object.
  • the computer (201) converts the pointer to point to the read / write protected area.
  • the computer (201) ends the algorithm in response to the end of the inverse transformation.
  • FIG. 17 shows a flowchart of an algorithm for barrierizing in the GC according to an embodiment of the present invention.
  • Steps 1701 to 1710 in FIG. 17 are one embodiment of the processing performed in step 1402 in FIG.
  • the computer (201) starts barrier rise.
  • the computer (201) empties the set S for storing pointers to pointers.
  • the computer (201) adds a GC root set such as a register or a stack to the set S.
  • the computer (201) checks whether an element is included in the set S. If there is an element in the set S, the process proceeds to step 1705. On the other hand, if the set S contains no element, the process proceeds to step 1706.
  • step 1705 the computer (201) extracts one element from the set S in response to the element being included in the set S. This extracted element is named element P. Element P is a pointer to a pointer.
  • step 1706 the computer (201) terminates the algorithm in response to the fact that no element is included in the set S.
  • step 1707 the computer (201) checks whether or not the object format pointed to by the pointer pointed to by the element P is a modified object format. If the format is modified, the process proceeds to step 1708. On the other hand, if the format is not modified, the process proceeds to step 1709.
  • step 1708 the computer (201) reads / write-protects the pointer pointed to by the element P in response to the object format pointed to by the pointer pointed to by the element P being a modified object format. The data is converted to point to the area and stored in the memory pointed to by P.
  • Step 1708 is a step of barrierizing in the GC.
  • the computer (201) processes the object Q pointed to by the pointer pointed to by the element P by a GC routine.
  • the GC routine typically marks object Q as if it were alive.
  • step 1710 the computer (201) adds a pointer to the pointer field (eg, 322 in FIG. 3) in the object Q to the set S.
  • FIG. 18A shows a virtual address space in step 1701 (before the start of GC) of FIG. 17, which is an embodiment of the present invention.
  • a virtual address space (1801) on the memory of the computer (201).
  • a read / write protection area (1802) on the memory of the computer (201).
  • a thread stack area (1803) No real memory is allocated to the read / write protected area (1802).
  • the thread stack area (1803) is a part of the GC root set.
  • the pointer (1821) of the object X (1811) points to the start address of the object Y.
  • the pointer (1822) of the object X (1811) points to the head address of the compressed object A (1812).
  • the pointer (1823) of the object Y (1813) points to the head address of the compressed object A (1812).
  • the pointer (1831) in the thread stack area points to the start address of the object X (1811).
  • Object A (1812) is in a compressed format. Therefore, it is necessary to convert the pointers (1822 and 1823) to the object A into barrier pointers.
  • FIG. 18B shows each object X, Y and A, each pointer value indicating the head of each object X, Y and A, and each barrier pointer value corresponding to each object X, Y and A.
  • the pointer of the normal object format is a pointer whose upper 2 bits of each pointer value are other than 11.
  • the barrier pointer is a value obtained by shifting the pointer of the normal object format to the right by the number of 2 bits and setting 11 to the free upper 2 bits.
  • FIG. 18C shows the four pointers shown in FIG. 18 to FIG. 25, and shows pointer values pointing to the respective pointers (notice that the pointers are not held by the pointers).
  • the pointer value indicating each of the pointers is a value given as a premise.
  • FIG. 19A shows the virtual address space in step 1703 of FIG. 17, which is an embodiment of the present invention.
  • the computer (201) adds a pointer value (000000) indicating a pointer in the stack area indicating the object X to the set S (FIG. 19B). .
  • FIG. 20A shows the virtual address space when processed through steps 1704 and 1705 of FIG. 17, which is an embodiment of the present invention.
  • step 1705 since the computer (201) takes out the element P from the set S, it takes out from the set S a pointer value (000000) that points to the pointer in the stack area that points to the object X (FIG. 20B).
  • FIG. 21A shows a virtual address space when processed through steps 1707, 1709 and 1710 of FIG. 17, which is an embodiment of the present invention.
  • the computer (201) adds a pointer to the pointer field in the object X to the set S (FIG. 21B). That is, the computer (201) collects a pointer value (001000) indicating the pointer in the object X indicating the object Y and a pointer value (001100) indicating the pointer in the object X indicating the object A. Add to S. Then, the computer (201) clears the element P. Note that the object X in FIG. 21A corresponds to the object Q in step 1710 in FIG.
  • FIG. 22A shows a virtual address space as processed through steps 1704, 1705, 1707, 1709 and 1710 of FIG. 17, which is an embodiment of the present invention.
  • the computer (201) retrieves the element P (here, the pointer value (001000) indicating the pointer in the object X indicating the object Y) from the set S, and thus the object X indicating the object Y.
  • a pointer value (001000) pointing to the pointer in is taken out from the set S.
  • the computer (201) adds a pointer to the pointer field in the object Y to the set S and clears the element P (FIG. 22B).
  • the computer (201) adds a pointer value (011100) that points to the object A and points to the pointer in the object Y to the set S, and also adds an element P (pointer in the object X that points to the object Y).
  • the pointer value pointing to (001000)) is cleared. Note that the object Y in FIG. 22A corresponds to the object Q in step 1710 in FIG.
  • FIG. 23A shows the virtual address space as processed through steps 1704, 1705, 1707 and 1708 of FIG. 17, which is an embodiment of the present invention.
  • the computer (201) retrieves an element P (here, a pointer value (001100) pointing to a pointer in the object X pointing to the object A) from the set S, so that the object X pointing to the object A A pointer value (001100) pointing to the pointer in is taken out from the set S.
  • the computer (201) rewrites the pointer (100000) in the object X that points to the object A (shifts to the right by 2 bits and adds 11 to the vacant bits). Convert to pointer (111000).
  • the computer (201) clears the element P. Note that the object A in FIG. 23A corresponds to the object Q in step 1710 in FIG.
  • FIG. 24A shows the virtual address space when processed through steps 1708, 1709, 1710, 1704, 1705, 1707 and 1708 of FIG. 17, which is an embodiment of the present invention.
  • the computer (201) retrieves an element P (here, a pointer value (011100) pointing to a pointer in the object Y pointing to the object A) from the set S, so that the object Y pointing to the object A A pointer value (011100) pointing to the pointer in is taken out from the set S.
  • the computer (201) rewrites the pointer (100000) in the object Y pointing to the object A (shifts to the right by 2 bits and adds 11 to the vacant bits). Convert to pointer (111000).
  • the computer (201) clears the element P. Note that the object A in FIG. 24A corresponds to the object Q in step 1710 in FIG.
  • FIG. 25A shows the virtual address space as processed through steps 1709, 1710, 1704 and 1706 of FIG. 17, which is an embodiment of the present invention.
  • the computer (201) clears the element P. Then, the process returns to step 1704, and the computer (201) advances the process to step 1706 and terminates since there are no elements in the set S.
  • FIG. 25B shows the virtual address space when barrier rise ends.
  • FIG. 26 shows an example of an operation of invoking a signal handler to recover (reverse) the original pointer from the converted pointer according to the embodiment of the present invention.
  • SIGSEGV indicates a segmentation violation signal.
  • a code (2601) is a code for performing the operation indicated by reference numeral 2602. Memory references are represented in the following format: [base_reg_object_head, reg_offset / imm_offset]. The access to the object (CPU memory access instruction) is “ld / st reg, It must be in the format [base_reg_object_head, reg / imm_offset] ”(load / store, load destination register, [register containing pointer value, offset]). The code (2601) performs the following operation (see 2602).
  • Decode the instruction with 0xab04; Read r12 into memory r3; (r12 is base_reg_object_head) When the most significant 2 bits of r12 are set, If 0xab04 is associated with a pinning array slot, Get the original pointer from the pinning array slot, If not, The original pointer is obtained by shifting left from r12 by a number of 2 bits, and the original pointer is recovered from the barrier pointer as if the object is pointed to by the original pointer.
  • FIG. 27 shows an example of a signal handler algorithm according to an embodiment of the present invention. Access via the barrier pointer always causes a hardware memory exception, which is converted into a signal by the OS.
  • the algorithm of FIG. 27 shows a signal handler algorithm implemented in Java TM VM. The details of the algorithm will be described below.
  • the OS passes to the signal handler the signal content that holds the exception code address, the exception data address, and the signal content of the register at the time of the hardware exception.
  • the signal handler first checks whether the exception data address is in the read / write protected area by address comparison (line 2). If the exception data address is in the read / write protected area, the signal handler must recover a pointer to the head of the object being accessed (hereinafter referred to as the “header pointer”). A pointer to the inside of the object (hereinafter referred to as “internal pointer”) is not sufficient. This is because the signal handler must refer to the header of the object to determine whether to perform profiling or recovery (line 11).
  • unvariable exception data addresses only generate internal pointers. If the Java TM VM supports a function for obtaining a header pointer from an internal pointer, that function can be used. Since there is generally no such support, it is necessary to limit the format of the object access instructions regardless of whether the object access instructions are code generated by a JIT compiler or interpreted code. This means that the register argument of the memory register must be a header pointer. For example, the format [base_reg, In the memory reference [offset_reg / immediate], base_reg must be a header pointer.
  • a variable header header can be obtained by decompressing the object access instruction and loading the contents of base_reg into the memory from the signal contents (lines 6-8). This limitation is usually satisfied in existing Java TM VM and JIT compilers.
  • this restriction can be broken when accessing large objects.
  • loop derived variable optimization and strength reduction in the JIT compiler can result in an internal pointer to the array.
  • the code generated by the JIT compiler is modified to maintain the header pointer in the method's register or in the stack slot.
  • Many JIT compilers already support this feature to help GC traverse the root object. Without this support, the GC cannot mark or move the object pointed to by the internal pointer.
  • the JIT compiler needs to be modified to associate each instruction that uses an internal pointer with the register number or stack offset that holds the header pointer. This allows the signal handler to obtain the header pointer from the exception code address (lines 3-4). Since most object access instructions do not use internal pointers, the associated data structure does not grow excessively.
  • the signal handler After unvarializing the header pointer (line 10), the signal handler performs a recovery operation or profiling depending on the header of the object. Objects that need recovery have special bits set in their headers. For profiling, the signal handler records the access (line 16) and emulates the execution of an exception instruction (line 17). For example, emulating a load means performing a load instead of an exception load instruction and writing the loaded value to a target register in the signal content. The signal handler is not allowed to write the unvaried pointer to the base register and return the exception instruction and re-execute it. Using this approach, the next instruction using the unvaried pointer no longer causes a hardware exception, and thus some of the accesses to be profiled are missed. Unfortunately, this approach can change the semantics of the program. Because some objects are represented by two different pointer values, the pointer-imquality instruction causes the false to be returned even if the two objects refer to the same object. Therefore, signal handlers need to emulate exception instructions.
  • FIG. 28 shows the experimental results regarding the relationship between the frequency of access to an object and the overhead according to the embodiment of the present invention.
  • the case where there is almost no access to the object pointed to by the pointer is, for example, the case where the object is compressed (see FIG. 4), or the case where the object is delayed (see FIG. 5).
  • the conventional persistent object database method it is necessary to perform a run-time check for all accesses of all objects.
  • an exception handling overhead is applied only to access to the object pointed to by the pointer. Therefore, according to the embodiment of the present invention, overhead is reduced.
  • FIG. 28 shows a graph of the results. From the graph, SPEC (Standard According to the compiler.compiler benchmark of Performance Evaluation Corporation) jvm2008, it can be seen that there is about 3% overhead when the number of bytes is 32 KB or 4 KB, but there is almost no overhead when the number of bytes is 64 MB or 4 MB.
  • SPEC Standard According to the compiler.compiler benchmark of Performance Evaluation Corporation
  • the object pointed to by the pointer is prepared as a compressed object (402) shown in FIG.
  • SPECjbb2005 Java (trademark)
  • FIG. Server Benchmark Benchmark program
  • a string object (502) is prepared in which the object pointed to by the pointer is assigned in a delayed manner as shown in FIG.
  • the string object (502) was used to execute the bloat benchmark program in the DaCapo benchmark on a computer that implements the method according to FIG. As a result, for the string object (502), the “bloat” benchmark was speeded up by 6%.
  • the access location of the object can be known using the embodiment of the present invention. This is because, as shown in step 1503 of FIG. 15, the instruction address where the exception has occurred is known and is the access location of the object. Therefore, it is only necessary to recompile the program with the JIT compiler and perform a runtime check for only the access location.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

本発明は、オブジェクトへのアクセスを効率良く行うことを目的とする。 本発明は、オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラムを提供する。当該方法は、上記オブジェクトへのポインタを操作して、当該ポインタを読み書き保護領域を指すポインタに変換するステップと、当該読み書き保護領域へのアクセス要求に応じて例外が発生することを利用して、上記変換されたポインタから元のポインタへ逆変換するステップとを含む。また、上記逆変換するステップは、上記例外が発生した命令を参照して、当該例外が発生した命令から、上記操作されたポインタを取得するステップと、当該取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得するステップとを含みうる。

Description

オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラム
 本発明は、コンピュータのメモリに保管されたオブジェクトへのアクセスを検出する技法に関し、特には変形されたオブジェクト・フォーマットを有するオブジェクトへのアクセスを検出する技法に関する。
 多くのプログラムでは、メモリのヒープ領域に多数のオブジェクトが動的に割り付けられる。当該オブジェクト・フォーマットは、例えば現在のJava(商標)仮想マシン(Virtual
Machine)実装においてプログラム実行を通じて固定されている。当該固定されたオブジェクト・フォーマットは、例えばヘッダ及びデータ・フィールドのレイアウト、並びにそれらのサイズである。ここで、メモリー・フットプリント(メモリ使用量)、メモリ帯域幅、キャッシュ・ミス、ガーベジ・コレクション(GC)頻度、及びGCオーバーヘッドを減少させることが、上記プログラムを実行するコンピュータのコストを減少させる上で有用である。そこで、上記固定されたオブジェクト・フォーマット(以下、「通常のオブジェクト・フォーマット」又は「元のオブジェクト・フォーマット」ともいう)を、上記コストを減少させるように変形し、上記プログラムに適用可能な多くのオブジェクト・フォーマット(以下、「変形されたオブジェクト・フォーマット」ともいう)が開発されている(下記図4~図6を参照)。
 オブジェクト・フォーマットが通常と異なり変形されている場合に、全てのアクセスでオブジェクト・フォーマットを確認する必要がある。しかしながら、全てのアクセスにおいてオブジェクト・フォーマットを確認することは、ランタイム・オーバーヘッドを生じ、しかもシステムのコスト面で不利である。
 また、オブジェクト・フォーマットが通常と異なり変形されている場合に、変形されたオブジェクト・フォーマットを有するオブジェクトを含むページを保護する必要がある。そのために、変形されたフォーマットを有するオブジェクトを回復するに際して、上記ページ中に含まれる全てのオブジェクト(当該変形されたフォーマットを有するオブジェクトを含む)が回復されなければならない(下記特許文献1及び下記図8を参照)。また、当該保護の他の例においては、ハードウェアのサポートが必要とされる(下記非特許文献1を参照)。
 特許文献1の発明は、メモリ領域に存在し所定の期間アクセスされないオブジェクトを隔離してメモリ領域を有効に使用するための方法に関し、特に、ヒープメモリ中に存在するオブジェクトを隔離するための方法に関する(段落0001)。特許文献1は、もしもユーザプログラムから準アクセス不可領域にアクセスがあった場合はシグナル・ハンドラに制御が移り、シグナル・ハンドラ中ではアクセスした仮想メモリアドレスが取得できるので、オブジェクトを同定してアクセスフラグを立てること、及び、次のGCの時にアクセスフラグが立っているオブジェクトは通常のヒープメモリ領域に戻してフラグをクリアすることを記載する(段落0114)。
 下記特許文献2の発明は、マルチタスク処理が可能なマルチタスク制御方法及び記憶媒体に関する(段落0001)。特許文献2は、割込みシグナル等の事象が発生した場合に、シグナル・ハンドラが割込みの発生を検出すると、シグナル・ハンドラはスーパーシグナルスレッドへ割り込みイベントの発生を通知する旨を記載する(段落0064)。
 下記非特許文献2は、オブジェクトの圧縮方法を開示する。
 下記非特許文献3は、永続的なオブジェクトへのアクセス方法を開示する。
特開2010-015223号公報 特開2000-066904号公報
Cliff Click et al., "The Pauseless GC Algorithm", [online], VEE’05,pp. 46 - 56, June 11-12, 2005, インターネット〈URLhttps://www.usenix.org/events/vee05/full_papers/p46-click.pdf〉 Jennifer B. Sartor et al., "No Bit Left Behind: The Limits of HeapData Compression", [online], ISMM’08, pp. 111-120, June 7-8, 2008, インターネット〈URLhttp://www.cs.utexas.edu/~jbsartor/ismm08-limits-compression.pdf〉 Charles Lamb et al., "THE OBJECT STORE DATABASE SYSTEM",Communication of the ACM, Vol. 34, No. 10, pp. 50-63, October 1991
 本発明は、コンピュータのメモリに保管されたオブジェクトへのアクセスを効率良く行うことを目的とする。特には、本発明は、変形されたオブジェクト・フォーマットを有するオブジェクトへのアクセスを効率良く行うことを目的とする。
 本発明は、オブジェクトへのアクセスを検出する方法、並びにコンピュータ・プログラム及びコンピュータを提供する。本発明は、オブジェクトへのポインタを操作して、当該ポインタを読み書き保護領域を指すポインタに変換し、当該読み書き保護領域へのアクセス要求に応じて例外が発生することを利用して、上記変換されたポインタから元のポインタへ逆変換することを特徴とする。当該逆変換によって元のポインタが回復されるので、元のポインタが指すオブジェクトを検出すること、そして当該元のポインタが指すオブジェクトへアクセスすることが可能になる。
 また、本発明の1つの実施態様では、上記逆変換は、例外が発生した命令を参照して、当該例外が発生した命令から、上記操作されたポインタを取得すること、当該取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得することを含む。当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得することによって、上記元のポインタが指すオブジェクトを検出すること、そして当該元のポインタが指すオブジェクトへアクセスすることが可能になる。
 また、本発明のさらに別の実施態様では、上記逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照して、当該逆変換された元のポインタが指すオブジェクト(参照されたヘッダ情報を有するオブジェクトでもある)のフォーマットに適した処理が行われうる。当該処理は、例えば、アクセスされる圧縮されたオブジェクトの伸長、又は、アクセスされるオブジェクトの遅延割り当てである。
 本発明の実施態様に従うと、読み書き保護領域へのアクセス要求に応じて例外が発生することを利用して、元のポインタが回復されるので当該元のポインタがアクセスするオブジェクトへ効率良くアクセスを行うことが可能である。また、本発明の実施態様に従うと、逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得することが可能であるので、元のポインタが指すオブジェクトを容易に検出することが可能である。また、本発明の実施態様に従うと、逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照し、当該参照されたヘッダ情報を有するオブジェクトのフォーマットに適した処理が行われるので、オブジェクト・フォーマットが通常と異なり変形されている場合であっても、当該異なるフォーマットを有するオブジェクトへ容易にアクセスすることが可能である。このことは、通常のオブジェクト・フォーマットに比べてメモリ使用量の少ないフォーマットを採用することを可能にし、さらにこのことはシステムのコストの低減ないしは処理速度の向上をもたらす。
本発明の実施形態におけるコンピュータ・ハードウェアの基本的なブロック図を示す。 図1に示すコンピュータ・ハードウェアの機能を有し、本発明の実施態様に従うシステムの機能ブロック図を示す。 オブジェクト、及びオブジェクトへのポインタの例を示す。 通常のオブジェクト・フォーマットが、圧縮により変形されたオブジェクト・フォーマットの例を示す。 通常のオブジェクト・フォーマットが、ポインタを使用して文字配列を指定することにより変形されたオブジェクト・フォーマットの例を示す。 通常のオブジェクト・フォーマットが、フィールド再配置により変形されたオブジェクト・フォーマットの例を示す。 従来技術である、永続的なオブジェクト・データベース方式における、オブジェクトへのアクセス方法を示す。 従来技術である、永続的なオブジェクト・データベース方式における、圧縮されたオブジェクトへのアクセス方法を示す。 本発明の実施態様に従う、ポインタを読み書き保護領域を指すように変換した場合のオブジェクトへのアクセス方法を示す。 本発明の実施態様に従う、ポインタを読み書き保護領域を指すように変換した場合のオブジェクトへのアクセス方法を示す。 本発明の実施態様に従う、オブジェクトへのポインタを、読み書き保護領域を指すように変換する例を示す。 本発明の実施態様に従う、読み書き保護領域がヒープ領域と同じサイズである場合におけるバリア・ポインタの例を示す。 本発明の実施態様に従う、読み書き保護領域がヒープ領域よりも小さいサイズである場合におけるバリア・ポインタの例を示す。 本発明の実施態様に従う、読み書き保護領域がOS保護領域である場合におけるバリア・ポインタの例を示す。 本発明の実施態様に従う、オブジェクトへのアクセスを検出する方法のフローチャートを示す。 本発明の実施態様に従う、オブジェクトの先頭へのポインタ値を格納するスロットを使用してメモリ・アクセス例外を処理するアルゴリズムのフローチャートを示す。 本発明の実施態様に従う、オブジェクトの割り付けにおいて、オブジェクトへのポインタを読み書き保護領域を指すように変換するアルゴリズムのフローチャートを示す。 本発明の実施態様に従う、ガーベジ・コレクションにおいて、オブジェクトへのポインタを読み書き保護領域を指すように変換するアルゴリズムのフローチャートを示す。 本発明の実施態様である、図17のステップ1701(GC開始前)における仮想アドレス・スペースを示す。 本発明の実施態様である、図17のステップ1703における仮想アドレス・スペースを示す。 本発明の実施態様である、図17のステップ1704及び1705を通じて処理される場合における仮想アドレス・スペース、並びに要素P及び集合Sの内容を示す。 本発明の実施態様である、図17のステップ1707、1709及び1710を通じて処理される場合における仮想アドレス・スペース、並びに要素P及び集合Sの内容を示す。 本発明の実施態様である、図17のステップ1704、1705、1707、1709及び1710を通じて処理される場合における仮想アドレス・スペース、並びに要素P及び集合Sの内容を示す。 本発明の実施態様である、図17のステップ1704、1705、1707及び1708を通じて処理される場合における仮想アドレス・スペース、並びに要素P及び集合Sの内容を示す。 本発明の実施態様である、図17のステップ1708、1709、1710、1704、1705、1707及び1708を通じて処理される場合における仮想アドレス・スペース、並びに要素P及び集合Sの内容を示す。 本発明の実施態様である、図17のステップ1709、1710、1704及び1706を通じて処理される場合における仮想アドレス・スペース、並びに要素P及び集合Sの内容を示す。 本発明の実施態様に従う、シグナル・ハンドラを呼び出して、変換されたポインタから元のポインタを回復(逆変換)させる動作の例を示す。 本発明の実施態様に従う、シグナル・ハンドラ・アルゴリズムの例を示す。 本発明の実施態様に従う、オブジェクトへのアクセスの頻度とオーバーヘッドとの関係についての実験結果を示す。
 本発明の実施形態を、以下に図面に従って説明する。以下の図を通して、特に断らない限り、同一の符号は同一の対象を指す。本発明の実施形態は、本発明の好適な態様を説明するためのものであり、本発明の範囲をここで示すものに限定する意図はないことを理解されたい。
 図1は、本発明の実施形態におけるコンピュータ・ハードウェアの基本的なブロック図を示す。
 コンピュータ(101)は、CPU(102)とメイン・メモリ(103)とを備えており、これらはバス(104)に接続されている。CPU(102)は好ましくは、32ビット又は64ビットのアーキテクチャに基づくものであり、例えば、インテル社のCore i(商標)シリーズ、Core 2(商標)シリーズ、Atom(商標)シリーズ、Xeon(商標)シリーズ、Pentium(登録商標)シリーズ、Celeron(登録商標)シリーズ、AMD社のPhenom(商標)シリーズ、Athlon(商標)シリーズ、Turion(商標)シリーズ又はSempron(商標)が使用されうる。バス(104)には、ディスプレイ・コントローラ(105)を介して、ディスプレイ(106)、例えば液晶ディスプレイ(LCD)が接続されうる。ディスプレイ(106)は、コンピュータの管理のために、通信回線を介してネットワークに接続されたコンピュータについての情報と、そのコンピュータ上で動作中のソフトウェアについての情報を、適当なグラフィック・インタフェースで表示するために使用される。バス(104)にはまた、SATA又はIDEコントローラ(107)を介して、記憶装置(108)、例えばハードディスク又はシリコン・ディスクと、ドライブ(109)、例えばCD、DVD又はBDドライブとが接続されうる。バス(104)にはさらに、キーボード・マウスコントローラ(110)又はUSBバス(図示せず)を介して、キーボード(111)及びマウス(112)が接続されうる。
 記憶装置(108)には、オペレーティング・システム、J2EEなどのJava(登録商標)処理環境、Java(登録商標)アプリケーション、Java(登録商標)仮想マシン(VM)、Java(登録商標)実行時(JIT)コンパイラを提供するプログラム、その他のプログラム、及びデータが、メイン・メモリ103にロード可能に記憶されている。
 ドライブ(109)は、必要に応じて、CD-ROM、DVD-ROM又はBDからプログラムを記憶装置(108)にインストールするために使用される。
 通信インタフェース(114)は、例えばイーサネット(登録商標)・プロトコルに従う。通信インタフェース(114)は、通信コントローラ(113)を介してバス(104)に接続され、コンピュータ(101)を通信回線(115)に物理的に接続する役割を担い、コンピュータ(101)のオペレーティング・システムの通信機能のTCP/IP通信プロトコルに対して、ネットワーク・インタフェース層を提供する。なお、通信回線(115)は、有線LAN環境、又は例えばIEEE802.11a/b/g/nなどの無線LAN接続規格に基づく無線LAN環境であってもよい。
 図2は、図1に示すコンピュータ(101)のハードウェア機能を有し、本発明の実施態様に従うコンピュータ(201)の機能ブロック図を示す。
 コンピュータ(201)は、図1に示す例えばCPU(102)、メイン・メモリ(103)及び記憶装置(108)に加えて、変換部(211)、逆変換部(212)を備えている。コンピュータ(201)は、さらに、処理部(213)及び実行部(214)を備えうる。
 変換部(211)は、オブジェクトへのポインタを操作して、当該ポインタを読み書き保護領域を指すポインタに変換する。
 本発明の1つの実施態様として、変換部(211)は、例えば、下記(1)~(3)に示す変換処理を行いうる。
 (1)ポインタに一定のオフセット値を加えて、読み書き保護領域を指すポインタ(変換されたポインタ)を得る。
 (2)オブジェクトへのポインタをnビット数分(nは整数である)右シフトし、そして一定のオフセット値を加えて、読み書き保護領域を指す(変換されたポインタ)を得る。
 (3)オブジェクトへのポインタをnビット数分(nは整数である)右シフトし、そして空いた左(上位)ビットに読み書き保護領域のアドレスを埋め込んで、読み書き保護領域を指す(変換されたポインタ)を得る。
 変換部(211)は、上記変換を、例えば、オブジェクトの割り付けにおいて、又は、ガーベジ・コレクションにおいて行う。
 逆変換部(212)は、読み書き保護領域へのアクセス要求に応じて例外が発生することを利用して、上記変換されたポインタから元のポインタへ逆変換する。
 本発明の1つの実施態様として、逆変換部(212)は、上記例外が発生した命令を参照して、当該例外が発生した命令から、上記操作されたポインタを取得し、当該取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得する。
 本発明の他の実施態様として、逆変換部(212)は、例外が発生した命令アドレスと、オブジェクトの先頭へのポインタ値を格納するスロット(ピンニング・アレイ・スロットともいう)のレジスタ又はスロット番号との対応表を参照して、当該例外が発生した命令アドレスから、前記操作されたポインタを取得し、当該取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得する。 本発明の他の実施態様として、逆変換部(212)は、
 上記変換部(211)で行われた(1)~(3)に対応して、下記(1’)~(3’)に示す逆変換処理を行いうる。
 (1’)上記(1)において変換されたポインタから一定のオフセット値を減じて、元のポインタを得る。
 (2’)上記(2)において変換されたポインタから一定のオフセット値を減じ、そして上記(2)と同じnビット数分左シフトして、元のポインタを得る。
 (3’)上記(3)において変換されたポインタを上記(3)と同じnビット数分左シフトして、元のポインタを得る。
 処理部(213)は、逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照して、当該参照されたヘッダ情報を有するオブジェクトのフォーマットに適した処理をする。当該フォーマットに適した処理は、例えば、圧縮オブジェクトの伸長、又は、文字配列の遅延割り当てである。
 実行部(214)は、フォーマットに適した処理を行った後に、逆変換された元のポインタが指すオブジェクトにアクセスする。
 図3は、オブジェクト、及びオブジェクトへのポインタの例を示す。
 「オブジェクト」は、プログラム上の抽象化された手続きの対象を具体化したものであり、プログラム中に記述されるオブジェクトの割り付け場所から生成されるオブジェクトである。「オブジェクト」は、プログラムの実行時に、メモリ内、例えばヒープ領域内に割り付けられる。「オブジェクト」は、例えばクラスから生成される。「オブジェクト」は、プログラムの実行が、例えば中断又は完了した場合であっても、ヒープ領域に存在しうる。ヒープ領域は、プログラムに使用されるヒープ領域全体ではなく、当該ヒープ領域全体の一部であって、オブジェクトが割り付けられる領域である。ヒープ領域は、例えば、GCの対象となるヒープ領域である。
 「オブジェクト」は、典型的には、ヘッダ及び少なくとも1のフィールドを含む(下記図4及び図6を参照)。ヘッダは、オブジェクト内に埋め込まれた、オブジェクト自体の情報を保持する部分であり、例えばオブジェクトのサイズ及び種類の情報を含む。フィールドは、オブジェクトの利用者がアクセス可能な部分であり、例えばポインタと非ポインタの2種類のデータを有する。ポインタとは、メモリ領域上のある場所を参照する値であり、多くの言語処理系では,オブジェクトへのポインタはオブジェクトの先頭アドレスを参照する(図3を参照)。非ポインタは、プログラミングにおいて、値そのものを利用するものであり、数値、文字、及び/又は真偽値を包含する。
 「オブジェクト」は、メモリ領域上に割り付けられる。GCは、配置されたオブジェクトを状況に応じて、移動したり、破棄したりする。
 「オブジェクトのフォーマット」には、所謂、通常のオブジェクト・フォーマット、及び、通常のオブジェクト・フォーマットが変形されたオブジェクト・フォーマット(以下、「変形されたオブジェクト・フォーマット」ともいう)を包含する。
 「通常のオブジェクト・フォーマット」は、例えば、Java(商標)、C♯、Script(PHP又はPerl)、Ruby、C、C++、LISP、Python又はHaskellの実装中に見られるフォーマットであり、特に変形されていないフォーマットをいう。Java(商標)において、オブジェクト・フォーマットは、Java(商標)の実装中(すなわち、メモリ内)でしか見られない。通常のオブジェクト・フォーマットは、オブジェクトのクラスによって異なる。
 「変形されたオブジェクト・フォーマット」とは、メモリー・フットプリント(メモリ使用量)、メモリ帯域幅、キャッシュ・ミス、ガーベジ・コレクション頻度、及びGCオーバーヘッドを減少させることを目的として、通常のオブジェクト・フォーマットが変形されたオブジェクト・フォーマットである。オブジェクト・フォーマットの変形例は、下記図4~図6に示されているが、本発明はこれらの変形例に限定されるものでない。
 オブジェクトX(311)は、その中にポインタ(321)を有する。ポインタ(321)は、オブジェクトA(312)へのアクセスを示し、オブジェクトA(312)の先頭のアドレスを有する。オブジェクトA(312)は、ポインタ(321)のターゲット・オブジェクトでもある。オブジェクトA(312)は、通常のオブジェクト・フォーマットを有するオブジェクト、又は、変形されたオブジェクト・フォーマットのいずれであってもよい。
 オブジェクトY(331)は、その中にポインタ(341)を有する。ポインタ(341)は、オブジェクトB(332)へのアクセスを示し、オブジェクトB(332)の先頭アドレスを有する。オブジェクトB(332)は、ポインタ(341)のターゲット・オブジェクトでもある。オブジェクトB(332)は、その中にポインタ(342)を有する。ポインタ(342)は、オブジェクトC(333)へのアクセスを示し、オブジェクトC(333)の先頭アドレスを有する。オブジェクトC(333)は、ポインタ(342)のターゲット・オブジェクトでもある。このように、ポインタを順に読み取り、当該読み取られたポインタからさらに他のオブジェクトへのアクセスが示される。オブジェクトB(332)及びオブジェクトC(333)はそれぞれ、通常のオブジェクト・フォーマットを有するオブジェクト、又は、変形されたオブジェクト・フォーマットのいずれであってもよい。
 図4は、通常のオブジェクト・フォーマットが、圧縮により変形されたオブジェクト・フォーマットの例を示す。
 圧縮により変形されるとは例えば、ある文字配列(character array(s))又はある部位に割り当てられた文字配列がアクセスされない傾向にあり且つそれら文字配列がアスキー(ASCII)文字列のみを含む場合に、当該文字配列が圧縮されうることをいう。オブジェクトの圧縮は、オブジェクト・アクセスの最適化をもたらす。
 オブジェクト・フォーマット(401)は、通常のフォーマットを示す。オブジェクト・フォーマット(402)は、オブジェクト・フォーマット(401)が圧縮により変形された場合のフォーマットを示す。
 オブジェクト・フォーマット(401)は、ヘッダ(411)並びに、ヌル値のデータ・フィールド(412、414、416及び418)及びアスキーのデータ・フィールド(413、415、417及び419)を含む。オブジェクト・フォーマット(402)は、ヘッダ(421)及び、アスキーのデータ・フィールド(422~425)を含む。 
 変形されたオブジェクト・フォーマット(402)では、オブジェクト・フォーマット(401)のヌル値のデータ・フィールド(412、414、416及び418)が削除され、且つアスキーのデータ・フィールド(413、415、417及び419)が結合されている。変形されたオブジェクト・フォーマット(402)のデータ・フィールドの数は4であり、オブジェクト・フォーマット(401)のデータ・フィールドの数は8であることから、変形されたオブジェクト・フォーマット(402)のデータ・フィールドはオブジェクト・フォーマット(401)のデータ・フィールドの半分に圧縮されている。変形されたオブジェクト・フォーマット(402)では、データ・フィールドの数が圧縮されているので、オブジェクト・フォーマット(401)に比べてメモリのコストを低減することが可能である。
 オブジェクトの圧縮方法については、多くの知られている方法がある(非特許文献2を参照)。
 図5は、通常のオブジェクト・フォーマットが、ポインタを使用して文字配列を指定することにより変形されたオブジェクト・フォーマットの例を示す。
 ポインタを使用して文字配列を指定するとは例えば、ある部位に割り当てられた複数のストリング・オブジェクトがアクセスされない傾向にあり且つそれらストリング・オブジェクトが他のストリング・オブジェクトと連結されることによって生成される場合に、当該連結されうる文字配列がポインタを使用して文字配列を指定されることをいう。当該ポインタを使用する文字配列の割り当ては、遅延的に(lazily)生じうる。遅延割り当ては、オブジェクトが実際に必要とされるまで当該オブジェクトを割り当てないので、オブジェクト・アクセスの最適化をもたらす。
 オブジェクト・フォーマット(501)は、通常のフォーマットを示す。オブジェクト・フォーマット(502)は、オブジェクト・フォーマット(501)が変形された場合のフォーマットを示す。
 オブジェクト・フォーマット(501)では、文字配列(512)及び文字配列(522)の2つが異なる位置に割り当てられている場合に、文字配列(512)及び文字配列(522)が結合されて、文字配列(532)が新たに生成されることを示す。文字配列(532)の生成は、遅延的に生じうる。オブジェクト・フォーマット(502)では、文字配列(542)及び文字配列(552)が異なる位置に割り当てられている場合に、文字配列(542)及び文字配列(552)のそれぞれが、2つのポインタ(562及び563)を使用して指定されることを示す。
 変形されたオブジェクト・フォーマット(502)では、オブジェクト・フォーマット(501)の文字配列(532)の代わりに2つのポインタ(562及び563)を有している点で異なっている。オブジェクト・フォーマット(502)では、文字配列(532)の代わりに2つのポインタ(562及び563)を有しているので、メモリのコストを低減することが可能である。
 図6は、通常のオブジェクト・フォーマットが、フィールド再配置により変形されたオブジェクト・フォーマットの例を示す。
 フィールド再配置とは例えば、オブジェクト中の2つ又はそれ以上のフィールドが同時にアクセスされる傾向にある場合に、当該2つ又はそれ以上のフィールドについてのデータキャッシュミスを減少させるために、当該2つ又はそれ以上のフィールドが同一場所に配置(co-locate)されることを示す。
 オブジェクト・フォーマット(601)は、通常のフォーマットを示す。オブジェクト・フォーマット(602)は、オブジェクト・フォーマット(601)が変形された場合のフォーマットを示す。
 オブジェクト・フォーマット(601)は、ヘッダ(611)及び、データ・フィールドを1~6(612~617)の順で含む。オブジェクト・フォーマット(602)は、ヘッダ(621)及び、データ・フィールドを1、6、3、4、5及び2(622~627)の順で含む。
 データ・フィールド1(612)及びデータ・フィールド6(617)は、同時にアクセスされる傾向にあるとする。
 オブジェクト・フォーマット(601)では、同時にアクセスされる傾向にあるデータ・フィールド1(612)及びデータ・フィールド6(617)が離れて存在している。そこで、変形されたオブジェクト・フォーマット(602)では、データ・フィールド1(622)に隣にデータ・フィールド6(623)が位置するように変形されている。変形されたオブジェクト・フォーマット(602)では、同時にアクセスされる傾向にあるデータ・フィールド1(622)及びデータ・フィールド6(623)が隣に位置するように変形されているので、メモリ・アクセスのコストを低減することが可能である。
 以下では、本発明の実施態様に従う、ポインタを読み書き保護領域を指すように変換した場合のオブジェクトへのアクセス方法(下記図9A及び図9Bを参照)の内容をより理解しやすくするために、従来技術である永続的なオブジェクト・データベース方式における、オブジェクトへのアクセス方法(下記図7及び図8を参照)をまず説明する。
 図7は、従来技術である、永続的なオブジェクト・データベース方式における、オブジェクトへのアクセス方法を示す。
 永続的なオブジェクト・データベース方式によるオブジェクトへのアクセスは下記の特徴を有する:(1)オブジェクトへのアクセスの監視がページ単位である;(2)当該方式が向いているケースはページ単位でアクセスの局所性がある場合である;及び、(3)当該方式の適用分野は、主に、データベース及びディスクへの分野であり、特にスワッピング・アウト/又はスワッピング・インにおいてである。図7に示す永続的なオブジェクトへのアクセス方法は、例えば非特許文献3に示されている。
 コンピュータ(201)のメモリ上に仮想アドレス・スペース(701)がある。仮想アドレス・スペース(701)上に、読み書き保護ページ(702)がある。オブジェクトX(721)のポインタは読み書き保護ページ内のオブジェクトA(741を参照)の先頭アドレスを示し、及び、オブジェクトA(741を参照)のポインタはオブジェクトB(742を参照)の先頭アドレスを示しているとする。また、オブジェクトY(731)のポインタはオブジェクトC(743を参照)の先頭アドレスを示しているとする。オブジェクトA(741を参照)、オブジェクトB(742を参照)及びオブジェクトC(743を参照)は、読み書き保護ページ(702)内にあるとする。
 図7の上図に示されているように、コンピュータ(201)が、オブジェクトX(721)からポインタを辿ってオブジェクトAにアクセスしたとする。そのオブジェクトAへのポイント先が読み書き保護ページ(702)である場合、コンピュータ(201)は、シグナル・ハンドラを使用して、全スレッドの実行を停止し、読み書き保護ページ(702)の保護を外す。保護を外した後の仮想アドレス・スペース(701)を図7の下図に示す。そして、当該下図に示されるように、コンピュータ(201)は、シグナル・ハンドラを使用して、オブジェクトA(741)をディスク又はリモートマシンからメモリ上にロードして、プログラムの実行を再開する。しかしながら、上記方法では、上記ロードにおいて、コンピュータ(201)は、オブジェクトA(741)だけでなく、当該オブジェクトA(741)と同じ読み書き保護ページ(702)内にあったオブジェクトB(742)及びオブジェクトC(743)もメモリ上にロードする。従って、メモリのコストが増大するというデメリットがある。
 図7の下図では、ロードされたオブジェクトA(741)から指されているオブジェクトがまだロードされていない場合、コンピュータ(201)は、新たな読み書き保護ページ(703)を割り当てて、オブジェクトA(741)のポインタがその読み書き保護ページ(703)を指すようにすることを示す。同様に、図7の下図では、ロードされたオブジェクトC(743)から指されているオブジェクトがまだロードされていない場合、コンピュータ(201)は、新たな読み書き保護ページ(703)を割り当てて、オブジェクC(743)のポインタがその読み書き保護ページ(703)を指すようにすることを示す。
 図8は、従来技術である、永続的なオブジェクト・データベース方式における、圧縮されたオブジェクトへのアクセス方法を示す。
 永続的なオブジェクト・データベース方式の特徴は上記において述べたとおりである。 
 コンピュータ(201)のメモリ上に仮想アドレス・スペース(801)がある。仮想アドレス・スペース(801)上に、読み書き保護ページ(802)がある。オブジェクトX(821)のポインタは圧縮オブジェクトA(822)の先頭アドレスを示し、及び、圧縮オブジェクトA(822)のポインタは圧縮オブジェクトB(823)の先頭アドレスを示しているとする。また、圧縮オブジェクトY(831)のポインタは圧縮オブジェクトC(832)の先頭アドレスを示しているとする。圧縮オブジェクトA(822)、圧縮オブジェクトB(823)及び圧縮オブジェクトC(832)は、読み書き保護ページ(802)内にあるとする。
 図8の上図に示されているように、コンピュータ(201)が、オブジェクトX(821)からポインタを辿ったとする。そのポイント先が読み書き保護ページ(802)である場合、コンピュータ(201)は、シグナル・ハンドラを使用して、全スレッドの実行を停止し、読み書き保護ページ(802)の保護を外す(812)。保護を外した後の仮想アドレス・スペース(801)を図8の下図に示す。そして、当該下図に示されるように、コンピュータ(201)は、シグナル・ハンドラを使用して、圧縮オブジェクトA(822)をメモリ上に伸長し、プログラムの実行を再開する。しかしながら、上記方法では、上記伸長において、圧縮オブジェクトA(822)だけでなく、当該圧縮オブジェクトA(822)と同じ読み書き保護ページ(802)内にある圧縮オブジェクトB(823)及び圧縮オブジェクトC(832)をもメモリ上に伸長する。従って、メモリのコストが増大するというデメリットがある。
 図9A及び図9Bは、本発明の実施態様に従う、ポインタを読み書き保護領域を指すように変換した場合のオブジェクトへのアクセス方法を示す。
 本発明の実施態様に従う、オブジェクトへのアクセスは下記の特徴を有する:(1)オブジェクトへのアクセスの監視がページ単位でなく、個々のオブジェクト単位である;(2)当該方式が向いているケースはページ単位でアクセスの局所性がある場合でなく、ヒープ中に散らばっているオブジェクト毎に監視したい場合である;及び、(3)本発明の実施態様の適用分野は、主に、オブジェクト・アクセスのプロファイリング、オブジェクトの圧縮、オブジェクトの遅延割り付け、及びオブジェクトの再配置である。
 図9Aにおいて、コンピュータ(201)のメモリ上に仮想アドレス・スペース(901)がある。仮想アドレス・スペース(901)上に、読み書き保護領域(902)がある。オブジェクトX(921)のポインタは読み書き保護領域(902)のアドレス(922)を示し、圧縮オブジェクトA(923)のポインタは読み書き保護領域(902)のアドレス(924)を示しているとする。また、オブジェクトY(931)のポインタは読み書き保護領域(902)のアドレス(932)を示しているとする。
 ここで留意すべきことは、オブジェクトX(921)のポインタは圧縮オブジェクトA(923)を指すアドレス(すなわち、圧縮オブジェクトAの先頭アドレス)から、読み書き保護領域(902)を指すポインタに変換されていることである。また、圧縮オブジェクトA(923)のポインタは圧縮オブジェクトB(925)を指すアドレス(すなわち、圧縮オブジェクトBの先頭アドレス)から、読み書き保護領域(902)を指すポインタに変換されていることである。また、オブジェクトY(931)のポインタは圧縮オブジェクトC(933)を指すアドレス(すなわち、圧縮オブジェクトCの先頭アドレス)から、読み書き保護領域(902)を指すポインタに変換されていることである。
 本明細書において、上記のように、ターゲット・オブジェクトへのポインタを読み書き保護領域を指すように変換(コード操作)することを「バリアライズ」(barrierize)という。バリアライズは、割り当てにおいて又はGCにおいて行われる。このバリアライズは、本発明の実施態様において、全てのオブジェクトにおいて行われうる。
 本明細書において、上記バリアライズによって変換されたポインタを、「バリア(barrier)・ポインタ」という。バリア・ポインタという名は、本発明者によって名付けられたものである。バリア・ポインタを介する全てのアクセスは、例外を生じさせる。
 上記変換によって各オブジェクトのポインタは読み書き保護領域(902)を指すように変換されるが、読み書き保護領域(902)内にオブジェクトそれ自体は実際には存在しないことに留意されたい。
 コンピュータ(201)が、オブジェクトX(921)からポインタを辿ったとする。そのポイント先が読み書き保護領域(902)のアドレス(922)を示しているとする。従って、読み書き保護領域(902)へのアクセス要求が生じる。ポイント先が読み書き保護領域(902)のアドレスを示しているので、当該アクセス要求に応じて例外が発生する。当該例外が発生することに応じて、コンピュータ(201)は、シグナル・ハンドラを使用して、オブジェクトX(921)のポインタから元のポインタを逆変換する。そして、コンピュータ(201)は、シグナル・ハンドラを使用して、アクセスされる圧縮オブジェクトA(923)のみを伸長する。圧縮オブジェクトA(923)のみを伸長した後の仮想アドレス・スペース(901)を図9Bに示す。図9Bに示すように、圧縮オブジェクトA(923)のみが伸長され、圧縮オブジェクトB(925)及び圧縮オブジェクトC(933)は伸長されない。すなわち、本発明の実施態様において、アクセスされるオブジェクトのみ、すなわち圧縮オブジェクトA(923)のみを伸長すればよい。コンピュータ(201)は、伸長されたオブジェクトA(943)へのアクセスを行い、プログラムの実行を再開する。
 同様に、コンピュータ(201)が、オブジェクトA(943)からポインタを辿ったとする。そのポイント先が読み書き保護領域(902)のアドレス(924)を示しているとする。従って、読み書き保護領域(902)へのアクセス要求が生じる。ポイント先が読み書き保護領域(902)のアドレスを示しているので、当該アクセス要求に応じて例外が発生する。当該例外が発生することに応じて、コンピュータ(201)は、シグナル・ハンドラを使用して、オブジェクトA(943)のポインタから元のポインタを逆変換する。そして、コンピュータ(201)は、シグナル・ハンドラを使用して、アクセスされる圧縮オブジェクトB(925)のみを伸長する。すなわち、圧縮オブジェクトC(933)は伸長されない。コンピュータ(201)は、伸長されたオブジェクトB(925)(図示せず)へのアクセスを行い、プログラムの実行を再開する。
 同様に、コンピュータ(201)が、オブジェクトY(931)からポインタを辿ったとする。そのポイント先が読み書き保護領域(902)のアドレス(932)を示しているとする。従って、読み書き保護領域(902)へのアクセス要求が生じる。ポイント先が読み書き保護領域(902)のアドレスを示しているので、当該アクセス要求に応じて例外が発生する。当該例外が発生することに応じて、コンピュータ(201)は、シグナル・ハンドラを使用して、オブジェクトY(931)のポインタから元のポインタを逆変換する。そして、コンピュータ(201)は、シグナル・ハンドラを使用して、アクセスされる圧縮オブジェクトC(933)のみを伸長する。コンピュータ(201)は、伸長されたオブジェクトC(933)(図示せず)へのアクセスを行い、プログラムの実行を再開する。
 本明細書において、上記バリアライズによって変換されたポインタを元に戻すように逆変換(コード操作)することを「アンバリアライズ」(unbarrierize)という。
 以上の通り、本発明の実施態様に従う方法では、アクセスされるオブジェクトのみ、すなわち圧縮オブジェクトA(923)のみを伸長すればよく、他の圧縮されたオブジェクトは影響されないことからメモリのコストが低減できる。言い換えれば、個々のオブジェクトを対象として当該個々のオブジェクトのフォーマットに適した処理をすることが可能であり、全てのオブジェクトについて、上記処理をする場合に比べて、システムのコスト(例えばメモリ使用量)を低減させることができるという有意点がある。
 図10は、本発明の実施態様に従う、オブジェクトへのポインタを、読み書き保護領域を指すように変換する例を示す。
 オブジェクト(1001)に含まれるポインタ(1002)は、オブジェクトA(1005)へのポインタである。ポインタ(1002)は、変換前のポインタであり、通常、その下位2又は3ビット(1004)がゼロであり、それ以外のビットがアクセスされるべきオブジェクトのアドレス(1003)を示す。アドレス(1003)は例えば、オブジェクトA(1005)の先頭アドレスである。
 本発明の実施態様に従うと、ポインタ(1002)の下位2又は3ビット(1004)がゼロであるという点を使用する。
 本発明の実施態様に従うと、下記に示すポインタのビット操作を行うことによって、ポインタ(1002)が読み書き保護領域を指すポインタに変換される。当該変換の一つの例は、例えば、ポインタ(1002)をnビット数分(nは整数である、例えばnは2又は3である)右シフトし、そして空いた左(上位)ビットに読み書き保護領域を指すポインタを設定することによって行われる。
 ポインタ(1012)は、上記変換により生成されたポインタである。上位nビット(1013)の数は、上記右シフトされたビットと同じ数である。それ以外のビット(1014)は、上記ビット(1003)と同じである。ポインタ(1012)の先頭(1013)が読み書き保護領域のアドレス(1015)を示す。
 読み書き保護領域は、例えば、特定の言語により生じるメモリ領域(例えばJava(商標)のヒープ外にある読み書き保護領域であり)、例えばOSメモリ領域である。また、読み書き保護領域は、例えば例外を生じさせるアドレスでありうる。例えば、コンピュータに32ビットLinux(商標)がインストールされている場合、その読み書き保護領域は、0xC0000000及びそれより上のアドレスである。当該読み書き保護領域は、ユーザからアクセス不可能である。その他、コンピュータが実装するプログラム言語に従う読み書き保護領域のアドレスが使用されうる。
 本発明の実施態様に従うと、バリアライズにおいて読み書き保護領域を使用することによって、ポインタを実メモリ(リアル・メモリ)に割り当てる必要はなく、単に仮想メモリ領域を予約し且つ保護するだけでよいという有利点がある。また、本発明の実施態様に従うと、ユーザ空間の仮想メモリ領域を予約する必要さえないという有利点がある。
 本発明の実施態様に従うと、次に示すポインタのビット操作を行うことによって、ポインタ(1012)が逆変換される。逆変換の結果、オブジェクトX(1021)のポインタは、オブジェクトAの先頭アドレスを指すようになる。すなわち、変換されたポインタから元のポインタへ逆変換される。逆変換は、ポインタ(1012)をnビット数分(nは整数である、例えばnは2又は3である)左シフトし、そして当該左シフトした分空いた右(下位)ビット(1024)にゼロを設定することによって行われる。この逆変換によって、ポインタ(1012)からポインタ(1022)(すなわち、ポインタ1002と同じである)が生成されて、目的のオブジェクトA(1025)へのアクセスを検出することが可能になる。
 下記図11~図13において、本発明の実施態様に従う種々のバリア・ポインタの例を示す。図11~図13のいずれもメモリ・レイアウトであり、図11のバリア・ポインタが基本的なバリア・ポインタであり、図12~図13が拡張的なバリア・ポインタである。本発明の実施態様において、当業者は図11~図13のバリア・ポインタ及びその他の実施態様のバリア・ポインタを任意に使用しうる。
 図11は、本発明の実施態様に従う、読み書き保護領域がヒープ領域と同じサイズである場合におけるバリア・ポインタの例を示す。
 仮想アドレス・スペース(1101)上に、Java(商標)ヒープ領域(1111)と、読み書き保護領域(1112)がある。元のポインタは矢印(1121)で示されており、バリア・ポインタは矢印(1122)で示されている。
 図11の例では、読み書き保護領域(1112)が、Java(商標)ヒープ領域(1111)と同じアドレス・サイズになるように予約される。同じアドレス・サイズにすることによって、実装が簡単になる。バリアライズにおいて、Java(商標)ヒープ領域(1111)と読み書き保護領域(1112)との間の一定のオフセットがポインタに加えられる。一方、アンバリアライズにおいて、一定のオフセットが減じられる。当該オフセットは、Java(商標)VMの初期化の間及びプログラム実行の間を通じて一定である。ほとんどのOSは、読み書き保護された仮想アドレス領域を予約するためのシステム・コールを有している。ここで、読み書き保護領域(1112)は、実メモリの割り当てを要求しないことに留意されたい。最近のOSは、実メモリの内容がプログラムによって最初にアクセスされるまで実メモリを仮想ページに割り当てない。読み書き保護領域(1112)は例外を生じさせるためにのみ使用される。従って、読み書き保護領域(1112)の内容は、外部から決してアクセスされず且つ実メモリも要求されない。図11に示す場合において、もしJava(商標)ヒープ領域(1111)が動的に拡張されるのであれば、読み書き保護領域(1112)も同様に拡張されなければならない。しかし、一般にこの拡張が成功することは保証されない。それ故に、プログラムが実行を開始するときに、読み書き保護領域(1112)のサイズは、Java(商標)ヒープ領域(1111)の最大サイズと一致するようにする。なお、読み書き保護領域(1112)のサイズがJava(商標)ヒープ領域(1111)のサイズよりも小さくないようにしてもよい。
 バリアライズは、オブジェクトの割り付けにおいて(下記図16を参照)、又はGCにおいて(下記図17を参照)行われうる。オブジェクトの割り付け時におけるバリアライズは、ある割り当て部位で割り付けられたオブジェクトをプロファイリング又は最適化するために有用である。バリア・ポインタが正確に作動するために、ターゲット・オブジェクトへポイントする全てのポインタがバリアライズされることが重要である。レジスタ中の一つのポインタのみが割り当て直後に割り当てられたオブジェクトをポイントする故に、生成されたJITコードにおいて又は改変されたインタープリタにおいてレジスタをバリアライズすることで足りる。対照的に、GCにおけるバリアライズは、長く生きているオブジェクトをプロファイリングし又は最適化するために適している。
 本発明の実施態様において、図11~図13に示すバリアライズ及びアンバリアライズの方式のうち、図11に示すバリアライズ及びアンバリアライズの方式が最も基本的な方式である。
 図12は、本発明の実施態様に従う、読み書き保護領域がヒープ領域よりも小さいサイズである場合におけるバリア・ポインタの例を示す。
 仮想アドレス・スペース(1201)上に、Java(商標)ヒープ領域(1211)と、読み書き保護領域(1212)がある。元のポインタは矢印(1221)で示されており、バリア・ポインタは矢印(1222)で示されている。図12において使用されるオブジェクトは、例えば8バイト単位でアラインされている。一般的なCPUの設計では、例えば8バイトのデータを8バイト・アラインしていないアドレスから読もうとすると、オーバーヘッドがかかる。そこで、オブジェクトの先頭を8バイト・アラインしておけばオブジェクトの中のフィールドも8バイト・アラインされるのでアクセスに余計なオーバーヘッドがかからないからである。
 図11の例では、読み書き保護領域(1112)のサイズは、Java(商標)ヒープ領域(1111)の最大サイズと一致又はそれよりも大きくするようにする。しかしながら、仮想アドレス・スペース(1101)は限られたリソースである。仮想アドレスにおける追加領域はまたトランスレーション・ルックアサイド・バッファ(TLB)ミスを増加させる。従って、読み書き保護領域をできるだけ小さくすることがよい。
 図12の例では、読み書き保護領域(1212)が、Java(商標)ヒープ領域(1211)よりも小さいサイズになるように予約される。例えば、読み書き保護領域(1212)は、Java(商標)ヒープ領域(1211)の8分の1のサイズでありうる。バリアライズにおいて、ポインタのnビット数分右シフトされ、オフセットが加えられる。一方、アンバリアライズにおいて、一定のオフセットが減じられ、nビット分が左シフトされる。バリアライズは、図11の例と同様に、オブジェクトの割り付けにおいて、又はGCにおいて行われる。
 図12に示すように、より小さい読み書き保護領域(1212)にとって、Java(商標)VMは、全てのJava(商標)オブジェクトが8バイト境界上で整列されるという事実を利用しうる。各オブジェクト・ポインタの最後3ビットはゼロであるので、なんらの情報を失うことなしに3ビット数分の右シフトが可能である。従って、読み書き保護領域(1212)のサイズは、上記されているように、Java(商標)ヒープ領域(1211)の8分の1のサイズでありうる。図12のバリアライズにおいて、バリア・ポインタは下記の式1で表されうる。
 [式1]
 Barrier_pointer=(Original_pointer - HEAP_BASE) >> 3 + PROTECTED_BASE
 式1は、下記式2で表されるように簡略化した形で表されうる。
 [式2]
 Barrier_pointer = Original_pointer >> 3 + CONSTANT;
 CONSTANT = PROTECTED_BASE - HEAP_BASE >> 3
 なお、図12に示すバリア・ポインタにおける問題点は、バリア・ポインタを通じてのアクセスは読み書き保護領域(1212)外のポインタ(アドレス)でありうることである。従って、オブジェクトへのポインタをバリアライズするときに、この条件が確認されなければならない。この確認は、下記式3で表されうる。
 [式3]
 Barrier_pointer + Object_size <= PROTECTED_TOP
 ここで、PROTECTED_TOPは、読み書き保護領域のトップ・アドレスである。
 図13は、本発明の実施態様に従う、読み書き保護領域がOS保護領域である場合におけるバリア・ポインタの例を示す。
 図13は、図12とは別の方法によって、読み書き保護領域のサイズを減少させる方法を示す。
 図13の例では、仮想アドレス・スペース(1301)上に、Java(商標)ヒープ領域(1311)と、Linux(商標) OS領域(1312)がある。Linux(商標) OS領域(1312)は、OSに使用されるアドレス範囲であるので読み書き保護領域である。元のポインタは矢印(1321)で示されており、バリア・ポインタは矢印(1322)で示されている。
図13の例では、Linux(商標) OS領域(1312)がLinux(商標) OSプログラムの仕様に従い、仮想アドレス・スペース(1301)の4分の1を占めており、且つOxC0...000から開始する。このLinux(商標) OS領域(1312)にユーザはアクセスすることができない。バリアライズにおいて、ポインタのnビット数分右シフトされ、空いた2ビットにLinux(商標) OS領域(1312)の先頭を指すアドレスが設定される(図13の例の場合、11である)。一方、アンバリアライズにおいて、ポインタのnビット分が左シフトされる。Java(商標)VMはユーザ・スペース中に読み書き保護領域を予約する必要がない。例えば、32ビットWindows(商標)において、当該OSは典型的に仮想アドレス・スペースの2分の1又は4分の1を予約する。例えば、32ビットAIXにおいて、当該OSは典型的に、4GBの仮想アドレス・スペースの16分の1を占める。このことは、Java(商標)VMが読み書き保護領域を予約するために他の場所において256MBで予約しうることを意味する。バリアライズは、図11の例と同様に、オブジェクトの割り付けにおいて、又はGCにおいて行われる。
 図14は、本発明の実施態様に従う、オブジェクトへのアクセスを検出する方法のフローチャートを示す。
 ステップ1401では、コンピュータ(201)は、オブジェクトへのアクセスを検出するアルゴリズムを開始する。
 ステップ1402では、変換部(211)は、上記オブジェクト(ターゲット・オブジェクト)へのポインタをコード操作して、当該ポインタを読み書き保護領域を指すポインタに変換する。当該ポインタの変換の態様は、変換部(211)の説明において述べたとおりである。ここで、オブジェクトの先頭以外の部分にアクセスがあった場合に、当該オブジェクトへのポインタが変換によって読み書き保護領域を指すことを保証する必要がある。そこで、当該保証をするために、元のポインタをバリアライズする際に、バリア・ポインタとオブジェクトサイズとの合計値が、読み書き保護領域を超えていないことをチェックする必要がある。ただし、当該合計値が読み書き保護領域を超えていたとしても、バリアライズを諦めればよいだけであるので、このオブジェクトについては通常と異なるフォーマットに変換できないだけである。
 ステップ1403では、コンピュータ(201)は、読み書き保護領域へのアクセスで例外が起きた場合に、メモリ・アクセス例外を検出して、シグナル・ハンドラを起動する。例外が発生している場合、当該処理はステップ1404に進む。一方、例外が発生していない場合は、例外の発生を待つ。なお、コンピュータ(201)は、起動された上記シグナル・ハンドラを使用して、以下のステップ1404~1410の各処理を行う。
 ステップ1404では、コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスかどうかを確認する。例外の発生は、例えば、セグメンテーション・フォールトの発生である。例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスであることに応じて、当該処理はステップ1405に進む。一方、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスでないことに応じて、当該処理はステップ1406に進む。
 ステップ1405では、逆変換部(212)は、シグナル・ハンドラを使用して、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスであることに応じて、上記変換されたポインタから元のポインタへ逆変換をする。当該ポインタの逆変換の本発明の実施態様は、逆変換部(212)の説明において述べたとおりであるが、逆変換部(212)の動作を下記にさらに詳細に説明する。
 当該シグナル・ハンドラは、本来アクセスするはずであったオブジェクトの先頭へのポインタを入手する必要がある。なぜならば、コンピュータ(201)は、元のオブジェクトの先頭へのポインタの先から当該元のオブジェクトのヘッダなどを読み出し、そして当該元のオブジェクトが圧縮されている場合に、当該圧縮オブジェクトを伸長するかどうかを決める必要があるためである。元のオブジェクトの先頭へのポインタを得るために、シグナル・ハンドラは以下の処理を行う。一般に、コンピュータ(201)は、シグナル・ハンドを使用して、例外が起きた命令のアドレスがわかるので、当該アドレスにある命令を読み出すと、例えば、下記式4で表されるフォーマットで表される命令が得られる(下記図18に対応する発明の詳細な説明の記載を参照)。
 [式4]
 load(ロード),ロード先レジスタ,[ポインタ値の入っているレジスタ,オフセット]
 さらに、コンピュータ(201)は、シグナル・ハンドを使用して、例外が起きたときのレジスタの値が読めるので、上記フォーマット中の「ポインタ値の入っているレジスタ」の中身のポインタ値を読むことができる。そこで、オブジェクトにアクセスする命令が下記式5に示すフォーマットであるように、JITコンパイラ又はインタープリタが改変される。
 [式5]
 load(ロード),ロード先レジスタ,[オブジェクトの先頭へのポインタ値の入っているレジスタ,オフセット]
 ただし、現在のJITコンパイラが吐き出すコード又はインタープリタは、上記フォーマット形式でオブジェクトにアクセスしていることがほとんどであるので、上記改変をする必要性は少ないであろう。このようにして、コンピュータ(201)は、シグナル・ハンドを使用して、式2で示される命令を読み出して、さらに「オブジェクトの先頭へのポインタ値」を読み出す。「オブジェクトの先頭へのポインタ値」は実際にはバリア・ポインタであるので、コンピュータ(201)は、シグナル・ハンドを使用して、当該「オブジェクトの先頭へのポインタ値」についてアンバリアライズを行う。その結果、コンピュータ(201)は、元のオブジェクトの先頭へのポインタ値を入手することができる
 例えばメモリ参照が[base_reg_object_head, reg_offset/imm_offset]のフォーマットで表される場合、コンピュータ(201)は、base_reg_object_headを読み取り、そしてアンバリアライズすることによって逆変換を行う(図18に対応する発明の詳細な説明の記載を参照)。また、当該逆変換は、上記ステップ1402で述べた例の場合、変換されたポインタをステップ1402でnビット数分右シフトしたのと同じnビット数分だけ左シフトすることによって行われる。または、当該逆変換は、例えば、例外が発生した命令を参照して、当該例外が発生した命令から、ポインタが変換されたオブジェクトの先頭へのポインタを取得し、当該取得したポインタを逆変換して元のオブジェクトの先頭へのポインタを取得することによって行われる。
 ステップ1408では、処理部(213)は、オブジェクトに応じた処理が必要かどうかを、例えばオブジェクトのヘッダ情報を参照して確認する。オブジェクトのヘッダには、例えば圧縮又は遅延割付などを識別するための符号が書かれている。例えば、ヘッダの特定のフィールドに“0”と書かれている場合は通常のフォーマットを意味し、同フィールドに“1”と書かれている場合は圧縮されたフォーマットを意味し、及び同フィールドに“2”と書かれている場合は、割り付けが遅延されたフォーマットを意味する。オブジェクトに応じた処理が必要な場合、当該処理はステップ1409に進む。一方、オブジェクトに応じた処理が必要でない場合、当該処理はステップ1410に進む。
 ステップ1409では、処理部(213)は、シグナル・ハンドラを使用して、逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照して、当該オブジェクトのフォーマットに適した処理を行う。オブジェクトのフォーマットに適した処理とは、例えば、オブジェクトへのアクセスのログを取ること、オブジェクトを元の形式へ戻すこと、新しい形式のままオブジェクトのフィールドにアクセスすることを包含する。オブジェクトへのアクセスのログを取ることで、プログラムの最適化においても、本発明の実施態様であるオブジェクトへのアクセスを検出する方法を使用することが可能である。オブジェクトを元の形式へ戻すこととは、例えばアクセスされるオブジェクトが圧縮されている場合に当該圧縮オブジェクトを伸長すること、又はアクセスされる文字配列を遅延割り当てすることである。
 ステップ1410では、実行部(214)は、シグナル・ハンドラを使用して、逆変換された元のポインタが指すオブジェクトにアクセスする。そして、当該処理は、ステップ1403に戻る。
 ステップ1406では、コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスでないことに応じて、当該例外が不正なアクセスであると判断し、当該不正なアクセスに応じた処理を行う。当該処理は、例えば、メモリ・ダンプの取得である。
 ステップ1407では、コンピュータ(201)は、オブジェクトへのアクセスを検出するアルゴリズムを終了する。
 図15は、本発明の実施態様に従う、ピンニング・アレイ・スロットを使用してメモリ・アクセス例外を処理するアルゴリズムのフローチャートを示す。
 図14のアルゴリズムでは、逆変換部(212)によって実行されるステップ1405において、[オブジェクトの先頭へのポインタ値の入っているレジスタ,オフセット](式5を参照)という式を使用してアンバリアライズを行い、元のオブジェクトの先頭へのポインタ値が得られることを説明した。しかしながら、このような形式にできないオブジェクト・アクセスがありうる。特に、配列オブジェクトへのアクセスにおいて顕著である。そこで、配列オブジェクトへのアクセスがある場合に、本アルゴリズムを使用しうる。なお、図15のアルゴリズムはステップ1504及び1507を有している点で図14のアルゴリズムと異なり、ステップ1508~1509を経由する場合に図14に対応する処理(すなわち、ピンニング・アレイ・スロットを使用しない態様)が行われる。
 配列オブジェクトへのアクセスは、下記式6~8で表される命令列になりうる。
 [式6]
  レジスタX=配列オブジェクトの先頭へのポインタ値
 [式7]
  レジスタX=レジスタX+インデックス
 [式8]
  ロード(load),ロード先レジスタ,[レジスタX,オフセット]
 ここで、式6のポインタ値がバリア・ポインタであった場合、式8の時点でのレジスタXの値から元の配列オブジェクトの先頭へのポインタ値を得ることは一般に困難である。なぜならば、単にアンバリアライズを行っても変なポインタ値になるだけであるからである。このようなレジスタXの値は、オブジェクトの先頭でなく内部を指すので、内部ポインタを呼ばれる。そこで、このような配列オブジェクトへのアクセスについては、下記式9~12で表されるようにアクセスするように、JITコンパイラ又はインタープリタを改変する。
 [式9]             
  レジスタX=配列オブジェクトの先頭へのポインタ値
 [式10]
  pinning_array_slot=レジスタ
 [式11]
  レジスタX=レジスタX+インデックス
 [式12]
  ロード(load),ロード先レジスタ,[レジスタX,オフセット]
 式10において、配列オブジェクトの先頭へのポインタ値をピンニング・アレイ・スロット(pinning_array_slot)中に保存しておく。ピンニング・アレイ・スロットは、オブジェクトの先頭へのポインタ値を保存しておく領域である。ピンニング・アレイ・スロットは、実際には、別のレジスタ又はスタック中にあるスロットである。また、式12の命令アドレスから、対応するピンニング・アレイ・スロットのレジスタ又はスロットのレジスタ又はスロット番号への対応表を作っておく。シグナル・ハンドラは、例外が起きた命令のアドレスをキーにして、上記対応表を引く。もし対応するピンニング・アレイ・スロットがある場合、当該対応するピンニング・アレイ・スロットから配列オブジェクトの先頭へのポインタ値を読み出す。当該読み出されたポインタ値はバリア・ポインタであるので、アンバリアライズを行って元の配列オブジェクトの先頭へのポインタ値を得ることができる。このピンニング・アレイ・スロットは、GCがオブジェクトを移動できるようにするために、例えばJava(商標)VMに例えば内部ポインタ・アウェア(aware)GCとして既にサポートされているものである。内部ポインタ・アウェアGCとは、オブジェクト内部を指すポインタを扱うことのできるGCである。従って、JITコンパイラ又はインタープリタを改変する必要は実際にはない。ただし、上記対応表が本発明の実施態様において新たに用意される必要があるものである。また、内部ポインタを用いた配列アクセスの箇所は実際にはプログラム中に多くはないので、対応表自体が大きくなりメモリを消費しすぎるということはない。
 以下に、上記ピンニング・アレイ・スロットを使用して、内部ポインタを使用する配列オブジェクトへのアクセス例外を処理するアルゴリズムのフローチャートを示す。
 ステップ1501では、コンピュータ(201)は、シグナル・ハンドラを使用して、メモリ・アクセス例外を処理するアルゴリズムを開始する。当該アルゴリズムの開始後に、読み書き保護領域へのアクセスで例外が起きて、シグナル・ハンドラが呼び出され、そして当該シグナル・ハンドラが実行される。
 ステップ1502では、コンピュータ(201)は、読み書き保護領域へのアクセスで例外が起きた場合に、例外を検出して、シグナル・ハンドラを起動する。例外が発生している場合、当該処理はステップ1503に進む。一方、例外が発生していない場合は、例外の発生を待つ。なお、コンピュータ(201)は、起動された上記シグナル・ハンドラを使用して、以下のステップ1503~1513の各処理を行う。
 ステップ1503では、コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスかどうかを確認する。例外の発生は、例えば、セグメンテーション違反(セグメンテーション・フォールトともいう)の発生である。セグメンテーション違反は、ソフトウェアの実行時に起きる特定のエラー条件であり、アクセスが許可されていないメモリ上の位置、もしくは許可されていない方法(例えば、リードオンリーの位置へ書き込みをしようとする又はオペレーティング・システムの部分を上書きしようとする)でメモリ上の位置のアクセスしようとするときに起きる。例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスであることに応じて、当該処理はステップ1504に進む。一方、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスでないことに応じて、当該処理はステップ1505に進む。
 ステップ1504では、コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きた命令アドレスに対応するピンニング・アレイ・スロットがあるかどうかを判定する。そのような各アクセスを、配列オブジェクトのヘッドへのポインタを含むスタック・スロットに関連付ける。この関連付けられたスロットを、上記されているように、ピンニング・アレイ・スロットという。ピンニング・アレイ・スロットには、各命令が関連付けられている。ピンニング・アレイ・スロットがあることに応じて、当該処理はステップ1507に進む。
 ステップ1507では、コンピュータ(201)は、シグナル・ハンドラを使用して、ピンニング・アレイ・スロットから元のオブジェクトの先頭のアドレスに対応するバリア・ポインタを読み出す。
 ステップ1510では、コンピュータ(201)は、シグナル・ハンドラを使用して、読み出したバリア・ポインタを逆変換して、元のオブジェクトの先頭のアドレスを得る。逆変換については、上述したとおりである。
 ステップ1511では、コンピュータ(201)は、シグナル・ハンドラを使用して、逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照して、当該オブジェクトのフォーマットに適した処理を行う。オブジェクトのフォーマットに適した処理とは、例えば、オブジェクトへのアクセスのログを取る、オブジェクトを元の形式へ戻す、新しい形式のままオブジェクトのフィールドにアクセスすることを包含する。オブジェクトを元の形式へ戻すとは、例えばオブジェクトが圧縮されている場合に当該圧縮オブジェクトを伸長すること、又は文字配列を遅延割り当てをすることである。
 ステップ1512では、コンピュータ(201)は、シグナル・ハンドラを使用して、逆変換された元のポインタが指すオブジェクトにアクセスする。そして、当該処理は、ステップ1513に進む。
 ステップ1513では、コンピュータ(201)は、シグナル・ハンドラを使用して、メモリ・アクセス例外を処理するアルゴリズムを終了する。
 ステップ1505では、コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きたデータ・アドレスが読み書き保護領域の中にあるデータ・アドレスでないことに応じて、当該例外が不正なアクセスであると判断し、当該不正なアクセスに応じた処理を行う。当該処理は、例えば、メモリ・ダンプの取得である。
 ステップ1506では、コンピュータ(201)は、シグナル・ハンドラを使用して、オブジェクトへのアクセスを検出するアルゴリズムを終了する。
 ステップ1508では、コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きた命令アドレスの命令をデコードして、ベース・レジスタ番号をメモリ内に読み出す。コンピュータ(201)は、シグナル・ハンドラを使用して、例外が起きたときの全てのレジスタ値を読み出すことができる。
 ステップ1509では、コンピュータ(201)は、シグナル・ハンドラを使用して、ステップ1508において読み出されたベース・レジスタ番号に対応するレジスタ値をメモリ内に読み出す。当該読み出したレジスタ値が、元のオブジェクトの先頭のアドレスに対応するバリア・ポインタである。当該処理はステップ1510に進み、上記されているように、当該読み出したレジスタ値(バリア・ポインタである)が逆変換されて、元のオブジェクトの先頭アドレスが得られる。
 下記図16及び図17において、本発明の実施態様に従う種々のバリアライズするアルゴリズムの例を示す。バリアライズは、図14のステップ1402において実行される。
 図16は、本発明の実施態様に従う、オブジェクトの割り付けにおいてバリアライズするアルゴリズムのフローチャートを示す。
 図16のステップ1601~1604は、図14のステップ1402において行われる処理の一つの実施態様である。
 ステップ1601では、コンピュータ(201)は、バリアライズを開始する。
 ステップ1602では、コンピュータ(201)は、ヒープメモリにオブジェクトを割り付ける。上記オブジェクトが割り付けられた直後において、当該割り付けられたオブジェクトを指すポインタは1つだけである。
 ステップ1603では、コンピュータ(201)は、上記オブジェクトが割り付けられた直後において、上記ポインタを読み書き保護領域を指すように変換する。
 ステップ1604では、コンピュータ(201)は、上記逆変換の終了に応じて、上記アルゴリズムを終了する。
 図17は、本発明の実施態様に従う、GCにおいてバリアライズするアルゴリズムのフローチャートを示す。
 図17のステップ1701~1710は、図14のステップ1402において行われる処理の一つの実施態様である。
 ステップ1701では、コンピュータ(201)は、バリアライズを開始する。
 ステップ1702では、コンピュータ(201)は、ポインタへのポインタを保存するための集合Sを空にする。
 ステップ1703では、コンピュータ(201)は、レジスタ又はスタックなどのGCのルート集合を上記集合Sに追加する。
 ステップ1704では、コンピュータ(201)は、集合Sに要素が入っているかどうかを検査する。集合Sに要素が入っている場合、当該処理はステップ1705に進む。一方、集合Sに要素が入っていない場合、当該処理はステップ1706に進む。
 ステップ1705では、コンピュータ(201)は、集合Sに要素が入っていることに応じて、集合Sから要素を1つ取り出す。この取り出した要素を要素Pと名付ける。要素Pはポインタへのポインタである。
 ステップ1706では、コンピュータ(201)は、集合Sに要素が入っていないことに応じて、上記アルゴリズムを終了する。
 ステップ1707では、コンピュータ(201)は、要素Pが指す先のポインタが指す先のオブジェクト・フォーマットが変形されたオブジェクト・フォーマットであるかどうかを検査する。上記変形されたフォーマットである場合、当該処理はステップ1708に進む。一方、上記変形されたフォーマットでない場合、当該処理はステップ1709に進む。
 ステップ1708では、コンピュータ(201)は、要素Pが指す先のポインタが指す先のオブジェクト・フォーマットが、変形されたオブジェクト・フォーマットであることに応じて、要素Pが指す先のポインタを、読み書き保護領域を指すように変換して、Pが指す先のメモリに格納する。ステップ1708は、GCにおいてバリアライズするステップである。
 ステップ1709では、コンピュータ(201)は、要素Pが指す先のポインタが指す先のオブジェクトQをGCのルーチンで処理する。当該GCのルーチンは、典型的にはオブジェクトQを生きていると見なして、当該オブジェクトQにマーク付けをする。
 ステップ1710では、コンピュータ(201)は、オブジェクトQの中のポインタ・フィールド(例えば、図3の322)へのポインタを集合Sに追加する。
 図18~図25は、本発明の実施態様である、図17の各ステップにおける仮想アドレス・スペースの例を示す。
 図18Aは、本発明の実施態様である、図17のステップ1701(GC開始前)における仮想アドレス・スペースを示す。
 コンピュータ(201)のメモリ上に仮想アドレス・スペース(1801)がある。仮想アドレス・スペース(1801)上に、読み書き保護領域(1802)及びスレッドのスタック領域(1803)がある。読み書き保護領域(1802)には、実メモリが割り付けられていない。スレッドのスタック領域(1803)は、GCのルート集合の一部である。
 オブジェクトX(1811)のポインタ(1821)は、オブジェクトYの先頭アドレスを指す。また、オブジェクトX(1811)のポインタ(1822)は、圧縮オブジェクトA(1812)の先頭アドレスを指す。オブジェクトY(1813)のポインタ(1823)は、圧縮オブジェクトA(1812)の先頭アドレスを指す。
 また、スレッドのスタック領域中のポインタ(1831)は、オブジェクトX(1811)の先頭アドレスを指す。
 オブジェクトA(1812)は圧縮されたフォーマットになっている。従って、オブジェクトAへのポインタ(1822及び1823)をバリア・ポインタに変換する必要がある。
 図18Bは、各オブジェクトX、Y及びAと、各オブジェクトX、Y及びAの先頭を指す各ポインタ値と、各オブジェクトX、Y及びAに対応する各バリア・ポインタ値を示す。なお、通常のオブジェクト・フォーマットのポインタは、各ポインタ値の上位2ビットが11以外のポインタである。バリア・ポインタは、上記通常のオブジェクト・フォーマットのポインタを2ビット数分右シフトし、そして空いた上位2ビットに11を立てた値である。
 図18Cは、図18~図25において示される4つのポインタを示し、且つ当該ポインタそれぞれを指すポインタ値(当該ポインタそれぞれが保持しているポインタ値でないことに留意されたい)を示す。なお、当該ポインタそれぞれを指すポインタ値は、前提として与えられた値である。
 図19Aは、本発明の実施態様である、図17のステップ1703における仮想アドレス・スペースを示す。
 ステップ1703では、コンピュータ(201)は、GCのルート集合が集合Sに加えられることから、オブジェクトXを指す、スタック領域中のポインタを指すポインタ値(000000)を集合Sに追加する(図19B)。
 図20Aは、本発明の実施態様である、図17のステップ1704及び1705を通じて処理される場合における仮想アドレス・スペースを示す。
 ステップ1705では、コンピュータ(201)は、集合Sから要素Pを取り出すことから、オブジェクトXを指す、スタック領域中のポインタを指すポインタ値(000000)を集合Sから取り出す(図20B)。
 図21Aは、本発明の実施態様である、図17のステップ1707、1709及び1710を通じて処理される場合の仮想アドレス・スペースを示す。
 ステップ1710では、コンピュータ(201)は、オブジェクトXの中のポインタ・フィールドへのポインタを集合Sに追加する(図21B)。すなわち、コンピュータ(201)は、オブジェクトYを指す、オブジェクトXの中のポインタを指すポインタ値(001000)、及び、オブジェクトAを指す、オブジェクトXの中のポインタを指すポインタ値(001100)を、集合Sに追加する。そして、コンピュータ(201)は、要素Pをクリアにする。なお、図21AのオブジェクトXは、図17のステップ1710でいうオブジェクトQに対応する。
 図22Aは、本発明の実施態様である、図17のステップ1704、1705、1707、1709及び1710を通じて処理される場合の仮想アドレス・スペースを示す。
 ステップ1705では、コンピュータ(201)は、集合Sから要素P(ここでは、オブジェクトYを指す、オブジェクトXの中のポインタを指すポインタ値(001000))を取り出すことから、オブジェクトYを指す、オブジェクトXの中のポインタを指すポインタ値(001000)を集合Sから取り出す。そして、ステップ1710では、コンピュータ(201)は、オブジェクトYの中のポインタ・フィールドへのポインタを集合Sに追加し、要素Pをクリアする(図22B)。すなわち、コンピュータ(201)は、オブジェクトAを指す、オブジェクトYの中のポインタを指すポインタ値(011100)を、集合Sに追加し、且つ、要素P(オブジェクトYを指す、オブジェクトXの中のポインタを指すポインタ値(001000))をクリアする。なお、図22AのオブジェクトYは、図17のステップ1710でいうオブジェクトQに対応する。
 図23Aは、本発明の実施態様である、図17のステップ1704、1705、1707及び1708を通じて処理される場合の仮想アドレス・スペースを示す。
 ステップ1705では、コンピュータ(201)は、集合Sから要素P(ここでは、オブジェクトAを指す、オブジェクトXの中のポインタを指すポインタ値(001100))を取り出すことから、オブジェクトAを指す、オブジェクトXの中のポインタを指すポインタ値(001100)を集合Sから取り出す。そして、ステップ1708では、コンピュータ(201)は、オブジェクトAを指す、オブジェクトXの中のポインタ(100000)を書き換えて(右へ2ビット数分シフトし、空きビットへ11を追加する)、バリア・ポインタ(111000)に変換する。そして、ステップ1710では、コンピュータ(201)は、要素Pをクリアする。なお、図23AのオブジェクトAは、図17のステップ1710でいうオブジェクトQに対応する。
 図24Aは、本発明の実施態様である、図17のステップ1708、1709、1710、1704、1705、1707及び1708を通じて処理される場合の仮想アドレス・スペースを示す。
 ステップ1705では、コンピュータ(201)は、集合Sから要素P(ここでは、オブジェクトAを指す、オブジェクトYの中のポインタを指すポインタ値(011100))を取り出すことから、オブジェクトAを指す、オブジェクトYの中のポインタを指すポインタ値(011100)を集合Sから取り出す。そして、ステップ1708では、コンピュータ(201)は、オブジェクトAを指す、オブジェクトYの中のポインタ(100000)を書き換えて(右へ2ビット数分シフトし、空きビットへ11を追加する)、バリア・ポインタ(111000)に変換する。そして、ステップ1710では、コンピュータ(201)は、要素Pをクリアする。なお、図24AのオブジェクトAは、図17のステップ1710でいうオブジェクトQに対応する。
 図25Aは、本発明の実施態様である、図17のステップ1709、1710、1704及び1706を通じて処理される場合の仮想アドレス・スペースを示す。
 ステップ1710では、コンピュータ(201)は、要素Pをクリアにする。そしてステップ1704に戻り、コンピュータ(201)は、集合Sに要素が入っていないので、処理をステップ1706に進めて、終了する。図25Bは、バリアライズが終了した際の仮想アドレス・スペースを示す。
 図26は、本発明の実施態様に従う、シグナル・ハンドラを呼び出して、変換されたポインタから元のポインタを回復(逆変換)させる動作の例を示す。
 SIGSEGVは、セグメンテーション違反シグナルを示す。
 コード(2601)は、符号2602に示されている操作を行うコードである。メモリ参照は、下記のフォーマットで表される:[base_reg_object_head,
reg_offset/imm_offset]。また、オブジェクトへのアクセス(CPUのメモリへのアクセス命令)は、“ld/st reg,
[base_reg_object_head, reg/imm_offset]”(ロード/ストア,ロード先レジスタ,[ポインタ値の入っているレジスタ,オフセット])のフォーマットでなければならない。
 コード(2601)は、下記に示す内容の動作を行う(2602を参照)。
 ・命令を0×ab04でデコードする;
 ・r12をメモリr3に読み込む;(r12はbase_reg_object_headである)
 ・r12の最上位の2ビットが設定される場合であって、
   0xab04がピンニング・アレイ・スロットに関連付けられている場合、
    元のポインタをピンニング・アレイ・スロットから取得し、
   関連付けられていない場合、
    元のポインタを、r12から2ビット数分だけ左シフトすることによって取得し、  そして、オブジェクトが元のポインタによって指されているようにバリア・ポインタから元のポインタを回復する。
 図27は、本発明の実施態様に従う、シグナル・ハンドラ・アルゴリズムの例を示す。 バリア・ポインタを介するアクセスはハードウェア・メモリ例外をいつも生じ、当該メモリ例外はOSによって信号に変換される。図27のアルゴリズムは、Java(商標)VMに実装されるシグナル・ハンドラ・アルゴリズムを示す。以下に、そのアルゴリズムの内容を説明する。
(1)ヘッド・ポインタの回復(逆変換)
 OSは、例外コード・アドレス、例外データ・アドレス、及びハードウェア例外の時間でのレジスタのシグナル内容を保持するシグナル内容をシグナル・ハンドラに渡す。シグナル・ハンドラは、まず、例外データ・アドレスが、アドレス比較によって読み書き保護領域内にあるかどうかをチェックする(行2)。例外データ・アドレスが読み書き保護領域内にある場合、シグナル・ハンドラは、アクセスされるオブジェクトのヘッドへのポインタ(以下、「ヘッダ・ポインタ」という)を回復させなければならない。オブジェクトの内部へのポインタ(以下、「内部ポインタ」という)は十分でない。なぜならば、シグナル・ハンドラはプロファイリング又はリカバリを実行するかどうかを決定するために、オブジェクトのヘッダを参照しなければならないからである(行11)。一般的に、例外データ・アドレスをアンバリアライズすることは内部ポインタを生成するのみである。もしJava(商標)VMが内部ポインタからヘッダ・ポインタを得るための機能をサポートするならば、当該機能が使用されうる。一般的にそのようなサポートがないので、オブジェクト・アクセス命令がJITコンパイラにより生成されたコード又はインタープリタ・コードであるかどうかにかかわらず、オブジェクト・アクセス命令のフォーマットを制限する必要がある。このことは、メモリ・レジスタのレジスタ引数がヘッダ・ポインタでなければならないことを意味する。例えば、形式[base_reg,
offset_reg/immediate]のメモリ参照において、base_regは、ヘッダ・ポインタでなければならない。次に、オブジェクト・アクセス命令を伸長し、且つシグナル内容からbase_regの内容をメモリ内にロードすることによってバリアライズされたヘッダ・ポインタが得られうる(行6~8)。この制限は、既存のJava(商標)VM及びJITコンパイラにおいて通常満足される。
 しかしながら、この制限は、大きいオブジェクトをアクセスする場合に破壊されうる。例えば、JITコンパイラにおいてループ導出変数最適化及び強度減少は、配列への内部ポインタをもたらしうる。内部ポインタを使用するそれら命令のために、メソッドのレジスタにおいて又はスタック・スロットにおいてヘッダ・ポインタを維持するためにJITコンパイラで生成されたコードが改変される。多くのJITコンパイラは、GCがルート・オブジェクトをトラバースすることを助けるためにこの機能を既にサポートしている。このサポートなしに、GCは内部ポインタによって指されているオブジェクトをマーク付け又は移動することができない。加えて、JITコンパイラは、内部ポインタを使用する各命令を、ヘッダ・ポインタを保持するレジスタ番号又はスタック・オフセットに関連付けるために改変される必要がある。このことは、シグナル・ハンドラが例外コード・アドレスからヘッダ・ポインタを入手することを可能にする(行3~4)。ほとんどのオブジェクト・アクセス命令が内部ポインタを使用しないので、上記関連付けられたデータ構造が過剰的に増えることはない。
(2)オブジェクト・アクセスのエミュレーション
 ヘッダ・ポインタのアンバリアライズ後に(行10)、シグナル・ハンドラは、オブジェクトのヘッダに依存して回復操作又はプロファイリングを実行する。回復を必要とするオブジェクトはそれらのヘッダに設定されている特別なビットを有する。プロファイリングのために、シグナル・ハンドラは、アクセスを記録し(行16)及び例外命令の実行をエミュレートする(行17)。例えばロードをエミュレートすることは、例外ロード命令の代わりにロードを実行し、そしてロードされた値をシグナル内容中のターゲット・レジスタに書き込むことを意味する。シグナル・ハンドラは、ベース・レジスタにアンバリアライズされたポインタを書き込むこと、そして例外命令を戻してそれを再実行することを許されていない。このアプローチを使用して、アンバリアライズされたポインタを使用する次の命令がハードウェア例外をもはや生じさせず、従ってプロファイルされるべきアクセスの幾つかをミスされることを生じさせる。悪いことに、このアプローチはプログラムのセマンティクスを変化させうる。なぜならば、幾つかのオブジェクトは、2つの異なるポインタ値によって表され、ポインタ・イクオリティ命令が、2つのオブジェクトが同じオブジェクトを参照している場合でさえもファールスを戻すことを生じさせる。それ故に、シグナル・ハンドラは例外命令をエミュレートすることが必要である。
 図28は、本発明の実施態様に従う、オブジェクトへのアクセスの頻度とオーバーヘッドとの関係についての実験結果を示す。
 ポインタが指すオブジェクトにほとんどアクセスがないことを仮定した最適化の場合を考える。ポインタが指すオブジェクトにほとんどアクセスがない場合とは、例えば、当該オブジェクトが圧縮されている場合(図4を参照)、又はオブジェクトが遅延割り付けされる場合(図5を参照)である。従来技術である永続的なオブジェクト・データベース方式では、全てのオブジェクトの全アクセスにおいて実行時チェックをする必要がある。一方、本願発明の実施態様に従うと、ポインタが指すオブジェクトへのアクセスでのみ例外処理のオーバーヘッドがかかる。従って、本願発明の実施態様に従うと、オーバーヘッドが低減される。
 以下に、監視対象であるオブジェクトへのアクセス頻度とオーバーヘッドとの関係についての実験結果を示す。
 実験は、Nバイトのオブジェクトを割り付けるごとに1オブジェクトをアクセス監視の対象とした。なお、監視対象であるオブジェクトに頻繁にアクセスがあるものとする。当該実験は、Linux(商標) p6 4.7GHz×16上でIBM(商標)ppc-32 J9/TR Java(登録商標)6(SR6)を使用して行われた。図28は、その結果のグラフを示す。グラフから、SPEC(Standard
Performance Evaluation Corporation)jvm2008のcompiler.compilerベンチマークに従うと、バイト数が32KB又は4KBにおいてオーバーヘッドが3%程度存在するが、バイト数が64MB又は4MBにおいてはオーバーヘッドがほとんど存在しないことがわかる。
 また、ポインタが指すオブジェクトが、図4に示す圧縮されたオブジェクト(402)を用意した。そして、当該圧縮されたオブジェクト(402)を使用して、図14に従う方法を実装するコンピュータ上で、SPECjbb2005(Java(商標)
Server Benchmark)ベンチマーク・プログラムを実行した。その結果、割り当て時に圧縮されたオブジェクト(402)を割り当てる手法により、SPECjbb2005のベンチマーク値が6.8%改善された。
 また、ポインタが指すオブジェクトが、図5に示す遅延的に割当てられるストリング・オブジェクト(502)を用意した。そして、当該ストリング・オブジェクト(502)を使用して、図14に従う方法を実装するコンピュータ上で、DaCapoベンチマーク中のbloatベンチマーク・プログラムを実行した。その結果、ストリング・オブジェクト(502)の場合、「bloat」ベンチマークが6%スピードアップされた。
 上記では、ポインタが指すオブジェクトにほとんどアクセスがないことを仮定した最適化の場合を考えた。しかし、上記ポインタが指すオブジェクトに頻繁にアクセスがあるようであれば、そもそもオブジェクトを圧縮又は遅延割り当ての対象とすることはない。または、上記ポインタが指すオブジェクトに頻繁にアクセスがある場合、本発明の実施態様を使用してオブジェクトのアクセス箇所がわかる。なぜならば、図15のステップ1503に示されているように、例外が起きた命令アドレスがわかり、それがオブジェクトのアクセス箇所であるからである。よって、JITコンパイラでプログラムを再コンパイルして、上記アクセス箇所だけについて、実行時チェックをするようにすればよい。

Claims (20)

  1.  コンピュータ処理において、オブジェクトへのアクセスを検出する方法であって、当該コンピュータが、
     当該オブジェクトへのポインタを操作して、当該ポインタを読み書き保護領域を指すポインタに変換するステップと、
     前記読み書き保護領域へのアクセス要求に応じて例外が発生することを利用して、前記変換されたポインタから元のポインタへ逆変換するステップと
     を実行することを含む、前記方法。
  2.  前記逆変換するステップが、
     前記例外が発生した命令を参照して、当該例外が発生した命令から、前記操作されたポインタを取得するステップと、
     前記取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得するステップと
     を含む、請求項1に記載の方法。
  3.  前記コンピュータが、
     前記逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照して、当該逆変換された元のポインタが指すオブジェクトのフォーマットに適した処理をするステップ
     をさらに実行することを含む、請求項2に記載の方法。
  4.  前記コンピュータが、
     前記フォーマットに適した処理を行った後に、前記逆変換された元のポインタが指すオブジェクトにアクセスするステップ
     をさらに実行することを含む、請求項3に記載の方法。
  5.  前記フォーマットに適した処理が、圧縮オブジェクトの伸長、又は、文字配列の遅延割り当てである、請求項3に記載の方法。
  6.  前記変換するステップが、ポインタに一定のオフセット値を加えて、前記読み書き保護領域を指すポインタを得るステップを含む、請求項1に記載の方法。
  7.  前記逆変換するステップが、前記変換されたポインタから一定のオフセット値を減じて、前記元のポインタを得るステップを含む、請求項6に記載の方法。
  8.  前記変換するステップが、前記オブジェクトへの前記ポインタをnビット数分(nは整数である)右シフトし、そして一定のオフセット値を加えて、前記読み書き保護領域を指すポインタを得るステップを含む、請求項1に記載の方法。
  9.  前記逆変換するステップが、前記変換されたポインタから一定のオフセット値を減じ、そして前記nビット数分左シフトして、前記元のポインタを得るステップを含む、請求項8に記載の方法。
  10.  前記読み書き保護領域が、オペレーティング・システムの保護領域である、請求項1に記載の方法。
  11.  前記変換するステップが、前記オブジェクトへの前記ポインタをnビット数分(nは整数である)右シフトし、そして空いた左ビットに読み書き保護領域のアドレスを埋め込んで、前記読み書き保護領域を指すポインタを得るステップを含む、請求項1に記載の方法。
  12.  前記逆変換するステップが、前記変換されたポインタを前記nビット数分左シフトして、前記元のポインタを得るステップを含む、請求項11に記載の方法。
  13.  前記逆変換するステップが、
     前記例外が発生した命令アドレスと、オブジェクトの先頭へのポインタ値を格納するスロットのレジスタ又はスロット番号との対応表を参照して、当該例外が発生した命令アドレスから、前記操作されたポインタを取得するステップと、
     前記取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得するステップを含む、請求項1に記載の方法。
  14.  前記変換するステップが、オブジェクトの割り付けにおいて、又は、ガーベジ・コレクションにおいて行われる、請求項1に記載の方法。
  15.  前記例外の発生が、セグメンテーション違反の発生である、請求項1に記載の方法。
  16.  前記例外の発生によりシグナル・ハンドラが起動し、当該シグナル・ハンドラを使用して、前記逆変換するステップが実行される、請求項1に記載の方法。
  17.  オブジェクトへのアクセスを検出するコンピュータであって、
     当該オブジェクトへのポインタを操作して、当該ポインタを読み書き保護領域を指すポインタに変換する変換部と、
     前記読み書き保護領域へのアクセス要求に応じて例外が発生することを利用して、前記変換されたポインタから元のポインタへ逆変換する逆変換部と
     を備えている、前記コンピュータ。
  18.  前記変換部が、さらに、前記例外が発生した命令を参照して、当該例外が発生した命令から、前記操作されたポインタを取得し、当該取得されたポインタを逆変換して、当該逆変換された元のポインタが指すオブジェクトの先頭へのポインタを取得し、
     前記コンピュータが、
     前記逆変換された元のポインタが指すオブジェクトのヘッダ情報を参照して、当該逆変換された元のポインタが指すオブジェクトのフォーマットに適した処理をする処理部をさらに備えている、請求項17に記載のコンピュータ。
  19.  前記フォーマットに適した処理を行った後に、前記逆変換された元のポインタが指すオブジェクトにアクセスする実行部をさらに備えている、請求項18に記載のコンピュータ。
  20.  コンピュータに、請求項1~16のいずれか一項に記載の方法の各ステップを実行させるコンピュータ・プログラム。
PCT/JP2011/069484 2010-10-20 2011-08-29 オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラム WO2012053284A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
DE112011103536T DE112011103536T5 (de) 2010-10-20 2011-08-29 Verfahren zum Erkennen von Zugriffen auf ein Objekt und Computer und Computerprogrammprodukt für selbiges
GB1307566.8A GB2498484A (en) 2010-10-20 2011-08-29 Method for detecting access of an object, computer thereof, and computer program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010-235841 2010-10-20
JP2010235841 2010-10-20

Publications (1)

Publication Number Publication Date
WO2012053284A1 true WO2012053284A1 (ja) 2012-04-26

Family

ID=45973966

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/069484 WO2012053284A1 (ja) 2010-10-20 2011-08-29 オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラム

Country Status (4)

Country Link
US (1) US20120102284A1 (ja)
DE (1) DE112011103536T5 (ja)
GB (1) GB2498484A (ja)
WO (1) WO2012053284A1 (ja)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016068981A1 (en) * 2014-10-31 2016-05-06 Hewlett Packard Enterprise Development Lp Systems and methods for restricting write access to non-volatile memory
US9584696B2 (en) * 2015-03-24 2017-02-28 Semiconductor Components Industries, Llc Imaging systems with embedded data transmission capabilities
US10452288B2 (en) 2017-01-19 2019-10-22 International Business Machines Corporation Identifying processor attributes based on detecting a guarded storage event
US10579377B2 (en) 2017-01-19 2020-03-03 International Business Machines Corporation Guarded storage event handling during transactional execution
US10496292B2 (en) 2017-01-19 2019-12-03 International Business Machines Corporation Saving/restoring guarded storage controls in a virtualized environment
US10725685B2 (en) 2017-01-19 2020-07-28 International Business Machines Corporation Load logical and shift guarded instruction
US10496311B2 (en) * 2017-01-19 2019-12-03 International Business Machines Corporation Run-time instrumentation of guarded storage event processing
US10732858B2 (en) 2017-01-19 2020-08-04 International Business Machines Corporation Loading and storing controls regulating the operation of a guarded storage facility
US10353707B2 (en) 2017-07-12 2019-07-16 International Business Machines Corporation Efficient pointer load and format
US11573793B2 (en) * 2020-03-18 2023-02-07 Oracle International Corporation Lazy push strategies for vectorized D-Heaps

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5845331A (en) * 1994-09-28 1998-12-01 Massachusetts Institute Of Technology Memory system including guarded pointers
JP2000066904A (ja) 1998-08-21 2000-03-03 Canon Inc マルチタスク制御方法及び記憶媒体
US7870553B2 (en) * 2003-08-28 2011-01-11 Mips Technologies, Inc. Symmetric multiprocessor operating system for execution on non-independent lightweight thread contexts
US7702663B2 (en) * 2004-01-05 2010-04-20 International Business Machines Corporation Breaking read barrier to apply optimizations
US7313566B1 (en) * 2004-12-23 2007-12-25 Sun Microsystems, Inc. Method and apparatus for isolating selected heap objects using a faulting address trap
US7979394B2 (en) * 2005-09-20 2011-07-12 Teradata Us, Inc. Method of managing storage and retrieval of data objects
JP2010015223A (ja) 2008-07-01 2010-01-21 Internatl Business Mach Corp <Ibm> メモリ領域中のオブジェクトを隔離するための方法

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
J.B. SARTOR ET AL.: "No bit left behind: the limits of heap data compression", PROCEEDING ISMM '08 PROCEEDINGS OF THE 7TH INTERNATIONAL SYMPOSIUM ON MEMORY MANAGEMENT, 2008, pages 111 - 120, Retrieved from the Internet <URL:http://dl.acm.org/citation.cfm?id=1375634.1375651&coll=DL&dl=ACM&CFID=54243151&CFTOKEN=47381469> [retrieved on 20111118] *
MIKI WATANABE ET AL.: "Database Engine Design Issues for Java", IPSJ SIG NOTES, vol. 97, no. 64, 14 July 1997 (1997-07-14), pages 125 - 130 *
SHINJI SUZUKI ET AL.: "The implementation of a persistent programming language P3L", IPSJ SIG NOTES, vol. 92, no. 61, 23 July 1992 (1992-07-23), pages 69 - 77 *

Also Published As

Publication number Publication date
DE112011103536T5 (de) 2013-08-01
GB201307566D0 (en) 2013-06-12
US20120102284A1 (en) 2012-04-26
GB2498484A (en) 2013-07-17

Similar Documents

Publication Publication Date Title
WO2012053284A1 (ja) オブジェクトへのアクセスを検出する方法、並びにそのコンピュータ及びコンピュータ・プログラム
EP3143500B1 (en) Handling value types
JP5147280B2 (ja) 異機種マルチプロセッサ・システムにおけるガーベッジ・コレクションのためのシステムおよび方法
JP6764485B2 (ja) ページ・フォールト解決法
US6134601A (en) Computer resource management system
US8024505B2 (en) System and method for optimistic creation of thread local objects in a virtual machine environment
US20140181359A1 (en) Information processing apparatus and method of collecting memory dump
US7506096B1 (en) Memory segment emulation model for virtual machine
JP2008041088A (ja) 大容量仮想メモリ・ページにおける保護帯域
US20150058381A1 (en) System and method for dynamically selecting a garbage collection algorithm based on the contents of heap regions
JP5031470B2 (ja) メモリ管理方法、情報処理装置及びメモリ管理プログラム
JP2015519646A (ja) マルチテナント型アプリケーション・ドメイン及びメモリの管理を伴う修正されたjvm
EP3278229B1 (en) Compressed pages having data and compression metadata
US8327111B2 (en) Method, system and computer program product for batched virtual memory remapping for efficient garbage collection of large object areas
JP5588072B2 (ja) メモリ割り当て方法、プログラム、及びシステム
US9734620B2 (en) Apparatus and method for graphics state management
JP5255049B2 (ja) データをキャッシュ・メモリにプリフェッチする方法、コンピュータ・プログラム、及びシステム
JP2009282774A (ja) エミュレーションプログラム、エミュレーション装置およびエミュレーション方法
US8151086B2 (en) Early detection of an access to de-allocated memory
US8479182B2 (en) Program, apparatus, and method of optimizing a java object
AU2018205196B2 (en) Lock free streaming of executable code data
US8732442B2 (en) Method and system for hardware-based security of object references
JP5246014B2 (ja) 仮想化プログラム、仮想化処理方法及び装置
KR20080067144A (ko) 효율적인 메모리 사용을 위한 스택 관리 장치 및 방법
JP2022093083A (ja) 情報処理装置及び制御プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11834126

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 1120111035365

Country of ref document: DE

Ref document number: 112011103536

Country of ref document: DE

ENP Entry into the national phase

Ref document number: 1307566

Country of ref document: GB

Kind code of ref document: A

Free format text: PCT FILING DATE = 20110829

WWE Wipo information: entry into national phase

Ref document number: 1307566.8

Country of ref document: GB

NENP Non-entry into the national phase

Ref country code: JP

ENPC Correction to former announcement of entry into national phase, pct application did not enter into the national phase

Ref country code: GB

122 Ep: pct application non-entry in european phase

Ref document number: 11834126

Country of ref document: EP

Kind code of ref document: A1