| 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/compiler/simplified-operator-reducer.h" | 5 #include "src/compiler/simplified-operator-reducer.h" |
| 6 | 6 |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 if (m.HasValue()) return ReplaceFloat64(m.Value()); | 82 if (m.HasValue()) return ReplaceFloat64(m.Value()); |
| 83 if (m.IsChangeFloat64ToTagged()) return Replace(m.node()->InputAt(0)); | 83 if (m.IsChangeFloat64ToTagged()) return Replace(m.node()->InputAt(0)); |
| 84 if (m.IsChangeInt31ToTaggedSigned() || m.IsChangeInt32ToTagged()) { | 84 if (m.IsChangeInt31ToTaggedSigned() || m.IsChangeInt32ToTagged()) { |
| 85 return Change(node, machine()->ChangeInt32ToFloat64(), m.InputAt(0)); | 85 return Change(node, machine()->ChangeInt32ToFloat64(), m.InputAt(0)); |
| 86 } | 86 } |
| 87 if (m.IsChangeUint32ToTagged()) { | 87 if (m.IsChangeUint32ToTagged()) { |
| 88 return Change(node, machine()->ChangeUint32ToFloat64(), m.InputAt(0)); | 88 return Change(node, machine()->ChangeUint32ToFloat64(), m.InputAt(0)); |
| 89 } | 89 } |
| 90 break; | 90 break; |
| 91 } | 91 } |
| 92 case IrOpcode::kChangeTaggedSignedToInt32: |
| 92 case IrOpcode::kChangeTaggedToInt32: { | 93 case IrOpcode::kChangeTaggedToInt32: { |
| 93 NumberMatcher m(node->InputAt(0)); | 94 NumberMatcher m(node->InputAt(0)); |
| 94 if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value())); | 95 if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value())); |
| 95 if (m.IsChangeFloat64ToTagged()) { | 96 if (m.IsChangeFloat64ToTagged()) { |
| 96 return Change(node, machine()->ChangeFloat64ToInt32(), m.InputAt(0)); | 97 return Change(node, machine()->ChangeFloat64ToInt32(), m.InputAt(0)); |
| 97 } | 98 } |
| 98 if (m.IsChangeInt31ToTaggedSigned() || m.IsChangeInt32ToTagged()) { | 99 if (m.IsChangeInt31ToTaggedSigned() || m.IsChangeInt32ToTagged()) { |
| 99 return Replace(m.InputAt(0)); | 100 return Replace(m.InputAt(0)); |
| 100 } | 101 } |
| 101 break; | 102 break; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 return jsgraph()->isolate(); | 251 return jsgraph()->isolate(); |
| 251 } | 252 } |
| 252 | 253 |
| 253 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { | 254 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { |
| 254 return jsgraph()->machine(); | 255 return jsgraph()->machine(); |
| 255 } | 256 } |
| 256 | 257 |
| 257 } // namespace compiler | 258 } // namespace compiler |
| 258 } // namespace internal | 259 } // namespace internal |
| 259 } // namespace v8 | 260 } // namespace v8 |
| OLD | NEW |