Fork me on GitHub
#clojure-dev
<
2015-07-27
>
michaelblume22:07:25

so I’ve been reading through Compiler.java and trying to get a better feel for how everything works

michaelblume22:07:02

I noticed in InvokeExpr.emitProto that we emit two calls to Util.classOf, rather than arranging to keep the result of the first call on the stack

michaelblume22:07:39

and I’m wondering if it’d make sense to do something like https://github.com/MichaelBlume/clojure/commit/8c3fe instead

bronsa22:07:17

@michaelblume: have you thought about putting it in a local rather than keeping it on the stack? would probably require less stack juggling

michaelblume22:07:10

that makes sense, I’d have to sort out how to create a local, but I think I can model that from the TryExpr code simple_smile

bronsa22:07:55

@michaelblume: look at finallyLocal/retLocal in TryExpr, it's not too hard

michaelblume22:07:46

(whitespace is a bit of a mess, clojure core does not really agree with my IDE)

bronsa22:07:03

@michaelblume: yeah that's what I was thinking of

bronsa22:07:31

@michaelblume: I don't think it will this patch will cause performance regressions (nor do i know if it will have benefits), but if it causes them, I'd say they would be on callsites that see the same type over and over again

michaelblume22:07:31

because then we never get to the second classOf and we’re storing classes in a local for no reason?

bronsa22:07:27

that case now executes two extra instructions