PTAL

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen-instructions.cc
File src/hydrogen-instructions.cc (right):

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen-instructions.cc#newcode2331
src/hydrogen-instructions.cc:2331: HConstant*
HConstant::CopyToTruncatedNumber(Zone* zone) {
On 2013/07/22 08:31:44, Toon Verwaest wrote:
Shouldn't we also return "this" for values that are already numbers?

there is no point to copying the constant if we are already a number
(since unlike the int32 case we do not change representation).

returning 'this' is afaik not a good idea, since then the client does
not know, if the instruction was already added or not...

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen-instructions.h
File src/hydrogen-instructions.h (right):

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen-instructions.h#newcode410
src/hydrogen-instructions.h:410: bool IsNoString() const {
On 2013/07/22 08:30:21, Toon Verwaest wrote:
Can we name this IsNonString, in line with IsNonPrimitive?

Done.

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen-instructions.h#newcode3361
src/hydrogen-instructions.h:3361: HConstant* CopyToTruncatedInt32(Zone*
zone);
On 2013/07/22 08:30:21, Toon Verwaest wrote:
I guess you tried hard to keep this const? I'd prefer to keep
it; but if it's
too hard... meh :)

the problem is deferred handle dereference in TruncateToNumber

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen-instructions.h#newcode3362
src/hydrogen-instructions.h:3362: HConstant* CopyToTruncatedNumber(Zone*
zone);
On 2013/07/22 08:30:21, Toon Verwaest wrote:
I think the original name is fine. CopyToTruncatedInt32 doesn't handle
all cases
either, and will return NULL if not possible. We could rename both to
TryCopyToTruncated* though.

On 2013/07/22 07:43:47, Jakob wrote:
> This sounds more generic than it is. How about
"CopyOddballToNumber"?


How about returning Maybe<>, now it is clear, that the conversion is
partial

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen.cc
File src/hydrogen.cc (right):

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen.cc#newcode7857
src/hydrogen.cc:7857: Push(Add<HConstant>(OS::nan_value(),
Representation::Double()));
On 2013/07/22 07:43:47, Jakob wrote:
Stack height mismatches at basic block joins are a pattern that we
need to
eliminate/avoid. Suggestion:

HValue copied_constant = Add<HConstant>(...);
IfBuilder if_nan(this);
if_nan.If<...>(...);
if_nan.Then();
if_nan.ElseDeopt();
if_nan.End();
return copied_constant;

Done.

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen.h
File src/hydrogen.h (right):

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen.h#newcode1121
src/hydrogen.h:1121: void BuildHydrogenBinaryOperation(BinaryOperation*
expr);
On 2013/07/22 07:43:47, Jakob wrote:
I don't see this defined or used anywhere.

Done.

https://codereview.chromium.org/19798002/diff/16001/src/hydrogen.h#newcode1123
src/hydrogen.h:1123: HValue* ConstantToNumber(HValue* value);
On 2013/07/22 07:43:47, Jakob wrote:
I don't see this anywhere either.

Done.

https://codereview.chromium.org/19798002/

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


Reply via email to