Update locked_region_code_injection tool to ASM 6.0-BETA.

ASM 6 is required to read version 53 (OpenJDK 9) class files.

Test: make EXPERIMENTAL_USE_OPENJDK9=true services.core
      (in the presence of other unsubmitted CLs that fix
      other issues)
Test: Copied all required dependencies into a subdirectory lib/,
      then ran the steps from TestMain.java, both for OpenJDK 8
      and OpenJDK 9 toolchains.
Bug: 67676752

Change-Id: If324d8ea28450d9a8426a2279190b2f4d9213ed5
This commit is contained in:
Tobias Thierer
2017-10-11 16:46:05 +01:00
parent 36d606c86d
commit 95aa2ea9d8
3 changed files with 10 additions and 7 deletions

View File

@@ -6,10 +6,10 @@ LOCAL_JAR_MANIFEST := manifest.txt
LOCAL_MODULE := lockedregioncodeinjection
LOCAL_SRC_FILES := $(call all-java-files-under,src)
LOCAL_STATIC_JAVA_LIBRARIES := \
asm-5.2 \
asm-commons-5.2 \
asm-tree-5.2 \
asm-analysis-5.2 \
asm-6.0_BETA \
asm-commons-6.0_BETA \
asm-tree-6.0_BETA \
asm-analysis-6.0_BETA \
guava-21.0 \
include $(BUILD_HOST_JAVA_LIBRARY)

View File

@@ -76,7 +76,7 @@ class LockFindingClassVisitor extends ClassVisitor {
private MethodVisitor chain;
public LockFindingMethodVisitor(String owner, MethodNode mn, MethodVisitor chain) {
super(Opcodes.ASM5, mn);
super(Opcodes.ASM6, mn);
assert owner != null;
this.owner = owner;
this.chain = chain;

View File

@@ -23,11 +23,14 @@ import org.junit.Test;
* <code>
* set -x
*
* croot frameworks/base/tools/locked_region_code_injection
*
* # Clean
* mkdir -p out
* rm -fr out/*
*
* # Make booster
* javac -cp lib/asm-all-5.2.jar src&#47;*&#47;*.java -d out/
* javac -cp lib/asm-6.0_BETA.jar:lib/asm-commons-6.0_BETA.jar:lib/asm-tree-6.0_BETA.jar:lib/asm-analysis-6.0_BETA.jar:lib/guava-21.0.jar src&#47;*&#47;*.java -d out/
* pushd out
* jar cfe lockedregioncodeinjection.jar lockedregioncodeinjection.Main *&#47;*.class
* popd
@@ -40,7 +43,7 @@ import org.junit.Test;
* popd
*
* # Run tool on unit tests.
* java -ea -cp lib/asm-all-5.2.jar:out/lockedregioncodeinjection.jar \
* java -ea -cp lib/asm-6.0_BETA.jar:lib/asm-commons-6.0_BETA.jar:lib/asm-tree-6.0_BETA.jar:lib/asm-analysis-6.0_BETA.jar:lib/guava-21.0.jar:out/lockedregioncodeinjection.jar \
* lockedregioncodeinjection.Main \
* -i out/test_input.jar -o out/test_output.jar \
* --targets 'Llockedregioncodeinjection/TestTarget;' \