From c3d97e302b5b4259ab71f8435a76bca1324d7e5b Mon Sep 17 00:00:00 2001
From: katherine-hough <32645020+katherine-hough@users.noreply.github.com>
Date: Sun, 26 Nov 2023 19:16:22 -0500
Subject: [PATCH] * Fixed issue with DaCapo on Java 8
---
.../java/edu/columbia/cs/psl/phosphor/Phosphor.java | 2 +-
integration-tests/pom.xml | 11 +++++++++++
integration-tests/runDacapo.sh | 8 +++++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/Phosphor.java b/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/Phosphor.java
index 8d13e0a04..38c034e6a 100644
--- a/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/Phosphor.java
+++ b/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/Phosphor.java
@@ -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) {
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index fef0f7c5e..46b9f620a 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -19,6 +19,7 @@
false
${edu.gmu.swe.phosphor:Phosphor:jar}
${edu.gmu.swe.phosphor:phosphor-driver:jar}
+ false
@@ -107,6 +108,15 @@
+
+ java8
+
+ 1.8
+
+
+ true
+
+
dacapo
@@ -138,6 +148,7 @@
${phosphor.jar}
${phosphor.driver.jar}
${data.flow.java}/bin/java
+ ${isJava8}
diff --git a/integration-tests/runDacapo.sh b/integration-tests/runDacapo.sh
index d34aa76e6..9e2e030a3 100755
--- a/integration-tests/runDacapo.sh
+++ b/integration-tests/runDacapo.sh
@@ -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)
@@ -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