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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 break; | 738 break; |
739 case IrOpcode::kArrayBufferWasNeutered: | 739 case IrOpcode::kArrayBufferWasNeutered: |
740 state = LowerArrayBufferWasNeutered(node, *effect, *control); | 740 state = LowerArrayBufferWasNeutered(node, *effect, *control); |
741 break; | 741 break; |
742 case IrOpcode::kStringFromCharCode: | 742 case IrOpcode::kStringFromCharCode: |
743 state = LowerStringFromCharCode(node, *effect, *control); | 743 state = LowerStringFromCharCode(node, *effect, *control); |
744 break; | 744 break; |
745 case IrOpcode::kStringFromCodePoint: | 745 case IrOpcode::kStringFromCodePoint: |
746 state = LowerStringFromCodePoint(node, *effect, *control); | 746 state = LowerStringFromCodePoint(node, *effect, *control); |
747 break; | 747 break; |
| 748 case IrOpcode::kStringCharAt: |
| 749 state = LowerStringCharAt(node, *effect, *control); |
| 750 break; |
748 case IrOpcode::kStringCharCodeAt: | 751 case IrOpcode::kStringCharCodeAt: |
749 state = LowerStringCharCodeAt(node, *effect, *control); | 752 state = LowerStringCharCodeAt(node, *effect, *control); |
750 break; | 753 break; |
751 case IrOpcode::kStringEqual: | 754 case IrOpcode::kStringEqual: |
752 state = LowerStringEqual(node, *effect, *control); | 755 state = LowerStringEqual(node, *effect, *control); |
753 break; | 756 break; |
754 case IrOpcode::kStringLessThan: | 757 case IrOpcode::kStringLessThan: |
755 state = LowerStringLessThan(node, *effect, *control); | 758 state = LowerStringLessThan(node, *effect, *control); |
756 break; | 759 break; |
757 case IrOpcode::kStringLessThanOrEqual: | 760 case IrOpcode::kStringLessThanOrEqual: |
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2219 graph()->NewNode(machine()->Word32And(), value_bit_field, | 2222 graph()->NewNode(machine()->Word32And(), value_bit_field, |
2220 jsgraph()->Int32Constant( | 2223 jsgraph()->Int32Constant( |
2221 JSArrayBuffer::WasNeutered::kMask)), | 2224 JSArrayBuffer::WasNeutered::kMask)), |
2222 jsgraph()->Int32Constant(0)), | 2225 jsgraph()->Int32Constant(0)), |
2223 jsgraph()->Int32Constant(0)); | 2226 jsgraph()->Int32Constant(0)); |
2224 | 2227 |
2225 return ValueEffectControl(value, effect, control); | 2228 return ValueEffectControl(value, effect, control); |
2226 } | 2229 } |
2227 | 2230 |
2228 EffectControlLinearizer::ValueEffectControl | 2231 EffectControlLinearizer::ValueEffectControl |
| 2232 EffectControlLinearizer::LowerStringCharAt(Node* node, Node* effect, |
| 2233 Node* control) { |
| 2234 Callable const callable = CodeFactory::StringCharAt(isolate()); |
| 2235 Operator::Properties properties = Operator::kNoThrow | Operator::kNoWrite; |
| 2236 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
| 2237 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 2238 isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties); |
| 2239 node->InsertInput(graph()->zone(), 0, |
| 2240 jsgraph()->HeapConstant(callable.code())); |
| 2241 node->InsertInput(graph()->zone(), 3, jsgraph()->NoContextConstant()); |
| 2242 node->InsertInput(graph()->zone(), 4, effect); |
| 2243 NodeProperties::ChangeOp(node, common()->Call(desc)); |
| 2244 return ValueEffectControl(node, node, control); |
| 2245 } |
| 2246 |
| 2247 EffectControlLinearizer::ValueEffectControl |
2229 EffectControlLinearizer::LowerStringCharCodeAt(Node* node, Node* effect, | 2248 EffectControlLinearizer::LowerStringCharCodeAt(Node* node, Node* effect, |
2230 Node* control) { | 2249 Node* control) { |
2231 Node* subject = node->InputAt(0); | 2250 Node* subject = node->InputAt(0); |
2232 Node* index = node->InputAt(1); | 2251 Node* index = node->InputAt(1); |
2233 | 2252 |
2234 // We may need to loop several times for ConsString/SlicedString {subject}s. | 2253 // We may need to loop several times for ConsString/SlicedString {subject}s. |
2235 Node* loop = | 2254 Node* loop = |
2236 graph()->NewNode(common()->Loop(4), control, control, control, control); | 2255 graph()->NewNode(common()->Loop(4), control, control, control, control); |
2237 Node* lsubject = | 2256 Node* lsubject = |
2238 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 4), | 2257 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 4), |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3816 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3835 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3817 Operator::kEliminatable); | 3836 Operator::kEliminatable); |
3818 to_number_operator_.set(common()->Call(desc)); | 3837 to_number_operator_.set(common()->Call(desc)); |
3819 } | 3838 } |
3820 return to_number_operator_.get(); | 3839 return to_number_operator_.get(); |
3821 } | 3840 } |
3822 | 3841 |
3823 } // namespace compiler | 3842 } // namespace compiler |
3824 } // namespace internal | 3843 } // namespace internal |
3825 } // namespace v8 | 3844 } // namespace v8 |
OLD | NEW |