Bug 168833 - Move Arg::Type and Arg::Width out into the B3 namespace, since they are general concepts
Summary: Move Arg::Type and Arg::Width out into the B3 namespace, since they are gener...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 162349
  Show dependency treegraph
 
Reported: 2017-02-24 10:43 PST by Filip Pizlo
Modified: 2017-02-24 14:52 PST (History)
1 user (show)

See Also:


Attachments
the patch (209.73 KB, patch)
2017-02-24 13:54 PST, Filip Pizlo
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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