Process for processing programs, process for detecting depth...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000

Reexamination Certificate

active

06363521

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Technical Field
The present invention relates to a method inlining in a compiler, particularly to a method inlining in Java (a trademark of Sun Microsystems) JIT (Just In Time) compiler, etc.
2. Prior Art
Java includes a security check facility in its language, wherein SecurityManager class comprises the following five methods:
(1) getClassContext
This is a method for returning as an array a class which a method corresponding to each frame on a stack belongs to. A frame is a storage area which stores information generated when a method is executed, about the method generated.
(2) currentClassLoader
This method returns a class loader itself of the newest class which has a class loader and which a method corresponding to a frame on a stack belongs to. A class loader is a class comprising a group of methods used to load classes which are not yet loaded. The newest means most recently executed.
(3) currentLoadedClass
This method returns the newest class which has a class loader and which a method corresponding to a frame on a stack belongs to.
(4) currentDepth
This method returns the depth in a stack of a frame corresponding to the newest method belonging to the same class as the specified one.
(5) classLoaderDepth
This method returns the depth of a frame in a stack, wherein the frame corresponds to a method belonging to the newest class with a class loader.
These methods acquire necessary information by tracing the stack. On the other hand, method inlining takes a code of the invoked method into the invoking side at the time of compiling instead of invoking a method at the time of execution to remove method invocation. Accordingly, there is no execution information generated as to any method which is already inlined. If any method of SecurityManager class is included in any code of inlined methods or in any method invoked from the inlined method, there arises a problem that the behavior of the program may change because they don't return the correct results. Thus, conventionally method inlining was executable only if it is assured that invocation relationship to the end is completely grasped and such method invocations do not include any call to a method of SecurityManager class.
In an object oriented language such as Java, messages are easily overloaded. Accordingly, while it has high reusability and flexibility as a module, it is almost difficult for a compiler to perform analysis which enables the aforementioned assurance. Java allows a final descriptor to be affixed to a special method. This “final” means being at the end and not to be overloaded. If the final attribute is not specified, a generally used virtual method invocation cannot specify an invoked code since it may be overridden. If method inlining is performed based on the final attribute, however, the extent to which method inlining is applicable is limited due to the following status. (a) A general programmer seldom uses the final attribute, and (b) even if the creator of a program recognizes it as a method invocation not to be overridden, in many cases there is no explicit designation of the final attribute.
Meanwhile, “a method invocation wherein invocation relationship to the end is completely grasped” is a method invocation wherein an invoked method is not a native method and is invoked by either a static invocation, a non-virtual invocation or a virtual method invocation with the final attribute. The native method is a method written in a language other than Java such as C and consists of a compiled code. Also, the static invocation is an invocation for a method defined with a static descriptor affixed (static method). The static method is a method for invocation without using an object, not overloaded by any other method. Accordingly, it is always possible in a static invocation to uniquely decide an executed method.
Accordingly, an object of the present invention is to expand the scope of execution optimization by method inlining in a language with a security facility such as Java.
It is also an object to enable method inlining in Java's JIT (Just In Time) compiler.
In addition, it is also an object to enable stack information in a state where method inlining is not executed to reappear, when method inlining is executed.
It is also an object, in a language such as Java, to enable looping by a tail recursion for a method including an invocation of a method whose process after its invocation is indefinite and which includes a self recursion.
Furthermore, it is also an object to enable grasping of the number of iterations in the looping.
It is also an object to enable preservation of the invocation relationship information between methods before method inlining, when method inlining is executed.
It is also an object to enable determination of which method's code is being executed when method inlining is executed.
SUMMARY OF THE INVENTION
To accomplish the above objects, the present invention has the following aspects. The first aspect comprises the steps of: generating a code necessary for looping by a tail recursion for a method including an invocation of a method whose process after its invocation is indefinite and which includes a self recursion; and generating a code for counting the number of iterations of the loop. By executing a program including such codes, the number of iterations of the loop can be counted so that a depth of a stack may be corrected when SecurityManager operates. Accordingly, in a language such as Java, it is also possible to attempt optimization by means of looping by a tail recursion.
The step of generating the code for counting the number of iterations of the loop may include a step of generating a work area on a stack when executing the program. It is also possible to generate a code for initializing the count of the number of the iterations of the loop before the code necessary for looping. In addition, it may also include a step of setting a flag which represents generation of a code necessary for looping in order to facilitate detection of this process being executed when SecurityManager operates.
On the other hand, if a program including an invocation of a method whose process after its invocation is indefinite and which includes a self recursion is executed, wherein the program includes a first method which includes a code necessary for looping by a tail recursion and a code for counting the number of iterations of the loop, in order to detect a depth of a frame associated with a specified method which satisfies a predetermined condition in a storage area storing information with respect to executed methods as corresponding frames, SecurityManager executes the steps of: determining whether a second method associated with a currently examined frame in the storage area is the specified method; if the second method is not the specified method, determining whether the second method is the first method; and if the second method is the first method, correcting the depth of a frame in the storage area associated with the second method by using the count value by the code for counting the number of iterations of the loop. By doing so, there will be no influence when method inlining by a tail recursion is performed. By correcting by the count value, it enables stack information in a state where inlining is not performed to reappear.
Moreover, if the second method is the specified method and a frame associated with the first method is already examined before examining a frame associated with the specified method, it further executes a step of returning a depth from an earliest frame in the storage area to a frame associated with the second method, wherein the depth is corrected by the count value in the first method. This is the process in the event of tracing a stack more deeply than in the previous paragraph.
In addition, if the second method is not the first method, it may further execute a step of adding 1 to the depth and changing the second method to a method associated with a next frame. Stack trace is performed until the specified

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Process for processing programs, process for detecting depth... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Process for processing programs, process for detecting depth..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Process for processing programs, process for detecting depth... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2882477

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.