diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-01-08 13:09:57 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2010-01-08 13:09:57 +0000 |
commit | a487bd514e44e60f55abf26a20536162f8a5741a (patch) | |
tree | a2b8c3bd3ae6d39004ae1d47dec6f28cbb5d68e7 /src/actors | |
parent | 12e885143ed38d67f9f94e7422852f01f4b85538 (diff) | |
download | scala-a487bd514e44e60f55abf26a20536162f8a5741a.tar.gz scala-a487bd514e44e60f55abf26a20536162f8a5741a.tar.bz2 scala-a487bd514e44e60f55abf26a20536162f8a5741a.zip |
Merged revisions 20307,20309-20312,20329,20341,...
Merged revisions
20307,20309-20312,20329,20341,20344,20349-20351,20357-20359,20363-20366,
20376-20377,20385-20388,20390,20398-20399,20401,20404-20406 via svnmerge
from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r20307 | milessabin | 2009-12-23 12:55:30 +0100 (Wed, 23 Dec 2009) | 1 line
In resident mode the reporter should be reset after each compiler Run.
review by odersky. ........ r20309 | odersky | 2009-12-23 16:02:17 +0100
(Wed, 23 Dec 2009) | 1 line
Weeds out stale symbols in typer. review by milessabin. ........
r20310 | odersky | 2009-12-23 16:02:38 +0100 (Wed, 23 Dec 2009) | 1 line
new testcase no review necessary.
........
r20311 | extempore | 2009-12-23 18:57:36 +0100 (Wed, 23 Dec 2009) | 9 lines
Created team of private[collection] abstract classes and traits in
scala.collection.views. Factored boilerplate and base Transformed
traits out of *ViewLike classes. Executive summary and motivation:
4812029 Dec 23 09:47 scala-library.jar // before 604150 Dec 23 09:24
4scala-library.jar // after
Direct size savings of 4.5%. Review by odersky.
........
r20312 | odersky | 2009-12-23 21:09:54 +0100 (Wed, 23 Dec 2009) | 2 lines
a more thorough treatment of the stale symbol problem. review by
milessabin. ........ r20329 | extempore | 2009-12-31 22:37:32 +0100
(Thu, 31 Dec 2009) | 1 line
Added an XML.load overload which takes an URL.
........
r20341 | phaller | 2010-01-04 13:06:07 +0100 (Mon, 04 Jan 2010) | 1 line
Fixed #2852 and #2854.
........
r20344 | rytz | 2010-01-04 15:08:25 +0100 (Mon, 04 Jan 2010) | 1 line
fix parsing of .net types with inner classes
........
r20349 | odersky | 2010-01-04 21:46:26 +0100 (Mon, 04 Jan 2010) | 2 lines
Added extensive statistics, reduced time of implicit resolution by
2/3rds, of whole typer by 1/4 to 1/3rd. ........ r20350 | odersky |
2010-01-04 23:33:01 +0100 (Mon, 04 Jan 2010) | 3 lines
refined changes to implicits to allow again implicits in non-static
companion objects. ........ r20351 | odersky | 2010-01-05 00:55:51 +0100
(Tue, 05 Jan 2010) | 2 lines
polished statistics generation. no review necessary. ........ r20357 |
phaller | 2010-01-05 10:33:22 +0100 (Tue, 05 Jan 2010) | 1 line
Adjusted timeout in test. No review.
........
r20358 | phaller | 2010-01-05 12:39:12 +0100 (Tue, 05 Jan 2010) | 1 line
Also run neg tests in directories in ant task. No review. ........
r20359 | rytz | 2010-01-05 15:02:13 +0100 (Tue, 05 Jan 2010) | 1 line
rebuilt plugin test jars. no review
........
r20363 | odersky | 2010-01-05 17:42:11 +0100 (Tue, 05 Jan 2010) | 1 line
further optimizations to implicits. Added general purpose counters and
timers to statistics. no review. ........ r20364 | odersky | 2010-01-05
17:43:41 +0100 (Tue, 05 Jan 2010) | 1 line
Closes #2853. No review necessary.
........
r20365 | odersky | 2010-01-05 17:44:32 +0100 (Tue, 05 Jan 2010) | 1 line
Closes #2848. No review.
........
r20366 | phaller | 2010-01-05 17:57:30 +0100 (Tue, 05 Jan 2010) | 1 line
Moved plugin neg tests to pending. No review.
........
r20376 | plocinic | 2010-01-06 12:12:10 +0100 (Wed, 06 Jan 2010) | 1 line
Closes #2793, #2651, #2650, #2653. Review by dragos. ........ r20377 |
plocinic | 2010-01-06 13:33:28 +0100 (Wed, 06 Jan 2010) | 1 line
Fixes #2857. No review.
........
r20385 | plocinic | 2010-01-06 16:26:36 +0100 (Wed, 06 Jan 2010) | 1 line
Closes #2657, #2789. Review by dragos.
........
r20386 | moors | 2010-01-06 17:23:42 +0100 (Wed, 06 Jan 2010) | 2 lines
reinstated accidentally deleted comment
no review
........
r20387 | odersky | 2010-01-06 17:44:32 +0100 (Wed, 06 Jan 2010) | 1 line
Fixed issue with operator symbols. '* is now a symbol. review by
community. ........ r20388 | odersky | 2010-01-06 17:46:48 +0100 (Wed,
06 Jan 2010) | 1 line
further speed improvements by eliminating most uses of paramTypes.
Knocks off about 3% of typer time. Not overwhelming but still worth
doing. Review by rytz. ........ r20390 | milessabin | 2010-01-06
19:48:13 +0100 (Wed, 06 Jan 2010) | 1 line
scalac portion of fix for #2689. For the isStale test to work as
intended the source file path has to be inferred from the orphaned
classfile. Review by Odersky. ........ r20398 | dragos | 2010-01-07
12:00:20 +0100 (Thu, 07 Jan 2010) | 2 lines
Fixed #2850 -- while inside finally causes VerifyError, review by rytz
........
r20399 | phaller | 2010-01-07 12:35:41 +0100 (Thu, 07 Jan 2010) | 1 line
Fixed issue in Reactor/Actor that could lead to premature termination
of actors. Added test that could reproduce it (occurred more often on
larger inputs, but test should not take too much time). The issue also
caused the reactor-exceptionOnSend test to timeout sometimes. Review by
plocinic. ........ r20401 | odersky | 2010-01-07 13:03:44 +0100 (Thu, 07
Jan 2010) | 1 line
Fixed #2844 with dpp's patch. review by xmlteam.
........
r20404 | plocinic | 2010-01-07 17:41:18 +0100 (Thu, 07 Jan 2010) | 1 line
Improvements in checking for references during dependency analysis.
For example more carefully analysis of abstract type members, typerefs
etc. References #2793. review by dragos. ........ r20405 | dragos |
2010-01-07 18:01:01 +0100 (Thu, 07 Jan 2010) | 2 lines
Added warning for failed inlining when the target is @inline
annotated. No review necessary. ........ r20406 | dragos | 2010-01-07
18:24:21 +0100 (Thu, 07 Jan 2010) | 2 lines
Added final modifiers to several classes used by Predef implicits.
Review by community. ........
Diffstat (limited to 'src/actors')
-rw-r--r-- | src/actors/scala/actors/Actor.scala | 8 | ||||
-rw-r--r-- | src/actors/scala/actors/Debug.scala | 9 | ||||
-rw-r--r-- | src/actors/scala/actors/Reactor.scala | 22 | ||||
-rw-r--r-- | src/actors/scala/actors/ReactorTask.scala | 1 | ||||
-rw-r--r-- | src/actors/scala/actors/ReplyReactor.scala | 8 |
5 files changed, 44 insertions, 4 deletions
diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index fb90cb9c46..907389b9f0 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -646,6 +646,7 @@ trait Actor extends AbstractActor with ReplyReactor with ReplyableActor { } // guarded by lock of this + // never throws SuspendActorException private[actors] override def scheduleActor(f: Any =>? Unit, msg: Any) = if ((f eq null) && (continuation eq null)) { // do nothing (timeout is handled instead) @@ -825,6 +826,13 @@ trait Actor extends AbstractActor with ReplyReactor with ReplyableActor { resumeActor() else if (waitingFor ne waitingForNone) { scheduleActor(continuation, null) + /* Here we should not throw a SuspendActorException, + since the current method is called from an actor that + is in the process of exiting. + + Therefore, the contract for scheduleActor is that + it never throws a SuspendActorException. + */ } } } diff --git a/src/actors/scala/actors/Debug.scala b/src/actors/scala/actors/Debug.scala index 481b68d7f4..bad19b8aeb 100644 --- a/src/actors/scala/actors/Debug.scala +++ b/src/actors/scala/actors/Debug.scala @@ -27,6 +27,15 @@ object Debug { def error(s: String) = if (lev > 0) System.err.println("Error: " + s) + + def doInfo(b: => Unit) = + if (lev > 2) b + + def doWarning(b: => Unit) = + if (lev > 1) b + + def doError(b: => Unit) = + if (lev > 0) b } class Debug(tag: String) { diff --git a/src/actors/scala/actors/Reactor.scala b/src/actors/scala/actors/Reactor.scala index d641f54eb6..8545b92d1e 100644 --- a/src/actors/scala/actors/Reactor.scala +++ b/src/actors/scala/actors/Reactor.scala @@ -108,8 +108,17 @@ trait Reactor extends OutputChannel[Any] { // assert continuation != null if (onSameThread) continuation(item._1) - else + else { scheduleActor(continuation, item._1) + /* Here, we throw a SuspendActorException to avoid + terminating this actor when the current ReactorTask + is finished. + + The SuspendActorException skips the termination code + in ReactorTask. + */ + throw Actor.suspendException + } } def !(msg: Any) { @@ -149,7 +158,14 @@ trait Reactor extends OutputChannel[Any] { // keep going } else { waitingFor = handlesMessage - done = true + /* Here, we throw a SuspendActorException to avoid + terminating this actor when the current ReactorTask + is finished. + + The SuspendActorException skips the termination code + in ReactorTask. + */ + throw Actor.suspendException } } } else { @@ -171,6 +187,8 @@ trait Reactor extends OutputChannel[Any] { * an actors act method. * * assume handler != null + * + * never throws SuspendActorException */ private[actors] def scheduleActor(handler: Any =>? Unit, msg: Any) = { val fun = () => handler(msg) diff --git a/src/actors/scala/actors/ReactorTask.scala b/src/actors/scala/actors/ReactorTask.scala index 28e93bbbff..f6ec67e94c 100644 --- a/src/actors/scala/actors/ReactorTask.scala +++ b/src/actors/scala/actors/ReactorTask.scala @@ -46,6 +46,7 @@ private[actors] class ReactorTask[T >: Null <: Reactor](var reactor: T, var fun: case e: Exception => Debug.info(reactor+": caught "+e) + Debug.doInfo { e.printStackTrace() } reactor.terminated() afterExecuting(e) } finally { diff --git a/src/actors/scala/actors/ReplyReactor.scala b/src/actors/scala/actors/ReplyReactor.scala index 4b31369db4..64860f4d38 100644 --- a/src/actors/scala/actors/ReplyReactor.scala +++ b/src/actors/scala/actors/ReplyReactor.scala @@ -57,8 +57,11 @@ trait ReplyReactor extends Reactor with ReplyableReactor { // assert continuation != null if (onSameThread) continuation(item._1) - else + else { scheduleActor(continuation, item._1) + // see Reactor.resumeReceiver + throw Actor.suspendException + } } // assume continuation != null @@ -83,7 +86,8 @@ trait ReplyReactor extends Reactor with ReplyableReactor { // keep going } else { waitingFor = handlesMessage - done = true + // see Reactor.searchMailbox + throw Actor.suspendException } } } else { |