Skip to content

Factor out java-specifics from language-agnostic code #1869

Closed
@peterschrammel

Description

@peterschrammel

I have created a JBMC repository where all the Java stuff will eventually go: https://github.com/diffblue/jbmc

(I'll populate below as my investigations progress)

Step 1a: Move jbmc and java_bytecode/library into new repo (in progress, see master branch of jbmc repo)

Step 1b: Separate out java-diff from goto-diff

  • TODO: tbd

Step 1c: Separate out java-analyzer from goto-analyzer

  • TODO: tbd

Step 2: Introduce required extension mechanisms into language-agnostic framework.

The following java_bytecode dependencies have been fixed:

The following java_bytecode dependencies must be removed:

  • goto-programs/goto_convert:
    • TODO: handle ID_*_new through separate goto passes

There are non-java_bytecode Java dependencies in (exhaustive list):

  • analyses/goto_check
  • analyses/uncaught_exception_analysis
    • special-casing AssertionError seems wrong and should be removed, otherwise there is nothing java-specific and no java_bytecode dependency
  • goto-analyzer/taint_analysis
    • prefix comparison should be fixed up, but no dep on java_bytecode
  • goto-instrument/call_sequences
    • use pretty name from symbol table instead of string manipulation, but no dep on java_bytecode
  • goto-instrument/cover_basic_blocks
    • requires java_source_location
    • factor out cover_basic_blocks_javat into separate class
    • but no dep on java_bytecode
  • goto-instrument/cover_filter
    • java built-ins should be done via a tag in the symbol table (see show_goto-functions), but no dep on java_bytecode
  • goto-programs/remove_exceptions
    • special-casing AssertionError seems wrong and should be removed, otherwise there is nothing java-specific and no dep on java_bytecode
    • inflight exception identifier can have a language-independent prefix
  • goto-programs/show_goto_functions
    • fix languaget::system_library_symbols for tagging symbols in the symbol table, but no dependency on java_bytecode
  • goto-symex/symex_assign, goto-symex/symex_builtin_functions
    • separate out cpp/java_new_array and unify, get mode from an lhs symbol
    • Ideally replace cpp_new by allocate in frontend
    • but no dependency on java_bytecode
  • pointer-analysis/value_set_dereference
    • silent failure should be replaced by an invariant, but no dependency on java_bytecode
  • util/source_location
    • requires java_source_location, but no dependency on java_bytecode
  • util/config
    • requires a bigger refactoring to make this non-global, non-critical for now
  • util/irep_ids.def
    • requires ability to extend irep_ids.def in a dependent repo, but no dependency on java_bytecode
  • util/unicode
    • used by string solver, seems uncritical

Step 3: Move java specifics into jbmc repo and update submodules in dependent repos

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions