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 translatable instructions of an input stream in a first language representation into an output stream in a second language representation;
identifying an unresolvable code in the input stream wherein a translator is unable to translate the unresolvable code from a first language representation into a second language representation; and
placing at least one second language representation instruction in the output stream responsive to identifying the unresolvable code 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
37 Claims
-
1. A method of translating computer program code from a first language representation into a second language representation, the method comprising:
-
translating translatable instructions of an input stream in a first language representation into an output stream in a second language representation; identifying an unresolvable code in the input stream wherein a translator is unable to translate the unresolvable code from a first language representation into a second language representation; and placing at least one second language representation instruction in the output stream responsive to identifying the unresolvable code 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, 15, 16, 17, 18, 19, 20, 21, 22)
-
-
23. 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 translatable instructions of the input stream into the output stream; identifying suspected code and unresolvable code in the input stream; upon determining by a translator, that the unresolvable code in the input stream cannot be translated from a first language representation into a second language representation, placing at least one second language representation instruction in the output stream responsive to identifying the unresolvable code in the input stream in the first language representation wherein the placed at least one second language representation instruction is at least one of a handling instruction or an exception throwing instruction; determining that the input stream is from a trusted source; and translating the suspected code in the input stream into the output stream. - View Dependent Claims (24, 25)
-
-
26. 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 translatable instructions in the input stream into the output stream; identifying an unresolvable instruction in the input stream wherein a translator is unable to translate the unresolvable instruction from a first language representation into a second language representation; placing at least one second language representation instruction in the output stream responsive to identifying the unresolvable instruction in the input stream wherein the placed at least one second language representation instruction is at least one of a handling instruction or an exception throwing instruction; identifying a first language representation of a declarative textual indication in the input stream, the declarative textual indication indicating how to handle an unresolvable instruction encountered in the input stream; 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; and 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 instruction encountered by the next phase of translation as the next phase translates the output stream into a third language representation. - View Dependent Claims (27)
-
-
28. A method of translating computer program code from 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 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 instruction in a first method in the input stream of the first language wherein one or more sub-units of translation are unable to translate the first unresolvable instruction into the output stream in the second language, determining by a basic block identification sub-unit of translation, that a second language instruction inserted in the output stream in place of the first unresolvable instruction can not be safely segregated within a determinable basic block within the first method in the output stream, 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 instruction in a second method in the input stream of the first language wherein one or more sub-units of translation are unable to translate the second unresolvable instruction into the output stream in the second language, determining by the basic block identification sub-unit of translation, that a second language instruction inserted in the output stream in place of the second unresolvable instruction can be safely segregated within a determinable basic block within the second method in the output stream, 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.
-
-
29. 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 translatable portions of a first language input stream into a second language output stream; instruction(s) identifying an unresolvable instruction in the first language input stream wherein an unresolvable instruction is an instruction a translator is unable to translate from a first language representation into a second language representation; and instruction(s) placing an exception throwing instruction in the second language output stream in response to identifying the unresolvable instruction in the first language input stream. - View Dependent Claims (30)
-
-
31. 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 translatable portions of a first language input stream into a second language output stream; instruction(s) identifying suspected code and an unresolvable code in the first language input stream wherein instructions translating translatable portions of the first language input stream are unable to translate the unresolvable code into the second language output stream; instruction(s) placing an exception throwing instruction in the second language output stream in response to identifying the unresolvable 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.
-
-
32. 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 translatable portions of a first language input stream into a second language output stream; instruction(s) identifying an untranslatable instruction in the first language input stream; and instruction(s) placing a handling instruction in the second language output stream in response to identifying the untranslatable instruction in the first language input stream wherein an untranslatable instruction is an instruction in a first language input stream that a translator is unable to translate into an instruction in a second language output stream. - View Dependent Claims (33)
-
-
34. 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 determine that code identified in the first language input stream can not be translated from a first language into a second language, and responsive to the determination, inserting an exception throwing instruction in the second language output stream.
-
35. 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 insert a handling instruction in the second language output stream wherein the handling instruction is inserted in the second language output stream subsequent to a translation sub-unit being unable to translate unresolvable code encountered in the first language input stream into code in the second language output stream; 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.
-
-
36. 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 determine that an instruction encountered in the first language input stream cannot be translated into the second language output stream, and in response to the determination, inserting a handling instruction in the second language output stream.
-
37. 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 instruction in the first file that a compiler is unable to translate into a second language representation; determining where the identified instruction in the first file would be placed in the second file by the compiler if the identified instruction were translatable; and inserting a second language representation of an exception throwing instruction into the second file near where the identified instruction would have been placed in the second file by the compiler if the instruction were translatable.
-
Specification