Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index b7ddeac0e428d2846aec3e5573cf90ac7a3ff5d2..f3ac9c5cbafebc73ed2d57a583930d749559fcb2 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -3671,11 +3671,20 @@ 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(edx); |
+ 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(eax); |
} |