Added some more comments. Perhaps we could split up the CL into a part that
handles the HConstants, and the extra type inference?
https://codereview.chromium.org/19271008/diff/23001/src/hydrogen.cc
File src/hydrogen.cc (right):
https://codereview.chromium.org/19271008/diff/23001/src/hydrogen.cc#newcode7894
src/hydrogen.cc:7894: HValue* HGraphBuilder::ConstantToNumber(HValue*
value) {
Perhaps you can also handle strings here.
https://codereview.chromium.org/19271008/diff/23001/src/hydrogen.cc#newcode7895
src/hydrogen.cc:7895: if (value->IsConstant()) {
Move this code together with HConstant::CopyToTruncatedInt32 as
"CopyToDouble", and perhaps extend CopyToTruncatedInt32 to also directly
handle the special values handled below.
https://codereview.chromium.org/19271008/diff/23001/src/hydrogen.cc#newcode7901
src/hydrogen.cc:7901: constant->handle()->IsTheHole()) {
Remove TheHole case.
https://codereview.chromium.org/19271008/diff/23001/src/hydrogen.cc#newcode7941
src/hydrogen.cc:7941: left->KnownOptimalRepresentation() :
Representation::FromType(left_type);
Could we calculate this in "type" and only at the end convert to
Representation? Now it's pretty schizophrenic mixing HType, Type and
Representation.
https://codereview.chromium.org/19271008/diff/23001/src/hydrogen.cc#newcode7954
src/hydrogen.cc:7954:
AddInstruction(HCheckInstanceType::NewIsString(right, zone()));
I'd use canonicalization to eliminate CheckInstanceType(string) of
values that are known to be type().IsString(); rather than conditionally
emit the instructions.
https://codereview.chromium.org/19271008/
--
--
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/groups/opt_out.