Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index 9ccd4ed5ef7d303c156898c6aa138f952e3719ff..0d2be7eff85103731e3beabbccea190a6b7b756b 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -507,7 +507,7 @@ class RepresentationSelector { |
} |
case IrOpcode::kStringAdd: { |
VisitBinop(node, kMachAnyTagged, kMachAnyTagged); |
- // TODO(titzer): lower StringAdd to stub/runtime call. |
+ if (lower()) lowering->DoStringAdd(node); |
break; |
} |
case IrOpcode::kLoadField: { |
@@ -807,6 +807,19 @@ void SimplifiedLowering::DoStoreElement(Node* node) { |
} |
+void SimplifiedLowering::DoStringAdd(Node* node) { |
+ StringAddStub stub(zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED); |
+ CodeStubInterfaceDescriptor* d = stub.GetInterfaceDescriptor(); |
+ CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor(d, 0, flags, zone()); |
+ node->set_op(jsgraph()->common()->Call(desc)); |
+ node->InsertInput(zone(), 0, jsgraph()->HeapConstant(stub.GetCode())); |
+ node->AppendInput(zone(), jsgraph()->UndefinedConstant()); |
+ node->AppendInput(zone(), graph()->start()); |
+ node->AppendInput(zone(), graph()->start()); |
+} |
+ |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |