Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 22432965482de6498f3e19a0e0a6c107ec9b92f4..4283d1f59bce6c7fde99c391e1f04ad30934e05c 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -3010,7 +3010,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
VisitForAccumulatorValue(args->at(0)); |
- Label materialize_true, materialize_false; |
+ Label materialize_true, materialize_false, skip_lookup; |
Label* if_true = NULL; |
Label* if_false = NULL; |
Label* fall_through = NULL; |
@@ -3022,7 +3022,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
__ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
__ ldrb(ip, FieldMemOperand(r1, Map::kBitField2Offset)); |
__ tst(ip, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
- __ b(ne, if_true); |
+ __ b(ne, &skip_lookup); |
// Check for fast case object. Generate false result for slow case object. |
__ ldr(r2, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
@@ -3068,6 +3068,14 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
__ b(ne, &loop); |
__ bind(&done); |
+ |
+ // Set the bit in the map to indicate that there is no local valueOf field. |
+ __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
+ __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
+ __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); |
+ |
+ __ bind(&skip_lookup); |
+ |
// If a valueOf property is not found on the object check that its |
// prototype is the un-modified String prototype. If not result is false. |
__ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
@@ -3077,11 +3085,9 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
__ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); |
__ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); |
__ cmp(r2, r3); |
- __ b(ne, if_false); |
- |
- __ jmp(if_true); |
- |
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
+ Split(eq, if_true, if_false, fall_through); |
+ |
context()->Plug(if_true, if_false); |
} |