Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 8cdf6b995beeb0d55d70e113a846e12bccf93dfa..a02f942702b3e60b18108928a4a7505de372fca0 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -810,20 +810,10 @@ void ICCompareStub::GenerateGeneric(MacroAssembler* masm) { |
__ IncrementCounter(isolate()->counters()->string_compare_native(), 1, r2, |
r3); |
if (cc == eq) { |
- StringCompareStub::GenerateFlatAsciiStringEquals(masm, |
- lhs, |
- rhs, |
- r2, |
- r3, |
- r4); |
+ StringHelper::GenerateFlatAsciiStringEquals(masm, lhs, rhs, r2, r3, r4); |
} else { |
- StringCompareStub::GenerateCompareFlatAsciiStrings(masm, |
- lhs, |
- rhs, |
- r2, |
- r3, |
- r4, |
- r5); |
+ StringHelper::GenerateCompareFlatAsciiStrings(masm, lhs, rhs, r2, r3, r4, |
+ r5); |
} |
// Never falls through to here. |
@@ -864,7 +854,7 @@ void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
const Register scratch = r1; |
- if (save_doubles_ == kSaveFPRegs) { |
+ if (save_doubles()) { |
mvstanton
2014/09/02 12:38:35
This is a nice thing to do.
|
__ SaveFPRegs(sp, scratch); |
} |
const int argument_count = 1; |
@@ -876,7 +866,7 @@ void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
__ CallCFunction( |
ExternalReference::store_buffer_overflow_function(isolate()), |
argument_count); |
- if (save_doubles_ == kSaveFPRegs) { |
+ if (save_doubles()) { |
__ RestoreFPRegs(sp, scratch); |
} |
__ ldm(ia_w, sp, kCallerSaved | pc.bit()); // Also pop pc to get Ret(0). |
@@ -3295,12 +3285,11 @@ void SubStringStub::Generate(MacroAssembler* masm) { |
} |
-void StringCompareStub::GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
- Register left, |
- Register right, |
- Register scratch1, |
- Register scratch2, |
- Register scratch3) { |
+void StringHelper::GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
+ Register left, Register right, |
+ Register scratch1, |
+ Register scratch2, |
+ Register scratch3) { |
Register length = scratch1; |
// Compare lengths. |
@@ -3334,13 +3323,9 @@ void StringCompareStub::GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
} |
-void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
- Register left, |
- Register right, |
- Register scratch1, |
- Register scratch2, |
- Register scratch3, |
- Register scratch4) { |
+void StringHelper::GenerateCompareFlatAsciiStrings( |
+ MacroAssembler* masm, Register left, Register right, Register scratch1, |
+ Register scratch2, Register scratch3, Register scratch4) { |
Label result_not_equal, compare_lengths; |
// Find minimum length and length difference. |
__ ldr(scratch1, FieldMemOperand(left, String::kLengthOffset)); |
@@ -3372,14 +3357,9 @@ void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
} |
-void StringCompareStub::GenerateAsciiCharsCompareLoop( |
- MacroAssembler* masm, |
- Register left, |
- Register right, |
- Register length, |
- Register scratch1, |
- Register scratch2, |
- Label* chars_not_equal) { |
+void StringHelper::GenerateAsciiCharsCompareLoop( |
+ MacroAssembler* masm, Register left, Register right, Register length, |
+ Register scratch1, Register scratch2, Label* chars_not_equal) { |
// Change index to run from -length to -1 by adding length to string |
// start. This means that loop ends when index reaches zero, which |
// doesn't need an additional compare. |
@@ -3431,7 +3411,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) { |
// Compare flat ASCII strings natively. Remove arguments from stack first. |
__ IncrementCounter(counters->string_compare_native(), 1, r2, r3); |
__ add(sp, sp, Operand(2 * kPointerSize)); |
- GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5); |
+ StringHelper::GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5); |
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
// tagged as a small integer. |
@@ -3704,11 +3684,11 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) { |
// Compare flat ASCII strings. Returns when done. |
if (equality) { |
- StringCompareStub::GenerateFlatAsciiStringEquals( |
- masm, left, right, tmp1, tmp2, tmp3); |
+ StringHelper::GenerateFlatAsciiStringEquals(masm, left, right, tmp1, tmp2, |
+ tmp3); |
} else { |
- StringCompareStub::GenerateCompareFlatAsciiStrings( |
- masm, left, right, tmp1, tmp2, tmp3, tmp4); |
+ StringHelper::GenerateCompareFlatAsciiStrings(masm, left, right, tmp1, tmp2, |
+ tmp3, tmp4); |
} |
// Handle more complex cases in runtime. |