OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" |
8 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/graph-inl.h" | 10 #include "src/compiler/graph-inl.h" |
10 #include "src/compiler/node-properties-inl.h" | 11 #include "src/compiler/node-properties-inl.h" |
11 #include "src/compiler/representation-change.h" | 12 #include "src/compiler/representation-change.h" |
12 #include "src/compiler/simplified-lowering.h" | 13 #include "src/compiler/simplified-lowering.h" |
13 #include "src/compiler/simplified-operator.h" | 14 #include "src/compiler/simplified-operator.h" |
14 #include "src/objects.h" | 15 #include "src/objects.h" |
15 | 16 |
16 namespace v8 { | 17 namespace v8 { |
17 namespace internal { | 18 namespace internal { |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 void SimplifiedLowering::DoStoreElement(Node* node) { | 845 void SimplifiedLowering::DoStoreElement(Node* node) { |
845 const ElementAccess& access = ElementAccessOf(node->op()); | 846 const ElementAccess& access = ElementAccessOf(node->op()); |
846 WriteBarrierKind kind = ComputeWriteBarrierKind( | 847 WriteBarrierKind kind = ComputeWriteBarrierKind( |
847 access.base_is_tagged, access.machine_type, access.type); | 848 access.base_is_tagged, access.machine_type, access.type); |
848 node->set_op(machine_.Store(access.machine_type, kind)); | 849 node->set_op(machine_.Store(access.machine_type, kind)); |
849 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1))); | 850 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1))); |
850 } | 851 } |
851 | 852 |
852 | 853 |
853 void SimplifiedLowering::DoStringAdd(Node* node) { | 854 void SimplifiedLowering::DoStringAdd(Node* node) { |
854 StringAddStub stub(zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED); | 855 Callable callable = CodeFactory::StringAdd( |
855 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor(); | 856 zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED); |
856 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 857 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
857 CallDescriptor* desc = Linkage::GetStubCallDescriptor(d, 0, flags, zone()); | 858 CallDescriptor* desc = |
| 859 Linkage::GetStubCallDescriptor(callable.descriptor(), 0, flags, zone()); |
858 node->set_op(common()->Call(desc)); | 860 node->set_op(common()->Call(desc)); |
859 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(stub.GetCode())); | 861 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(callable.code())); |
860 node->AppendInput(zone(), jsgraph()->UndefinedConstant()); | 862 node->AppendInput(zone(), jsgraph()->UndefinedConstant()); |
861 node->AppendInput(zone(), graph()->start()); | 863 node->AppendInput(zone(), graph()->start()); |
862 node->AppendInput(zone(), graph()->start()); | 864 node->AppendInput(zone(), graph()->start()); |
863 } | 865 } |
864 | 866 |
865 | 867 |
866 Node* SimplifiedLowering::StringComparison(Node* node, bool requires_ordering) { | 868 Node* SimplifiedLowering::StringComparison(Node* node, bool requires_ordering) { |
867 CEntryStub stub(zone()->isolate(), 1); | 869 CEntryStub stub(zone()->isolate(), 1); |
868 Runtime::FunctionId f = | 870 Runtime::FunctionId f = |
869 requires_ordering ? Runtime::kStringCompare : Runtime::kStringEquals; | 871 requires_ordering ? Runtime::kStringCompare : Runtime::kStringEquals; |
(...skipping 29 matching lines...) Expand all Loading... |
899 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 901 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
900 node->set_op(machine()->IntLessThanOrEqual()); | 902 node->set_op(machine()->IntLessThanOrEqual()); |
901 node->ReplaceInput(0, StringComparison(node, true)); | 903 node->ReplaceInput(0, StringComparison(node, true)); |
902 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 904 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
903 } | 905 } |
904 | 906 |
905 | 907 |
906 } // namespace compiler | 908 } // namespace compiler |
907 } // namespace internal | 909 } // namespace internal |
908 } // namespace v8 | 910 } // namespace v8 |
OLD | NEW |