Skip to content

Commit

Permalink
* Fixed issue with DaCapo on Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
katherine-hough committed Nov 27, 2023
1 parent a37f32b commit c3d97e3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static void initialize(String agentArgs, InstrumentationAdaptor instrumen
Phosphor.instrumentation = instrumentation;
instrumentation.addTransformer(new ClassSupertypeReadingTransformer());
RUNTIME_INST = true;
if (agentArgs != null) {
if (agentArgs != null || Configuration.IS_JAVA_8) {
PhosphorOption.configure(true, parseOptions(agentArgs));
}
if (System.getProperty("phosphorCacheDirectory") != null) {
Expand Down
11 changes: 11 additions & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<data.flow.skip>false</data.flow.skip>
<phosphor.jar>${edu.gmu.swe.phosphor:Phosphor:jar}</phosphor.jar>
<phosphor.driver.jar>${edu.gmu.swe.phosphor:phosphor-driver:jar}</phosphor.driver.jar>
<isJava8>false</isJava8>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -107,6 +108,15 @@
</plugins>
</build>
<profiles>
<profile>
<id>java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<isJava8>true</isJava8>
</properties>
</profile>
<profile>
<id>dacapo</id>
<build>
Expand Down Expand Up @@ -138,6 +148,7 @@
<argument>${phosphor.jar}</argument>
<argument>${phosphor.driver.jar}</argument>
<argument>${data.flow.java}/bin/java</argument>
<argument>${isJava8}</argument>
</arguments>
</configuration>
</execution>
Expand Down
8 changes: 7 additions & 1 deletion integration-tests/runDacapo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ readonly BUILD_DIR=$1
readonly PHOSPHOR_JAR=$2
readonly DRIVER_JAR=$3
readonly INST_JVM=$4
readonly IS_JAVA_8=$5
readonly DACAPO_DIR=$BUILD_DIR/dacapo
readonly INST_DACAPO_DIR=$BUILD_DIR/dacapo-inst
readonly BENCHMARKS=(avrora fop h2 jython luindex pmd sunflow xalan)
Expand All @@ -23,9 +24,14 @@ if [ ! -d "$DACAPO_DIR" ]; then
fi
cd "$BUILD_DIR"

phosphor_args=""
if [ "$IS_JAVA_8" == "true" ]; then
phosphor_args="-java8"
fi

if [ ! -d "$INST_DACAPO_DIR" ]; then
echo "Creating data flow instrumented dacapo"
java -Xmx8g -jar "$DRIVER_JAR" -q -forceUnboxAcmpEq -withEnumsByValue "$DACAPO_DIR" "$INST_DACAPO_DIR"
java -Xmx8g -jar "$DRIVER_JAR" -q -forceUnboxAcmpEq -withEnumsByValue $phosphor_args "$DACAPO_DIR" "$INST_DACAPO_DIR"
else
echo "Not regenerating data flow instrumented dacapo"
fi
Expand Down

0 comments on commit c3d97e3

Please sign in to comment.