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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 1455123002: [turbofan] Check word32 -> float64 conversion with input type/output truncation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Get rid of the guards Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/js/math.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 SetOutput(node, output_type); 393 SetOutput(node, output_type);
394 394
395 int values = node->op()->ValueInputCount(); 395 int values = node->op()->ValueInputCount();
396 396
397 if (lower()) { 397 if (lower()) {
398 // Update the phi operator. 398 // Update the phi operator.
399 MachineType type = static_cast<MachineType>(output_type); 399 MachineType type = static_cast<MachineType>(output_type);
400 if (type != OpParameter<MachineType>(node)) { 400 if (type != OpParameter<MachineType>(node)) {
401 NodeProperties::ChangeOp(node, lowering->common()->Phi(type, values)); 401 NodeProperties::ChangeOp(node, lowering->common()->Phi(type, values));
402 } 402 }
403 }
403 404
404 // Convert inputs to the output representation of this phi. 405 // Convert inputs to the output representation of this phi, pass the
405 for (int i = 0; i < node->InputCount(); i++) { 406 // use truncation along.
406 ProcessInput(node, i, i < values ? output_type : 0); 407 MachineType use_type = static_cast<MachineType>((use & kTypeMask) | output);
407 } 408 for (int i = 0; i < node->InputCount(); i++) {
408 } else { 409 ProcessInput(node, i, i < values ? use_type : 0);
409 // Propagate {use} of the phi to value inputs, and 0 to control.
410 MachineType use_type =
411 static_cast<MachineType>((use & kTypeMask) | output);
412 for (int i = 0; i < node->InputCount(); i++) {
413 ProcessInput(node, i, i < values ? use_type : 0);
414 }
415 } 410 }
416 } 411 }
417 412
418 void VisitCall(Node* node, SimplifiedLowering* lowering) { 413 void VisitCall(Node* node, SimplifiedLowering* lowering) {
419 const CallDescriptor* desc = OpParameter<const CallDescriptor*>(node->op()); 414 const CallDescriptor* desc = OpParameter<const CallDescriptor*>(node->op());
420 const MachineSignature* sig = desc->GetMachineSignature(); 415 const MachineSignature* sig = desc->GetMachineSignature();
421 int params = static_cast<int>(sig->parameter_count()); 416 int params = static_cast<int>(sig->parameter_count());
422 // Propagate representation information from call descriptor. 417 // Propagate representation information from call descriptor.
423 for (int i = 0; i < node->InputCount(); i++) { 418 for (int i = 0; i < node->InputCount(); i++) {
424 if (i == 0) { 419 if (i == 0) {
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 ReplaceEffectUses(node, comparison); 1564 ReplaceEffectUses(node, comparison);
1570 node->ReplaceInput(0, comparison); 1565 node->ReplaceInput(0, comparison);
1571 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); 1566 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
1572 node->TrimInputCount(2); 1567 node->TrimInputCount(2);
1573 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); 1568 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual());
1574 } 1569 }
1575 1570
1576 } // namespace compiler 1571 } // namespace compiler
1577 } // namespace internal 1572 } // namespace internal
1578 } // namespace v8 1573 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/js/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698