摘要:
Systems and methods for implementing an execution stack which stores frames for functions written in multiple programming languages are provided. The frames for functions written in different programming languages may be interleaved on the same execution stack. A data block on the execution stack may be utilized to traverse the execution stack around a frame by storing a stack pointer and frame pointer to a previous frame. Additionally, exceptions may be propagated, with conversion if necessary, through frames on the execution stack that are written in different programming languages.
摘要:
Systems and methods for increasing the execution speed of virtual machine instructions for a function are provided. A portion of the virtual machine instructions of the function are compiled into native machine instructions so that the function includes both virtual and native machine instructions. Execution of the native machine instructions may be accomplished by overwriting a virtual machine instruction of the function with a virtual machine instruction that specifies execution of the native machine instructions. Additionally, the original virtual machine instruction may be stored so that the original virtual machine instructions can be regenerated.
摘要:
Methods and apparatus for speculatively locking an object are disclosed. According to one aspect of the present invention, a method for acquiring use of an object using a current thread includes a determination of whether a first bit included in the object is set to indicate that the object is speculatively owned by a speculative owner thread. When the object is speculatively owned, the speculative owner thread is allowed to use the object without locking the object. The method also includes checking a stored identifier that is associated with the object and identifies the speculative owner thread, as well as determining whether the stored identifier identifies the current thread. When the stored identifier identifies the current thread, the current thread already has use of the object; i.e., the current thread is the speculative owner thread. Finally, the method includes locking the object using the speculative owner thread when it is determined that the stored identifier does not identify the current thread. In one embodiment, as for example when substantially all objects in a computing system are known to be suitable for speculative ownership, the stored identifier is checked before determining when the first bit associated with the object is set to indicate that the object is associated with the speculative owner thread.
摘要:
Systems and methods for implementing an execution stack which stores frames for functions written in multiple programming languages are provided. The frames for functions written in different programming languages may be interleaved on the same execution stack. A data block on the execution stack may be utilized to traverse the execution stack around a frame by storing a stack pointer and frame pointer to a previous frame. Additionally, exceptions may be propagated, with conversion if necessary, through frames on the execution stack that are written in different programming languages.
摘要:
Methods and apparatus for dynamically compiling byte codes associated with methods during idle periods in the execution of a computer program are disclosed. The described methods are particularly suitable for use in computer systems that are arranged to execute both interpreted and compiled byte codes. In some embodiments, methods to be dynamically compiled are referenced in one or more lists. The lists may be prioritized to facilitate the compilation of the highest priority methods first. In one embodiment, a pair of compilation lists are provided with a first one of the compilation lists being created prior to processing the computer program while the other is created during the processing of the computer program.
摘要:
Methods and apparatus which enable threads to lock and to unlock objects disclosed. According to one aspect of the present invention, a method for associating an object with a first thread includes obtaining the contents of the object header field of the object. The contents obtained from the object header field are then stored into a first location within a stack which is associated with the first thread. A reference indicator, which identifies the stack in which the contents obtained from the object header field are stored, is then stored in the object header field. In one embodiment, the method further includes updating a status indicator associated with the object to essentially show that the reference indicator is stored in the object header field. In such an embodiment, the contents of the object header may include a header value, and the status indicator may be updated to indicate that the object is accessible to the first thread.
摘要:
A method for synchronizing threads in a computer operating under control of a program written in an object-based computer programming language provides for a first thread to lock an object by moving the object header to a stack address and replacing the header with the stack address. The first thread unlocks the object by returning the header to its associated memory location. Second and subsequent threads attempting to access a locked object detect the presence of the stack address in the header memory location and suspend their attempts to access the object. When using aligned stacks, all stack addresses will be even, and all object-headers will be odd. Threads efficiently check the status of the object by testing the least significant bit. A preferred method is implemented in a "JAVA" just-in-time compiler of a "JAVA" virtual machine.
摘要:
One embodiment of the present invention provides a system that uses map objects to access object properties for a program written in a dynamic object-oriented programming language, thereby facilitating property access for languages that allow additional properties to be defined for objects at runtime. During operation, the system receives an object of an object type. This object is associated with a memory region and a given map object (from a set of map objects associated with the given object type) that describes how properties of the object are mapped to fields in the memory region. When receiving a request to access a property of the object, the system determines whether the given map object includes a field mapping for the property. If so, the system accesses a field in the memory region associated with the property using the field mapping.
摘要:
A system that associates an identifier with an instance defined within an object-oriented programming system. The system generates an identifier for the instance and associates a new near object with the instance, wherein the new near object points to a class specifying behavior for the object. The system stores the identifier in the new near object, and sets a class pointer located within a header of the instance to point to the new near object. In this way, the class pointer indirectly points to the class for the object through the new near object. The system can lock the instance to facilitate exclusive access to the instance by copying a near object associated with the instance to a method activation on the execution stack, and setting the class pointer of the instance to point to the copy of the near object on the execution stack.
摘要:
Methods and apparatus for dynamically compiling byte codes associated with methods during idle periods in the execution of a computer program are disclosed. The described methods are particularly suitable for use in computer systems that are arranged to execute both interpreted and compiled byte codes. In some embodiments, methods to be dynamically compiled are referenced in one or more lists. The lists may be prioritized to facilitate the compilation of the highest priority methods first. In one embodiment, a pair of compilation lists are provided with a first one of the compilation lists being created prior to processing the computer program while the other is created during the processing of the computer program.