| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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#length. No review.
|
| |
|
| |
|
|
|
|
|
| |
Added settings for presentation compiler debugging options. no review.
|
|
|
|
|
|
|
|
|
| |
Bencharking a larger program with parallel collections.
Fixed a couple of bugs in parallel collections.
No review.
|
|
|
|
|
|
|
|
|
| |
Finer conversions for immutable parallel collections.
Added some missing traits.
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
| |
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 found, - reloadSources
|
|
|
|
|
| |
small, very focused taste of Ordering contravariance. No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
| |
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 -explaintypes having gone off the
deep end. Review by odersky.
|
|
|
|
|
| |
Reverting the previous patch for output change breakage. No review.
|
|
|
|
|
|
| |
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 not have owner" problem
in names defaults.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Attempt to fix NoSymbol does not have owner problem in Eclipse.
|