Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: src/compiler/simplified-lowering.cc

Issue 530973002: Lower simplified StringAdd to stub call. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698