Archive for December, 2004

Lots more gcjx hacking

I’ve been doing a lot more gcjx hacking over break. It is now
down to around 180 Jacks failures (still some definite assignment
stuff to clean up). I’ve been compiling Classpath using it quite
regularly, and finally checked in a Classpath build patch to make it
simple to try this out.

My kind-of-wacky plan of using fields that define
operator() to make them act like methods was successful
recently. When I refactored warning handling to add support for
SuppressWarnings, I turned all those fields into real methods and
pushed them into a superclass (which is then reused elsewhere). This
required no changes to any users, which of course was the goal. It’s
all about the textual form.

Sometimes I think refactoring is over-hyped. One problem with it
is that you have to hope that either the IDE writer thought to include
the refactoring you need, or that you can hack the IDE to provide it
(assuming it is difficult enough to do that it warrants this). A more
flexible approach would combine something like pattern matching on the
AST with Emacs keyboard macros. That way you could use semantic
information to find the areas to change (useful), but then use plain
old text hacking to do the actual modification.

I plan to spend the rest of vacation lazing about and occasionally
hacking on medi8. I’d like to be able to actually edit something
before work starts again.

gcjx bug fixing

I went through gcc bugzilla and counted PRs that are fixed by
gcjx. I came up with 72, though a few of those are maybes. Chances
are, if you have found a front end bug in gcj, it is already fixed in

This weekend I also changed gcjx to optionally run the bytecode
verifier on the bytecode it creates, before writing it out. This
caught a couple of code generation bugs (and a funny buglet in the
verifier — it failed to special-case Object.<init>).

gcjx update

Annotations basically work, reading 1.5 class files (i.e.,
Signature parsing) works, annotations are generated in
the bytecode output, and SuppressWarnings mostly works.
That’s a lot for the last couple of weeks.

Elliott Hughes has been doing some profiling to find out why gcjx
is slow. It looks like there are some relatively simple ways to speed
it up. As guessed, the parser is a trouble spot.

All that seems to remain for 1.5 are generic methods. I had
written a lot of the unification code, but then deleted it by mistake.
:-(. It turns out not to be so hard to write though.

It is kind of demoralizing to work on an insane gcj
, all the while knowing that gcjx is a hundred times simpler to
hack on, and this bug doesn’t exist there anyway. I wonder how many
PRs gcjx will fix when it goes in… fifty? One hundred?

Ocean’s 12

First, what’s up with the remake fever Hollywood seems to have
caught? They’ve remade everything except Zardoz and My Dinner With

Ocean’s 12 was ok, though in place of old-style slick and cool
they decided to substitute dialog that ends mid-sentence. That’s not
great… and then the zooming around in time didn’t work so well and
the plot wasn’t nearly as engaging as in 11. All in all, a
disappointment. Prediction: no number 13.


I must be the last person around to see this movie, because
whenever I tell people about it they just nod and agree that it was
really great. Plot-wise it is pretty basic, about a blind samurai who
is reminiscent of characters Eastwood played in spaghetti westerns.
It is a little gory, but the blood seemed to be computer generated and
was slightly off, color-wise, so I didn’t have to close my eyes or
anything. There are some nice twists, the film itself is beautiful,
and there are a couple of short “poetic” moments that reminded me of
the final scene (which I love) in The Seven Samurai.

San Francisco

I just got back from a short vacation in San Francisco, visiting
an old friend of Elyn’s. We did a lot of walking. I seem to mostly
go on vacations that drain me more than they refresh; San Francisco is
so visually stimulating and interesting architecturally that I spent
most of my time silently gawking. This gets hard after a couple of
days. One notable building: some bank building downtown which is
basically a roman corinthian temple. Wonderful.

SF also has a weird effect on my brain. I find myself thinking
crazy thoughts like, “now I must start a corporation and make ten
million dollars”, or “I must buy and renovate a turn of the century
mansion”. If I moved there I would probably never sleep again.


I was looking through the gcjx to-do list this weekend and I
realized that it is far enough along to enumerate the remaining
projects that are bigger than a simple bug fix:

  • Parsing Signature attributes when reading class files
  • Semantic analysis for generic methods
  • Some bytecode generation work for attributes and generics (for
    generics the particular problem is bridge methods — pretty
  • Some semantic analysis code for attributes; e.g. reworking the
    warning code to handle SuppressWarnings
  • Finish the tree back end (I’d say it is 80% finished)

I think that is it. It really isn’t very much. It is pretty
strange to be this close to the finish.

Fedora Core 4

One of the things we talked about at the summit was what to about
Java programs in Fedora Core. People seemed pretty gung ho about work
in this area. Two concrete things to come out of this: we’d like to
get gcj-eclipse into FC4 (an unofficial “we”, hopefully RH will come
along), and, if we can get everything done in time, also gcjwebplugin.
The latter really seems like a stretch goal to me, there isn’t much
time and there is a lot of work to do.


I’m ready to make the gcjx branch on, but I’m
strangely reluctant. I think my hangup is that I still haven’t worked
out all the details of how to build the thing. I’d like to put the
bulk of the compiler in a new top-level directory, but I don’t see how
to make the bootstrapping work in this case. In particular, it seems
to me that if we build a native compiler, we’d like to use the
just-build libstdc++ for gcjx. But, that is hard because that is a
target library and is built long after the parts of gcjx that interact
with gcc.