Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1472)

Unified Diff: src/compiler/change-lowering.cc

Issue 517123004: [turbofan] Use enum instead of bool for parameter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/change-lowering.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index edf9bc511102b3318fea0f86cf1342741fddfe2e..c2805bb0a329b463536b0deef8edadc6fa567d47 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -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);
« no previous file with comments | « src/compiler/change-lowering.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698