GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support for `invokedynamic` instruction in the engine · Issue #386 · UnitTestBot/UTBotJava

Support for invokedynamic instruction in the engine #386

New issue
Copy link
New issue
Copy link
Open
Open
Support for invokedynamic instruction in the engine#386
Copy link
Assignees
CaelmBleidd
Labels
comp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution enginectg-bugIssue is a bugIssue is a bugctg-enhancementNew feature, improvement or change requestNew feature, improvement or change request

Description

@dtim
dtim
opened on Jul 4, 2022
Issue body actions

Description

Engine currently does not support the dynamicinvoke bytecode instruction introduced in JDK 7.

An important case where invokedynamic is necessary is string concatenation: starting from Java 9, the operator + for String is implemented using dynamicinvoke. As a result, the plugin fails to generate tests for string concatenation when the code is compiled using JDK 9 or later (the primary concern is JDK 11).

To support + operator for String in Java 11, a fallback implementation has been provided that triggers concrete execution every time invokedynamic is encountered (PR . It is clearly a hack, and a proper implementation of invokedynamic is necessary.

Soot sometimes replaces invokedynamic with other invoke* opcodes (e.g., for lambdas), but it is supposedly a special case. For example, the Jimple graph for string concatenation with + includes JDynamicInvokeExpr expression.

Expected behavior

The implementation of invokedynamic instruction in the engine should update the global graph with the graph of the bootstrap method and generate branches corresponding to possible outcomes of invokedynamic along with type and/or value constraints to discard unnecessary paths.

Environment

The invokedynamic instruction is present in JDK 7 or later.

The feature does not depend on any specific UnitTestBot configuration.

Potential alternatives

Possible approaches to support dynamicinvoke are under investigation.

Context

  • The paper that describes invokedynamic representation in Soot: bodden12invokedynamic.pdf
  • JVM spec (JDK 7), chapter 6
  • Documentation for java.lang.invoke (JDK 11)

Activity

  1. dtim
    added
    ctg-bugIssue is a bugIssue is a bug
    ctg-enhancementNew feature, improvement or change requestNew feature, improvement or change request
    comp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution engine
    on Jul 4, 2022
  2. dtim
    self-assigned this
    on Jul 4, 2022
  3. dtim
    changed the title [-]Support for dynamic invoke in the engine[/-] [+]Support for `invokedynamic` instruction in the engine[/+] on Jul 6, 2022
  4. CaelmBleidd
    assigned
    CaelmBleidd
    and unassigned
    dtim
    on Oct 13, 2022
  5. sergeypospelov
    added a commit that references this issue on Oct 27, 2022

    Dynamic invoke for string concatenation #386 (#1185)

    50dc51b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @CaelmBleidd
    CaelmBleidd

Labels

comp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution enginectg-bugIssue is a bugIssue is a bugctg-enhancementNew feature, improvement or change requestNew feature, improvement or change request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.