summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-01-01 00:07:33 +0000
committerjhugunin <jhugunin>2003-01-01 00:07:33 +0000
commit28f09b17d4991c6754d0a2b701a6f6eb4abdbed0 (patch)
tree2b25293ee5214809508d761ff4bd75c0f4d45354 /org.aspectj.ajdt.core
parent9987be3397f667a639bc18165ef037853ccd330f (diff)
downloadaspectj-28f09b17d4991c6754d0a2b701a6f6eb4abdbed0.tar.gz
aspectj-28f09b17d4991c6754d0a2b701a6f6eb4abdbed0.zip
finished implementation of around inlining
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java2
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java114
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java50
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java57
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/Proceed.java5
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java224
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java9
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java2
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java12
9 files changed, 461 insertions, 14 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
index 81cabdb69..9cbc17afb 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
@@ -359,6 +359,8 @@ public class BuildArgParser extends org.eclipse.jdt.internal.compiler.batch.Main
buildConfig.setNoWeave(true);
} else if (arg.equals("-XserializableAspects")) {
buildConfig.setXserializableAspects(true);
+ } else if (arg.equals("-XnoInline")) {
+ buildConfig.setXnoInline(true);
} else if (arg.equals("-Xlintfile")) {
if (args.size() > nextArgIndex) {
File lintSpecFile = makeFile(((ConfigParser.Arg)args.get(nextArgIndex)).getValue());
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
new file mode 100644
index 000000000..411ae4df5
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
@@ -0,0 +1,114 @@
+/* *******************************************************************
+ * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
+ * ******************************************************************/
+
+
+package org.aspectj.ajdt.internal.compiler.ast;
+
+import java.util.Arrays;
+
+import org.aspectj.ajdt.internal.compiler.lookup.*;
+import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedHandler;
+import org.aspectj.weaver.*;
+import org.aspectj.weaver.ShadowMunger;
+import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter;
+import org.eclipse.jdt.internal.compiler.ast.*;
+import org.eclipse.jdt.internal.compiler.lookup.*;
+
+/**
+ * Takes a method that already has the three extra parameters
+ * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart
+ */
+
+public class AccessForInlineVisitor extends AbstractSyntaxTreeVisitorAdapter {
+ PrivilegedHandler handler;
+ EclipseWorld world;
+ public AccessForInlineVisitor(EclipseWorld world, PrivilegedHandler handler) {
+ this.world = world;
+ this.handler = handler;
+ }
+
+ public void endVisit(SingleNameReference ref, BlockScope scope) {
+ if (ref.binding instanceof FieldBinding) {
+ FieldBinding fieldBinding = (FieldBinding)ref.binding;
+ makePublic(fieldBinding.declaringClass);
+ if (isPublic(fieldBinding)) return;
+ ref.binding = handler.getPrivilegedAccessField(fieldBinding);
+ }
+ }
+
+ public void endVisit(QualifiedNameReference ref, BlockScope scope) {
+ if (ref.binding instanceof FieldBinding) {
+ FieldBinding fieldBinding = (FieldBinding)ref.binding;
+ makePublic(fieldBinding.declaringClass);
+ if (isPublic(fieldBinding)) return;
+ ref.binding = handler.getPrivilegedAccessField(fieldBinding);
+ }
+ }
+
+ public void endVisit(FieldReference ref, BlockScope scope) {
+ if (ref.binding instanceof FieldBinding) {
+ FieldBinding fieldBinding = (FieldBinding)ref.binding;
+ makePublic(fieldBinding.declaringClass);
+ if (isPublic(fieldBinding)) return;
+ ref.binding = handler.getPrivilegedAccessField(fieldBinding);
+ }
+ }
+ public void endVisit(MessageSend send, BlockScope scope) {
+ if (send instanceof Proceed) return;
+ if (send.binding == null) return;
+ if (isPublic(send.binding)) return;
+ makePublic(send.binding.declaringClass);
+ send.binding = send.codegenBinding = handler.getPrivilegedAccessMethod(send.binding);
+ }
+ public void endVisit(AllocationExpression send, BlockScope scope) {
+ if (send.binding == null) return;
+ if (isPublic(send.binding)) return;
+ makePublic(send.binding.declaringClass);
+ send.binding = handler.getPrivilegedAccessMethod(send.binding);
+ }
+ public void endVisit(
+ QualifiedTypeReference ref,
+ BlockScope scope)
+ {
+ makePublic(ref.binding);
+ }
+
+ public void endVisit(
+ SingleTypeReference ref,
+ BlockScope scope)
+ {
+ makePublic(ref.binding);
+ }
+
+ private boolean isPublic(FieldBinding fieldBinding) {
+ // these are always effectively public to the inliner
+ if (fieldBinding instanceof InterTypeFieldBinding) return true;
+ return fieldBinding.isPublic();
+ }
+
+ private boolean isPublic(MethodBinding methodBinding) {
+ // these are always effectively public to the inliner
+ if (methodBinding instanceof InterTypeMethodBinding) return true;
+ return methodBinding.isPublic();
+ }
+
+ private void makePublic(TypeBinding binding) {
+ if (binding instanceof ReferenceBinding) {
+ ReferenceBinding rb = (ReferenceBinding)binding;
+ if (!rb.isPublic()) handler.notePrivilegedTypeAccess(rb);
+ } else if (binding instanceof ArrayBinding) {
+ makePublic( ((ArrayBinding)binding).leafComponentType );
+ } else {
+ return;
+ }
+ }
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
index 15e28461f..9b783cb11 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
@@ -47,6 +47,8 @@ public class AdviceDeclaration extends MethodDeclaration {
public MethodBinding proceedMethodBinding;
+
+ public List proceedCalls = new ArrayList(2);
public boolean proceedInInners;
public ResolvedMember[] proceedCallSignatures;
public boolean[] formalsUnchangedToProceed;
@@ -98,15 +100,9 @@ public class AdviceDeclaration extends MethodDeclaration {
pointcutDesignator.finishResolveTypes(this, this.binding,
baseArgumentCount, upperScope.referenceContext.binding);
+ if (binding == null || ignoreFurtherInvestigation) return;
- if (kind == AdviceKind.Around && binding != null) {
- //XXX set these correctly
- proceedInInners = false;
- proceedCallSignatures = new ResolvedMember[0];
- formalsUnchangedToProceed = new boolean[baseArgumentCount];
- declaredExceptions = new TypeX[0];
-
-
+ if (kind == AdviceKind.Around) {
ReferenceBinding[] exceptions =
new ReferenceBinding[] { upperScope.getJavaLangThrowable() };
proceedMethodBinding = new MethodBinding(Modifier.STATIC,
@@ -119,6 +115,44 @@ public class AdviceDeclaration extends MethodDeclaration {
super.resolveStatements(upperScope);
if (binding != null) determineExtraArgumentFlags();
+
+ if (kind == AdviceKind.Around) {
+ int n = proceedCalls.size();
+ EclipseWorld world = EclipseWorld.fromScopeLookupEnvironment(upperScope);
+
+ //System.err.println("access to: " + Arrays.asList(handler.getMembers()));
+
+ //XXX set these correctly
+ formalsUnchangedToProceed = new boolean[baseArgumentCount];
+ proceedCallSignatures = new ResolvedMember[0];
+ proceedInInners = false;
+ declaredExceptions = new TypeX[0];
+
+ for (int i=0; i < n; i++) {
+ Proceed call = (Proceed)proceedCalls.get(i);
+ if (call.inInner) {
+ //System.err.println("proceed in inner: " + call);
+ proceedInInners = true;
+ //XXX wrong
+ //proceedCallSignatures[i] = world.makeResolvedMember(call.binding);
+ }
+ }
+
+ // if we have proceed in inners we won't ever be inlined so the code below is unneeded
+ if (!proceedInInners) {
+ PrivilegedHandler handler = (PrivilegedHandler)upperScope.referenceContext.binding.privilegedHandler;
+ //XXX timings is odd here
+ if (handler == null) {
+ handler = new PrivilegedHandler((AspectDeclaration)upperScope.referenceContext);
+ upperScope.referenceContext.binding.privilegedHandler = handler;
+ }
+
+ this.traverse(new MakeDeclsPublicVisitor(), (ClassScope)null);
+
+ AccessForInlineVisitor v = new AccessForInlineVisitor(world, handler);
+ this.traverse(v, (ClassScope) null);
+ }
+ }
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java
new file mode 100644
index 000000000..84ed18b75
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java
@@ -0,0 +1,57 @@
+/* *******************************************************************
+ * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
+ * ******************************************************************/
+
+
+package org.aspectj.ajdt.internal.compiler.ast;
+
+import java.util.Arrays;
+
+import org.aspectj.ajdt.internal.compiler.lookup.*;
+import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedHandler;
+import org.aspectj.weaver.*;
+import org.aspectj.weaver.ShadowMunger;
+import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter;
+import org.eclipse.jdt.internal.compiler.ast.*;
+import org.eclipse.jdt.internal.compiler.lookup.*;
+
+/**
+ * Takes a method that already has the three extra parameters
+ * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart
+ */
+
+public class MakeDeclsPublicVisitor extends AbstractSyntaxTreeVisitorAdapter {
+
+ public void endVisit(
+ AnonymousLocalTypeDeclaration decl,
+ BlockScope scope) {
+ decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
+ }
+
+ public void endVisit(LocalTypeDeclaration decl, BlockScope scope) {
+ decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
+ }
+
+
+ public void endVisit(ConstructorDeclaration decl, ClassScope scope) {
+ decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
+ }
+
+ public void endVisit(FieldDeclaration decl, MethodScope scope) {
+ decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
+ }
+
+
+ public void endVisit(MethodDeclaration decl, ClassScope scope) {
+ decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers);
+ }
+
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/Proceed.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/Proceed.java
index 541184931..5cb328da5 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/Proceed.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/Proceed.java
@@ -22,6 +22,8 @@ import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
public class Proceed extends MessageSend {
+ public boolean inInner = false;
+
public Proceed(MessageSend parent) {
super();
@@ -108,11 +110,14 @@ public class Proceed extends MessageSend {
if (context instanceof AdviceDeclaration) {
AdviceDeclaration adviceDecl = (AdviceDeclaration)context;
if (adviceDecl.kind == AdviceKind.Around) {
+ adviceDecl.proceedCalls.add(this);
return adviceDecl;
} else {
return null;
}
}
+ } else if (scope instanceof ClassScope) {
+ inInner = true;
}
return findEnclosingAround(scope.parent);
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java
new file mode 100644
index 000000000..355ed098c
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java
@@ -0,0 +1,224 @@
+/* *******************************************************************
+ * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
+ * ******************************************************************/
+
+
+package org.aspectj.ajdt.internal.compiler.ast;
+
+import java.util.Arrays;
+
+import org.aspectj.weaver.*;
+import org.aspectj.weaver.ShadowMunger;
+import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter;
+import org.eclipse.jdt.internal.compiler.ast.*;
+import org.eclipse.jdt.internal.compiler.lookup.*;
+
+/**
+ * Takes a method that already has the three extra parameters
+ * thisJoinPointStaticPart, thisJoinPoint and thisEnclosingJoinPointStaticPart
+ */
+
+public class ProceedVisitor extends AbstractSyntaxTreeVisitorAdapter {
+ boolean needsDynamic = false;
+ boolean needsStatic = false;
+ boolean needsStaticEnclosing = false;
+ boolean hasEffectivelyStaticRef = false;
+
+ LocalVariableBinding thisJoinPointDec;
+ LocalVariableBinding thisJoinPointStaticPartDec;
+ LocalVariableBinding thisEnclosingJoinPointStaticPartDec;
+
+ LocalVariableBinding thisJoinPointDecLocal;
+ LocalVariableBinding thisJoinPointStaticPartDecLocal;
+ LocalVariableBinding thisEnclosingJoinPointStaticPartDecLocal;
+
+ boolean replaceEffectivelyStaticRefs = false;
+
+ AbstractMethodDeclaration method;
+
+ ProceedVisitor(AbstractMethodDeclaration method) {
+ this.method = method;
+ int index = method.arguments.length - 3;
+
+ thisJoinPointStaticPartDecLocal = method.scope.locals[index];
+ thisJoinPointStaticPartDec = method.arguments[index++].binding;
+ thisJoinPointDecLocal = method.scope.locals[index];
+ thisJoinPointDec = method.arguments[index++].binding;
+ thisEnclosingJoinPointStaticPartDecLocal = method.scope.locals[index];
+ thisEnclosingJoinPointStaticPartDec = method.arguments[index++].binding;
+ }
+
+ public void computeJoinPointParams() {
+ // walk my body to see what is needed
+ method.traverse(this, (ClassScope) null);
+
+ //??? add support for option to disable this optimization
+ //System.err.println("check: "+ hasEffectivelyStaticRef + ", " + needsDynamic);
+ if (hasEffectivelyStaticRef && !needsDynamic) {
+ // replace effectively static refs with thisJoinPointStaticPart
+ replaceEffectivelyStaticRefs = true;
+ needsStatic = true;
+ method.traverse(this, (ClassScope) null);
+ }
+ }
+
+ boolean isRef(NameReference ref, Binding binding) {
+ return ref.binding == binding;
+ }
+
+ boolean isRef(Expression expr, Binding binding) {
+ //System.err.println("isRef: " + expr + ", " + binding);
+ return expr != null
+ && expr instanceof NameReference
+ && isRef((NameReference) expr, binding);
+ }
+
+ public void endVisit(SingleNameReference ref, BlockScope scope) {
+ if (isRef(ref, thisJoinPointDec))
+ needsDynamic = true;
+ else if (isRef(ref, thisJoinPointStaticPartDec))
+ needsStatic = true;
+ else if (isRef(ref, thisEnclosingJoinPointStaticPartDec))
+ needsStaticEnclosing = true;
+ }
+
+ // public void checkAndFix(ASTObject body) {
+ // this.process(body);
+ // if (needsFakeStatic && !needsDynamic) {
+ // if (!this.getCompiler().getOptions().noMetaJoinPointOptimization) {
+ // makeFakeStatics = true;
+ // needsStatic = true;
+ // this.process(body);
+ // } else {
+ // needsDynamic = true;
+ // }
+ // }
+ // }
+
+ boolean canTreatAsStatic(String id) {
+ return id.equals("toString")
+ || id.equals("toShortString")
+ || id.equals("toLongString")
+ || id.equals("getKind")
+ || id.equals("getSignature")
+ || id.equals("getSourceLocation")
+ || id.equals("getStaticPart");
+ }
+
+ // boolean canTreatAsStatic(VarExpr varExpr) {
+ // ASTObject parent = varExpr.getParent();
+ // if (parent instanceof CallExpr) {
+ // Method calledMethod = ((CallExpr)parent).getMethod();
+ // return canTreatAsStatic(calledMethod);
+ //
+ // //??? should add a case here to catch
+ // //??? tjp.getEnclosingExecutionJoinPoint().STATIC_METHOD()
+ // } else if (parent instanceof BinopExpr) {
+ // BinopExpr binop = (BinopExpr)parent;
+ // if (binop.getType().isEquivalent(this.getTypeManager().getStringType())) {
+ // return true;
+ // } else {
+ // return false;
+ // }
+ // } else {
+ // return false;
+ // }
+ // }
+
+ boolean inBlockThatCantRun = false;
+
+ public boolean visit(MessageSend call, BlockScope scope) {
+ Expression receiver = call.receiver;
+ if (isRef(receiver, thisJoinPointDec)) {
+ if (canTreatAsStatic(new String(call.selector))) {
+ if (replaceEffectivelyStaticRefs) {
+ replaceEffectivelyStaticRef(call);
+ } else {
+ //System.err.println("has static reg");
+ hasEffectivelyStaticRef = true;
+ if (call.arguments != null) {
+ int argumentsLength = call.arguments.length;
+ for (int i = 0; i < argumentsLength; i++)
+ call.arguments[i].traverse(this, scope);
+ }
+ return false;
+ }
+ }
+ }
+
+ return super.visit(call, scope);
+ }
+
+ private void replaceEffectivelyStaticRef(MessageSend call) {
+ //System.err.println("replace static ref");
+ NameReference receiver = (NameReference) call.receiver;
+ receiver.binding = thisJoinPointStaticPartDecLocal; //thisJoinPointStaticPartDec;
+ receiver.codegenBinding = thisJoinPointStaticPartDecLocal;
+
+ call.binding.declaringClass =
+ (ReferenceBinding) thisJoinPointStaticPartDec.type;
+ }
+
+ public int removeUnusedExtraArguments() {
+ int extraArgumentFlags = 0;
+
+ this.computeJoinPointParams();
+ MethodBinding binding = method.binding;
+
+
+ int index = binding.parameters.length - 3;
+ if (needsStaticEnclosing) {
+ extraArgumentFlags |= Advice.ThisEnclosingJoinPointStaticPart;
+ } else {
+ removeParameter(index+2);
+ }
+
+ if (needsDynamic) {
+ extraArgumentFlags |= Advice.ThisJoinPoint;
+ } else {
+ removeParameter(index+1);
+ }
+
+ if (needsStatic) {
+ extraArgumentFlags |= Advice.ThisJoinPointStaticPart;
+ } else {
+ removeParameter(index+0);
+ }
+
+ return extraArgumentFlags;
+ }
+
+ private void removeParameter(int indexToRemove) {
+ TypeBinding[] parameters = method.binding.parameters;
+ method.scope.locals = removeLocalBinding(indexToRemove, method.scope.locals);
+ method.binding.parameters = removeParameter(indexToRemove, method.binding.parameters);
+ }
+
+
+ private static TypeBinding[] removeParameter(int index, TypeBinding[] bindings) {
+ int len = bindings.length;
+ TypeBinding[] ret = new TypeBinding[len-1];
+ System.arraycopy(bindings, 0, ret, 0, index);
+ System.arraycopy(bindings, index+1, ret, index, len-index-1);
+ return ret;
+ }
+
+ private static LocalVariableBinding[] removeLocalBinding(int index, LocalVariableBinding[] bindings) {
+ int len = bindings.length;
+ //??? for performance we should do this in-place
+ LocalVariableBinding[] ret = new LocalVariableBinding[len-1];
+ System.arraycopy(bindings, 0, ret, 0, index);
+ System.arraycopy(bindings, index+1, ret, index, len-index-1);
+ return ret;
+ }
+
+
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
index 8a43cfa33..93e0ebad9 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
@@ -40,6 +40,7 @@ public class AjBuildConfig {
private boolean emacsSymMode = false;
private boolean noWeave = false;
private boolean XserializableAspects = false;
+ private boolean XnoInline = false;
private String lintMode = AJLINT_DEFAULT;
private File lintSpecFile = null;
@@ -202,4 +203,12 @@ public class AjBuildConfig {
XserializableAspects = xserializableAspects;
}
+ public boolean isXnoInline() {
+ return XnoInline;
+ }
+
+ public void setXnoInline(boolean xnoInline) {
+ XnoInline = xnoInline;
+ }
+
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index 6fa941d82..a5f19ca94 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -239,6 +239,7 @@ public class AjBuildManager {
private void initBcelWorld(IMessageHandler handler) throws IOException {
bcelWorld = new BcelWorld(buildConfig.getClasspath(), handler);
+ bcelWorld.setXnoInline(buildConfig.isXnoInline());
bcelWeaver = new BcelWeaver(bcelWorld);
for (Iterator i = buildConfig.getAspectpath().iterator(); i.hasNext();) {
@@ -504,6 +505,7 @@ public class AjBuildManager {
pr, nameEnvironment);
EclipseWorld ew = new EclipseWorld(le, handler);
ew.setLint(bcelWorld.getLint());
+ ew.setXnoInline(buildConfig.isXnoInline());
le.world = ew;
pr.world = ew;
le.world.buildManager = this;
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java
index f2273f1b3..f1c1b67f8 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java
@@ -21,8 +21,8 @@ import org.aspectj.testing.util.TestUtil;
public class WorkingTestMain {
public static void main(String[] args1) throws IOException {
- testExamples();
- //testOne();
+ //testExamples();
+ testOne();
}
public static void testOne() throws IOException {
@@ -50,7 +50,8 @@ public class WorkingTestMain {
//args.add("../weaver/testdata/megatrace.jar");
args.add("testdata/src1/AroundA1.java");
- //args.add("../tests/new/AroundInnerCalls.java");
+ args.add("-XnoInline");
+ //args.add("../tests/new/Counting1.java");
//args.add("-Xlint:error");
//args.add("testdata/src1/InterType.java");
//args.add("@" + examplesDir + "tjp/files.lst");
@@ -59,12 +60,11 @@ public class WorkingTestMain {
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
//CommandTestCase.runCompiler(args, new int[] {11, 14, 18, 32, 43});
-// CommandTestCase.printGenerated("../out", "AdviceOnInheritedMethod");
+ CommandTestCase.printGenerated("../out", "AroundA1");
// CommandTestCase.printGenerated("../out", "SuperC");
// CommandTestCase.printGenerated("../out", "SubC");
- //TestUtil.runMain("out;../bcweaver/testdata/megatrace.jar", "Privileged");
- //TestUtil.runMain("out;../lib/test/testing-client.jar", "AroundInnerCalls");
+ TestUtil.runMain("out;../lib/test/testing-client.jar", "AroundA1");
}
private static String examplesDir = "../docs/dist/doc/examples/";