| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 3392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3403 StringHelper::GenerateCopyCharacters( | 3403 StringHelper::GenerateCopyCharacters( |
| 3404 masm, a1, t1, a2, a3, String::TWO_BYTE_ENCODING); | 3404 masm, a1, t1, a2, a3, String::TWO_BYTE_ENCODING); |
| 3405 | 3405 |
| 3406 __ bind(&return_v0); | 3406 __ bind(&return_v0); |
| 3407 Counters* counters = isolate()->counters(); | 3407 Counters* counters = isolate()->counters(); |
| 3408 __ IncrementCounter(counters->sub_string_native(), 1, a3, t0); | 3408 __ IncrementCounter(counters->sub_string_native(), 1, a3, t0); |
| 3409 __ DropAndRet(3); | 3409 __ DropAndRet(3); |
| 3410 | 3410 |
| 3411 // Just jump to runtime to create the sub string. | 3411 // Just jump to runtime to create the sub string. |
| 3412 __ bind(&runtime); | 3412 __ bind(&runtime); |
| 3413 __ TailCallRuntime(Runtime::kSubString, 3, 1); | 3413 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); |
| 3414 | 3414 |
| 3415 __ bind(&single_char); | 3415 __ bind(&single_char); |
| 3416 // v0: original string | 3416 // v0: original string |
| 3417 // a1: instance type | 3417 // a1: instance type |
| 3418 // a2: length | 3418 // a2: length |
| 3419 // a3: from index (untagged) | 3419 // a3: from index (untagged) |
| 3420 __ SmiTag(a3, a3); | 3420 __ SmiTag(a3, a3); |
| 3421 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 3421 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
| 3422 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3422 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
| 3423 generator.GenerateFast(masm); | 3423 generator.GenerateFast(masm); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3597 | 3597 |
| 3598 // Check that both objects are sequential one-byte strings. | 3598 // Check that both objects are sequential one-byte strings. |
| 3599 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); | 3599 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); |
| 3600 | 3600 |
| 3601 // Compare flat ASCII strings natively. Remove arguments from stack first. | 3601 // Compare flat ASCII strings natively. Remove arguments from stack first. |
| 3602 __ IncrementCounter(counters->string_compare_native(), 1, a2, a3); | 3602 __ IncrementCounter(counters->string_compare_native(), 1, a2, a3); |
| 3603 __ Addu(sp, sp, Operand(2 * kPointerSize)); | 3603 __ Addu(sp, sp, Operand(2 * kPointerSize)); |
| 3604 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1); | 3604 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1); |
| 3605 | 3605 |
| 3606 __ bind(&runtime); | 3606 __ bind(&runtime); |
| 3607 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3607 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); |
| 3608 } | 3608 } |
| 3609 | 3609 |
| 3610 | 3610 |
| 3611 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3611 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
| 3612 // ----------- S t a t e ------------- | 3612 // ----------- S t a t e ------------- |
| 3613 // -- a1 : left | 3613 // -- a1 : left |
| 3614 // -- a0 : right | 3614 // -- a0 : right |
| 3615 // -- ra : return address | 3615 // -- ra : return address |
| 3616 // ----------------------------------- | 3616 // ----------------------------------- |
| 3617 | 3617 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3907 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, | 3907 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
| 3908 tmp2, tmp3, tmp4); | 3908 tmp2, tmp3, tmp4); |
| 3909 } | 3909 } |
| 3910 | 3910 |
| 3911 // Handle more complex cases in runtime. | 3911 // Handle more complex cases in runtime. |
| 3912 __ bind(&runtime); | 3912 __ bind(&runtime); |
| 3913 __ Push(left, right); | 3913 __ Push(left, right); |
| 3914 if (equality) { | 3914 if (equality) { |
| 3915 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3915 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
| 3916 } else { | 3916 } else { |
| 3917 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3917 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); |
| 3918 } | 3918 } |
| 3919 | 3919 |
| 3920 __ bind(&miss); | 3920 __ bind(&miss); |
| 3921 GenerateMiss(masm); | 3921 GenerateMiss(masm); |
| 3922 } | 3922 } |
| 3923 | 3923 |
| 3924 | 3924 |
| 3925 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 3925 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
| 3926 DCHECK(state() == CompareICState::OBJECT); | 3926 DCHECK(state() == CompareICState::OBJECT); |
| 3927 Label miss; | 3927 Label miss; |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5264 kStackUnwindSpace, kInvalidStackOffset, | 5264 kStackUnwindSpace, kInvalidStackOffset, |
| 5265 MemOperand(fp, 6 * kPointerSize), NULL); | 5265 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5266 } | 5266 } |
| 5267 | 5267 |
| 5268 | 5268 |
| 5269 #undef __ | 5269 #undef __ |
| 5270 | 5270 |
| 5271 } } // namespace v8::internal | 5271 } } // namespace v8::internal |
| 5272 | 5272 |
| 5273 #endif // V8_TARGET_ARCH_MIPS | 5273 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |