Default methods for jdk8: request for code review
Keith McGuigan
keith.mcguigan at oracle.com
Tue Oct 30 07:55:10 PDT 2012
On Oct 29, 2012, at 1:15 AM, David Holmes wrote:
> Hi Keith,
>
> The more I look at this the more questions that come to mind. :)
>
> Can you expand on the rationale for using overpass methods instead of augmenting the existing method lookup procedures. I'm concerned about its impact on startup time - and given that we have not yet added all the default methods that will be added, nor do we know for certain which interfaces will get what methods, I don't think we can measure this yet.
It is certainly something we can look into in the future. We will at some point need some sort of signature adapter with checkcasts in order to get from a callsite to a default method. So something needs to be created. Doing it lazily instead of ahead-of-time is something to look into, but a likely result of that is that we end up performing the generic analysis multiple times at different call sites and end up on losing some of the sharing -- doing it all at once may be more efficient since the parsing of generic signatures and some of the hierarchy analysis is effectively "reused".
> In LinkResolver::resolve_method we would previously bail out if the resolved_klass is in fact an interface. But now we will pass that interface to both lookup_method_in_klasses and lookup_method_in_interfaces. That sounds wrong - should the names of these methods be updated?
Yeah maybe we should. I'll look into that.
> In instanceKlass.cpp in the new interface initialization section why do you refer to the "superclass initialization error"? Are we simply pretending that any failure here was actually a superclass failure? And if so, is that temporary?
I copied that code from the superclass initialization part, so it does the same thing as there. I think the idea is that if we encounter an error during initialization, we save that exception and perform the notify. Any exception that occurs during the notify is ignored and the initialization error is rethrown.
--
- Keith
More information about the hotspot-dev
mailing list