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

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

Issue 931623002: [turbofan] Optimize certain chains of Branch into a Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addrssed comments. Created 5 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 | « src/compiler/scheduler.cc ('k') | 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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 return VisitLeaf(node, kRepWord64); 494 return VisitLeaf(node, kRepWord64);
495 case IrOpcode::kFloat64Constant: 495 case IrOpcode::kFloat64Constant:
496 return VisitLeaf(node, kRepFloat64); 496 return VisitLeaf(node, kRepFloat64);
497 case IrOpcode::kExternalConstant: 497 case IrOpcode::kExternalConstant:
498 return VisitLeaf(node, kMachPtr); 498 return VisitLeaf(node, kMachPtr);
499 case IrOpcode::kNumberConstant: 499 case IrOpcode::kNumberConstant:
500 return VisitLeaf(node, kRepTagged); 500 return VisitLeaf(node, kRepTagged);
501 case IrOpcode::kHeapConstant: 501 case IrOpcode::kHeapConstant:
502 return VisitLeaf(node, kRepTagged); 502 return VisitLeaf(node, kRepTagged);
503 503
504 case IrOpcode::kEnd:
505 case IrOpcode::kIfTrue:
506 case IrOpcode::kIfFalse:
507 case IrOpcode::kReturn:
508 case IrOpcode::kMerge:
509 case IrOpcode::kThrow:
510 return VisitInputs(node); // default visit for all node inputs.
511
512 case IrOpcode::kBranch: 504 case IrOpcode::kBranch:
513 ProcessInput(node, 0, kRepBit); 505 ProcessInput(node, 0, kRepBit);
514 Enqueue(NodeProperties::GetControlInput(node, 0)); 506 Enqueue(NodeProperties::GetControlInput(node, 0));
515 break; 507 break;
508 case IrOpcode::kSwitch:
509 ProcessInput(node, 0, kRepWord32);
510 Enqueue(NodeProperties::GetControlInput(node, 0));
511 break;
516 case IrOpcode::kSelect: 512 case IrOpcode::kSelect:
517 return VisitSelect(node, use, lowering); 513 return VisitSelect(node, use, lowering);
518 case IrOpcode::kPhi: 514 case IrOpcode::kPhi:
519 return VisitPhi(node, use, lowering); 515 return VisitPhi(node, use, lowering);
520 516
521 //------------------------------------------------------------------ 517 //------------------------------------------------------------------
522 // JavaScript operators. 518 // JavaScript operators.
523 //------------------------------------------------------------------ 519 //------------------------------------------------------------------
524 // For now, we assume that all JS operators were too complex to lower 520 // For now, we assume that all JS operators were too complex to lower
525 // to Simplified and that they will always require tagged value inputs 521 // to Simplified and that they will always require tagged value inputs
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 1531
1536 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { 1532 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) {
1537 node->set_op(machine()->IntLessThanOrEqual()); 1533 node->set_op(machine()->IntLessThanOrEqual());
1538 node->ReplaceInput(0, StringComparison(node, true)); 1534 node->ReplaceInput(0, StringComparison(node, true));
1539 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); 1535 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
1540 } 1536 }
1541 1537
1542 } // namespace compiler 1538 } // namespace compiler
1543 } // namespace internal 1539 } // namespace internal
1544 } // namespace v8 1540 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698