US2017010900A1PendingUtilityA1
Adding Functionality To Existing Code At Exits
Est. expiryFeb 28, 2021(expired)· nominal 20-yr term from priority
Inventors:Jeffrey R. Cobb
G06F 8/41G06F 9/443G06F 9/4426G06F 8/315G06F 9/4486G06F 9/449G06F 2201/88G06F 11/3466G06F 2201/865G06F 11/3409
57
PatentIndex Score
0
Cited by
0
References
0
Claims
Abstract
New code is added to existing object code in order to add new functionality. For example, a call to start a profiler function can be added at the beginning of a Java method and a call to stop the profiler function can be added at the exits of the Java method. A method may have many different exits. To insure that the profiler process is stopped regardless of which exit is performed, the byte code and exception table are modified.
Claims
exact text as granted — not AI-modifiedI claim:
1 . A method implemented on one or more machines for modifying existing object code, the method comprising:
adding exit code to said existing object code; and adding a new entry in an exceptions data store for said existing object code, said new entry points to said exit code.
2 . A method according to claim 1 , further comprising:
creating a path to said exit code from said existing object code.
3 . A method according to claim 2 , wherein:
said creating a path includes adding a jump instruction.
4 . A method according to claim 1 , wherein:
said exit code is part of a profiling process; and said method further comprises performing said profiling process.
5 . A method according to claim 1 , further comprising:
adding start code to said existing object code.
6 . A method according to claim 5 , wherein:
said existing object code includes a method having original byte code; said start code is to be performed upon starting said method; said start code is a call to a start method; said exit code is a call to an exit method; said start method starts a profiling process; and said exit method stops a profiling process.
7 . A method according to claim 5 , wherein:
said existing object code includes a method having original byte code; and said adding start code includes adding new byte code to said method and adjusting indices for said original byte code, said new byte code is positioned to be executed prior to said original byte code.
8 . A method according to claim 7 , wherein:
said start code starts a profiling process; said exit code stops a profiling process; said exit code is positioned to be executed subsequent to said original byte code; said exceptions data store is an exception table for said method; and said adding a new entry in said exceptions data store includes adding said new entry into said exception table for said method, said new entry indicates a range of indices corresponding to said original byte code, said new entry includes a reference to said exit code and said new entry indicates that said new entry pertains to all types of exceptions.
9 . A method according to claim 1 , wherein:
said new entry includes a reference to said exit code and indicates that said new entry pertains to two or more types of exceptions.
10 . A method according to claim 1 , wherein:
said new entry includes a reference to said exit code and indicates that said new entry pertains to all types of exceptions.
11 . A method according to claim 1 , wherein:
said existing object code includes a method; and said adding a new entry in said exceptions data store includes adding said new entry for said method, said new entry indicates a range of indices corresponding to said method, said new entry includes a reference to said exit code and said new entry indicates that said new entry pertains to multiple types of exceptions.
12 . A method according to claim 1 , further comprising:
storing said exit code.
13 . A method according to claim 1 , wherein:
said existing object code includes a Java method; said exit code is Java; and said exceptions data store is a Java exception table for said Java method.
14 . A method according to claim 1 , wherein said adding exit code includes:
adding new finalization code; adding new code that calls said new finalization code if no exceptions occur; and adding a new exception handler, said new exception handler is performed if an otherwise unhandled exception occurs, said new exception handler calls said new finalization code.
15 . A method according to claim 14 , wherein:
said adding a new entry in an exceptions data store includes adding a new entry in an exceptions table, said new entry includes a reference to a portion of said existing object code and a reference to said new exception handler.
16 . A method according to claim 1 , wherein:
said adding a new entry in an exceptions data store creates a grouping of a portion of said existing object code and references a portion of said exit code that is to be performed if an exception occurs during execution of said portion of said existing object code.
17 . A method according to claim 1 , wherein:
said adding exit code and adding a new entry include adding try and finally functionality to said existing object code.
18 . The method of claim 1 , wherein said adding exit code and adding a new entry are performed automatically.
19 . One or more processor readable storage devices having processor readable code embodied thereon, said processor readable code for programming one or more processors to perform a method comprising:
adding exit code to existing object code, and adding a new entry in an exceptions data store pointing to said exit code.
20 . One or more processor readable storage devices according to claim 19 , wherein:
said existing object code includes a method having original byte code; said method further comprises adding start code to said existing object code, said adding start code includes adding new byte code to said method and adjusting indices for said original byte code; said start code starts a profiling process; said exit code stops a profiling process; said exit code is positioned to be executed subsequent to said original byte code; said exceptions data store is an exception table for said method; and said adding a new entry in said exceptions data store includes adding a new entry into said exception table for said method, said new entry indicates a range of indices corresponding to said original byte code, said new entry includes a reference to said exit code and said new entry indicates that said new entry pertains to all types of exceptions.
21 . One or more processor readable storage devices according to claim 19 , wherein:
said existing object code includes a method; and said adding a new entry in said exceptions data store includes adding said new entry for said method, said new entry indicates a range of indices corresponding to said method, said new entry includes a reference to said exit code and said new entry indicates that said new entry pertains to multiple types of exceptions.
22 . One or more processor readable storage devices according to claim 19 , wherein said adding exit code includes:
adding new finalization code; adding new code that calls said new finalization code if no exceptions occur; and adding a new exception handler, said new exception handler is performed if an otherwise unhandled exception occurs, said new exception handler calls said new finalization code, said adding a new entry in an exceptions data store includes adding a new entry in an exceptions table, said new entry includes a reference to a portion of said existing object code and a reference to said new exception handler.
23 . One or more processor readable storage device according to claim 19 , wherein:
said adding a new entry in an exceptions data store comprises creating a new grouping of at least a portion of said existing object code; said adding exit code includes adding new finalization code for said grouping, adding new code that calls said new finalization code if no exceptions occur, and adding new code that is performed if an exception occurs, said new code that is performed if an exception occurs calls said new finalization code.
24 . One or more processor readable storage device according to claim 23 , wherein said adding a new entry in an exceptions data store comprises:
adding a new entry in an exceptions table that includes a reference to said grouping and a reference to said new finalization code.
25 . A method implemented on one or more machines for adding functionality to existing object code, the method comprising:
adding new exit functionality to said existing object code; creating a grouping of all or a portion of said existing object code; and associating said grouping of said existing object code with at least a portion of said new exit functionality that is to be performed if an exception occurs during execution of said grouping of said existing object code.
26 . A method according to claim 25 , wherein:
said method includes adding start functionality to said existing object code; said existing object code includes a method having original byte code; said start functionality is to be performed upon starting said method; said new exit functionality is performed upon exiting said method; said start functionality is a call to a start method; said new exit functionality is a call to an exit method; said start method starts a profiling process; and said exit method stops a profiling process.
27 . A method according to claim 25 , wherein:
said method includes adding start functionality to said existing object code; said existing object code includes a method having original byte code; and said adding start functionality includes adding new byte code to said method and adjusting indices for said original byte code, said new byte code is positioned to be executed prior to said original byte code.
28 . A method according to claim 27 , wherein:
said start functionality starts a profiling process; said new exit functionality stops a profiling process; said new exit functionality is positioned to be executed subsequent to said original byte code; said adding new exit functionality includes adding an instruction to jump to new exit code from said original byte code; and said associating includes adding a new entry to an exception table, said new entry indicates a range of indices corresponding to said original byte code, said new entry includes a reference to said new exit functionality and said new entry indicates that said new entry pertains to all types of exceptions.
29 . A method according to claim 25 , wherein:
said creating a grouping and associating implement try and finally functionality.
30 . A method according to claim 25 , wherein:
said existing object code includes a method; and said associating includes adding a new entry into an exceptions data store for said method, said new entry indicates a range of indices corresponding to said original method, said new entry includes a reference to exit code and said new entry indicates that said new entry pertains to multiple types of exceptions.
31 . A method according to claim 25 , wherein said adding new exit functionality includes:
adding new finalization code; adding new code that calls said new finalization code if no exceptions occur; and adding a new exception handler, said new exception handler is performed if an otherwise unhandled exception occurs, said new exception handler calls said new finalization code.
32 . A method according to claim 31 , wherein:
said creating and associating includes adding a new entry in an exceptions table, said new entry includes a reference to said grouping and a reference to said new exception handler.
33 . A method according to claim 25 , wherein:
said adding, creating and associating include adding try and finally functionality to said existing object code.
34 . One or more processor readable storage devices having processor readable code embodied thereon, said processor readable code for programming one or more processors to perform a method comprising:
adding new exit functionality to existing object code; creating a grouping of all or part of said existing object code; and associating said new exit functionality as a clean up process for said all or part of said existing object code grouped together.
35 . One or more processor readable storage devices according to claim 34 , wherein:
said method further comprises adding start functionality to said existing object code; said existing object code includes a method having original byte code; said adding start functionality includes adding new byte code to said method and adjusting indices for said original byte code, said new byte code is positioned to be executed prior to said original byte code; said start functionality starts a profiling process; said new exit functionality stops a profiling process; said new exit functionality is positioned to be executed subsequent to said original byte code; and said associating includes adding a new entry to an exception table, said new entry indicates a range of indices corresponding to said original byte code, said new entry includes a reference to said new exit functionality and said new entry indicates that said new entry pertains to all types of exceptions.
36 . One or more processor readable storage devices according to claim 34 , wherein:
said creating a grouping and associating implement try and finally functionality.
37 . One or more processor readable storage devices according to claim 34 , wherein:
said existing object code includes a method; and said associating includes adding a new entry into an exceptions data store for said method, said new entry indicates a range of indices corresponding to said original byte code, said new entry includes a reference to said new exit functionality and said new entry indicates that said new entry pertains to multiple types of exceptions.
38 . An apparatus, comprising:
one or more storage devices; and one or more processors in communication with said one or more storage devices, said one or more processors programmed to perform a method comprising:
accessing existing object code; and
adding try and finally functionality to said existing object code.
39 . An apparatus according to claim 38 , wherein said adding try and finally functionality includes:
adding new finalization code; adding new code that calls said new finalization code if no exceptions occur; adding a new exception handler, said new exception handler is performed if an otherwise unhandled exception occurs, said new exception handler calls said new finalization code; and adding a new entry in an exceptions table, said new entry includes a reference to a portion of said existing object code and a reference to said new exception handler.
40 . An apparatus according to claim 39 , wherein:
said new entry indicates that said new entry pertains to multiple types of exceptions.Join the waitlist — get patent alerts
Track US2017010900A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.