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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 break; | 743 break; |
744 case IrOpcode::kArrayBufferWasNeutered: | 744 case IrOpcode::kArrayBufferWasNeutered: |
745 result = LowerArrayBufferWasNeutered(node); | 745 result = LowerArrayBufferWasNeutered(node); |
746 break; | 746 break; |
747 case IrOpcode::kStringFromCharCode: | 747 case IrOpcode::kStringFromCharCode: |
748 result = LowerStringFromCharCode(node); | 748 result = LowerStringFromCharCode(node); |
749 break; | 749 break; |
750 case IrOpcode::kStringFromCodePoint: | 750 case IrOpcode::kStringFromCodePoint: |
751 result = LowerStringFromCodePoint(node); | 751 result = LowerStringFromCodePoint(node); |
752 break; | 752 break; |
| 753 case IrOpcode::kStringIndexOf: |
| 754 result = LowerStringIndexOf(node); |
| 755 break; |
753 case IrOpcode::kStringCharAt: | 756 case IrOpcode::kStringCharAt: |
754 result = LowerStringCharAt(node); | 757 result = LowerStringCharAt(node); |
755 break; | 758 break; |
756 case IrOpcode::kStringCharCodeAt: | 759 case IrOpcode::kStringCharCodeAt: |
757 result = LowerStringCharCodeAt(node); | 760 result = LowerStringCharCodeAt(node); |
758 break; | 761 break; |
759 case IrOpcode::kStringEqual: | 762 case IrOpcode::kStringEqual: |
760 result = LowerStringEqual(node); | 763 result = LowerStringEqual(node); |
761 break; | 764 break; |
762 case IrOpcode::kStringLessThan: | 765 case IrOpcode::kStringLessThan: |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 vfalse0, | 2052 vfalse0, |
2050 __ IntPtrConstant(SeqTwoByteString::kHeaderSize - kHeapObjectTag), | 2053 __ IntPtrConstant(SeqTwoByteString::kHeaderSize - kHeapObjectTag), |
2051 code); | 2054 code); |
2052 __ Goto(&done, vfalse0); | 2055 __ Goto(&done, vfalse0); |
2053 } | 2056 } |
2054 | 2057 |
2055 __ Bind(&done); | 2058 __ Bind(&done); |
2056 return done.PhiAt(0); | 2059 return done.PhiAt(0); |
2057 } | 2060 } |
2058 | 2061 |
| 2062 Node* EffectControlLinearizer::LowerStringIndexOf(Node* node) { |
| 2063 Node* subject = node->InputAt(0); |
| 2064 Node* search_string = node->InputAt(1); |
| 2065 Node* position = node->InputAt(2); |
| 2066 |
| 2067 Callable callable = CodeFactory::StringIndexOf(isolate()); |
| 2068 Operator::Properties properties = Operator::kEliminatable; |
| 2069 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
| 2070 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 2071 isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties); |
| 2072 return __ Call(desc, __ HeapConstant(callable.code()), subject, search_string, |
| 2073 position, __ NoContextConstant()); |
| 2074 } |
| 2075 |
2059 Node* EffectControlLinearizer::LowerStringComparison(Callable const& callable, | 2076 Node* EffectControlLinearizer::LowerStringComparison(Callable const& callable, |
2060 Node* node) { | 2077 Node* node) { |
2061 Node* lhs = node->InputAt(0); | 2078 Node* lhs = node->InputAt(0); |
2062 Node* rhs = node->InputAt(1); | 2079 Node* rhs = node->InputAt(1); |
2063 | 2080 |
2064 Operator::Properties properties = Operator::kEliminatable; | 2081 Operator::Properties properties = Operator::kEliminatable; |
2065 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 2082 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
2066 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 2083 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
2067 isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties); | 2084 isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties); |
2068 return __ Call(desc, __ HeapConstant(callable.code()), lhs, rhs, | 2085 return __ Call(desc, __ HeapConstant(callable.code()), lhs, rhs, |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2749 return isolate()->factory(); | 2766 return isolate()->factory(); |
2750 } | 2767 } |
2751 | 2768 |
2752 Isolate* EffectControlLinearizer::isolate() const { | 2769 Isolate* EffectControlLinearizer::isolate() const { |
2753 return jsgraph()->isolate(); | 2770 return jsgraph()->isolate(); |
2754 } | 2771 } |
2755 | 2772 |
2756 } // namespace compiler | 2773 } // namespace compiler |
2757 } // namespace internal | 2774 } // namespace internal |
2758 } // namespace v8 | 2775 } // namespace v8 |
OLD | NEW |