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/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/graph-inl.h" | 8 #include "src/compiler/graph-inl.h" |
9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
10 #include "src/compiler/representation-change.h" | 10 #include "src/compiler/representation-change.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 // TODO(titzer): lower StringLessThan to stub/runtime call. | 500 // TODO(titzer): lower StringLessThan to stub/runtime call. |
501 break; | 501 break; |
502 } | 502 } |
503 case IrOpcode::kStringLessThanOrEqual: { | 503 case IrOpcode::kStringLessThanOrEqual: { |
504 VisitBinop(node, kMachAnyTagged, kRepBit); | 504 VisitBinop(node, kMachAnyTagged, kRepBit); |
505 // TODO(titzer): lower StringLessThanOrEqual to stub/runtime call. | 505 // TODO(titzer): lower StringLessThanOrEqual to stub/runtime call. |
506 break; | 506 break; |
507 } | 507 } |
508 case IrOpcode::kStringAdd: { | 508 case IrOpcode::kStringAdd: { |
509 VisitBinop(node, kMachAnyTagged, kMachAnyTagged); | 509 VisitBinop(node, kMachAnyTagged, kMachAnyTagged); |
510 // TODO(titzer): lower StringAdd to stub/runtime call. | 510 if (lower()) lowering->DoStringAdd(node); |
511 break; | 511 break; |
512 } | 512 } |
513 case IrOpcode::kLoadField: { | 513 case IrOpcode::kLoadField: { |
514 FieldAccess access = FieldAccessOf(node->op()); | 514 FieldAccess access = FieldAccessOf(node->op()); |
515 ProcessInput(node, 0, changer_->TypeForBasePointer(access)); | 515 ProcessInput(node, 0, changer_->TypeForBasePointer(access)); |
516 SetOutput(node, access.machine_type); | 516 SetOutput(node, access.machine_type); |
517 if (lower()) lowering->DoLoadField(node); | 517 if (lower()) lowering->DoLoadField(node); |
518 break; | 518 break; |
519 } | 519 } |
520 case IrOpcode::kStoreField: { | 520 case IrOpcode::kStoreField: { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 800 |
801 void SimplifiedLowering::DoStoreElement(Node* node) { | 801 void SimplifiedLowering::DoStoreElement(Node* node) { |
802 const ElementAccess& access = ElementAccessOf(node->op()); | 802 const ElementAccess& access = ElementAccessOf(node->op()); |
803 WriteBarrierKind kind = ComputeWriteBarrierKind( | 803 WriteBarrierKind kind = ComputeWriteBarrierKind( |
804 access.base_is_tagged, access.machine_type, access.type); | 804 access.base_is_tagged, access.machine_type, access.type); |
805 node->set_op(machine_.Store(access.machine_type, kind)); | 805 node->set_op(machine_.Store(access.machine_type, kind)); |
806 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1))); | 806 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1))); |
807 } | 807 } |
808 | 808 |
809 | 809 |
| 810 void SimplifiedLowering::DoStringAdd(Node* node) { |
| 811 StringAddStub stub(zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED); |
| 812 CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor(); |
| 813 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
| 814 CallDescriptor* desc = Linkage::GetStubCallDescriptor(d, 0, flags, zone()); |
| 815 node->set_op(jsgraph()->common()->Call(desc)); |
| 816 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(stub.GetCode())); |
| 817 node->AppendInput(zone(), jsgraph()->UndefinedConstant()); |
| 818 node->AppendInput(zone(), graph()->start()); |
| 819 node->AppendInput(zone(), graph()->start()); |
| 820 } |
| 821 |
| 822 |
810 } // namespace compiler | 823 } // namespace compiler |
811 } // namespace internal | 824 } // namespace internal |
812 } // namespace v8 | 825 } // namespace v8 |
OLD | NEW |