[abc-users] problems with ants benchmark

From: Sam Davis <sddavis@cs.ubc.ca>
Date: Sat Jun 23 2007 - 01:46:44 BST

[apologies if this message is received more than once]

Hello,

I've recently been trying to reproduce the benchmark results from the
PLDI'05 paper, Optimising AspectJ, to see how much they vary across
different platforms and VMs, and I may have stumbled upon a bug in abc's
interprocedural cflow optimization (O3). I found that the ants
benchmark (from the "AspectJ benchmarks") consistently performs no
better when compiled with abcO3 than when compiled with abc, whereas the
paper reported a 40% speedup when using O3. According to the paper, all
of the 84 query shadows in ants will be determined to never match and
will be removed when using O3. However, looking at the bytecode produced
by abcO3, it turns out that 3 of the query shadows are not removed
(which means that the (expensive) update shadow can't be removed either,
which I think accounts for the lack of any speedup). Two of these
shadows occur in advice (the creation of StringBuffers in
command.Comment and model.Resting), and the other is in a static method
(the creation of a RuntimeException in Ant.SenseDir.toString(int)). It
appears to me as though all of these shadows are unreachable.

I've also noticed that using O3 can change the behaviour of the program
being compiled. A modified version of ants behaves
differently when compiled with and without O3, as follows:
ajbenches> run abc ants
Running ants (abc): benchmark.Main
ajbenches> run abcO3 ants
Running ants (abcO3): benchmark.Main
allocation during play: NoNewInCmd.java:14:12 call(java.lang.Object())
allocations per game 1

The only changes from the original version of ants are that
profile.NoNewInRound from the src.extras directory is included in the
compilation, and a field is added to profile.NoNewInCmd:

aspect NoNewInCmd {
        Object o = new Object();//************************
        
            before(Command c) : cflow(call(* Command.step(..)) && target(c))
                                  && call(*.new(..))
                                  && !within(NoNewInCmd){
                System.err.println("allocation during command: "+ c +" at " +
thisJoinPointStaticPart.getSourceLocation() + " "+thisJoinPointStaticPart);
        }
}

It seems that the call to the Object constructor above is in
cflow(call(* World.play(..))) only if O3 is used.

One final note: abc sometimes has a segmentation fault running on Java
HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing). This
seems to occur only when O3 is used. It happened the first time I tried
to compile the attached version of ants, and happened several other
times on other versions of ants.

If anyone can shed any light on any of these issues, especially the
first, it would be much appreciated.

Thanks,
Sam
Received on Sat Jun 23 00:40:09 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 25 2007 - 15:00:10 BST