Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 86d1a05f17e042e03d6926a11aa68c5e099cd838..f41748518a988ad9a364e7a9552fa45dac7b4474 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10995,9 +10995,11 @@ |
left = BuildNumberToString(left, left_type); |
} else if (!left_type->Is(Type::String())) { |
DCHECK(right_type->Is(Type::String())); |
- return AddUncasted<HStringAdd>( |
- left, right, allocation_mode.GetPretenureMode(), |
- STRING_ADD_CONVERT_LEFT, allocation_mode.feedback_site()); |
+ // TODO(bmeurer): We might want to optimize this, because we already |
+ // know that the right hand side is a string. |
+ Add<HPushArguments>(left, right); |
+ return AddUncasted<HCallRuntime>(Runtime::FunctionForId(Runtime::kAdd), |
+ 2); |
} |
// Convert right argument as necessary. |
@@ -11006,9 +11008,11 @@ |
right = BuildNumberToString(right, right_type); |
} else if (!right_type->Is(Type::String())) { |
DCHECK(left_type->Is(Type::String())); |
- return AddUncasted<HStringAdd>( |
- left, right, allocation_mode.GetPretenureMode(), |
- STRING_ADD_CONVERT_RIGHT, allocation_mode.feedback_site()); |
+ // TODO(bmeurer): We might want to optimize this, because we already |
+ // know that the left hand side is a string. |
+ Add<HPushArguments>(left, right); |
+ return AddUncasted<HCallRuntime>(Runtime::FunctionForId(Runtime::kAdd), |
+ 2); |
} |
} |
@@ -11025,7 +11029,7 @@ |
if (!right_string.is_null() && right_string->length() == 0) return left; |
if (!left_string.is_null() && !right_string.is_null()) { |
return AddUncasted<HStringAdd>( |
- left, right, allocation_mode.GetPretenureMode(), |
+ left, right, strength, allocation_mode.GetPretenureMode(), |
STRING_ADD_CHECK_NONE, allocation_mode.feedback_site()); |
} |
@@ -11054,8 +11058,8 @@ |
// Fallback to using the string add stub. |
return AddUncasted<HStringAdd>( |
- left, right, allocation_mode.GetPretenureMode(), STRING_ADD_CHECK_NONE, |
- allocation_mode.feedback_site()); |
+ left, right, strength, allocation_mode.GetPretenureMode(), |
+ STRING_ADD_CHECK_NONE, allocation_mode.feedback_site()); |
} |
if (graph()->info()->IsStub()) { |
@@ -12468,7 +12472,8 @@ |
CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
HValue* right = Pop(); |
HValue* left = Pop(); |
- HInstruction* result = NewUncasted<HStringAdd>(left, right); |
+ HInstruction* result = |
+ NewUncasted<HStringAdd>(left, right, strength(function_language_mode())); |
return ast_context()->ReturnInstruction(result, call->id()); |
} |