Language subset validation
Abstract
A method for language subset validation includes validating multiple program modules that comprise a program. Each of the program modules includes multiple bytecodes defined for a first computer language that is a hardware-dependent subset of a second computer language. The validation includes indicating an error condition for each item in the multiple program modules that is not defined for the first computer language, indicating an error condition for each item in the multiple program modules that is not supported by an execution environment of the first computer language and indicating an error condition for each item in the plurality of program modules that is defined for the first computer language but used in a manner inconsistent with the first computer language. An apparatus for language subset validation includes at least one memory having program instructions and at least one processor configured to use the program instructions to validate multiple program modules that together form a program. The processor is further configured to use the program instructions to indicate an error condition for each item in the multiple program modules that is not defined for the first computer language, indicate an error condition for each item in the multiple program modules that is not supported by an execution environment of the first computer language and indicate an error condition for each item in the plurality of program modules that is defined for the first computer language but used in a manner inconsistent with the first computer language.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for language subset validation, comprising:
validating a plurality of program modules comprising a program, each of said program modules including a plurality of bytecodes defined for a first computer language, said first computer language being a hardware-dependent subset of a second computer language, said validating including:
indicating an error condition for each item in said plurality of program modules that is not defined for said first computer language;
indicating an error condition for each item in said plurality of program modules that is not supported by an execution environment of said first computer language; and
indicating an error condition for each item in said plurality of program modules that is defined for said first computer language but used in a manner inconsistent with said first computer language.
2 . The method of claim 1 wherein
said program modules comprise class files; and
said validating further comprises:
determining memory usage by summing code and data usage for all of said program modules; and
indicating an error condition when said memory usage exceeds a maximum memory usage.
3 . The method of claim 1 wherein
said program modules comprise CAP files; and
said validating further comprises:
determining memory usage by summing code and data usage for all of said program modules; and
indicating an error condition when said memory usage exceeds a maximum memory usage.
4 . The method of claim 2 wherein said validating further comprises:
reading each method within said class files;
indicating an error when a method declaration is not supported by said first computer language; and
indicating an error when said execution environment does not support an optional feature of said first computer language and said method declaration includes said optional feature.
5 . The method of claim 4 wherein said validating further comprises:
indicating an error when a field declaration is not supported by said first computer language; and
indicating an error when said execution environment does not support an optional feature of said first computer language and said field declaration includes said optional feature.
6 . The method of claim 5 wherein said validating further comprises:
reading bytecode of each of said methods;
indicating an error when said bytecode uses data types that are not supported by said first computer language;
indicating an error when said bytecode operates on values of types that are not supported by said first computer language;
indicating an error when said execution environment does not support an optional type of said first computer language and said instruction uses said optional type; and
indicating an error when said execution environment does not support an optional type of said first computer language and said instruction operates on at least one value of said optional type.
7 . The method of claim 4 wherein said validating further comprises:
generating a data flow for each method within said class files; and
using said data flow to determine whether the potential for overflow exists in an arithmetic intermediate result within a method, said potential for overflow creating a first final result that is semantically different from a second final result, said first final result obtained when said method is executed against said first computer language, said second final result obtained when said method is executed against said second computer language.
8 . The method of claim 4 wherein said validating further comprises:
reading at least one class file comprising a package;
indicating an error when the total number of local variables and parameters within each method of each class in said package exceeds a maximum number of variables and parameters;
converting all bytecodes within said method according to said first computer language to create converted bytecodes; and
indicating an error when the total number of converted bytecodes exceeds a maximum number of bytecodes.
9 . The method of claim 8 wherein said validating further comprises:
indicating an error when the total number of instance fields within each class of said package exceeds a maximum number of instance fields;
indicating an error when the total number of static fields within each class of said package exceeds a maximum number of static fields;
indicating an error when the total number of instance methods within each class of said package exceeds a maximum number of instance methods;
indicating an error when the total number of static methods within each class of said package exceeds a maximum number of static methods; and
indicating an error when the total number of superinterfaces of each class or each interface of said package exceeds a maximum number of superinterfaces.
10 . The method of claim 9 wherein said validating further comprises:
indicating an error when a public interface extends a package visible interface within said package; and
indicating an error when the access visibility of a package default method in a superclass is changed to public or protected in a subclass in within said package.
11 . The method of claim 1 wherein
said first computer language is defined for a Java Card™ Virtual Machine; and
said second computer language comprises the Java™ language.
12 . The method of claim 1 wherein
said first computer language is defined for a Java Card™ Virtual Machine; and
said second computer language comprises Java™ class files.
13 . A program storage device readable by a machine, embodying a program of instructions executable by the machine to perform a method for language subset validation, the method comprising:
validating a plurality of program modules comprising a program, each of said program modules including a plurality of bytecodes defined for a first computer language, said first computer language being a hardware-dependent subset of a second computer language, said validating including:
indicating an error condition for each item in said plurality of program modules that is not defined for said first computer language;
indicating an error condition for each item in said plurality of program modules that is not supported by an execution environment of said first computer language; and
indicating an error condition for each item in said plurality of program modules that is defined for said first computer language but used in a manner inconsistent with said first computer language.
14 . The program storage device of claim 13 wherein
said program modules comprise class files; and
said validating further comprises:
determining memory usage by summing code and data usage for all of said program modules; and
indicating an error condition when said memory usage exceeds a maximum memory usage.
15 . The program storage device of claim 13 wherein
said program modules comprise CAP files; and
said validating further comprises:
determining memory usage by summing code and data usage for all of said program modules; and
indicating an error condition when said memory usage exceeds a maximum memory usage.
16 . The program storage device of claim 14 wherein said validating further comprises:
reading each method within said class files;
indicating an error when a method declaration is not supported by said first computer language; and
indicating an error when said execution environment does not support an optional feature of said first computer language and said method declaration includes said optional feature.
17 . The program storage device of claim 16 wherein said validating further comprises:
indicating an error when a field declaration is not supported by said first computer language; and
indicating an error when said execution environment does not support an optional feature of said first computer language and said field declaration includes said optional feature.
18 . The program storage device of claim 17 wherein said validating further comprises:
reading bytecode of each of said methods;
indicating an error when said bytecode uses data types that are not supported by said first computer language;
indicating an error when said bytecode operates on values of types that are not supported by said first computer language;
indicating an error when said execution environment does not support an optional type of said first computer language and said instruction uses said optional type; and
indicating an error when said execution environment does not support an optional type of said first computer language and said instruction operates on at least one value of said optional type.
19 . The program storage device of claim 16 wherein said validating further comprises:
generating a data flow for each method within said class files; and
using said data flow to determine whether the potential for overflow exists in an arithmetic intermediate result within a method, said potential for overflow creating a first final result that is semantically different from a second final result, said first final result obtained when said method is executed against said first computer language, said second final result obtained when said method is executed against said second computer language.
20 . The program storage device of claim 16 wherein said validating further comprises:
reading at least one class file comprising a package;
indicating an error when the total number of local variables and parameters within each method of each class in said package exceeds a maximum number of variables and parameters;
converting all bytecodes within said method according to said first computer language to create converted bytecodes; and
indicating an error when the total number of converted bytecodes exceeds a maximum number of bytecodes.
21 . The program storage device of claim 20 wherein said validating further comprises:
indicating an error when the total number of instance fields within each class of said package exceeds a maximum number of instance fields;
indicating an error when the total number of static fields within each class of said package exceeds a maximum number of static fields;
indicating an error when the total number of instance methods within each class of said package exceeds a maximum number of instance methods;
indicating an error when the total number of static methods within each class of said package exceeds a maximum number of static methods; and
indicating an error when the total number of superinterfaces of each class or each interface of said package exceeds a maximum number of superinterfaces.
22 . The program storage device of claim 21 wherein said validating further comprises:
indicating an error when a public interface extends a package visible interface within said package; and
indicating an error when the access visibility of a package default method in a superclass is changed to public or protected in a subclass in within said package.
23 . The program storage device of claim 13 wherein
said first computer language is defined for a Java Card™ Virtual Machine; and
said second computer language comprises the Java™ language.
24 . The program storage device of claim 13 wherein
said first computer language is defined for a Java Card™ Virtual Machine; and
said second computer language comprises Java™ class files.
25 . An apparatus for language subset validation, comprising:
means for validating a plurality of program modules comprising a program, each of said program modules including a plurality of bytecodes defined for a first computer language, said first computer language being a hardware-dependent subset of a second computer language, said validating including:
means for indicating an error condition for each item in said plurality of program modules that is not defined for said first computer language;
means for indicating an error condition for each item in said plurality of program modules that is not supported by an execution environment of said first computer language; and
means for indicating an error condition for each item in said plurality of program modules that is defined for said first computer language but used in a manner inconsistent with said first computer language.
26 . The apparatus of claim 25 wherein
said program modules comprise class files; and
said validating means further comprises:
means for determining memory usage by summing code and data usage for all of said program modules; and
means for indicating an error condition when said memory usage exceeds a maximum memory usage.Join the waitlist — get patent alerts
Track US2003135792A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.