Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-15 Thread Paul Sandoz
> On 14 Nov 2017, at 20:48, stanislav lukyanov > wrote: > > On 15.11.2017 6:19, Paul Sandoz wrote: >>> On 10 Nov 2017, at 01:36, stanislav lukyanov >>> wrote: >>> >>> On 10.11.2017 0:13, Paul Sandoz wrote: <...> I would prefer to follow up later on with more non-normative explanat

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-14 Thread stanislav lukyanov
On 15.11.2017 6:19, Paul Sandoz wrote: On 10 Nov 2017, at 01:36, stanislav lukyanov wrote: On 10.11.2017 0:13, Paul Sandoz wrote: <...> I would prefer to follow up later on with more non-normative explanatory text. It will take some careful crafting and i don’t want that to side-track the r

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-14 Thread Paul Sandoz
> On 10 Nov 2017, at 01:36, stanislav lukyanov > wrote: > > On 10.11.2017 0:13, Paul Sandoz wrote: >> <...> >> I would prefer to follow up later on with more non-normative explanatory >> text. It will take some careful crafting and i don’t want that to side-track >> the review for the moment

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-10 Thread Volker Simonis
On Thu, Nov 9, 2017 at 8:06 PM, Paul Sandoz wrote: > Hi Volker, > >> On 9 Nov 2017, at 01:01, Volker Simonis wrote: >> >> Hi Paul, >> >> just some quick process-related questions. >> >> Is this intended to be targeted for jdk 10? >> > > Yes, that’s what we are aiming for. I am front loading revie

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-10 Thread stanislav lukyanov
On 10.11.2017 0:13, Paul Sandoz wrote: <...> I would prefer to follow up later on with more non-normative explanatory text. It will take some careful crafting and i don’t want that to side-track the review for the moment (including guidance on what forms of computed constants are acceptable).

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-09 Thread Paul Sandoz
Hi Volker, > On 9 Nov 2017, at 01:01, Volker Simonis wrote: > > Hi Paul, > > just some quick process-related questions. > > Is this intended to be targeted for jdk 10? > Yes, that’s what we are aiming for. I am front loading reviews ahead of a propose to target (which should hopefully happe

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-09 Thread Paul Sandoz
Hi, > On 9 Nov 2017, at 00:24, stanislav lukyanov > wrote: > > Hi Paul, > > How about changing the name of the class to ConstantFactory to align > with its two siblings - LambdaMetafactory and StringConcatFactory? > I would prefer to keep it as is. It is intended to cover many forms of BSMs

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-09 Thread Volker Simonis
Hi Paul, just some quick process-related questions. Is this intended to be targeted for jdk 10? Is the current implementation already available in a separate repository and/or branch? I've read in the RFR for 8186046 that some parts are currently being refined in the amber repository. Or is the

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-09 Thread stanislav lukyanov
I also noticed that Class::isPrimitive now says the following:     "These objects may only be accessed via the following public static final variables, and are the only Class objects for which this method returns true." (the fields its talking about are the .TYPE) Should this text be tweaked?

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-09 Thread stanislav lukyanov
Hi Paul, How about changing the name of the class to ConstantFactory to align with its two siblings - LambdaMetafactory and StringConcatFactory? Other comments are purely about the spec text (should I be posting them in the CSR issue instead?) The class-level javadoc could use more text to de

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-08 Thread John Rose
On Nov 7, 2017, at 12:59 PM, John Rose wrote: > > For condy, having the BSM validate types is a code smell > for the reason you mention. Also, when primitives (and value > types) are in the mix, people usually code the validation > incorrectly, since Class.isInstance is the wrong tool, and > the

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-08 Thread Paul Sandoz
> On 8 Nov 2017, at 08:59, John Rose wrote: > > On Nov 7, 2017, at 1:35 PM, fo...@univ-mlv.fr > wrote: >> >> perhaps getFinalStatic, because it's restricted to final field. > > The restriction to final field is because we are expecting the > method to be used from c

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-08 Thread John Rose
On Nov 7, 2017, at 1:35 PM, fo...@univ-mlv.fr wrote: > > perhaps getFinalStatic, because it's restricted to final field. The restriction to final field is because we are expecting the method to be used from condy, where it seems to be a syntax error to sample a constant from a non-constant variab

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread Paul Sandoz
> On 7 Nov 2017, at 14:18, fo...@univ-mlv.fr wrote: >> >> Try passing Class.class to it. To be honest this is somewhat motivated by >> testing when called explicitly. > > see my answer to John. > Fair point, i’ll go with Class. It’s the less smelly option. Updated along with other changes:

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread forax
> De: "John Rose" > À: "Rémi Forax" > Cc: "Paul Sandoz" , "hotspot-dev" > , "core-libs-dev" > > Envoyé: Mardi 7 Novembre 2017 23:20:01 > Objet: Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants >

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread John Rose
On Nov 7, 2017, at 2:18 PM, fo...@univ-mlv.fr wrote: > >>> >>> Also, why it's not called in invoke ? >>> >> >> What “it” are you referring to? > > validateClassAccess. Because having a MH means you have already been granted access to invoke it. Having a Class does *not* mean you have been gr

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread forax
- Mail original - > De: "Paul Sandoz" > À: "Remi Forax" > Cc: "core-libs-dev" , "hotspot-dev" > > Envoyé: Mardi 7 Novembre 2017 21:54:06 > Objet: Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants > Hi

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread Paul Sandoz
> On 7 Nov 2017, at 13:54, Paul Sandoz wrote: >> >>> If it's not used by an indy, why do we need to test that ? Also, why it's >>> not called in invoke ? >> >> …Enum.valueOf doesn't do a security check; that is its choice. >> This means that if you pass it an enum type that is not public >> or

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread Paul Sandoz
> On 7 Nov 2017, at 12:59, John Rose wrote: > > Good comments! I can handle a couple of them… > > On Nov 7, 2017, at 11:33 AM, Remi Forax wrote: >> >> I fail to see the point of using validateClassAccess(), if the BSM is used >> through an indy, the type is created only if the caller class

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread forax
- Mail original - > De: "John Rose" > À: "Rémi Forax" > Cc: "Paul Sandoz" , "hotspot-dev" > , "core-libs-dev" > > Envoyé: Mardi 7 Novembre 2017 21:59:41 > Objet: Re: RFR 8187742 Minimal set of bootstrap methods

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread John Rose
Good comments! I can handle a couple of them… On Nov 7, 2017, at 11:33 AM, Remi Forax wrote: > > I fail to see the point of using validateClassAccess(), if the BSM is used > through an indy, the type is created only if the caller class can create it, > so the test seems redundant. That's tru

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread Paul Sandoz
Hi Remi, You are asking a lot of the same questions we went through a number of times before landing where we are :-) > On 7 Nov 2017, at 11:33, Remi Forax wrote: > > Hi Paul, > > You have an import static requireNonNull but it is only used once in > nullConstant, all other methods use Obje

Re: RFR 8187742 Minimal set of bootstrap methods for dynamic constants

2017-11-07 Thread Remi Forax
Hi Paul, You have an import static requireNonNull but it is only used once in nullConstant, all other methods use Objects.requireNonNull. The test that checks that lookup, name and type are null or not is different in each method, so by example in primitiveClass, if type equals null, you get an