Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 7dd828136b22afaa5f255977d07618d77f9dc3d5..bf61f75c4bb8cba259054674ba7c33e8f6575f4c 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -5473,16 +5473,32 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
// Compare lengths (precomputed). |
__ bind(&compare_lengths); |
__ SmiTest(length_difference); |
+#ifndef ENABLE_LATIN_1 |
__ j(not_zero, &result_not_equal, Label::kNear); |
+#else |
+ Label length_not_equal; |
+ __ j(not_zero, &length_not_equal, Label::kNear); |
+#endif |
// Result is EQUAL. |
__ Move(rax, Smi::FromInt(EQUAL)); |
__ ret(0); |
Label result_greater; |
+#ifdef ENABLE_LATIN_1 |
+ Label result_less; |
+ __ bind(&length_not_equal); |
+ __ j(greater, &result_greater, Label::kNear); |
+ __ jmp(&result_less, Label::kNear); |
+#endif |
__ bind(&result_not_equal); |
// Unequal comparison of left to right, either character or length. |
+#ifndef ENABLE_LATIN_1 |
__ j(greater, &result_greater, Label::kNear); |
+#else |
+ __ j(above, &result_greater, Label::kNear); |
+ __ bind(&result_less); |
+#endif |
// Result is LESS. |
__ Move(rax, Smi::FromInt(LESS)); |