Claims
- 1. A method for converting a synchronized method into a non-synchronized method, comprising:
receiving a code module that includes the synchronized method, wherein the synchronized method automatically performs a lock operation before executing the method body and automatically performs an unlock operation after executing the method body, whereby at most one thread at a time can execute the method body; changing the synchronized method into a non-synchronized method that does not automatically perform lock and unlock operations; inserting an explicit lock instruction at the beginning of the method body; and inserting an explicit unlock instruction at the end of the method body.
- 2. The method of claim 1, further comprising adding a new exception handler to the method, wherein the new exception handler releases the lock when an exception is thrown within the method body.
- 3. The method of claim 2, wherein the new exception handler calls an existing exception hander after releasing the lock.
- 4. The method of claim 1,
wherein the lock is a monitor; wherein performing the lock operation involves performing a monitor enter operation; and wherein performing the unlock operation involves performing a monitor exit operation.
- 5. The method of claim 1, wherein changing the synchronized method into a non-synchronized method involves modifying an attribute of the synchronized method to change the synchronized method into a non-synchronized method.
- 6. The method of claim 1, wherein the code module is a class file.
- 7. The method of claim 1, wherein the conversion process takes place within a translator that translates one or more class files into a suite file that is suitable for execution on a smart card.
- 8. The method of claim 1, wherein the code module contains platform-independent bytecodes, and wherein the conversion process involves modifying the platform-independent bytecodes.
- 9. The method of claim 1, wherein the code module contains source code instructions specified in a high-level programming language, and wherein the conversion process involves modifying the source code instructions.
- 10. The method of claim 1, wherein the synchronized method can be a static method or a virtual method.
- 11. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for converting a synchronized method into a non-synchronized method, the method comprising:
receiving a code module that includes the synchronized method, wherein the synchronized method automatically performs a lock operation before executing the method body and automatically performs an unlock operation after executing the method body, whereby at most one thread at a time can execute the method body; changing the synchronized method into a non-synchronized method that does not automatically perform lock and unlock operations; inserting an explicit lock instruction at the beginning of the method body; and inserting an explicit unlock instruction at the end of the method body.
- 12. The computer-readable storage medium of claim 11, wherein the method further comprises adding a new exception handler to the method, wherein the new exception handler releases the lock when an exception is thrown within the method body.
- 13. The computer-readable storage medium of claim 12, wherein the new exception handler calls an existing exception hander after releasing the lock.
- 14. The computer-readable storage medium of claim 11,
wherein the lock is a monitor; wherein performing the lock operation involves performing a monitor enter operation; and wherein performing the unlock operation involves performing a monitor exit operation.
- 15. The computer-readable storage medium of claim 11, wherein changing the synchronized method into a non-synchronized method involves modifying an attribute of the synchronized method to change the synchronized method into a non-synchronized method.
- 16. The computer-readable storage medium of claim 11, wherein the code module is a class file.
- 17. The computer-readable storage medium of claim 11, wherein the conversion process takes place within a translator that translates one or more class files into a suite file that is suitable for execution on a smart card.
- 18. The computer-readable storage medium of claim 11, wherein the code module contains platform-independent bytecodes, and wherein the conversion process involves modifying the platform-independent bytecodes.
- 19. The computer-readable storage medium of claim 11, wherein the code module contains source code instructions specified in a high-level programming language, and wherein the conversion process involves modifying the source code instructions.
- 20. The computer-readable storage medium of claim 11, wherein the synchronized method can be a static method or a virtual method.
- 21. An apparatus that converts a synchronized method into a non-synchronized method, comprising:
a receiving mechanism configured to receive a code module that includes the synchronized method, wherein the synchronized method automatically performs a lock operation before executing the method body and automatically performs an unlock operation after executing the method body, whereby at most one thread at a time can execute the method body; and a conversion mechanism configured to,
change the synchronized method into a non-synchronized method that does not automatically perform lock and unlock operations, insert an explicit lock instruction at the beginning of the method body, and to insert an explicit unlock instruction at the end of the method body.
- 22. The apparatus of claim 21, wherein the conversion mechanism is configured to add a new exception handler to the method, wherein the new exception handler releases the lock when an exception is thrown within the method body.
- 23. The apparatus of claim 22, wherein the new exception handler calls an existing exception hander after releasing the lock.
- 24. The apparatus of claim 21,
wherein the lock is a monitor; wherein performing the lock operation involves performing a monitor enter operation; and wherein performing the unlock operation involves performing a monitor exit operation.
- 25. The apparatus of claim 21, wherein the conversion mechanism is configured to change the synchronized method into a non-synchronized method by modifying an attribute of the synchronized method to change the synchronized method into a non-synchronized method.
- 26. The apparatus of claim 21, wherein the code module is a class file.
- 27. The apparatus of claim 21, wherein the apparatus is located within a translator that translates one or more class files into a suite file that is suitable for execution on a smart card.
- 28. The apparatus of claim 21, wherein the code module contains platform-independent bytecodes, and wherein the conversion mechanism is configured to modify the platform-independent bytecodes.
- 29. The apparatus of claim 21, wherein the code module contains source code instructions specified in a high-level programming language, and wherein the conversion mechanism is configured to modify the source code instructions.
- 30. The apparatus of claim 21, wherein the synchronized method can be a static method or a virtual method.
RELATED APPLICATION
[0001] This application hereby claims priority under 35 U.S.C. §119 to U.S. Provisional Patent Application No. 60/392,375, filed on Jun. 26, 2002, entitled “Optimizing Platform Independent Code,” by inventors Nicholas Shaylor and Douglas Simon and to U.S. Provisional Patent Application No. 60/412,607, filed on Sep. 20, 2002, entitled “The Squawk System,” by inventors Nicholas Shaylor and Douglas Simon.
Provisional Applications (2)
|
Number |
Date |
Country |
|
60392375 |
Jun 2002 |
US |
|
60412607 |
Sep 2002 |
US |