Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 7996779a107fc9b00d84d5c4446889bdbbd76d8b..cb7d15fce15d527996610a9c7afd541f7f6b88b7 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -3319,38 +3319,37 @@ void StringHelper::GenerateOneByteCharsCompareLoop( |
void StringCompareStub::Generate(MacroAssembler* masm) { |
- Label runtime; |
- |
- Counters* counters = isolate()->counters(); |
- |
- // Stack frame on entry. |
- // sp[0]: right string |
- // sp[4]: left string |
- __ Ldrd(r0 , r1, MemOperand(sp)); // Load right in r0, left in r1. |
+ // ----------- S t a t e ------------- |
+ // -- r1 : left |
+ // -- r0 : right |
+ // -- lr : return address |
+ // ----------------------------------- |
+ __ AssertString(r1); |
+ __ AssertString(r0); |
Label not_same; |
__ cmp(r0, r1); |
__ b(ne, ¬_same); |
- STATIC_ASSERT(EQUAL == 0); |
- STATIC_ASSERT(kSmiTag == 0); |
__ mov(r0, Operand(Smi::FromInt(EQUAL))); |
- __ IncrementCounter(counters->string_compare_native(), 1, r1, r2); |
- __ add(sp, sp, Operand(2 * kPointerSize)); |
+ __ IncrementCounter(isolate()->counters()->string_compare_native(), 1, r1, |
+ r2); |
__ Ret(); |
__ bind(¬_same); |
// Check that both objects are sequential one-byte strings. |
+ Label runtime; |
__ JumpIfNotBothSequentialOneByteStrings(r1, r0, r2, r3, &runtime); |
- // Compare flat one-byte strings natively. Remove arguments from stack first. |
- __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); |
- __ add(sp, sp, Operand(2 * kPointerSize)); |
+ // Compare flat one-byte strings natively. |
+ __ IncrementCounter(isolate()->counters()->string_compare_native(), 1, r2, |
+ r3); |
StringHelper::GenerateCompareFlatOneByteStrings(masm, r1, r0, r2, r3, r4, r5); |
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
// tagged as a small integer. |
__ bind(&runtime); |
+ __ Push(r1, r0); |
__ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
} |