[9] RFR (M): 8050057: Improve caching of MethodHandle reinvokers (original) (raw)
Paul Sandoz paul.sandoz at oracle.com
Wed Jul 16 09:33:23 UTC 2014
- Previous message: [9] RFR (M): 8050057: Improve caching of MethodHandle reinvokers
- Next message: [9] RFR (M): 8050057: Improve caching of MethodHandle reinvokers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jul 14, 2014, at 5:17 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
http://cr.openjdk.java.net/~vlivanov/8050057/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8050057
Cache MethodHandle reinvokers per basic type. For BoundMethodHandles, rebinding is no-op unless underlying LF is too complex (see BMH::tooComplex() for details). Also, introduced DelegatingMethodHandle whose invocation behavior is determined by a target MethodHandle. The delegating MH itself can hold extra "intentions" beyond the simple behavior. AsVarargsCollector and WrappedMember are made subclasses of DelegatingMethodHandle. Also, SimpleMethodHandle extends BoundMethodHandle now. Rebinding and delegation share same logic and LF shape, but have different caches (LFREBIND vs LFDELEGATE). The only difference is their name. They could be consolidated in the future. Testing: jdk/java/lang/invoke, jdk/java/util/streams, nashorn, octane w/ "-ea -esa" and COMPILETHRESHOLD={0,30}. Reviewed-by: vlivanov, ? Contributed-by: john.r.rose at oracle.com
Looks good. Juste one comment.
BoundMethodHandle
The following fields can be made final: 132 private static int FIELD_COUNT_THRESHOLD = 12; // largest convenient BMH field count 133 private static int FORM_EXPRESSION_THRESHOLD = 24; // largest convenient BMH expression count
Paul.
- Previous message: [9] RFR (M): 8050057: Improve caching of MethodHandle reinvokers
- Next message: [9] RFR (M): 8050057: Improve caching of MethodHandle reinvokers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]