| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // if IsSmi(y) then ChangeSmiToFloat64(y) | 222 // if IsSmi(y) then ChangeSmiToFloat64(y) |
| 223 // else LoadHeapNumberValue(y) | 223 // else LoadHeapNumberValue(y) |
| 224 Node* const object = NodeProperties::GetValueInput(value, 0); | 224 Node* const object = NodeProperties::GetValueInput(value, 0); |
| 225 Node* const context = NodeProperties::GetContextInput(value); | 225 Node* const context = NodeProperties::GetContextInput(value); |
| 226 Node* const effect = NodeProperties::GetEffectInput(value); | 226 Node* const effect = NodeProperties::GetEffectInput(value); |
| 227 Node* const control = NodeProperties::GetControlInput(value); | 227 Node* const control = NodeProperties::GetControlInput(value); |
| 228 | 228 |
| 229 Diamond d1(graph(), common(), TestNotSmi(object), BranchHint::kFalse); | 229 Diamond d1(graph(), common(), TestNotSmi(object), BranchHint::kFalse); |
| 230 d1.Chain(control); | 230 d1.Chain(control); |
| 231 | 231 |
| 232 DCHECK_EQ(FLAG_turbo_deoptimization, |
| 233 OperatorProperties::GetFrameStateInputCount(value->op()) == 1); |
| 232 Node* number = | 234 Node* number = |
| 233 OperatorProperties::HasFrameStateInput(value->op()) | 235 FLAG_turbo_deoptimization |
| 234 ? graph()->NewNode(value->op(), object, context, | 236 ? graph()->NewNode(value->op(), object, context, |
| 235 NodeProperties::GetFrameStateInput(value), | 237 NodeProperties::GetFrameStateInput(value, 0), |
| 236 effect, d1.if_true) | 238 effect, d1.if_true) |
| 237 : graph()->NewNode(value->op(), object, context, effect, | 239 : graph()->NewNode(value->op(), object, context, effect, |
| 238 d1.if_true); | 240 d1.if_true); |
| 239 Diamond d2(graph(), common(), TestNotSmi(number)); | 241 Diamond d2(graph(), common(), TestNotSmi(number)); |
| 240 d2.Nest(d1, true); | 242 d2.Nest(d1, true); |
| 241 Node* phi2 = d2.Phi(kMachFloat64, LoadHeapNumberValue(number, d2.if_true), | 243 Node* phi2 = d2.Phi(kMachFloat64, LoadHeapNumberValue(number, d2.if_true), |
| 242 ChangeSmiToFloat64(number)); | 244 ChangeSmiToFloat64(number)); |
| 243 | 245 |
| 244 Node* phi1 = d1.Phi(kMachFloat64, phi2, ChangeSmiToFloat64(object)); | 246 Node* phi1 = d1.Phi(kMachFloat64, phi2, ChangeSmiToFloat64(object)); |
| 245 Node* ephi1 = d1.EffectPhi(number, effect); | 247 Node* ephi1 = d1.EffectPhi(number, effect); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 284 } |
| 283 | 285 |
| 284 | 286 |
| 285 MachineOperatorBuilder* ChangeLowering::machine() const { | 287 MachineOperatorBuilder* ChangeLowering::machine() const { |
| 286 return jsgraph()->machine(); | 288 return jsgraph()->machine(); |
| 287 } | 289 } |
| 288 | 290 |
| 289 } // namespace compiler | 291 } // namespace compiler |
| 290 } // namespace internal | 292 } // namespace internal |
| 291 } // namespace v8 | 293 } // namespace v8 |
| OLD | NEW |