again on megamorphic problems
MacGregor, Duncan (GE Energy Management)
duncan.macgregor at ge.com
Fri Dec 21 06:44:03 PST 2012
On 21/12/2012 11:42, "Jochen Theodorou" <blackdrag at gmx.org> wrote:
>Am 21.12.2012 12:28, schrieb MacGregor, Duncan (GE Energy Management):
>>For example, Charles, how do you handle the creation of literals /
>> constants when building specialised methods? Are the literals
>>instantiated
>> by two specialised versions identical or simply equal?
>
>I must confess, I didn't even think about this yet. That could indeed
>cause problems. simply copying the bytecode of the method would maybe
>not be ok then
Well, if you are the one copying the method then the obvious solution
would be to include some unique identifier as part of the arguments to
instantiate literals, and maintain some sort of map of literals that have
been previously instantiated.
If you want the JVM to handle this sort of specialisation then the
semantics of current call site could be maintained by introducing a new
method on CallSite (createSpecialization maybe?) which would simply return
the CallSite itself but could be overridden by subclasses to do something
more appropriate for specialisation of methods (e.g. return a fresh
version of the call site with the initial target). This would still
require some changes to the JVM spec, and I don't know how the current
implementation handles a call site being wired into multiple places (well,
I do know it didn't copy well with it, but this may have changed over the
last year or so).
More information about the mlvm-dev
mailing list