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

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

Issue 2059653002: [turbofan] Introduce PlainPrimitiveToNumber. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 4 years, 6 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/opcodes.h ('k') | src/compiler/simplified-operator.h » ('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 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 access.base_is_tagged, access.machine_type.representation(), 1632 access.base_is_tagged, access.machine_type.representation(),
1633 access.type, node->InputAt(2)); 1633 access.type, node->InputAt(2));
1634 if (write_barrier_kind < access.write_barrier_kind) { 1634 if (write_barrier_kind < access.write_barrier_kind) {
1635 access.write_barrier_kind = write_barrier_kind; 1635 access.write_barrier_kind = write_barrier_kind;
1636 NodeProperties::ChangeOp( 1636 NodeProperties::ChangeOp(
1637 node, jsgraph_->simplified()->StoreElement(access)); 1637 node, jsgraph_->simplified()->StoreElement(access));
1638 } 1638 }
1639 } 1639 }
1640 return; 1640 return;
1641 } 1641 }
1642 case IrOpcode::kPlainPrimitiveToNumber:
1643 ProcessInput(node, 0, UseInfo::AnyTagged());
1644 if (truncation.TruncatesToWord32()) {
1645 SetOutput(node, MachineRepresentation::kWord32);
1646 if (lower()) {
1647 NodeProperties::ChangeOp(node,
1648 simplified()->PlainPrimitiveToWord32());
1649 }
1650 } else if (truncation.TruncatesToFloat64()) {
1651 SetOutput(node, MachineRepresentation::kFloat64);
1652 if (lower()) {
1653 NodeProperties::ChangeOp(node,
1654 simplified()->PlainPrimitiveToFloat64());
1655 }
1656 } else {
1657 SetOutput(node, MachineRepresentation::kTagged);
1658 }
1659 return;
1642 case IrOpcode::kObjectIsCallable: 1660 case IrOpcode::kObjectIsCallable:
1643 case IrOpcode::kObjectIsNumber: 1661 case IrOpcode::kObjectIsNumber:
1644 case IrOpcode::kObjectIsReceiver: 1662 case IrOpcode::kObjectIsReceiver:
1645 case IrOpcode::kObjectIsSmi: 1663 case IrOpcode::kObjectIsSmi:
1646 case IrOpcode::kObjectIsString: 1664 case IrOpcode::kObjectIsString:
1647 case IrOpcode::kObjectIsUndetectable: { 1665 case IrOpcode::kObjectIsUndetectable: {
1648 ProcessInput(node, 0, UseInfo::AnyTagged()); 1666 ProcessInput(node, 0, UseInfo::AnyTagged());
1649 SetOutput(node, MachineRepresentation::kBit); 1667 SetOutput(node, MachineRepresentation::kBit);
1650 return; 1668 return;
1651 } 1669 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 // inference runs, so we do not have any real test coverage. 1819 // inference runs, so we do not have any real test coverage.
1802 // Simply fail here. 1820 // Simply fail here.
1803 case IrOpcode::kChangeFloat64ToInt32: 1821 case IrOpcode::kChangeFloat64ToInt32:
1804 case IrOpcode::kChangeFloat64ToUint32: 1822 case IrOpcode::kChangeFloat64ToUint32:
1805 case IrOpcode::kTruncateInt64ToInt32: 1823 case IrOpcode::kTruncateInt64ToInt32:
1806 case IrOpcode::kChangeFloat32ToFloat64: 1824 case IrOpcode::kChangeFloat32ToFloat64:
1807 case IrOpcode::kCheckedUint32ToInt32: 1825 case IrOpcode::kCheckedUint32ToInt32:
1808 case IrOpcode::kCheckedFloat64ToInt32: 1826 case IrOpcode::kCheckedFloat64ToInt32:
1809 case IrOpcode::kCheckedTaggedToInt32: 1827 case IrOpcode::kCheckedTaggedToInt32:
1810 case IrOpcode::kCheckedTaggedToFloat64: 1828 case IrOpcode::kCheckedTaggedToFloat64:
1829 case IrOpcode::kPlainPrimitiveToWord32:
1830 case IrOpcode::kPlainPrimitiveToFloat64:
1811 FATAL("Representation inference: unsupported opcodes."); 1831 FATAL("Representation inference: unsupported opcodes.");
1812 break; 1832 break;
1813 1833
1814 default: 1834 default:
1815 VisitInputs(node); 1835 VisitInputs(node);
1816 // Assume the output is tagged. 1836 // Assume the output is tagged.
1817 return SetOutput(node, MachineRepresentation::kTagged); 1837 return SetOutput(node, MachineRepresentation::kTagged);
1818 } 1838 }
1819 UNREACHABLE(); 1839 UNREACHABLE();
1820 } 1840 }
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2819 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 2839 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
2820 Operator::kNoProperties); 2840 Operator::kNoProperties);
2821 to_number_operator_.set(common()->Call(desc)); 2841 to_number_operator_.set(common()->Call(desc));
2822 } 2842 }
2823 return to_number_operator_.get(); 2843 return to_number_operator_.get();
2824 } 2844 }
2825 2845
2826 } // namespace compiler 2846 } // namespace compiler
2827 } // namespace internal 2847 } // namespace internal
2828 } // namespace v8 2848 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698