| 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/change-lowering.h" | 5 #include "src/compiler/change-lowering.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/diamond.h" | 8 #include "src/compiler/diamond.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 return Replace(AllocateHeapNumberWithValue(val, control)); | 158 return Replace(AllocateHeapNumberWithValue(val, control)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) { | 162 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) { |
| 163 if (machine()->Is64()) { | 163 if (machine()->Is64()) { |
| 164 return Replace(graph()->NewNode( | 164 return Replace(graph()->NewNode( |
| 165 machine()->Word64Shl(), | 165 machine()->Word64Shl(), |
| 166 graph()->NewNode(machine()->ChangeInt32ToInt64(), value), | 166 graph()->NewNode(machine()->ChangeInt32ToInt64(), value), |
| 167 SmiShiftBitsConstant())); | 167 SmiShiftBitsConstant())); |
| 168 } else if (NodeProperties::GetBounds(value).upper->Is(Type::Signed31())) { | 168 } else if (NodeProperties::GetBounds(value).upper->Is(Type::SignedSmall())) { |
| 169 return Replace( | 169 return Replace( |
| 170 graph()->NewNode(machine()->WordShl(), value, SmiShiftBitsConstant())); | 170 graph()->NewNode(machine()->WordShl(), value, SmiShiftBitsConstant())); |
| 171 } | 171 } |
| 172 | 172 |
| 173 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value); | 173 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value); |
| 174 Node* ovf = graph()->NewNode(common()->Projection(1), add); | 174 Node* ovf = graph()->NewNode(common()->Projection(1), add); |
| 175 | 175 |
| 176 Diamond d(graph(), common(), ovf, BranchHint::kFalse); | 176 Diamond d(graph(), common(), ovf, BranchHint::kFalse); |
| 177 d.Chain(control); | 177 d.Chain(control); |
| 178 return Replace( | 178 return Replace( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 282 } |
| 283 | 283 |
| 284 | 284 |
| 285 MachineOperatorBuilder* ChangeLowering::machine() const { | 285 MachineOperatorBuilder* ChangeLowering::machine() const { |
| 286 return jsgraph()->machine(); | 286 return jsgraph()->machine(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace compiler | 289 } // namespace compiler |
| 290 } // namespace internal | 290 } // namespace internal |
| 291 } // namespace v8 | 291 } // namespace v8 |
| OLD | NEW |