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/compiler-source-position-table.h" | 9 #include "src/compiler/compiler-source-position-table.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 break; | 723 break; |
724 case IrOpcode::kObjectIsSmi: | 724 case IrOpcode::kObjectIsSmi: |
725 state = LowerObjectIsSmi(node, *effect, *control); | 725 state = LowerObjectIsSmi(node, *effect, *control); |
726 break; | 726 break; |
727 case IrOpcode::kObjectIsString: | 727 case IrOpcode::kObjectIsString: |
728 state = LowerObjectIsString(node, *effect, *control); | 728 state = LowerObjectIsString(node, *effect, *control); |
729 break; | 729 break; |
730 case IrOpcode::kObjectIsUndetectable: | 730 case IrOpcode::kObjectIsUndetectable: |
731 state = LowerObjectIsUndetectable(node, *effect, *control); | 731 state = LowerObjectIsUndetectable(node, *effect, *control); |
732 break; | 732 break; |
| 733 case IrOpcode::kNewRestParameterElements: |
| 734 state = LowerNewRestParameterElements(node, *effect, *control); |
| 735 break; |
| 736 case IrOpcode::kNewUnmappedArgumentsElements: |
| 737 state = LowerNewUnmappedArgumentsElements(node, *effect, *control); |
| 738 break; |
733 case IrOpcode::kArrayBufferWasNeutered: | 739 case IrOpcode::kArrayBufferWasNeutered: |
734 state = LowerArrayBufferWasNeutered(node, *effect, *control); | 740 state = LowerArrayBufferWasNeutered(node, *effect, *control); |
735 break; | 741 break; |
736 case IrOpcode::kStringFromCharCode: | 742 case IrOpcode::kStringFromCharCode: |
737 state = LowerStringFromCharCode(node, *effect, *control); | 743 state = LowerStringFromCharCode(node, *effect, *control); |
738 break; | 744 break; |
739 case IrOpcode::kStringFromCodePoint: | 745 case IrOpcode::kStringFromCodePoint: |
740 state = LowerStringFromCodePoint(node, *effect, *control); | 746 state = LowerStringFromCodePoint(node, *effect, *control); |
741 break; | 747 break; |
742 case IrOpcode::kStringCharCodeAt: | 748 case IrOpcode::kStringCharCodeAt: |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2157 | 2163 |
2158 control = graph()->NewNode(common()->Merge(2), if_true, if_false); | 2164 control = graph()->NewNode(common()->Merge(2), if_true, if_false); |
2159 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); | 2165 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); |
2160 value = graph()->NewNode(common()->Phi(MachineRepresentation::kBit, 2), vtrue, | 2166 value = graph()->NewNode(common()->Phi(MachineRepresentation::kBit, 2), vtrue, |
2161 vfalse, control); | 2167 vfalse, control); |
2162 | 2168 |
2163 return ValueEffectControl(value, effect, control); | 2169 return ValueEffectControl(value, effect, control); |
2164 } | 2170 } |
2165 | 2171 |
2166 EffectControlLinearizer::ValueEffectControl | 2172 EffectControlLinearizer::ValueEffectControl |
| 2173 EffectControlLinearizer::LowerNewRestParameterElements(Node* node, Node* effect, |
| 2174 Node* control) { |
| 2175 int const formal_parameter_count = ParameterCountOf(node->op()); |
| 2176 |
| 2177 Callable const callable = CodeFactory::NewRestParameterElements(isolate()); |
| 2178 Operator::Properties const properties = node->op()->properties(); |
| 2179 CallDescriptor::Flags const flags = CallDescriptor::kNoFlags; |
| 2180 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 2181 isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties); |
| 2182 Node* value = effect = graph()->NewNode( |
| 2183 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), |
| 2184 jsgraph()->IntPtrConstant(formal_parameter_count), |
| 2185 jsgraph()->NoContextConstant(), effect); |
| 2186 return ValueEffectControl(value, effect, control); |
| 2187 } |
| 2188 |
| 2189 EffectControlLinearizer::ValueEffectControl |
| 2190 EffectControlLinearizer::LowerNewUnmappedArgumentsElements(Node* node, |
| 2191 Node* effect, |
| 2192 Node* control) { |
| 2193 int const formal_parameter_count = ParameterCountOf(node->op()); |
| 2194 |
| 2195 Callable const callable = |
| 2196 CodeFactory::NewUnmappedArgumentsElements(isolate()); |
| 2197 Operator::Properties const properties = node->op()->properties(); |
| 2198 CallDescriptor::Flags const flags = CallDescriptor::kNoFlags; |
| 2199 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 2200 isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties); |
| 2201 Node* value = effect = graph()->NewNode( |
| 2202 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), |
| 2203 jsgraph()->IntPtrConstant(formal_parameter_count), |
| 2204 jsgraph()->NoContextConstant(), effect); |
| 2205 return ValueEffectControl(value, effect, control); |
| 2206 } |
| 2207 |
| 2208 EffectControlLinearizer::ValueEffectControl |
2167 EffectControlLinearizer::LowerArrayBufferWasNeutered(Node* node, Node* effect, | 2209 EffectControlLinearizer::LowerArrayBufferWasNeutered(Node* node, Node* effect, |
2168 Node* control) { | 2210 Node* control) { |
2169 Node* value = node->InputAt(0); | 2211 Node* value = node->InputAt(0); |
2170 | 2212 |
2171 Node* value_bit_field = effect = graph()->NewNode( | 2213 Node* value_bit_field = effect = graph()->NewNode( |
2172 simplified()->LoadField(AccessBuilder::ForJSArrayBufferBitField()), value, | 2214 simplified()->LoadField(AccessBuilder::ForJSArrayBufferBitField()), value, |
2173 effect, control); | 2215 effect, control); |
2174 value = graph()->NewNode( | 2216 value = graph()->NewNode( |
2175 machine()->Word32Equal(), | 2217 machine()->Word32Equal(), |
2176 graph()->NewNode(machine()->Word32Equal(), | 2218 graph()->NewNode(machine()->Word32Equal(), |
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3774 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3816 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3775 Operator::kEliminatable); | 3817 Operator::kEliminatable); |
3776 to_number_operator_.set(common()->Call(desc)); | 3818 to_number_operator_.set(common()->Call(desc)); |
3777 } | 3819 } |
3778 return to_number_operator_.get(); | 3820 return to_number_operator_.get(); |
3779 } | 3821 } |
3780 | 3822 |
3781 } // namespace compiler | 3823 } // namespace compiler |
3782 } // namespace internal | 3824 } // namespace internal |
3783 } // namespace v8 | 3825 } // namespace v8 |
OLD | NEW |