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

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

Issue 512753002: Disable some changes tests on ARM64. Also, fix the changes lowering to not use the more expensive T… (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') | test/cctest/compiler/test-changes-lowering.cc » ('j') | 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 2348dd55177c2b6abf2b695f5162477b19d7f8b8..1024f02b1d7e64f2f9b4fb9707c997958b46360f 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -27,12 +27,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);
case IrOpcode::kChangeTaggedToUint32:
- // ToInt32 and ToUint32 perform exactly the same operation, just the
- // interpretation of the resulting 32 bit value is different, so we can
- // use the same subgraph for both operations.
- // See ECMA-262 9.5: ToInt32 and ECMA-262 9.6: ToUint32.
- return ChangeTaggedToInt32(node->InputAt(0), control);
+ return ChangeTaggedToI32(node->InputAt(0), control, false);
case IrOpcode::kChangeUint32ToTagged:
return ChangeUint32ToTagged(node->InputAt(0), control);
default:
@@ -170,7 +167,8 @@ Reduction ChangeLowering::ChangeInt32ToTagged(Node* val, Node* control) {
}
-Reduction ChangeLowering::ChangeTaggedToInt32(Node* val, Node* control) {
+Reduction ChangeLowering::ChangeTaggedToI32(Node* val, Node* control,
+ bool is_signed) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagMask == 1);
@@ -179,8 +177,9 @@ Reduction ChangeLowering::ChangeTaggedToInt32(Node* val, Node* control) {
Node* branch = graph()->NewNode(common()->Branch(), tag, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
- Node* change = graph()->NewNode(machine()->TruncateFloat64ToInt32(),
- LoadHeapNumberValue(val, if_true));
+ Operator* op = is_signed ? machine()->ChangeFloat64ToInt32()
+ : machine()->ChangeFloat64ToUint32();
+ Node* change = graph()->NewNode(op, LoadHeapNumberValue(val, if_true));
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* number = ChangeSmiToInt32(val);
« no previous file with comments | « src/compiler/change-lowering.h ('k') | test/cctest/compiler/test-changes-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698