Index: src/x64/codegen-x64.cc |
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc |
index c15b08b91d1574abea26488c2617d8112d35edb4..6467734abe79a8a883b40d259f609b25829e6cd3 100644 |
--- a/src/x64/codegen-x64.cc |
+++ b/src/x64/codegen-x64.cc |
@@ -10922,7 +10922,6 @@ void StringCharCodeAtGenerator::GenerateSlow( |
call_helper.BeforeCall(masm); |
__ push(object_); |
__ push(index_); |
- __ push(result_); |
__ push(index_); // Consumed by runtime conversion function. |
if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
__ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
@@ -10936,9 +10935,11 @@ void StringCharCodeAtGenerator::GenerateSlow( |
// have a chance to overwrite it. |
__ movq(scratch_, rax); |
} |
- __ pop(result_); |
__ pop(index_); |
__ pop(object_); |
+ // Reload the instance type. |
+ __ movq(result_, FieldOperand(object_, HeapObject::kMapOffset)); |
+ __ movzxbl(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); |
call_helper.AfterCall(masm); |
// If index is still not a smi, it must be out of range. |
__ JumpIfNotSmi(scratch_, index_out_of_range_); |