Placing exception throwing instructions in compiled code
First Claim
1. A method of translating computer program code from a first language representation into a second language representation, the method comprising:
- translating the translatable instructions of an input stream in a first language representation into an output stream in a second language representation;
identifying an unresolvable translation error in the input stream; and
placing at least one second language representation instruction in the output stream responsive to identifying the unresolvable translation error in the input stream;
wherein the placed at least one second language representation instruction is at least one of either a handling instruction or an exception throwing instruction.
2 Assignments
0 Petitions
Accused Products
Abstract
A compiler that completes compilation upon identifying unresolvable input during compilation instead of aborting compilation. This can be accomplished by inserting an exception-throwing instruction, and/or handlers in place of the unresolvable input in the compiled code output. If the section of the compiled code containing the inserted exception throwing instruction is later executed, an exception is thrown and/or handled. Compilation of code from a trusted source can be completed without inserting an exception throwing instruction when the code has only suspected but unverifiable problems.
-
Citations
38 Claims
-
1. A method of translating computer program code from a first language representation into a second language representation, the method comprising:
-
translating the translatable instructions of an input stream in a first language representation into an output stream in a second language representation;
identifying an unresolvable translation error in the input stream; and
placing at least one second language representation instruction in the output stream responsive to identifying the unresolvable translation error in the input stream;
wherein the placed at least one second language representation instruction is at least one of either a handling instruction or an exception throwing instruction. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 33, 35, 36, 37, 38)
-
-
15. A method of translating computer program code from an input stream in a first language representation into an output stream in a second language representation, and the input stream may or may not be from a trusted source, the method comprising:
-
translating the translatable instructions of the input stream into the output stream;
identifying suspected code in the input stream;
determining that the input stream is from a trusted source; and
translating the suspected code in the input stream into the output stream.
-
-
21. A method of translating computer program code from an input stream in a first language representation into an output stream in a second language representation, the input stream comprising declarative textual indications, the method comprising:
-
translating the translatable instructions in the input stream into the output stream;
identifying a first language representation of a declarative textual indication in the input stream, the declarative textual indication indicating how to handle at least one of either an unresolvable translation error or a suspected code encountered in the input stream; and
translating the first language representation of the declarative textual indication in the input stream into the second language representation of the declarative textual indications in the output stream;
whereby the second language representations of the declarative textual indications are available to a next phase of translation, the next phase of translation able to use the second language representation of the declarative textual indication as a resource for determining how to handle an unresolvable translation error and/or suspect code encountered by the next phase of translation as the next phase translates the output stream into a third language representation. - View Dependent Claims (22, 23, 31, 32)
-
-
24. A method of translating computer program code an input stream in a first language into an output stream in a second language, the method of translating including multiple sub-units of translation, the method comprising:
-
translating the translatable portions of the input stream into the output stream;
identifying a suspected code in the input stream, determining by a security sub-unit of translation based on a declarative textual indication in the input stream that the input stream is from a trusted source, and translating the suspected code into the output stream;
identifying a first unresolvable translation error in a first method in the input stream, determining by a basic block identification sub-unit of translation, that the first unresolvable translation error can not be safely segregated within a determinable basic block within the first method, and invoking a method level exception throwing instruction insertion sub-unit of translation to insert an exception throwing instruction in the output stream, and invoking a handler data structure insertion sub-unit of translation to insert a handler data structure in the output stream; and
identifying a second unresolvable translation error in a second method in the input stream, determining by the basic block identification sub-unit of translation, that the second unresolvable translation error can be safely segregated within a determinable basic block within the second method, and invoking a basic block level exception throwing instruction insertion sub-unit of translation to insert an exception throwing instruction in the output stream, and invoking the handler data structure insertion sub-unit of translation to insert a handler data structure in the output stream.
-
-
25. In a computer readable medium, instructions operational to translate a first language input stream into a second language output stream, the instructions comprising:
-
instruction(s) for translating the translatable portions of a first language input stream into a second language output stream;
instruction(s) identifying an unresolvable translation error in the first language input stream; and
instruction(s) placing an exception throwing instruction in the second language output stream in response to identifying the unresolvable translation error in the first language input stream.
-
-
26. In a computer readable medium, instructions operational to translate a first language input stream into a second language output stream, the instructions comprising:
-
instruction(s) translating the translatable portions of a first language input stream into a second language output stream;
instruction(s) identifying suspected code in the first language input stream;
instruction(s) determining the source of the first language input stream; and
instructions(s) translating the suspected code into the second language output stream in response to determining that the first language input stream is from a trusted source.
-
-
27. In a computer readable medium, instructions operational to translate a first language input stream into a second language output stream, the instructions comprising:
-
instruction(s) for translating the translatable portions of a first language input stream into a second language output stream;
instruction(s) identifying an unresolvable translation error in the first language input stream; and
instruction(s) placing a handling instruction in the second language output stream in response to identifying the unresolvable translation error in the first language input stream.
-
-
28. In a computer system having a user input device, a first language input stream, an operating system, a translation system operating under control of the operating system, the system comprising:
-
a translation process operating under control of the operating system, and translating the first language input stream into a second language output stream subsequent to a user input on the user input device;
a translation sub-unit operational to perform some portion of the translation process; and
a translation sub-unit operational to translate an unresolvable translation error identified in the first language input stream into an inserted exception throwing instruction in a translated code of the second language output stream.
-
-
29. In a computer system having a user input device, a first language input stream, an operating system, a translation system operating under control of the operating system, the system comprising:
-
a translation process operating under control of the operating system, and translating the first language input stream into a second language output stream subsequent to a user input on the user input device;
a translation sub-unit operational to perform some portion of the translation process; and
a translation sub-unit operational to verify that a source of the first language input stream is a trusted source, and translating a suspected code encountered in the first language input stream into a translated code in the second language output stream upon verifying that the source of the first language input stream is a trusted source.
-
-
30. In a computer system having a user input device, a first language input stream, an operating system, a translation system operating under control of the operating system, the system comprising:
-
a translation process operating under control of the operating system, and translating the first language input stream into a second language output stream subsequent to a user input on the user input device;
a translation sub-unit operational to perform some portion of the translation process; and
a translation sub-unit operational to translate an unresolvable translation error encountered in the first language input stream into an inserted handling instruction in a translated code of the second language output stream.
-
-
34. A method of delaying identification of compile time errors until run time, the method comprising:
-
compiling a first file containing a first language representation of a computer program into a second file containing a second language representation of the computer program;
identifying an unresolvable instruction in the first file;
determining where the identified unresolvable instruction in the first file would be placed in the second file by the compiler if the identified unresolvable instruction were resolvable;
translating the identified unresolvable instruction into a second language representation of an exception throwing instruction; and
inserting the second language representation of the exception throwing instruction into the second file where the identified unresolvable instruction would have been placed in the second file by the compiler if the unresolvable instruction were resolvable.
-
Specification