LCOV - code coverage report
Current view: top level - src/compiler - select-lowering.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 11 11 100.0 %
Date: 2019-04-17 Functions: 3 3 100.0 %

          Line data    Source code
       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
       3             : // found in the LICENSE file.
       4             : 
       5             : #include "src/compiler/select-lowering.h"
       6             : 
       7             : #include "src/compiler/common-operator.h"
       8             : #include "src/compiler/diamond.h"
       9             : #include "src/compiler/graph.h"
      10             : #include "src/compiler/node.h"
      11             : #include "src/compiler/node-properties.h"
      12             : 
      13             : namespace v8 {
      14             : namespace internal {
      15             : namespace compiler {
      16             : 
      17      464074 : SelectLowering::SelectLowering(Graph* graph, CommonOperatorBuilder* common)
      18      464074 :     : common_(common), graph_(graph) {}
      19             : 
      20             : SelectLowering::~SelectLowering() = default;
      21             : 
      22             : 
      23    43976027 : Reduction SelectLowering::Reduce(Node* node) {
      24    43976027 :   if (node->opcode() != IrOpcode::kSelect) return NoChange();
      25       18424 :   SelectParameters const p = SelectParametersOf(node->op());
      26             : 
      27             :   Node* cond = node->InputAt(0);
      28             :   Node* vthen = node->InputAt(1);
      29             :   Node* velse = node->InputAt(2);
      30             : 
      31             :   // Create a diamond and a phi.
      32       18424 :   Diamond d(graph(), common(), cond, p.hint());
      33       18424 :   node->ReplaceInput(0, vthen);
      34       18424 :   node->ReplaceInput(1, velse);
      35       18424 :   node->ReplaceInput(2, d.merge);
      36       18424 :   NodeProperties::ChangeOp(node, common()->Phi(p.representation(), 2));
      37             :   return Changed(node);
      38             : }
      39             : 
      40             : }  // namespace compiler
      41             : }  // namespace internal
      42      121996 : }  // namespace v8

Generated by: LCOV version 1.10