https://codereview.chromium.org/1155043005/diff/20001/src/api.cc
File src/api.cc (right):
https://codereview.chromium.org/1155043005/diff/20001/src/api.cc#newcode7256
src/api.cc:7256: COMPILE_ASSERT(i::FIRST_SPACE == 0,
first_space_assumed_to_be_zero);
Sorry for chiming in so late, but IMHO this is still far too
complicated, just express what you really want to say explicitly:
bool IsValidAllocationSpace(AllocationSpace space) {
switch (space) {
case NEW_SPACE:
case OLD_SPACE:
case CODE_SPACE:
case MAP_SPACE:
case LO_SPACE:
return true;
default:
return false;
}
}
(Name/namespace/etc. is open for bikeshedding :-) This is crystal clear,
compiles to 2 instructions in a value context and even 1 instruction in
a test context.
More generally: Looking at the usages, AllocationSpace should really be
a class, not an enum...
https://codereview.chromium.org/1155043005/
--
--
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.