https://codereview.chromium.org/23717039/diff/8001/src/hydrogen-instructions.h
File src/hydrogen-instructions.h (left):
https://codereview.chromium.org/23717039/diff/8001/src/hydrogen-instructions.h#oldcode3550
src/hydrogen-instructions.h:3550:
How about writing codes in this way?
- if (left()->IsConstant()) return true;
- if (right()->IsConstant()) return false;
+ if (left()->IsConstant() && left()->EmitAtUses()) return true;
+ if (right()->IsConstant() && right()->EmitAtUses()) return false;
+
+ // If destination is one operand of the phi node, they might be
allocated
+ // to the same register by hinting.
+ if (left()->IsPhi()) {
+ HPhi* phi = HPhi::cast(left());
+ for (int i = 0; i < phi->OperandCount(); i++) {
+ if (phi->OperandAt(i) == this) return false;
+ }
+ } else if (right()->IsPhi()) {
+ HPhi* phi = HPhi::cast(right());
+ for (int i = 0; i < phi->OperandCount(); i++) {
+ if (phi->OperandAt(i) == this) return true;
+ }
+ }
https://codereview.chromium.org/23717039/
--
--
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.