Bug 168833

Summary: Move Arg::Type and Arg::Width out into the B3 namespace, since they are general concepts
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 162349    
Attachments:
Description Flags
the patch saam: review+

Description Filip Pizlo 2017-02-24 10:43:28 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2017-02-24 13:54:04 PST
Created attachment 302685 [details]
the patch
Comment 2 Saam Barati 2017-02-24 14:06:39 PST
Comment on attachment 302685 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=302685&action=review

r=me

> Source/JavaScriptCore/ChangeLog:22
> +        I kept both as non-enum classes because I think that we've learned that terse compiler
> +        code is a good thing. I don't want to say Bank::GP when I can say GP. With Width, the
> +        argument is even stronger, since you cannot say Width::8 but you can say Width8.

I don't always agree with this. But in this situation, after reading this patch, I agree it's easier to read. I'm not in love with calling it "bank", but I'm not sure what else to call it, and this is consistent with uses of "bank" elsewhere.
The reason I don't like it, for example, is the function name "acceptsBank" means nothing to me unless I've read the code.

I wonder if we can still by the increased type safety of the enum class without having to prefix with the enum name. Is there a way to use "using" or somthing similar on an enum class?
Comment 3 Filip Pizlo 2017-02-24 14:08:17 PST
(In reply to comment #2)
> Comment on attachment 302685 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=302685&action=review
> 
> r=me
> 
> > Source/JavaScriptCore/ChangeLog:22
> > +        I kept both as non-enum classes because I think that we've learned that terse compiler
> > +        code is a good thing. I don't want to say Bank::GP when I can say GP. With Width, the
> > +        argument is even stronger, since you cannot say Width::8 but you can say Width8.
> 
> I don't always agree with this. But in this situation, after reading this
> patch, I agree it's easier to read. I'm not in love with calling it "bank",
> but I'm not sure what else to call it, and this is consistent with uses of
> "bank" elsewhere.
> The reason I don't like it, for example, is the function name "acceptsBank"
> means nothing to me unless I've read the code.

Is the problem here the name of Bank or the fact that it's not an enum class?

> 
> I wonder if we can still by the increased type safety of the enum class
> without having to prefix with the enum name. Is there a way to use "using"
> or somthing similar on an enum class?
Comment 4 Saam Barati 2017-02-24 14:13:48 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Comment on attachment 302685 [details]
> > the patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=302685&action=review
> > 
> > r=me
> > 
> > > Source/JavaScriptCore/ChangeLog:22
> > > +        I kept both as non-enum classes because I think that we've learned that terse compiler
> > > +        code is a good thing. I don't want to say Bank::GP when I can say GP. With Width, the
> > > +        argument is even stronger, since you cannot say Width::8 but you can say Width8.
> > 
> > I don't always agree with this. But in this situation, after reading this
> > patch, I agree it's easier to read. I'm not in love with calling it "bank",
> > but I'm not sure what else to call it, and this is consistent with uses of
> > "bank" elsewhere.
> > The reason I don't like it, for example, is the function name "acceptsBank"
> > means nothing to me unless I've read the code.
> 
> Is the problem here the name of Bank or the fact that it's not an enum class?
The name of bank. Again, I don't have a better suggestion ATM.

> > 
> > I wonder if we can still by the increased type safety of the enum class
> > without having to prefix with the enum name. Is there a way to use "using"
> > or somthing similar on an enum class?
Comment 5 Filip Pizlo 2017-02-24 14:17:53 PST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Comment on attachment 302685 [details]
> > > the patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=302685&action=review
> > > 
> > > r=me
> > > 
> > > > Source/JavaScriptCore/ChangeLog:22
> > > > +        I kept both as non-enum classes because I think that we've learned that terse compiler
> > > > +        code is a good thing. I don't want to say Bank::GP when I can say GP. With Width, the
> > > > +        argument is even stronger, since you cannot say Width::8 but you can say Width8.
> > > 
> > > I don't always agree with this. But in this situation, after reading this
> > > patch, I agree it's easier to read. I'm not in love with calling it "bank",
> > > but I'm not sure what else to call it, and this is consistent with uses of
> > > "bank" elsewhere.
> > > The reason I don't like it, for example, is the function name "acceptsBank"
> > > means nothing to me unless I've read the code.
> > 
> > Is the problem here the name of Bank or the fact that it's not an enum class?
> The name of bank. Again, I don't have a better suggestion ATM.

OK, we're on the same page. :-)
Comment 6 Filip Pizlo 2017-02-24 14:52:17 PST
Landed in https://trac.webkit.org/changeset/212970