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 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 jsgraph()->HeapNumberMapConstant()); | 1663 jsgraph()->HeapNumberMapConstant()); |
1664 | 1664 |
1665 switch (mode) { | 1665 switch (mode) { |
1666 case CheckTaggedInputMode::kNumber: { | 1666 case CheckTaggedInputMode::kNumber: { |
1667 control = effect = graph()->NewNode( | 1667 control = effect = graph()->NewNode( |
1668 common()->DeoptimizeUnless(DeoptimizeReason::kNotAHeapNumber), | 1668 common()->DeoptimizeUnless(DeoptimizeReason::kNotAHeapNumber), |
1669 check_number, frame_state, effect, control); | 1669 check_number, frame_state, effect, control); |
1670 break; | 1670 break; |
1671 } | 1671 } |
1672 case CheckTaggedInputMode::kNumberOrOddball: { | 1672 case CheckTaggedInputMode::kNumberOrOddball: { |
1673 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), | 1673 Node* branch = |
1674 check_number, control); | 1674 graph()->NewNode(common()->Branch(), check_number, control); |
1675 | 1675 |
1676 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 1676 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
1677 Node* etrue = effect; | 1677 Node* etrue = effect; |
1678 | 1678 |
1679 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); | 1679 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); |
1680 // For oddballs also contain the numeric value, let us just check that | 1680 // For oddballs also contain the numeric value, let us just check that |
1681 // we have an oddball here. | 1681 // we have an oddball here. |
1682 Node* efalse = effect; | 1682 Node* efalse = effect; |
1683 Node* instance_type = efalse = graph()->NewNode( | 1683 Node* instance_type = efalse = graph()->NewNode( |
1684 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), | 1684 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), |
(...skipping 21 matching lines...) Expand all Loading... |
1706 | 1706 |
1707 EffectControlLinearizer::ValueEffectControl | 1707 EffectControlLinearizer::ValueEffectControl |
1708 EffectControlLinearizer::LowerCheckedTaggedToFloat64(Node* node, | 1708 EffectControlLinearizer::LowerCheckedTaggedToFloat64(Node* node, |
1709 Node* frame_state, | 1709 Node* frame_state, |
1710 Node* effect, | 1710 Node* effect, |
1711 Node* control) { | 1711 Node* control) { |
1712 CheckTaggedInputMode mode = CheckTaggedInputModeOf(node->op()); | 1712 CheckTaggedInputMode mode = CheckTaggedInputModeOf(node->op()); |
1713 Node* value = node->InputAt(0); | 1713 Node* value = node->InputAt(0); |
1714 | 1714 |
1715 Node* check = ObjectIsSmi(value); | 1715 Node* check = ObjectIsSmi(value); |
1716 Node* branch = | 1716 Node* branch = graph()->NewNode(common()->Branch(), check, control); |
1717 graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control); | |
1718 | 1717 |
1719 // In the Smi case, just convert to int32 and then float64. | 1718 // In the Smi case, just convert to int32 and then float64. |
1720 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 1719 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
1721 Node* etrue = effect; | 1720 Node* etrue = effect; |
1722 Node* vtrue = ChangeSmiToInt32(value); | 1721 Node* vtrue = ChangeSmiToInt32(value); |
1723 vtrue = graph()->NewNode(machine()->ChangeInt32ToFloat64(), vtrue); | 1722 vtrue = graph()->NewNode(machine()->ChangeInt32ToFloat64(), vtrue); |
1724 | 1723 |
1725 // Otherwise, check heap numberness and load the number. | 1724 // Otherwise, check heap numberness and load the number. |
1726 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); | 1725 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); |
1727 ValueEffectControl number_state = BuildCheckedHeapNumberOrOddballToFloat64( | 1726 ValueEffectControl number_state = BuildCheckedHeapNumberOrOddballToFloat64( |
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3309 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3308 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3310 Operator::kEliminatable); | 3309 Operator::kEliminatable); |
3311 to_number_operator_.set(common()->Call(desc)); | 3310 to_number_operator_.set(common()->Call(desc)); |
3312 } | 3311 } |
3313 return to_number_operator_.get(); | 3312 return to_number_operator_.get(); |
3314 } | 3313 } |
3315 | 3314 |
3316 } // namespace compiler | 3315 } // namespace compiler |
3317 } // namespace internal | 3316 } // namespace internal |
3318 } // namespace v8 | 3317 } // namespace v8 |
OLD | NEW |