Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 8b36f9ee5c417e78fcb148ceef755b6cd24e78c8..a78f8b11b424bd2da551354c58aae1a61367116a 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -327,7 +327,8 @@ void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, |
GenerateStringCheck(masm, receiver, scratch1, miss, &check_wrapper); |
// Load length directly from the string. |
- __ movq(rax, FieldOperand(receiver, String::kLengthOffset)); |
+ __ movl(rax, FieldOperand(receiver, String::kLengthOffset)); |
+ __ Integer32ToSmi(rax, rax); |
__ ret(0); |
// Check if the object is a JSValue wrapper. |
@@ -339,7 +340,8 @@ void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, |
// directly if it is. |
__ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset)); |
GenerateStringCheck(masm, scratch2, scratch1, miss, miss); |
- __ movq(rax, FieldOperand(scratch2, String::kLengthOffset)); |
+ __ movl(rax, FieldOperand(scratch2, String::kLengthOffset)); |
+ __ Integer32ToSmi(rax, rax); |
__ ret(0); |
} |