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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 3228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3239 masm, r1, r5, r2, r3, String::TWO_BYTE_ENCODING); | 3239 masm, r1, r5, r2, r3, String::TWO_BYTE_ENCODING); |
3240 | 3240 |
3241 __ bind(&return_r0); | 3241 __ bind(&return_r0); |
3242 Counters* counters = isolate()->counters(); | 3242 Counters* counters = isolate()->counters(); |
3243 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); | 3243 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); |
3244 __ Drop(3); | 3244 __ Drop(3); |
3245 __ Ret(); | 3245 __ Ret(); |
3246 | 3246 |
3247 // Just jump to runtime to create the sub string. | 3247 // Just jump to runtime to create the sub string. |
3248 __ bind(&runtime); | 3248 __ bind(&runtime); |
3249 __ TailCallRuntime(Runtime::kSubString, 3, 1); | 3249 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); |
3250 | 3250 |
3251 __ bind(&single_char); | 3251 __ bind(&single_char); |
3252 // r0: original string | 3252 // r0: original string |
3253 // r1: instance type | 3253 // r1: instance type |
3254 // r2: length | 3254 // r2: length |
3255 // r3: from index (untagged) | 3255 // r3: from index (untagged) |
3256 __ SmiTag(r3, r3); | 3256 __ SmiTag(r3, r3); |
3257 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, | 3257 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, |
3258 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3258 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
3259 generator.GenerateFast(masm); | 3259 generator.GenerateFast(masm); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3426 __ JumpIfNotBothSequentialOneByteStrings(r1, r0, r2, r3, &runtime); | 3426 __ JumpIfNotBothSequentialOneByteStrings(r1, r0, r2, r3, &runtime); |
3427 | 3427 |
3428 // Compare flat one-byte strings natively. Remove arguments from stack first. | 3428 // Compare flat one-byte strings natively. Remove arguments from stack first. |
3429 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); | 3429 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); |
3430 __ add(sp, sp, Operand(2 * kPointerSize)); | 3430 __ add(sp, sp, Operand(2 * kPointerSize)); |
3431 StringHelper::GenerateCompareFlatOneByteStrings(masm, r1, r0, r2, r3, r4, r5); | 3431 StringHelper::GenerateCompareFlatOneByteStrings(masm, r1, r0, r2, r3, r4, r5); |
3432 | 3432 |
3433 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 3433 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
3434 // tagged as a small integer. | 3434 // tagged as a small integer. |
3435 __ bind(&runtime); | 3435 __ bind(&runtime); |
3436 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3436 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); |
3437 } | 3437 } |
3438 | 3438 |
3439 | 3439 |
3440 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3440 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
3441 // ----------- S t a t e ------------- | 3441 // ----------- S t a t e ------------- |
3442 // -- r1 : left | 3442 // -- r1 : left |
3443 // -- r0 : right | 3443 // -- r0 : right |
3444 // -- lr : return address | 3444 // -- lr : return address |
3445 // ----------------------------------- | 3445 // ----------------------------------- |
3446 | 3446 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3707 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, | 3707 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
3708 tmp2, tmp3, tmp4); | 3708 tmp2, tmp3, tmp4); |
3709 } | 3709 } |
3710 | 3710 |
3711 // Handle more complex cases in runtime. | 3711 // Handle more complex cases in runtime. |
3712 __ bind(&runtime); | 3712 __ bind(&runtime); |
3713 __ Push(left, right); | 3713 __ Push(left, right); |
3714 if (equality) { | 3714 if (equality) { |
3715 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3715 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
3716 } else { | 3716 } else { |
3717 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3717 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); |
3718 } | 3718 } |
3719 | 3719 |
3720 __ bind(&miss); | 3720 __ bind(&miss); |
3721 GenerateMiss(masm); | 3721 GenerateMiss(masm); |
3722 } | 3722 } |
3723 | 3723 |
3724 | 3724 |
3725 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 3725 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
3726 DCHECK(state() == CompareICState::OBJECT); | 3726 DCHECK(state() == CompareICState::OBJECT); |
3727 Label miss; | 3727 Label miss; |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5050 kStackUnwindSpace, NULL, | 5050 kStackUnwindSpace, NULL, |
5051 MemOperand(fp, 6 * kPointerSize), NULL); | 5051 MemOperand(fp, 6 * kPointerSize), NULL); |
5052 } | 5052 } |
5053 | 5053 |
5054 | 5054 |
5055 #undef __ | 5055 #undef __ |
5056 | 5056 |
5057 } } // namespace v8::internal | 5057 } } // namespace v8::internal |
5058 | 5058 |
5059 #endif // V8_TARGET_ARCH_ARM | 5059 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |