WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
168833
Move Arg::Type and Arg::Width out into the B3 namespace, since they are general concepts
https://bugs.webkit.org/show_bug.cgi?id=168833
Summary
Move Arg::Type and Arg::Width out into the B3 namespace, since they are gener...
Filip Pizlo
Reported
2017-02-24 10:43:28 PST
Patch forthcoming.
Attachments
the patch
(209.73 KB, patch)
2017-02-24 13:54 PST
,
Filip Pizlo
saam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2017-02-24 13:54:04 PST
Created
attachment 302685
[details]
the patch
Saam Barati
Comment 2
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?
Filip Pizlo
Comment 3
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?
Saam Barati
Comment 4
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?
Filip Pizlo
Comment 5
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. :-)
Filip Pizlo
Comment 6
2017-02-24 14:52:17 PST
Landed in
https://trac.webkit.org/changeset/212970
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug