Benchmarking Smalltalk on JVM
Rémi Forax
forax at univ-mlv.fr
Wed Feb 1 14:19:53 PST 2012
On 02/01/2012 10:44 PM, Mark Roos wrote:
> This may be a little much to ask but... These bytecodes take about
> 20ns per cycle to run on
> my 2.8 GHz mac using jdk8-B23 without TieredCompile. Does this seem
> reasonable given the number of indy calls?
> The GWT depth on the method sends is 1
>
> thanks
> mark
>
> LABEL <56> LABEL 1
> <56> aload 4
> <58> aload 3
> <59> astore 1
> <60> aload 1
> INDY (asm) <61> ["at:"] RtCallSite, (6) {RtTestCases class
> benchmarkLoop, 19}
> <66> astore 1
> <67> aload 1
> <68> astore 5
> INDY (asm) <70> ["41"] ConstantCallSite, (6) {dummy}
> <75> aload 4
> <77> astore 1
> <78> aload 1
> INDY (asm) <79> ["increment:"] RtCallSite, (6) {RtTestCases class
> benchmarkLoop, 23}
> <84> astore 1
> LABEL <85> LABEL 0
> <85> aload 4
> <87> astore 1
> INDY (asm) <88> ["41000000"] ConstantCallSite, (6) {dummy}
> <93> aload 1
> INDY (asm) <94> ["<="] RtCallSite, (6) {RtTestCases class
> benchmarkLoop, 24}
> <99> astore 1
> <100> aload 1
> <101> getstatic ri/core/rtalk/RtObject _true Lri/core/rtalk/RtObject;
> JUMP <104> if_acmpeq LABEL 1
Without the descriptors of invokedynamic and the code of the BSM, it's
hard to tell.
Anyway, you can optimize the last instructions, <= should return a boolean
so the sequence should be:
ldc 41000000
aload 1
indy <= (ILObject;)Z
if_eq LABEL 1
for that you have to propagate types, from root to leafs to type the
return type
of invokedynamic with the expected type (the condition of an if is a
boolean)
an from leafs to root (the first argument of <= is an int).
cheers,
Rémi
More information about the mlvm-dev
mailing list