(intended to do everything except that one maybe is_stricter_than comment)


https://codereview.chromium.org/894683003/diff/40001/src/globals.h
File src/globals.h (right):

https://codereview.chromium.org/894683003/diff/40001/src/globals.h#newcode234
src/globals.h:234: #define is_strict(language_mode) ((language_mode) &
STRICT)
On 2015/02/03 12:26:20, rossberg wrote:
Why a macro instead of an inline funciton?

Made this inline; added is_sloppy and is_valid_language_mode.

https://codereview.chromium.org/894683003/diff/40001/src/objects-inl.h
File src/objects-inl.h (right):

https://codereview.chromium.org/894683003/diff/40001/src/objects-inl.h#newcode5818
src/objects-inl.h:5818: DCHECK(!is_strict(this->language_mode()) ||
is_strict(language_mode));
On 2015/02/03 12:26:20, rossberg wrote:
Maybe abstract that into an is_stricter_than predicate.

That seems overkill; this is now easier to read after adding is_sloppy:

is_sloppy(this->language_mode()) || is_strict(language_mode)

(And this occurs in... 2 places, I think)

https://codereview.chromium.org/894683003/diff/40001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/894683003/diff/40001/src/objects.cc#newcode14003
src/objects.cc:14003: DCHECK(language_unchecked == SLOPPY ||
language_unchecked == STRICT);
On 2015/02/03 12:26:20, rossberg wrote:
I suppose we could have a predicate is_valid_language_mode to avoid
repeating
and maintaining these conditions.

Done.

https://codereview.chromium.org/894683003/diff/40001/src/parser.h
File src/parser.h (right):

https://codereview.chromium.org/894683003/diff/40001/src/parser.h#newcode49
src/parser.h:49: DCHECK(backing_[kLanguageModeIndex] == SLOPPY ||
On 2015/02/03 12:26:20, rossberg wrote:
Same here, could use is_valid_l_m

Done.

https://codereview.chromium.org/894683003/diff/40001/src/runtime/runtime-compiler.cc
File src/runtime/runtime-compiler.cc (right):

https://codereview.chromium.org/894683003/diff/40001/src/runtime/runtime-compiler.cc#newcode446
src/runtime/runtime-compiler.cc:446: DCHECK(args.smi_at(4) == STRICT ||
args.smi_at(4) == SLOPPY);
On 2015/02/03 12:26:20, rossberg wrote:
Could use predicate here as well.

Done.

https://codereview.chromium.org/894683003/diff/40001/src/runtime/runtime-utils.h
File src/runtime/runtime-utils.h (right):

https://codereview.chromium.org/894683003/diff/40001/src/runtime/runtime-utils.h#newcode78
src/runtime/runtime-utils.h:78: RUNTIME_ASSERT(args.smi_at(index) ==
STRICT ||       \
On 2015/02/03 12:26:20, rossberg wrote:
same here

Done.

https://codereview.chromium.org/894683003/diff/40001/test/unittests/compiler/js-typed-lowering-unittest.cc
File test/unittests/compiler/js-typed-lowering-unittest.cc (right):

https://codereview.chromium.org/894683003/diff/40001/test/unittests/compiler/js-typed-lowering-unittest.cc#newcode65
test/unittests/compiler/js-typed-lowering-unittest.cc:65: const
LanguageMode kLanguageModes[] = {SLOPPY, STRICT};
On 2015/02/03 12:26:20, rossberg wrote:
Maybe add a static assert here as well, so that we remember to extend
this?

Done.

https://codereview.chromium.org/894683003/

--
--
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.

Reply via email to