| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
since r19547, which was for #1836 but loosened the noose too much.
Closes #4128, review by odersky.
|
|
|
|
|
|
| |
Added some more debugging tools for printing types. Squirrelled it away
in a type debugging trait. No review.
|
|
|
|
|
|
|
|
|
|
|
| |
after each phase, so all the allocations are partitionable by phase
in the profiler. I also changed the name of -Yprofile-resident to
-Yprofile-memory and had it snapshot after the run instead of between
them, so it is usable for regular scalac usage as well.
Added tools/profile_scalac which can be used as a drop-in replacement
which handles some tedious setup. Review by dragos.
|
|
|
|
|
|
|
|
| |
Modified generic companion apply to call empty if there are no
arguments, so something like Set() does not generate unnecessary
garbage. Also found some immutable classes which don't reuse an empty
object for emptiness, and gave them one. No review.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
There was a massive 30+ line cut and paste between isPlausiblyCompatible
and normSubType. Since I already painstakingly optimized the former, it
was incredibly depressing to discover an exact copy of the "before" code
pasted into a method later in the same file. I can't begin to convey how
much unnecessary difficulty this sort of thing brings for us. Friends,
romans, countrymen, put down your ctrl-Vs. Review by anyone who might be
tempted to perform similar cutting and pasting in the future.
|
|
|
|
|
|
|
|
|
|
| |
Working my way through popular methods with a microscope looking to
shave off some time. Along the way fighting off various poor software
engineering practices no doubt perpetrated in haste by people who
suffered grave regrets afterward, such as the passing around of
listbuffers to be modified by the callee, and a more egregious one to
follow. No review.
|
|
|
|
|
|
|
| |
Since r22374 isCompatible and isCompatibleArg have been bit-for-bit
identical methods. Deleted isCompatibleArg. Also gave some structure to
the act of disabling implicit search. No review.
|
|
|
|
|
|
|
| |
Clear caseClassOfModuleClass lazily, otherwise we lose information
calculated during the namer phase upon next run triggered by the
presentation compiler. Review by odersky.
|
|
|
|
|
|
| |
Misc uninteresting tidbits to take some weight off overly large patches
in progress. No review.
|
|
|
|
|
|
|
|
|
|
| |
questions start to arise as the ability to distinguish between type and
term names becomes more fully realized: particularly that the ability
to distinguish between TermSymbols and TypeSymbols has not come along
with the names. In any case, this is more tedious than I might have
anticipated but mostly because it's blazing a trail of typiness to ease
the path for others. No review.
|
|
|
|
|
|
| |
Knocking a few instructions off isSubType2, and dodging some list
traversals in SubstMap. Review by odersky.
|
|
|
|
|
| |
More comprehensive escaping for compiler Strings/Chars. No review.
|
|
|
|
|
|
|
|
|
|
|
| |
Generalized a pile of duplicated type caching code, but it's still
largely undeployed because I haven't figured out how to make it as fast
as the copy-pasted version, which bugs me like you wouldn't believe.
Cannot deal with making "Sophie's Choice" between performance and lack
of duplication. I left one deployment in because it fixed a bug, or at
least so I see it: can't see why one would want the two absent error
messages in t2641.check. Review by odersky.
|
|
|
|
|
|
|
|
| |
A very conservative extraction of some of the FOOmode logic because it
lends itself to encapsulation and that's something we need more of. I am
doing everything these days with spectacularly high performance paranoia
so you don't even need to ask. (It is if anything faster.) No review.
|
| |
|
| |
|
|
|
|
|
|
| |
Changed the cache in the jvm backend to use a WeakHashMap for names.
Added some details to mutable.WeakHashMap scaladoc.
|
|
|
|
|
|
| |
Remove symbols from the cache once they have been used to retrieve the
corresponding definition tree. no review.
|
| |
|
|
|
|
|
|
| |
Modified the self-type protected accessor test to avoid unnecessary
runtime failures. Closes #4119, review by dragos.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even after the mostly blissful marriage of Traversable and Iterator
there was some fussin' and fightin' over who should have to care for
Option. Now there is peace among the collections once again.
// before
scala> Iterator(Some(1), None).flatten
<console>:6: error: value flatten is not a member of Iterator[Option[Int]]
// after
scala> Iterator(Some(1), None).flatten
res0: Iterator[Int] = non-empty iterator
Review by moors.
|
|
|
|
|
|
|
|
|
|
| |
Investigating what can be done about our 2000 or so closures created
via by-name calls takes me through uncurry with a mop. Sifting through
compiler generated classfiles I am horrified at one example of decadent
closure creation perpetrated by a certain extempore. CompilerCommand
goes from 28 classfiles to 16 and manages to get smaller anyway anyway.
Some people just can't be trusted with closures. No review.
|
|
|
|
|
|
|
|
|
| |
There's still some temporary scaffolding propping up the Names
situation. This removes one strut: no more is there an implicit
conversion from String to TypeName. Implicits which remain to be deal
with: String => TermName, Name => TermName, Name => TypeName. Once
they're gone we're ready for KindNames! Just kidding, no review.
|
|
|
|
|
|
| |
Poking around at and hardening anything which may conceivably interact
with ZipFile.getNextEntry. No review.
|
|
|
|
|
|
| |
The above issue was made explicit using the dx tool for the Android SDK
to convert Java bytecode to Dalvik bytecode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
forward toString, but forwarding equals and hashCode breaks equality
with sequences. Closes #4122, no review.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
repo and includes jline binary. No review.
|
| |
|
|
|
|
|
|
| |
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 and reducing uses of
length. No review.
|
|
|
|
|
|
|
|
| |
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 names: otherwise the
inliner doesn't recognize its attractiveness. No review.
|
|
|
|
|
|
|
|
|
|
| |
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 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 matcher. No review.
|
|
|
|
|
| |
stay for the aesthetics! Review by odersky.
|
|
|
|
|
|
|
| |
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 pin down. Reverts the
last two patches until my bring gets bigger. No review.
|
| |
|
|
|
|
|
|
| |
A couple caches knock a full 20% off the time spent in genjvm. Review by
dragos.
|
|
|
|
|
|
|
| |
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 under the suspicion that
this might solve some of the recent "tree not found" errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|