| OLD | NEW |
| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-typed-lowering.h" | 8 #include "src/compiler/js-typed-lowering.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 Node* branch0 = | 1518 Node* branch0 = |
| 1519 graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, control); | 1519 graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, control); |
| 1520 | 1520 |
| 1521 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0); | 1521 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0); |
| 1522 Node* cache_array_true0; | 1522 Node* cache_array_true0; |
| 1523 Node* cache_length_true0; | 1523 Node* cache_length_true0; |
| 1524 Node* cache_type_true0; | 1524 Node* cache_type_true0; |
| 1525 Node* etrue0; | 1525 Node* etrue0; |
| 1526 { | 1526 { |
| 1527 // Enum cache case. | 1527 // Enum cache case. |
| 1528 Node* cache_type_enum_length = etrue0 = graph()->NewNode( | 1528 Node* cache_type_enum_length = etrue0 = |
| 1529 simplified()->LoadField(AccessBuilder::ForMapBitField3()), cache_type, | 1529 graph()->NewNode(simplified()->LoadField( |
| 1530 effect, if_true0); | 1530 AccessBuilder::ForMapBitField3(graph()->zone())), |
| 1531 cache_length_true0 = | 1531 cache_type, effect, if_true0); |
| 1532 graph()->NewNode(machine()->Word32And(), cache_type_enum_length, | 1532 cache_length_true0 = graph()->NewNode( |
| 1533 jsgraph()->Uint32Constant(Map::EnumLengthBits::kMask)); | 1533 simplified()->NumberBitwiseAnd(), cache_type_enum_length, |
| 1534 jsgraph()->Int32Constant(Map::EnumLengthBits::kMask)); |
| 1534 | 1535 |
| 1535 Node* check1 = | 1536 Node* check1 = |
| 1536 graph()->NewNode(machine()->Word32Equal(), cache_length_true0, | 1537 graph()->NewNode(machine()->Word32Equal(), cache_length_true0, |
| 1537 jsgraph()->Int32Constant(0)); | 1538 jsgraph()->Int32Constant(0)); |
| 1538 Node* branch1 = | 1539 Node* branch1 = |
| 1539 graph()->NewNode(common()->Branch(BranchHint::kTrue), check1, if_true0); | 1540 graph()->NewNode(common()->Branch(BranchHint::kTrue), check1, if_true0); |
| 1540 | 1541 |
| 1541 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | 1542 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); |
| 1542 Node* cache_array_true1; | 1543 Node* cache_array_true1; |
| 1543 Node* etrue1; | 1544 Node* etrue1; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1788 case IrOpcode::kJSStrictEqual: | 1789 case IrOpcode::kJSStrictEqual: |
| 1789 return ReduceJSStrictEqual(node, false); | 1790 return ReduceJSStrictEqual(node, false); |
| 1790 case IrOpcode::kJSStrictNotEqual: | 1791 case IrOpcode::kJSStrictNotEqual: |
| 1791 return ReduceJSStrictEqual(node, true); | 1792 return ReduceJSStrictEqual(node, true); |
| 1792 case IrOpcode::kJSLessThan: // fall through | 1793 case IrOpcode::kJSLessThan: // fall through |
| 1793 case IrOpcode::kJSGreaterThan: // fall through | 1794 case IrOpcode::kJSGreaterThan: // fall through |
| 1794 case IrOpcode::kJSLessThanOrEqual: // fall through | 1795 case IrOpcode::kJSLessThanOrEqual: // fall through |
| 1795 case IrOpcode::kJSGreaterThanOrEqual: | 1796 case IrOpcode::kJSGreaterThanOrEqual: |
| 1796 return ReduceJSComparison(node); | 1797 return ReduceJSComparison(node); |
| 1797 case IrOpcode::kJSBitwiseOr: | 1798 case IrOpcode::kJSBitwiseOr: |
| 1798 return ReduceInt32Binop(node, machine()->Word32Or()); | 1799 return ReduceInt32Binop(node, simplified()->NumberBitwiseOr()); |
| 1799 case IrOpcode::kJSBitwiseXor: | 1800 case IrOpcode::kJSBitwiseXor: |
| 1800 return ReduceInt32Binop(node, machine()->Word32Xor()); | 1801 return ReduceInt32Binop(node, simplified()->NumberBitwiseXor()); |
| 1801 case IrOpcode::kJSBitwiseAnd: | 1802 case IrOpcode::kJSBitwiseAnd: |
| 1802 return ReduceInt32Binop(node, machine()->Word32And()); | 1803 return ReduceInt32Binop(node, simplified()->NumberBitwiseAnd()); |
| 1803 case IrOpcode::kJSShiftLeft: | 1804 case IrOpcode::kJSShiftLeft: |
| 1804 return ReduceUI32Shift(node, kSigned, simplified()->NumberShiftLeft()); | 1805 return ReduceUI32Shift(node, kSigned, simplified()->NumberShiftLeft()); |
| 1805 case IrOpcode::kJSShiftRight: | 1806 case IrOpcode::kJSShiftRight: |
| 1806 return ReduceUI32Shift(node, kSigned, simplified()->NumberShiftRight()); | 1807 return ReduceUI32Shift(node, kSigned, simplified()->NumberShiftRight()); |
| 1807 case IrOpcode::kJSShiftRightLogical: | 1808 case IrOpcode::kJSShiftRightLogical: |
| 1808 return ReduceUI32Shift(node, kUnsigned, | 1809 return ReduceUI32Shift(node, kUnsigned, |
| 1809 simplified()->NumberShiftRightLogical()); | 1810 simplified()->NumberShiftRightLogical()); |
| 1810 case IrOpcode::kJSAdd: | 1811 case IrOpcode::kJSAdd: |
| 1811 return ReduceJSAdd(node); | 1812 return ReduceJSAdd(node); |
| 1812 case IrOpcode::kJSSubtract: | 1813 case IrOpcode::kJSSubtract: |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 } | 1921 } |
| 1921 | 1922 |
| 1922 | 1923 |
| 1923 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1924 MachineOperatorBuilder* JSTypedLowering::machine() const { |
| 1924 return jsgraph()->machine(); | 1925 return jsgraph()->machine(); |
| 1925 } | 1926 } |
| 1926 | 1927 |
| 1927 } // namespace compiler | 1928 } // namespace compiler |
| 1928 } // namespace internal | 1929 } // namespace internal |
| 1929 } // namespace v8 | 1930 } // namespace v8 |
| OLD | NEW |