summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* fixed issue with EnclosingMethod attribute.michelou2010-12-308-164/+184
| | | | | | The above issue was made explicit using the dx tool for the Android SDK to convert Java bytecode to Dalvik bytecode.
* fixed (and extended) bytecode readermichelou2010-12-3034-445/+2121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMPORTANT NOTE Modifying code of the FJBG library is a very sensitive task since its write operations are eg. used by the Scala compiler. This SVN commit affects (should affect) only the read operations (which did never work) of the FJBG library. Changes include: - fixed several killer bugs in the bytecode reader (see below). - added missing input stream constructors in several Attribute classes (eg. JBootstrapInvokeDynamic, JEnclosingMethodAttribute, JInnerClassesAttribute) together with the corresponding class registrations in class JAttributeFactory. - added classes JExceptionsTable, JLocalVariableTableAttribute and JStackMapTableAttribute (including corresponding factory methods in class FJBGContext). - overriden method toString in most classes to support output format similar to javap (see below). - did some code cleanup (tabs, etc..). Bug fixes include: - fixed incorrect stream.readInt() in JSourceFileAttribute constructor. - fixed missing code.lineNumbers initialization in JLineNumberTableAttribute constructor. - fixed incorrect code in class util.ByteArray constructor (stream). - added method setCode in class JMethod to link them together. Output of decoded bytecode: The added toString() methods return javap-like formatted strings for the decoded data, eg. for the LocalVariableTable attribute you get the following output: ... LocalVariableTable: Start Length Slot Name Signature 0 6 0 this LTest$; 0 6 1 args [Ljava/lang/String; Executing the following Java code will produce decoded bytecode in a format similar to the command line "javap -p -v -classpath <cpath> <classes>": static void printClass(String filePath) throws Exception { FJBGContext fjbgContext = new FJBGContext(49, 0); DataInputStream in = new DataInputStream(new FileInputStream(filePath)); JClass jclass = fjbgContext.JClass(in); System.out.println(jclass); in.close(); } Mainly for providing a demonstrator of the FJBG reader we added to the FJBG library the main class ch.epfl.lamp.fjbg.Main which behaves similarly to javap, the class file disassembler of the J2SE SDK. For instance the following commands produce (more or less) the same output: ~$ scala ch.epfl.lamp.fjbg.Main -classpath classes 'Test javap -p -v$' ~$ -classpath classes 'Test $' In several cases fjbg.Main will provide more information for access flags (eg. brigde methods) and class file attributes (eg. enclosing methods). TODO - integration of FJBGContext.JLocalVariableTableAttribute into the JVM backend of the Scala compiler (cleaner handling of local variables). - The source code of the FJBG library is currently generated using the compiler option "-source 1.4"; moving to source release 1.5 would allow further code improvements like: List --> List<T> (cast removals) StringBuffer --> StringBuilder (faster implementation) /*@Override*/ --> @Override A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
* Removed Proxy from parents of WrappedString.Paul Phillips2010-12-301-1/+2
| | | | | | forward toString, but forwarding equals and hashCode breaks equality with sequences. Closes #4122, no review.
* Thinking I have to dial down a timeout.Paul Phillips2010-12-301-1/+1
|
* Tired of paying the DEVIRTUALIZE compilation pr...Paul Phillips2010-12-307-85/+53
| | | | | | | | | Tired of paying the DEVIRTUALIZE compilation price, not to mention checks for conditions which are never true, I disabled it more thoroughly. Found a couple unused fields in expensive places like Symbol. Stomped out some duplicate logic in the world of flattening and places beyond. No review.
* More jline work from huynhjl.Paul Phillips2010-12-305-62/+132
| | | | | repo and includes jline binary. No review.
* It's all partest freeze debugging. No review.Paul Phillips2010-12-305-31/+67
|
* Mr.Paul Phillips2010-12-292-84/+15
| | | | | | StreamAppender is the leader among suspicious things which look like they freeze things, so I started ripping it out. Again. No review.
* Some accumulated cleanup done while profiling a...Paul Phillips2010-12-2922-112/+68
| | | | | | Some accumulated cleanup done while profiling and reducing uses of length. No review.
* After profiling revealed 100Ks of unnecessary s...Paul Phillips2010-12-281-3/+14
| | | | | | | | After profiling revealed 100Ks of unnecessary singleTypes being created, I tracked it down to typeOfThis on ClassSymbol. I put in a cache like the one on thisType and knocked almost 5% off the quick.comp time. Review by odersky.
* Added withFilter to the list of monadic method ...Paul Phillips2010-12-283-2/+5
| | | | | | Added withFilter to the list of monadic method names: otherwise the inliner doesn't recognize its attractiveness. No review.
* The partest hangs are back in force.Paul Phillips2010-12-285-87/+134
| | | | | | | | | | down the long and freezy road once again. With this patch you can send a SIGHUP to partest and it will spew a bunch of internal state. It is also possible I fixed the underlying issue by cleaning up the super fragile dependence on counters never getting the least bit off track. If fixed, it'll still be fun to send signals. If not, this will be coming in handy reeeeeal soon. No review.
* Some additions to SignalManager to make it easy...Paul Phillips2010-12-282-3/+108
| | | | | | | | Some additions to SignalManager to make it easy to do things in response to a signal. Like say if you're partest and you're back to freezing a few times a day and you'd like to reveal what precisely you're up to. No review.
* Plugging some leakiness I found in the pattern ...Paul Phillips2010-12-233-6/+7
| | | | | Plugging some leakiness I found in the pattern matcher. No review.
* A pretty severe cleanup of typeRef.Paul Phillips2010-12-231-32/+21
| | | | | stay for the aesthetics! Review by odersky.
* I cannot be beaten by mysterious side effecting.Paul Phillips2010-12-235-95/+91
| | | | | | | 25% off the time spent in genjvm. Also eliminates the originalOwner field in Symbol in favor of a cache which is only updated when the originalOwner changes. Review by dragos.
* Looks like there is some side effecting I can't...Paul Phillips2010-12-231-6/+1
| | | | | | Looks like there is some side effecting I can't pin down. Reverts the last two patches until my bring gets bigger. No review.
* Fix for stability failure, I think. No review.Paul Phillips2010-12-231-3/+4
|
* A couple caches knock a full 20% off the time s...Paul Phillips2010-12-221-2/+6
| | | | | | A couple caches knock a full 20% off the time spent in genjvm. Review by dragos.
* Recognize calls to scala varargs methods where ...Paul Phillips2010-12-221-4/+6
| | | | | | | Recognize calls to scala varargs methods where the parameter list is empty, and give Nil as the sequence rather than wrapping an empty Array. Review by odersky.
* Reinstantiated the "integrateNew" functionality...Martin Odersky2010-12-221-2/+2
| | | | | | Reinstantiated the "integrateNew" functionality under the suspicion that this might solve some of the recent "tree not found" errors.
* Fix 'Symbol.companionModule' for the resident m...Iulian Dragos2010-12-221-6/+16
| | | | | | | | | | | | | | | | | Fix 'Symbol.companionModule' for the resident mode compiler. It was confused by having modules being translated to lazy values. The direct consequence was a crash in the build manager when looking at a constructor using a default argument (compiled separately), but only on the second run. The resident compiler may run many times over, and symbols may be reused. Therefore, a module symbol that has been translated to a lazy val by refchecks is not guaranteed to have MODULE set on the next run (even before refcheck). Flags are not part of symbol history. Instead we rely on the fact that a synthetic lazy value must have been a module. review by odersky.
* This fixes a regression incurred in r23565 whic...Paul Phillips2010-12-222-6/+8
| | | | | | | This fixes a regression incurred in r23565 which was creating at least tens of megabytes of garbage on each build. There is a whole bunch to say about this one, but first the commit. Review by odersky.
* The undoLog is being cleared before a typer run...Paul Phillips2010-12-222-4/+7
| | | | | | | The undoLog is being cleared before a typer run, but not afterward. This meant a huge amount of unnecessary garbage persisted beyond typer. Now, more clearing. Review by moors.
* More elimination of avoidable calls to List#len...Paul Phillips2010-12-2113-113/+111
| | | | | More elimination of avoidable calls to List#length. No review.
* Disabled forkjoin on ibm1.6.Aleksandar Pokopec2010-12-211-2/+5
|
* Added settings for presentation compiler debugg...Iulian Dragos2010-12-212-7/+11
| | | | | Added settings for presentation compiler debugging options. no review.
* Bencharking a larger program with parallel coll...Aleksandar Pokopec2010-12-216-69/+107
| | | | | | | | | Bencharking a larger program with parallel collections. Fixed a couple of bugs in parallel collections. No review.
* Finer conversions for immutable parallel collec...Aleksandar Pokopec2010-12-2114-72/+235
| | | | | | | | | Finer conversions for immutable parallel collections. Added some missing traits. No review.
* I really don't know the proper way to fix it in...Eugene Vigdorchik2010-12-211-1/+8
| | | | | | I really don't know the proper way to fix it in the current setting, so just guarding.
* Quik fixes for - double definitions, - tree not...Martin Odersky2010-12-211-4/+6
| | | | | Quik fixes for - double definitions, - tree not found, - reloadSources
* An Ordering for Seq and all of its descendents.Paul Phillips2010-12-211-0/+15
| | | | | small, very focused taste of Ordering contravariance. No review.
* This commit is about not calling .length or .si...Paul Phillips2010-12-2017-143/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is about not calling .length or .size on Lists. Sometimes it is unavoidable; not often. I created some methods for the compiler which should probably be in the collections, which do things like test if two sequences have the same length in a more efficient manner than calling length on each. Also, wouldn't it be wonderful to have some mechanism for finding these issues in a more automated way. Like say an annotation: LinearSeqLike { @badjuju("Calling length on linear seqs is O(n)") def length: Int = whee } Or since I imagine everyone thinks they're calling length with lists of 2 or 3, an optional runtime check which yelled if it sees you calling length on a 600 element list, or worse: var i = 0 while (i < myList.length) { // you don't want to see what this does f(myList(i)) ; i += 1; } Uniformity of interface without uniformity of behavior leaves us with traps. No review.
* presentation compiler cleanup & rewriteMartin Odersky2010-12-204-166/+174
|
* I'm wandering around trunk looking for slowness.Paul Phillips2010-12-2016-213/+120
| | | | | | | | | | | | | | | | | are constant distractions which I've meant forever to fix anyway, such as the importing of collection.mutable._ (or any other package with lots of reused names.) Why is this relevant to performance? Well, var x = new HashSet[Int] What's that? What does 'x += 1' mean? These are questions we can all live without. There's almost nothing left which references HashSet or HashMap or Stack or other ambiguous classes without a qualifier: I can finish trunk but I can't keep it clean on my own. (Where should I be writing this stuff down, I wonder.) No review.
* Explaining something for the (largeish N)th tim...Paul Phillips2010-12-191-3/+83
| | | | | | | | | | | | | | | | | | | Explaining something for the (largeish N)th time finally awoke me to the fact that software can explain things. I labored a long time over this error message: I'm sure it can still use work (and/or it will drive scalaz users off some kind of cliff) but the simple common case people have so much trouble with is lit up like a christmas tree and for this I will take some bullets. build/pack/bin/scala -e 'class Foo[T] ; Set[Foo[AnyRef]]() + new Foo[String]' :1: error: type mismatch; found : this.Foo[String] required: this.Foo[java.lang.Object] Note: String <: java.lang.Object, but class Foo is invariant in type T. You may wish to define T as +T instead. (SLS 4.5) class Foo[T] ; Set[Foo[AnyRef]]() + new Foo[String] ^ Review by moors.
* Optimization based on profiler data.Paul Phillips2010-12-197-41/+36
| | | | | | into strings for the benefit of log messages which are never going to be printed, that sort of thing. No review.
* One more insomniac try: the fix for -explaintyp...Paul Phillips2010-12-191-5/+7
| | | | | | One more insomniac try: the fix for -explaintypes having gone off the deep end. Review by odersky.
* Reverting the previous patch for output change ...Paul Phillips2010-12-191-7/+5
| | | | | Reverting the previous patch for output change breakage. No review.
* The fix for -explaintypes having gone off the d...Paul Phillips2010-12-191-5/+7
| | | | | | The fix for -explaintypes having gone off the deep end. Perhaps other good may come of it as well. Review by odersky.
* More fixes to avoid the dreaded "NoSymbol does ...Martin Odersky2010-12-183-4/+24
| | | | | | More fixes to avoid the dreaded "NoSymbol does not have owner" problem in names defaults.
* Added some infrastructure for tracking and disp...Paul Phillips2010-12-185-24/+73
| | | | | | | | | | | | | | | | | | | | Added some infrastructure for tracking and displaying information. Used it to generate phase timing tables. Couldn't bring myself to add another option so it's temporarily behind a system property until I sort out the output options. % scalac -Dscala.timings foo.scala // or: ant -Djvm.opts="-Dscala.timings" [...] phase id ms share -------------- -- ---- ----- typer 4 5816 44.94 mixin 20 1220 9.43 specialize 13 1179 9.11 erasure 15 916 7.08 ...etc. No review.
* Application now uses delayedInit.Martin Odersky2010-12-175-73/+79
|
* Temporary fix for #4092. No reviewHubert Plociniczak2010-12-171-2/+7
|
* Fixed compiler crash on malformed source file.Martin Odersky2010-12-171-1/+5
|
* Attempt to fix NoSymbol does not have owner pro...Martin Odersky2010-12-174-8/+13
| | | | | Attempt to fix NoSymbol does not have owner problem in Eclipse.
* Discovered bug in mapConserve introduced in r23...Paul Phillips2010-12-171-3/+1
| | | | | | | | | | Discovered bug in mapConserve introduced in r23038 when a tail recursive version was submitted. I am optimistic this is a player in recent performance degradation based on the timing of the commit and the fact that I was examining mapConserve because of info from my homemade profiler. (But it's late and I only just found it, so I'll be the last to know.) Review by odersky.
* do not add entry in InnerClass attribute if out...michelou2010-12-161-101/+103
| | | | | | | | | | | | | | | | do not add entry in InnerClass attribute if outer name is null (according to comment for outerName method) in order to remove the following warning message reported by the dx tool (Android): warning: Ignoring InnerClasses attribute for an anonymous inner class (test$$anonfun$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class.
* Added more logging to the presentation compiler.Iulian Dragos2010-12-162-1/+23
|
* Removed the 'codeGenerator' field, which was a ...Iulian Dragos2010-12-162-50/+63
| | | | | | | | | | Removed the 'codeGenerator' field, which was a source of leaks. Refactored javaName/javaType and the like. Now javaName does only name mangling, and it is overriden by the BytecodeGenerator to keep track of inner classes. JVMUtils now can be instantited by third party tools like Eclipse and use javaName without polluting the code generator's state. review by extempore.