| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // Schedule the call's IfSuccess node (if there is no exception use). | 344 // Schedule the call's IfSuccess node (if there is no exception use). |
| 345 TryScheduleCallIfSuccess(node, control); | 345 TryScheduleCallIfSuccess(node, control); |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 | 349 |
| 350 bool EffectControlLinearizer::TryWireInStateEffect(Node* node, Node** effect, | 350 bool EffectControlLinearizer::TryWireInStateEffect(Node* node, Node** effect, |
| 351 Node** control) { | 351 Node** control) { |
| 352 ValueEffectControl state(nullptr, nullptr, nullptr); | 352 ValueEffectControl state(nullptr, nullptr, nullptr); |
| 353 switch (node->opcode()) { | 353 switch (node->opcode()) { |
| 354 case IrOpcode::kGuard: | 354 case IrOpcode::kTypeGuard: |
| 355 state = LowerGuard(node, *effect, *control); | 355 state = LowerTypeGuard(node, *effect, *control); |
| 356 break; | 356 break; |
| 357 case IrOpcode::kChangeBitToTagged: | 357 case IrOpcode::kChangeBitToTagged: |
| 358 state = LowerChangeBitToTagged(node, *effect, *control); | 358 state = LowerChangeBitToTagged(node, *effect, *control); |
| 359 break; | 359 break; |
| 360 case IrOpcode::kChangeInt31ToTaggedSigned: | 360 case IrOpcode::kChangeInt31ToTaggedSigned: |
| 361 state = LowerChangeInt31ToTaggedSigned(node, *effect, *control); | 361 state = LowerChangeInt31ToTaggedSigned(node, *effect, *control); |
| 362 break; | 362 break; |
| 363 case IrOpcode::kChangeInt32ToTagged: | 363 case IrOpcode::kChangeInt32ToTagged: |
| 364 state = LowerChangeInt32ToTagged(node, *effect, *control); | 364 state = LowerChangeInt32ToTagged(node, *effect, *control); |
| 365 break; | 365 break; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 break; | 407 break; |
| 408 default: | 408 default: |
| 409 return false; | 409 return false; |
| 410 } | 410 } |
| 411 NodeProperties::ReplaceUses(node, state.value); | 411 NodeProperties::ReplaceUses(node, state.value); |
| 412 *effect = state.effect; | 412 *effect = state.effect; |
| 413 *control = state.control; | 413 *control = state.control; |
| 414 return true; | 414 return true; |
| 415 } | 415 } |
| 416 | 416 |
| 417 EffectControlLinearizer::ValueEffectControl EffectControlLinearizer::LowerGuard( | 417 EffectControlLinearizer::ValueEffectControl |
| 418 Node* node, Node* effect, Node* control) { | 418 EffectControlLinearizer::LowerTypeGuard(Node* node, Node* effect, |
| 419 Node* control) { |
| 419 Node* value = node->InputAt(0); | 420 Node* value = node->InputAt(0); |
| 420 return ValueEffectControl(value, effect, control); | 421 return ValueEffectControl(value, effect, control); |
| 421 } | 422 } |
| 422 | 423 |
| 423 EffectControlLinearizer::ValueEffectControl | 424 EffectControlLinearizer::ValueEffectControl |
| 424 EffectControlLinearizer::LowerChangeFloat64ToTagged(Node* node, Node* effect, | 425 EffectControlLinearizer::LowerChangeFloat64ToTagged(Node* node, Node* effect, |
| 425 Node* control) { | 426 Node* control) { |
| 426 Node* value = node->InputAt(0); | 427 Node* value = node->InputAt(0); |
| 427 | 428 |
| 428 Node* value32 = graph()->NewNode(machine()->RoundFloat64ToInt32(), value); | 429 Node* value32 = graph()->NewNode(machine()->RoundFloat64ToInt32(), value); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 return jsgraph()->Int32Constant(Smi::kMaxValue); | 974 return jsgraph()->Int32Constant(Smi::kMaxValue); |
| 974 } | 975 } |
| 975 | 976 |
| 976 Node* EffectControlLinearizer::SmiShiftBitsConstant() { | 977 Node* EffectControlLinearizer::SmiShiftBitsConstant() { |
| 977 return jsgraph()->IntPtrConstant(kSmiShiftSize + kSmiTagSize); | 978 return jsgraph()->IntPtrConstant(kSmiShiftSize + kSmiTagSize); |
| 978 } | 979 } |
| 979 | 980 |
| 980 } // namespace compiler | 981 } // namespace compiler |
| 981 } // namespace internal | 982 } // namespace internal |
| 982 } // namespace v8 | 983 } // namespace v8 |
| OLD | NEW |