On 2015/12/02 01:13:13, adamk wrote:
I've noted what I mean by de-generalizing.
I'm all for reusable code, but I tend to lean towards doing that once
there
are
multiple cases. This ensures that the general code actually serves
multiple
use-cases well. As-is, this code looks general but in fact only handles a
single
case.
Maybe I'm missing something: is there another thing this would be used
for in,
say, the next week or two?
https://codereview.chromium.org/1309813007/diff/690001/src/ast/ast.h
File src/ast/ast.h (right):
https://codereview.chromium.org/1309813007/diff/690001/src/ast/ast.h#newcode416
src/ast/ast.h:416: int hints() const { return
RewriteHintsField::decode(bit_field_); }
This returns an int, but will only ever be kDestructuringAssignment
https://codereview.chromium.org/1309813007/diff/690001/src/ast/ast.h#newcode418
src/ast/ast.h:418: bool IsRewritableAs(RewriteHint hint) const {
There is only a single argument that could be passed here
https://codereview.chromium.org/1309813007/diff/690001/src/ast/ast.h#newcode423
src/ast/ast.h:423: bool IsRewrittenAs(RewriteHint reason) const {
Ditto
https://codereview.chromium.org/1309813007/diff/690001/src/ast/ast.h#newcode427
src/ast/ast.h:427: void RewriteAs(Expression* new_expression, RewriteHint
reason) {
And again, the second argument here is can only ever be one thing
https://codereview.chromium.org/1309813007/diff/690001/src/ast/ast.h#newcode447
src/ast/ast.h:447: class RewriteHintsField : public BitField<uint16_t, 0,
4>
{};
This bit field wouldn't be necessary, you could have one bool thats
'is_rewritten_'
alright, done
https://codereview.chromium.org/1309813007/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.