Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 15607 Details for
Bug 77638
Patches for reducing matching-time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
First approach again, here without overhead for testcase
lazy_matching_simple_deployment_ready.patch (text/plain), 8.56 KB, created by
Eric Bodden
on 2004-11-03 10:06:05 EST
(
hide
)
Description:
First approach again, here without overhead for testcase
Filename:
MIME Type:
Creator:
Eric Bodden
Created:
2004-11-03 10:06:05 EST
Size:
8.56 KB
patch
obsolete
>Index: .classpath >=================================================================== >RCS file: /home/technology/org.aspectj/modules/weaver/.classpath,v >retrieving revision 1.1 >diff -u -r1.1 .classpath >--- .classpath 16 Dec 2002 18:02:43 -0000 1.1 >+++ .classpath 3 Nov 2004 14:28:02 -0000 >@@ -1,15 +1,14 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> >- <classpathentry kind="src" path="src"/> >- <classpathentry kind="src" path="testsrc"/> >- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> >- <classpathentry kind="src" path="/runtime"/> >- <classpathentry kind="lib" path="/lib/bcel/bcel.jar" >- rootpath="bcel-5.0/src/java" sourcepath="/lib/bcel/bcel-src.zip"/> >- <classpathentry kind="lib" path="/lib/junit/junit.jar" sourcepath="/lib/junit/src.jar"/> >- <classpathentry kind="src" path="/util"/> >- <classpathentry kind="src" path="/testing-util"/> >- <classpathentry kind="src" path="/bridge"/> >- <classpathentry kind="src" path="/asm"/> >- <classpathentry kind="output" path="bin"/> >+ <classpathentry kind="src" path="src"/> >+ <classpathentry kind="src" path="testsrc"/> >+ <classpathentry sourcepath="JRE_SRC" kind="var" path="JRE_LIB"/> >+ <classpathentry kind="src" path="/runtime"/> >+ <classpathentry kind="src" path="/util"/> >+ <classpathentry kind="src" path="/testing-util"/> >+ <classpathentry kind="src" path="/bridge"/> >+ <classpathentry kind="src" path="/asm"/> >+ <classpathentry kind="var" path="bcel"/> >+ <classpathentry kind="var" path="junit"/> >+ <classpathentry kind="output" path="bin"/> > </classpath> >Index: src/org/aspectj/weaver/patterns/AndPointcut.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/weaver/src/org/aspectj/weaver/patterns/AndPointcut.java,v >retrieving revision 1.8 >diff -u -r1.8 AndPointcut.java >--- src/org/aspectj/weaver/patterns/AndPointcut.java 8 Jun 2004 15:04:34 -0000 1.8 >+++ src/org/aspectj/weaver/patterns/AndPointcut.java 3 Nov 2004 14:28:03 -0000 >@@ -27,30 +27,90 @@ > > public class AndPointcut extends Pointcut { > Pointcut left, right; // exposed for testing >+ >+ private final boolean evaluateLeftFirst; > > public AndPointcut(Pointcut left, Pointcut right) { > super(); > this.left = left; > this.right = right; > setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); >+ //if left pc is easier to match, match this one first >+ this.evaluateLeftFirst = this.left.matchingCosts() < this.right.matchingCosts(); > } > > public FuzzyBoolean fastMatch(FastMatchInfo type) { >- return left.fastMatch(type).and(right.fastMatch(type)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.fastMatch(type); >+ if(leftValue.maybeTrue()) { >+ return leftValue.and(right.fastMatch(type)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.fastMatch(type); >+ if(rightValue.maybeTrue()) { >+ return rightValue.and(left.fastMatch(type)); >+ } else { >+ return rightValue; >+ } >+ } > } > > public FuzzyBoolean match(Shadow shadow) { >- return left.match(shadow).and(right.match(shadow)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.match(shadow); >+ if(leftValue.maybeTrue()) { >+ return leftValue.and(right.match(shadow)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.match(shadow); >+ if(rightValue.maybeTrue()) { >+ return rightValue.and(left.match(shadow)); >+ } else { >+ return rightValue; >+ } >+ } > } > > public FuzzyBoolean match(JoinPoint jp, JoinPoint.StaticPart encJP) { >- return left.match(jp,encJP).and(right.match(jp,encJP)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.match(jp,encJP); >+ if(leftValue.maybeTrue()) { >+ return leftValue.and(right.match(jp,encJP)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.match(jp,encJP); >+ if(rightValue.maybeTrue()) { >+ return rightValue.and(left.match(jp,encJP)); >+ } else { >+ return rightValue; >+ } >+ } > } >- >+ > public FuzzyBoolean match(JoinPoint.StaticPart jpsp) { >- return left.match(jpsp).and(right.match(jpsp)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.match(jpsp); >+ if(leftValue.maybeTrue()) { >+ return leftValue.and(right.match(jpsp)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.match(jpsp); >+ if(rightValue.maybeTrue()) { >+ return rightValue.and(left.match(jpsp)); >+ } else { >+ return rightValue; >+ } >+ } > } >- >+ > public String toString() { > return "(" + left.toString() + " && " + right.toString() + ")"; > } >Index: src/org/aspectj/weaver/patterns/OrPointcut.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/weaver/src/org/aspectj/weaver/patterns/OrPointcut.java,v >retrieving revision 1.8 >diff -u -r1.8 OrPointcut.java >--- src/org/aspectj/weaver/patterns/OrPointcut.java 8 Jun 2004 15:04:34 -0000 1.8 >+++ src/org/aspectj/weaver/patterns/OrPointcut.java 3 Nov 2004 14:28:03 -0000 >@@ -28,28 +28,88 @@ > public class OrPointcut extends Pointcut { > private Pointcut left, right; > >+ private final boolean evaluateLeftFirst; >+ > public OrPointcut(Pointcut left, Pointcut right) { > super(); > this.left = left; > this.right = right; > setLocation(left.getSourceContext(), left.getStart(), right.getEnd()); >+ //if left pc is easier to match, match this one first >+ this.evaluateLeftFirst = this.left.matchingCosts() < this.right.matchingCosts(); > } > > > public FuzzyBoolean fastMatch(FastMatchInfo type) { >- return left.fastMatch(type).or(right.fastMatch(type)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.fastMatch(type); >+ if(leftValue.maybeFalse()) { >+ return leftValue.or(right.fastMatch(type)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.fastMatch(type); >+ if(rightValue.maybeFalse()) { >+ return rightValue.or(left.fastMatch(type)); >+ } else { >+ return rightValue; >+ } >+ } > } > > public FuzzyBoolean match(Shadow shadow) { >- return left.match(shadow).or(right.match(shadow)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.match(shadow); >+ if(leftValue.maybeFalse()) { >+ return leftValue.or(right.match(shadow)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.match(shadow); >+ if(rightValue.maybeFalse()) { >+ return rightValue.or(left.match(shadow)); >+ } else { >+ return rightValue; >+ } >+ } > } > > public FuzzyBoolean match(JoinPoint jp, JoinPoint.StaticPart encJP) { >- return left.match(jp,encJP).or(right.match(jp,encJP)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.match(jp,encJP); >+ if(leftValue.maybeFalse()) { >+ return leftValue.or(right.match(jp,encJP)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.match(jp,encJP); >+ if(rightValue.maybeFalse()) { >+ return rightValue.or(left.match(jp,encJP)); >+ } else { >+ return rightValue; >+ } >+ } > } >- >+ > public FuzzyBoolean match(JoinPoint.StaticPart jpsp) { >- return left.match(jpsp).or(right.match(jpsp)); >+ if(this.evaluateLeftFirst) { >+ FuzzyBoolean leftValue = left.match(jpsp); >+ if(leftValue.maybeFalse()) { >+ return leftValue.or(right.match(jpsp)); >+ } else { >+ return leftValue; >+ } >+ } else { >+ FuzzyBoolean rightValue = right.match(jpsp); >+ if(rightValue.maybeFalse()) { >+ return rightValue.or(left.match(jpsp)); >+ } else { >+ return rightValue; >+ } >+ } > } > > public String toString() { >Index: src/org/aspectj/weaver/patterns/Pointcut.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/weaver/src/org/aspectj/weaver/patterns/Pointcut.java,v >retrieving revision 1.12 >diff -u -r1.12 Pointcut.java >--- src/org/aspectj/weaver/patterns/Pointcut.java 28 Jul 2004 15:14:50 -0000 1.12 >+++ src/org/aspectj/weaver/patterns/Pointcut.java 3 Nov 2004 14:28:03 -0000 >@@ -62,7 +62,15 @@ > this.state = SYMBOLIC; > } > >- >+ /** >+ * @return The approximate costs of checking for a match >+ * of this pointcut. This should in most cases be implemented by subclasses. >+ */ >+ public int matchingCosts() { >+ return 0; >+ } >+ >+ > /** > * Could I match any shadows in the code defined within this type? > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
aclement
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 77638
:
15606
| 15607 |
15608