Commit Graph

12955 Commits

Author SHA1 Message Date
extempore 4028f83c6d Some profiling infrastructure. With no small amount of fiddling
I avoided creating any dependency on yourkit.  In addition, there
was no way to give arguments to the JVM without losing the ones
defined in ANT_OPTS, which has been a massive pain for a while.
So there is now "jvm.opts" which is simply appended to ANT_OPTS, e.g.

  % ant -Djvm.opts=-verbose
  [echo] Forking with JVM opts: -Xms1536M -Xmx2g -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC -verbose

There is a minimal stub defining a profiler interface:

  scala.tools.util.Profiling

Then the yourkit wrapper implements that interface.  Once your
locker has been rebuilt once, you can do this:

  ant yourkit.run

And it will build quick.lib/comp with profiling enabled, assuming
it can find the necessary files.  See the yourkit.init target for
values to change: or ant -Dyourkit.home=/path/to/it might be enough.

Review by dragos.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23528 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-16 23:08:45 +00:00
eugenevigdorchik 7cc1b7cbcc Correct wrong comment. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23526 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-16 16:10:59 +00:00
dragos ab663a16d3 Added and corrected existing comments. Review by extempore,moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23525 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-16 10:05:09 +00:00
extempore 7d8efa7feb Switched from ignoring nonexistent directory to creating an empty
one to accomodate old underpowered versions of ant.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23524 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-16 06:01:44 +00:00
extempore 5344437581 ant, build.xml and classpath issues. It looks like everyone has
been ignoring their painstakingly set classpaths and using whatever
they can find in the vicinity of the scala script, which works OK
for pack but not so well for quick.

I also added a build.xml feature so you can drop jars into a dir and
have them automatically used everywhere.  The directory is lib/extra.
Pro tip: add lib/extra to .gitignore and put jars like
yjp-controller-api-redist.jar in there.

Closes #3706, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23523 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-16 05:03:50 +00:00
dragos c2cb28673f Cosmetic changes to previous fix for #3918. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23521 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 17:09:28 +00:00
dragos 393c08c6f7 Clear the undoLog for types in resetTyper. This solves
a memory leak when running scalac in resident mode (including
the presentation compiler and build manager). no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23520 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 17:09:25 +00:00
phaller bc7ad7413f Changed javasigs test to use new javaccmd system property.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23519 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 16:55:39 +00:00
phaller a0f3f89453 partest sets javaccmd system property when running tests. Review by dragos.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23518 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 16:53:45 +00:00
eugenevigdorchik 9f32d348d3 Revert unused code. Names for types and terms are different, so findMember never returns types for term names. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23517 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 11:26:34 +00:00
eugenevigdorchik 745b93d93f adapt not to confuse types and stable terms. Review by odersky.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23516 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 08:57:17 +00:00
extempore cb76213c82 Cleaned up some hangover from equality struggles of yore.
Deprecated now pointless vals.  Close #3998, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23515 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-15 04:59:04 +00:00
dragos dc6256cde1 Moved failing test to pending until I figure out how hudson is running on chara
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23513 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-14 17:19:15 +00:00
extempore 91cd2ba5df Fixed -Xexperimental and other settings so that setting them false will
falsify the associated options rather than truify them.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23512 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-14 16:46:51 +00:00
extempore b576d04f7e Merge branch 'master' of /scala/trunk
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23511 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-14 03:55:38 +00:00
extempore 5013988a8e Made the additions to Predef described in #3762. Added comments
reminding me or someone to deprecate in 2.9.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23510 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-14 03:15:13 +00:00
dragos facbdd6309 Use partest's java and javac command in the javasigs
test. no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23508 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-13 19:18:30 +00:00
dragos 451e08b965 Fix InnerClasses attribute: anonymous classes don't have
an outer name. EnclosingMethod is correctly generated. 
Fixed isAnonymousClass definition. Updated test that
depends on anonymous inner class names.
Closes (again) #3249, references #2749. 
review by odersky,extempore.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23507 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-13 13:31:49 +00:00
dragos 99c3d3a745 Fixed erasure.intersectionDominator. Make sure a symbol
is loaded before testing for 'isTrait'. closes #3918, review by odersky,extempore.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23506 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-13 10:53:18 +00:00
extempore 75e9316e14 Another exciting development in the world of -Y options which
I and three other people will use.  Today's is -Yrich-exceptions.
Use it like so:

  SOURCEPATH=/path/to/src scalac -Yrich-exceptions a.scala

