Commit 8c26a93f authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

[turbofan] Use enum instead of bool for parameter.

TEST=compiler-unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/517123004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 804ef93d
......@@ -28,9 +28,9 @@ Reduction ChangeLowering::Reduce(Node* node) {
case IrOpcode::kChangeTaggedToFloat64:
return ChangeTaggedToFloat64(node->InputAt(0), control);
case IrOpcode::kChangeTaggedToInt32:
return ChangeTaggedToI32(node->InputAt(0), control, true);
return ChangeTaggedToUI32(node->InputAt(0), control, kSigned);
case IrOpcode::kChangeTaggedToUint32:
return ChangeTaggedToI32(node->InputAt(0), control, false);
return ChangeTaggedToUI32(node->InputAt(0), control, kUnsigned);
case IrOpcode::kChangeUint32ToTagged:
return ChangeUint32ToTagged(node->InputAt(0), control);
default:
......@@ -168,8 +168,8 @@ Reduction ChangeLowering::ChangeInt32ToTagged(Node* val, Node* control) {
}
Reduction ChangeLowering::ChangeTaggedToI32(Node* val, Node* control,
bool is_signed) {
Reduction ChangeLowering::ChangeTaggedToUI32(Node* val, Node* control,
Signedness signedness) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagMask == 1);
......@@ -178,8 +178,8 @@ Reduction ChangeLowering::ChangeTaggedToI32(Node* val, Node* control,
Node* branch = graph()->NewNode(common()->Branch(), tag, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Operator* op = is_signed ? machine()->ChangeFloat64ToInt32()
: machine()->ChangeFloat64ToUint32();
Operator* op = (signedness == kSigned) ? machine()->ChangeFloat64ToInt32()
: machine()->ChangeFloat64ToUint32();
Node* change = graph()->NewNode(op, LoadHeapNumberValue(val, if_true));
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
......
......@@ -27,6 +27,8 @@ class ChangeLowering V8_FINAL : public Reducer {
virtual Reduction Reduce(Node* node) V8_OVERRIDE;
private:
enum Signedness { kSigned, kUnsigned };
Node* HeapNumberValueIndexConstant();
Node* SmiMaxValueConstant();
Node* SmiShiftBitsConstant();
......@@ -40,7 +42,7 @@ class ChangeLowering V8_FINAL : public Reducer {
Reduction ChangeFloat64ToTagged(Node* val, Node* control);
Reduction ChangeInt32ToTagged(Node* val, Node* control);
Reduction ChangeTaggedToFloat64(Node* val, Node* control);
Reduction ChangeTaggedToI32(Node* val, Node* control, bool is_signed);
Reduction ChangeTaggedToUI32(Node* val, Node* control, Signedness signedness);
Reduction ChangeUint32ToTagged(Node* val, Node* control);
Graph* graph() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment