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

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

Issue 2672713002: [turbofan] Guard invariant that Branch/Select condition must be Boolean. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/verifier.cc » ('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/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 return MachineRepresentation::kFloat64; 887 return MachineRepresentation::kFloat64;
888 } else if (type->Is(Type::ExternalPointer())) { 888 } else if (type->Is(Type::ExternalPointer())) {
889 return MachineType::PointerRepresentation(); 889 return MachineType::PointerRepresentation();
890 } 890 }
891 return MachineRepresentation::kTagged; 891 return MachineRepresentation::kTagged;
892 } 892 }
893 893
894 // Helper for handling selects. 894 // Helper for handling selects.
895 void VisitSelect(Node* node, Truncation truncation, 895 void VisitSelect(Node* node, Truncation truncation,
896 SimplifiedLowering* lowering) { 896 SimplifiedLowering* lowering) {
897 DCHECK(TypeOf(node->InputAt(0))->Is(Type::Boolean()));
897 ProcessInput(node, 0, UseInfo::Bool()); 898 ProcessInput(node, 0, UseInfo::Bool());
898 899
899 MachineRepresentation output = 900 MachineRepresentation output =
900 GetOutputInfoForPhi(node, TypeOf(node), truncation); 901 GetOutputInfoForPhi(node, TypeOf(node), truncation);
901 SetOutput(node, output); 902 SetOutput(node, output);
902 903
903 if (lower()) { 904 if (lower()) {
904 // Update the select operator. 905 // Update the select operator.
905 SelectParameters p = SelectParametersOf(node->op()); 906 SelectParameters p = SelectParametersOf(node->op());
906 if (output != p.representation()) { 907 if (output != p.representation()) {
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 return VisitLeaf(node, MachineRepresentation::kTaggedPointer); 1418 return VisitLeaf(node, MachineRepresentation::kTaggedPointer);
1418 case IrOpcode::kPointerConstant: { 1419 case IrOpcode::kPointerConstant: {
1419 VisitLeaf(node, MachineType::PointerRepresentation()); 1420 VisitLeaf(node, MachineType::PointerRepresentation());
1420 if (lower()) { 1421 if (lower()) {
1421 intptr_t const value = OpParameter<intptr_t>(node); 1422 intptr_t const value = OpParameter<intptr_t>(node);
1422 DeferReplacement(node, lowering->jsgraph()->IntPtrConstant(value)); 1423 DeferReplacement(node, lowering->jsgraph()->IntPtrConstant(value));
1423 } 1424 }
1424 return; 1425 return;
1425 } 1426 }
1426 1427
1427 case IrOpcode::kBranch: 1428 case IrOpcode::kBranch: {
1429 DCHECK(TypeOf(node->InputAt(0))->Is(Type::Boolean()));
1428 ProcessInput(node, 0, UseInfo::Bool()); 1430 ProcessInput(node, 0, UseInfo::Bool());
1429 EnqueueInput(node, NodeProperties::FirstControlIndex(node)); 1431 EnqueueInput(node, NodeProperties::FirstControlIndex(node));
1430 return; 1432 return;
1433 }
1431 case IrOpcode::kSwitch: 1434 case IrOpcode::kSwitch:
1432 ProcessInput(node, 0, UseInfo::TruncatingWord32()); 1435 ProcessInput(node, 0, UseInfo::TruncatingWord32());
1433 EnqueueInput(node, NodeProperties::FirstControlIndex(node)); 1436 EnqueueInput(node, NodeProperties::FirstControlIndex(node));
1434 return; 1437 return;
1435 case IrOpcode::kSelect: 1438 case IrOpcode::kSelect:
1436 return VisitSelect(node, truncation, lowering); 1439 return VisitSelect(node, truncation, lowering);
1437 case IrOpcode::kPhi: 1440 case IrOpcode::kPhi:
1438 return VisitPhi(node, truncation, lowering); 1441 return VisitPhi(node, truncation, lowering);
1439 case IrOpcode::kCall: 1442 case IrOpcode::kCall:
1440 return VisitCall(node, lowering); 1443 return VisitCall(node, lowering);
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after
3507 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3510 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3508 Operator::kNoProperties); 3511 Operator::kNoProperties);
3509 to_number_operator_.set(common()->Call(desc)); 3512 to_number_operator_.set(common()->Call(desc));
3510 } 3513 }
3511 return to_number_operator_.get(); 3514 return to_number_operator_.get();
3512 } 3515 }
3513 3516
3514 } // namespace compiler 3517 } // namespace compiler
3515 } // namespace internal 3518 } // namespace internal
3516 } // namespace v8 3519 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698