Issue Details (XML | Word | Printable)

Key: RVM-152
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Peter Donald
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Bytecode verifier

Created: 21/Jul/07 03:50 AM   Updated: 11/Apr/08 09:24 AM
Component/s: Runtime
Affects Version/s: None
Fix Version/s: 1000

Time Tracking:
Not Specified


 Description  « Hide
We should introduce a byte code verifier. This should ideally support the verification of class files with versions up to 1.5 and it should support the alternative verification mechanism introduced in JSR 202. One alternative is to use verifiers from projects such as justice from BCEL or we could wait until the Moxie codebase is released and reuse that verifier.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Peter Donald added a comment - 21/Jul/07 04:10 AM
Ideally any verifier we use would be capable of being extended to add custom intra-procedural verification rules and possibly even add inter-procedure linking constraints.

i.e. For intra-procedural constraints we could add rules to ensure;

  • @Unpreemtible functions do not contain any "illegal" opcodes
  • @Pure functions do not not contain any mutator opcodes.
  • null is never assigned to a @Unboxed value
  • @Unboxed values never cast

For inter-procedural constraints we could add rules like

  • @Unpreemtible functions can only call @Unpreemtible methods or equiv
  • @Pure functions can only call @Pure functions

In the future we could also add all sorts of annotations and verify them. (Using Haskells naming mechanisms)

  • @IO procedure has side-effects and can only call @IO or @Pure
  • @STM procedure is a software transactional procedure and can only call @Pure or @STM
  • @STM_RO is a read-only STM and can only call @Pure or @STM_RO

We could also use the "verifier" to automagically classify different procedures as @IO, @Pure, @STM etc which would simplify the compiler and enable many more optimizations with relatively minimal overhead (as data flow analysis already donw within verifier).