Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index caa7352eae8bb60b771e6c475ecb2727d568f8b7..5ee6bdfe27bcaa44adee4bbd700906e1ca8ba0de 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -3740,11 +3740,20 @@ void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { |
void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
ASSERT_EQ(2, args->length()); |
- VisitForStackValue(args->at(0)); |
- VisitForStackValue(args->at(1)); |
+ if (FLAG_new_string_add) { |
+ VisitForStackValue(args->at(0)); |
+ VisitForAccumulatorValue(args->at(1)); |
- StringAddStub stub(STRING_ADD_CHECK_BOTH); |
- __ CallStub(&stub); |
+ __ pop(a1); |
+ NewStringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED); |
+ __ CallStub(&stub); |
+ } else { |
+ VisitForStackValue(args->at(0)); |
+ VisitForStackValue(args->at(1)); |
+ |
+ StringAddStub stub(STRING_ADD_CHECK_BOTH); |
+ __ CallStub(&stub); |
+ } |
context()->Plug(v0); |
} |