Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 8ec05910a53ba541b50f494210625966e60632d4..3a1d1282a6bc65d5fc0a77d648d9a4be2c2491e4 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -5790,6 +5790,7 @@ void StringAddStub::GenerateConvertArgument(MacroAssembler* masm, |
__ b(lt, &done); |
// Check the number to string cache. |
+ Label not_cached; |
__ bind(¬_string); |
// Puts the cached result into scratch1. |
NumberToStringStub::GenerateLookupNumberStringCache(masm, |
@@ -5798,9 +5799,26 @@ void StringAddStub::GenerateConvertArgument(MacroAssembler* masm, |
scratch2, |
scratch3, |
scratch4, |
- slow); |
+ ¬_cached); |
__ mov(arg, scratch1); |
__ str(arg, MemOperand(sp, stack_offset)); |
+ __ jmp(&done); |
+ |
+ // Check if the argument is a safe string wrapper. |
+ __ bind(¬_cached); |
+ __ JumpIfSmi(arg, slow); |
+ __ CompareObjectType( |
+ arg, scratch1, scratch2, JS_VALUE_TYPE); // map -> scratch1. |
+ __ b(ne, slow); |
+ __ ldrb(scratch2, FieldMemOperand(scratch1, Map::kBitField2Offset)); |
+ __ and_(scratch2, |
+ scratch2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
+ __ cmp(scratch2, |
+ Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
+ __ b(ne, slow); |
+ __ ldr(arg, FieldMemOperand(arg, JSValue::kValueOffset)); |
+ __ str(arg, MemOperand(sp, stack_offset)); |
+ |
__ bind(&done); |
} |