__ ldr(r0, MemOperand(sp, 0));
- // Check if the object is a string.
+ // Check if the object is a string leaving the instance type in the
+ // r1 register.
GenerateStringCheck(masm, r0, r1, r3, &miss, &check_wrapper);
// Load length directly from the string.
// Check if the object is a JSValue wrapper.
__ bind(&check_wrapper);
- __ cmp(r0, Operand(JS_VALUE_TYPE));
+ __ cmp(r1, Operand(JS_VALUE_TYPE));
__ b(ne, &miss);
// Check if the wrapped value is a string and load the length
Label* miss) {
Label load_length, check_wrapper;
- // Check if the object is a string.
+ // Check if the object is a string leaving the instance type in the
+ // scratch register.
GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper);
// Load length directly from the string.
// Check if the object is a JSValue wrapper.
__ bind(&check_wrapper);
- __ cmp(receiver, JS_VALUE_TYPE);
+ __ cmp(scratch, JS_VALUE_TYPE);
__ j(not_equal, miss, not_taken);
// Check if the wrapped value is a string and load the length