In the repl, -Yrich-exceptions will cause lastException to be
bound to an Exceptional instead of old rusty Throwable.  That
spins up new powers:

  scala> Nil.head
  [Nil.head] (List.scala:389)
  (access lastException for the full trace)
  scala> lastException.show
  /* The repl internal portion of the stack trace is elided. */
  [Nil.head]
   386:   override def isEmpty = true
   387:   override def head: Nothing =
   388:     throw new NoSuchElementException("head of empty list")
  *389:   override def tail: List[Nothing] =
   390:     throw new UnsupportedOperationException("tail of empty list")
   391:   // Removal of equals method here might lead to an infinite recursion similar to IntMap.equals.
   392:   override def equals(that: Any) = that match {

  [line0.<init>] (<console>:6)
  [line0.<clinit>] (<console>:-1)

Also try "lastException.showTable" but this is getting a little long
for more excerpt.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23505 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-13 03:18:12 +00:00
dragos d95299a6da Generate EnclosingMethod classfile attributes.
This should fix java signatures when they refer to
method type parameters. I unrolled Adriaans previous fix 
for #3249, as this one is more general. Closes #3249, 
review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23503 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-12 16:26:17 +00:00
extempore 27bbc29b55 A revival of r21442, which I had reverted based on the mistaken
belief it was causing mysterious trunk issues of the day.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23502 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-12 14:18:44 +00:00
extempore 6450392f1e Half of an implementation of sealedness for java enums.
Since it's only half it's behind -Xexperimental, but it works
like a charm for the half where it works (that being compiling
against bytecode.) Need input on how to approach the source half.
References ticket #2442.  Review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23501 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-12 00:07:37 +00:00
prokopec e9b52abcd6 A slight performance improvement for parallel sets.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23498 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 14:38:32 +00:00
prokopec 71d61ea4de Solved a performance problem in parallel hash table sets.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23497 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 14:38:29 +00:00
extempore 671f70e6dc A test case having some issues. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23496 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 06:34:32 +00:00
extempore 34fe053b17 Some more work on options related to showing compiler structures
during compilation.  The pickler knew more than was healthy about
things like compiler settings, so I let the pickler worry about
pickling and moved that logic somewhere closer to the surface.
Some convenience oriented tweaks to command line phase parsing.
The end result is as follows (some output trimmed for brevity.)

// dippy.scala
class Dippy {
  def f[T <: Dippy](x: T) = (x, x)
  object DingusDippy extends util.Random { }
}
// className@phaseString should be reliably unambiguous
% scalac -Xshow-class Dippy@typer,erasure,jvm dippy.scala

<<-- class Dippy after phase 'typer' -->>
Members (excluding Any/AnyRef unless overridden):
  final object DingusDippy extends object Dippy.this.DingusDippy
  def f[T <: Dippy](x: T): (T, T)

<<-- class Dippy after phase 'erasure' -->>
Members (excluding Any/AnyRef unless overridden):
  private lazy var DingusDippy$module: object Dippy#DingusDippy
  lazy val DingusDippy(): object Dippy#DingusDippy
  def f(x: Dippy): Tuple2

<<-- class Dippy after phase 'jvm' -->>
Members (excluding Any/AnyRef unless overridden):
  protected var bitmap$0: Int
  private lazy var DingusDippy$module: object Dippy$DingusDippy
  lazy val DingusDippy(): object Dippy$DingusDippy
  def f(x: Dippy): Tuple2

No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23495 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 05:21:37 +00:00
extempore 7ca27a45c1 Some minor fixes found by findbugs. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23494 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 05:20:39 +00:00
extempore 5ed7d4403e Unsuppressed generic signatures for members with expanded names.
Closes #3897, review by dragos.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23493 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 05:19:47 +00:00
extempore e411ca8e1b Introduces "Origins" for all your superhero backstory needs.
It logs where all the calls are coming from: that's all for the moment.
It's explained in the comments and test case, so I'm sure you don't
need it all repeated here.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23492 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-11 05:18:59 +00:00
prokopec 9a0016b808 Benchmarking parallel sets.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23490 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-10 16:21:31 +00:00
prokopec 925f1b4c91 Added a benchmark for mutable hash sets.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23489 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-10 16:21:28 +00:00
prokopec 4c27bce40d Fixes #3878. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23488 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-10 16:13:19 +00:00
prokopec 89eb7ac881 To fix the failing nightly.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23487 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-10 16:13:16 +00:00
extempore 519724ac7c protected[this] members should be accessible to super.x calls.
Closes #464, review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23486 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-10 15:02:54 +00:00
plocinic 51addf8093 Closes #3980. Review by dragos.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23476 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-09 11:04:39 +00:00
extempore 5ad1a6f113 While investigating the cause of #3984, discovered that set
hashcodes were being calculated like:

  elems map (_.hashCode) sum

This looks totally correct, except that because of set+map
semantics it drops all the duplicate hashcodes and therefore
calculates the wrong sum anytime there are unequal elements
with equal hashcodes.  If we're married to the set+map semantics
(and I don't know what could be done about it) I had better
get a proper -Xlint going because this is one of those traps
which shoots bees out of its mouth.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23475 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-09 03:13:17 +00:00
extempore ed9780d83f Iteration bug in TrieIterator. Closes #3984, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23474 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-09 03:12:57 +00:00
extempore ee1afe0e4f Restored the stack traces I'd accidentally smothered in r23426, and
cleaned up ObjectRunner/ScriptRunner a bit.  Closes #3978, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23472 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 20:44:20 +00:00
extempore 7d6ad3316a Deprecation patrol. While on patrol noticed that JavaConverters has
the same issues as JavaConversions with respect to overloading implicit
methods making them inaccessible to view bounds.  Fixed JavaConverters.
Added a warning for when people overload parameterized implicits: in almost
all cases the name is irrelevant so there's little point in unwittingly
suffering degraded functionality.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23471 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 20:11:41 +00:00
extempore c509ea3a16 Fixed crasher with @elidable on parameterized methods.
Closes #3981, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23470 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 20:10:53 +00:00
extempore caa4f89204 This is work on -Ycheck:icode. I'm happy to say that the whole
distribution can now be built with that option, with or without
optimization, and almost all tests cases can.  (Those which can't
are due to different -Ycheck: issues.)

Major changes of interest are as follows:

* LOAD_EXCEPTION and THROW are parameterized on the throwable symbol.
* Does not squash all traits down to AnyRef, but instead deals with
  issues as they arise.  By observation the cases where one needs a
  "Foo with Product" to manifest as both a "Foo" and a "Product" at
  different places are quite rare, so we need not throw out the whole baby.
* Exception handlers now have positions.
* The remaining checker failures removed, such as CALL_METHOD wanting
  to pop a value off the stack after calling a constructor.
* Many multiply defined values such as REFERENCE(ObjectClass) put in
  one place (ICodes.scala) and reused.
* -Ycheck:icode output (if also given -Ydebug) worthy of Michelangelo.

Here is a class and the -Ycheck:icode -Ydebug output for f's block.

	class A {
	  def f(x: Int, y: String) =
	    try println(x + y.length)
	    catch { case x: NullPointerException => () }
	}

** Checking Block 4 [S: 3, 2] [P: 1] <closed>
   1-> REF(singleton class Predef)                                     3    + LOAD_MODULE object Predef
      2-> INT                                                          3    + LOAD_LOCAL(value x)
         3-> REF(class String)                                         3    + LOAD_LOCAL(value y)
      2<- REF(class String)                                            3    - CALL_METHOD java.lang.String.length (dynamic)
         3-> INT                                                       3    + CALL_METHOD java.lang.String.length (dynamic)
      2<- INT                                                          3    - CALL_PRIMITIVE(Arithmetic(ADD,INT))
   1<- INT                                                             3    - """
      2-> INT                                                          3    + CALL_PRIMITIVE(Arithmetic(ADD,INT))
   1<- INT                                                             3    - BOX INT
      2-> REF(class Integer)                                           3    + BOX INT
   1<- REF(class Integer)                                              3    - CALL_METHOD scala.Predef.println (dynamic)
0<- REF(singleton class Predef)                                        3    - CALL_METHOD scala.Predef.println (dynamic)

Review by dragos (I marked the specific spots I thought of interest
with "PP to ID" which makes it sound like I'm talking to my primal self.
Next week on programmer theater: "PP to SUPEREGO.")

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23469 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 18:13:08 +00:00
extempore 748dae76f5 Modified the lub calculation in TypeKinds to avoid the icode checker
failures described in ticket #3872.  This does not alter the compiler's
lub calculation as I'd hoped because I could not figure out how to
accomplish this without having unintended consequences.  I think that
either Symbol.isLess could be adjusted, or perhaps the implementation of
spanningTypes, or other places... but it eluded me and I defer to the
type wizards.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23468 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 18:12:25 +00:00
extempore cc589916bc A bit of -Xshow-class / -Xshow-object which didn't quite make the
Global patch.  Now type selections should do the right thing, e.g.

  scalac -Xshow-class Global#Run src/compiler/scala/tools/nsc/Global.scala

will show you interesting things about Run.  Or see the test case
for even more thrills.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23467 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 14:25:01 +00:00
eugenevigdorchik 3e5905dd6f Proper fix for adaptToNewRun for toplevel classes; if the compiler is running after flatten, then nothing to adapt
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23466 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 13:33:12 +00:00
dubochet a1d096d3c0 [scaladoc] Fixes build. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23465 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 12:59:15 +00:00
prokopec afd4ad5cbe Disabled a test failing on server.
No review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23464 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 10:02:09 +00:00
prokopec 1cfbc14011 A test output changed. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23463 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 08:52:23 +00:00
prokopec a2c5b16460 Added size maps to flat hash tables.
Added parallel mutable hash sets.
Implemented parallel mutable hash set iterators.
Implemented parallel mutable hash set combiners.
Factored out unrolled linked lists into a separate class UnrolledBuffer, added tests.
Added parallel mutable hash set tests, and debugged hashsets.

No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23462 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 08:52:20 +00:00
prokopec 283e72254a Pruned away structural invocations throughout the collections framework.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23461 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2010-11-08 08:52:14 +00:00