Support for invokedynamic
instruction in the engine
#386
Labels
comp-symbolic-engine
Issue is related to the symbolic execution engine
ctg-bug
Issue is a bug
ctg-enhancement
New feature, improvement or change request
Uh oh!
There was an error while loading. Please reload this page.
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+
forString
is implemented usingdynamicinvoke
. 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 forString
in Java 11, a fallback implementation has been provided that triggers concrete execution every timeinvokedynamic
is encountered (PR . It is clearly a hack, and a proper implementation ofinvokedynamic
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
+
includesJDynamicInvokeExpr
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 ofinvokedynamic
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
invokedynamic
representation in Soot: bodden12invokedynamic.pdfjava.lang.invoke
(JDK 11)The text was updated successfully, but these errors were encountered: