diff options
author | aclement <aclement> | 2006-03-18 11:59:16 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-03-18 11:59:16 +0000 |
commit | 7e4b7dafc0b6d20fb2b17e9bc4a12fd7d8934471 (patch) | |
tree | 912f029abebbf3d1219eefd862fba9c554fdbeab /weaver | |
parent | 9dca72e7c63a5623f3d442bf43bb88810368a65a (diff) | |
download | aspectj-7e4b7dafc0b6d20fb2b17e9bc4a12fd7d8934471.tar.gz aspectj-7e4b7dafc0b6d20fb2b17e9bc4a12fd7d8934471.zip |
128650: more memory stuff
Diffstat (limited to 'weaver')
8 files changed, 32 insertions, 14 deletions
diff --git a/weaver/src/org/aspectj/weaver/ISourceContext.java b/weaver/src/org/aspectj/weaver/ISourceContext.java index 70c7031d8..e669fd856 100644 --- a/weaver/src/org/aspectj/weaver/ISourceContext.java +++ b/weaver/src/org/aspectj/weaver/ISourceContext.java @@ -19,4 +19,5 @@ public interface ISourceContext { public ISourceLocation makeSourceLocation(IHasPosition position); public ISourceLocation makeSourceLocation(int line, int offset); public int getOffset(); + public void tidy(); } diff --git a/weaver/src/org/aspectj/weaver/MissingResolvedTypeWithKnownSignature.java b/weaver/src/org/aspectj/weaver/MissingResolvedTypeWithKnownSignature.java index c80ae4255..96cda71af 100644 --- a/weaver/src/org/aspectj/weaver/MissingResolvedTypeWithKnownSignature.java +++ b/weaver/src/org/aspectj/weaver/MissingResolvedTypeWithKnownSignature.java @@ -119,6 +119,8 @@ public class MissingResolvedTypeWithKnownSignature extends ResolvedType { return 0; } + public void tidy() {} + }; } diff --git a/weaver/src/org/aspectj/weaver/NameMangler.java b/weaver/src/org/aspectj/weaver/NameMangler.java index 7337305bc..aae578c9e 100644 --- a/weaver/src/org/aspectj/weaver/NameMangler.java +++ b/weaver/src/org/aspectj/weaver/NameMangler.java @@ -21,7 +21,9 @@ public class NameMangler { throw new RuntimeException("static"); } public static final char[] AJC_DOLLAR_PREFIX = {'a', 'j', 'c','$'}; + public static final char[] CLINIT={'<','c','l','i','n','i','t','>'}; public static final String PREFIX = "ajc$"; + public static final char[] INIT = {'<','i','n','i','t','>'}; public static final String ITD_PREFIX = PREFIX + "interType$"; public static final char[] METHOD_ASPECTOF = {'a', 's', 'p','e','c','t','O','f'}; public static final char[] METHOD_HASASPECT = {'h', 'a', 's','A','s','p','e','c','t'}; diff --git a/weaver/src/org/aspectj/weaver/ReferenceType.java b/weaver/src/org/aspectj/weaver/ReferenceType.java index dab54d1ab..faca76095 100644 --- a/weaver/src/org/aspectj/weaver/ReferenceType.java +++ b/weaver/src/org/aspectj/weaver/ReferenceType.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.Map; import org.aspectj.bridge.ISourceLocation; +import org.aspectj.weaver.bcel.BcelObjectType; import org.aspectj.weaver.patterns.Declare; import org.aspectj.weaver.patterns.PerClause; @@ -610,7 +611,8 @@ public class ReferenceType extends ResolvedType { } public void setDelegate(ReferenceTypeDelegate delegate) { - if (this.delegate!=null && this.delegate.getSourceContext()!=SourceContextImpl.UNKNOWN_SOURCE_CONTEXT) + // Don't copy from BcelObjectType to EclipseSourceType - the context may be tidied (result null'd) after previous weaving + if (this.delegate!=null && !(this.delegate instanceof BcelObjectType) && this.delegate.getSourceContext()!=SourceContextImpl.UNKNOWN_SOURCE_CONTEXT) ((AbstractReferenceTypeDelegate)delegate).setSourceContext(this.delegate.getSourceContext()); this.delegate = delegate; for(Iterator it = this.derivativeTypes.iterator(); it.hasNext(); ) { diff --git a/weaver/src/org/aspectj/weaver/SourceContextImpl.java b/weaver/src/org/aspectj/weaver/SourceContextImpl.java index b90dae980..8924d4f07 100644 --- a/weaver/src/org/aspectj/weaver/SourceContextImpl.java +++ b/weaver/src/org/aspectj/weaver/SourceContextImpl.java @@ -37,6 +37,8 @@ public class SourceContextImpl implements ISourceContext { return new File(delegate.getSourcefilename()); } + public void tidy() {} + public int getOffset() { return 0; } /* @@ -94,5 +96,6 @@ public class SourceContextImpl implements ISourceContext { public ISourceLocation makeSourceLocation(IHasPosition position) {return null;} public ISourceLocation makeSourceLocation(int line, int offset) {return null;} public int getOffset() {return 0;} + public void tidy() {} }; } diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index 9e3efe8fe..7f4263e38 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -100,8 +100,8 @@ public abstract class World implements Dump.INode { private boolean checkedAdvancedConfiguration=false; // Xset'table options private boolean fastDelegateSupportEnabled = isASMAround; - private boolean runMinimalMemory = true; - + private boolean runMinimalMemory = false; + public boolean forDEBUG_structuralChangesCode = false; // Records whether ASM is around ... so we might use it for delegates @@ -717,6 +717,7 @@ public abstract class World implements Dump.INode { public final static String xsetCAPTURE_ALL_CONTEXT = "captureAllContext"; // default false public final static String xsetACTIVATE_LIGHTWEIGHT_DELEGATES = "activateLightweightDelegates"; // default true public final static String xsetRUN_MINIMAL_MEMORY ="runMinimalMemory"; // default true + public final static String xsetDEBUG_STRUCTURAL_CHANGES_CODE = "debugStructuralChangesCode"; // default false public boolean isInJava5Mode() { return behaveInJava5Way; @@ -1086,21 +1087,27 @@ public abstract class World implements Dump.INode { if (!checkedAdvancedConfiguration) { Properties p = getExtraConfiguration(); if (p!=null) { - if (isASMAround) { // dont bother if its not... - String s = p.getProperty(xsetACTIVATE_LIGHTWEIGHT_DELEGATES,"true"); - fastDelegateSupportEnabled = s.equalsIgnoreCase("true"); - if (!fastDelegateSupportEnabled) - getMessageHandler().handleMessage(MessageUtil.info("[activateLightweightDelegates=false] Disabling optimization to use lightweight delegates for non-woven types")); - } - // wonder if this should be based on whether an incremental build can follow? - String s = p.getProperty(xsetRUN_MINIMAL_MEMORY,"false"); + + if (isASMAround) { // dont bother if its not... + String s = p.getProperty(xsetACTIVATE_LIGHTWEIGHT_DELEGATES,"true"); + fastDelegateSupportEnabled = s.equalsIgnoreCase("true"); + if (!fastDelegateSupportEnabled) + getMessageHandler().handleMessage(MessageUtil.info("[activateLightweightDelegates=false] Disabling optimization to use lightweight delegates for non-woven types")); + } + + String s = p.getProperty(xsetRUN_MINIMAL_MEMORY,"false"); runMinimalMemory = s.equalsIgnoreCase("true"); // if (runMinimalMemory) // getMessageHandler().handleMessage(MessageUtil.info("[runMinimalMemory=true] Optimizing bcel processing (and cost of performance) to use less memory")); + + + s = p.getProperty(xsetDEBUG_STRUCTURAL_CHANGES_CODE,"false"); + forDEBUG_structuralChangesCode = s.equalsIgnoreCase("true"); + } checkedAdvancedConfiguration=true; - } - } + } + } public boolean isRunMinimalMemory() { ensureAdvancedConfigurationProcessed(); diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index 63a916ca1..27278739c 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -1058,7 +1058,7 @@ class BcelClassWeaver implements IClassWeaver { for (int i = 0; i < dontAddMeTwice.length; i++){ Annotation ann = dontAddMeTwice[i]; if (ann != null && decaF.getAnnotationX().getTypeName().equals(ann.getTypeName())){ - dontAddMeTwice[i] = null; // incase it really has been added twice! + //dontAddMeTwice[i] = null; // incase it really has been added twice! return true; } } diff --git a/weaver/src/org/aspectj/weaver/tools/PointcutParser.java b/weaver/src/org/aspectj/weaver/tools/PointcutParser.java index f4c68eff3..0c86fb19c 100644 --- a/weaver/src/org/aspectj/weaver/tools/PointcutParser.java +++ b/weaver/src/org/aspectj/weaver/tools/PointcutParser.java @@ -386,6 +386,7 @@ public class PointcutParser { public int getOffset() { return 0; } + public void tidy() {} }; return new AtAjAttributes.BindingScope(inType,sourceContext,formalBindings); } |