Browse Source

asm3.3.1/jarjar'd and activated auto stackmap creation for major version 51 classfiles (java7)

tags/V1_6_12M2
aclement 12 years ago
parent
commit
0c541f6694

+ 1
- 1
weaver/.classpath View File

<classpathentry kind="lib" path="/lib/commons/commons.jar" sourcepath="/lib/commons/commons-src.zip"/> <classpathentry kind="lib" path="/lib/commons/commons.jar" sourcepath="/lib/commons/commons-src.zip"/>
<classpathentry kind="lib" path="/lib/bcel/bcel.jar" sourcepath="/lib/bcel/bcel-src.zip"/> <classpathentry kind="lib" path="/lib/bcel/bcel.jar" sourcepath="/lib/bcel/bcel-src.zip"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/lib/asm/asm-3.1.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.aspectj.matcher"/> <classpathentry combineaccessrules="false" kind="src" path="/org.aspectj.matcher"/>
<classpathentry kind="lib" path="/lib/asm/asm-3.3.1.renamed.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

+ 3
- 3
weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java View File

writeBack(world); writeBack(world);
byte[] wovenClassFileData = myGen.getJavaClass().getBytes(); byte[] wovenClassFileData = myGen.getJavaClass().getBytes();
// if is java 6 class file // if is java 6 class file
if (myGen.getMajor() >= Constants.MAJOR_1_6 && world.shouldGenerateStackMaps() && AsmDetector.isAsmAround) {
if (((myGen.getMajor() == Constants.MAJOR_1_6 && world.shouldGenerateStackMaps()) || myGen.getMajor() > Constants.MAJOR_1_6)
&& AsmDetector.isAsmAround) {
wovenClassFileData = StackMapAdder.addStackMaps(world, wovenClassFileData); wovenClassFileData = StackMapAdder.addStackMaps(world, wovenClassFileData);
} }


WeaverStateInfo wsi = myType.getWeaverState();// getOrCreateWeaverStateInfo
// ();
WeaverStateInfo wsi = myType.getWeaverState();// getOrCreateWeaverStateInfo();
if (wsi != null && wsi.isReweavable()) { // && !reweavableDataInserted if (wsi != null && wsi.isReweavable()) { // && !reweavableDataInserted
// reweavableDataInserted = true; // reweavableDataInserted = true;
return wsi.replaceKeyWithDiff(wovenClassFileData); return wsi.replaceKeyWithDiff(wovenClassFileData);

+ 2
- 2
weaver/src/org/aspectj/weaver/bcel/asm/AsmDetector.java View File



static { static {
try { try {
Class reader = Class.forName("org.objectweb.asm.ClassReader");
Class visitor = Class.forName("org.objectweb.asm.ClassVisitor");
Class<?> reader = Class.forName("aj.org.objectweb.asm.ClassReader");
Class<?> visitor = Class.forName("aj.org.objectweb.asm.ClassVisitor");
Method m = reader.getMethod("accept", new Class[] { visitor, Integer.TYPE }); Method m = reader.getMethod("accept", new Class[] { visitor, Integer.TYPE });
isAsmAround = m != null; isAsmAround = m != null;
} catch (Exception e) { } catch (Exception e) {

+ 3
- 2
weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java View File

import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.World; import org.aspectj.weaver.World;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;

import aj.org.objectweb.asm.ClassReader;
import aj.org.objectweb.asm.ClassWriter;


/** /**
* Uses asm to add the stack map attribute to methods in a class. The class is passed in as pure byte data and then a reader/writer * Uses asm to add the stack map attribute to methods in a class. The class is passed in as pure byte data and then a reader/writer

Loading…
Cancel
Save