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 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 // Read the argument from the adaptor frame and return it. | 1590 // Read the argument from the adaptor frame and return it. |
1591 __ sub(r3, r0, r1); | 1591 __ sub(r3, r0, r1); |
1592 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r3)); | 1592 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r3)); |
1593 __ ldr(r0, MemOperand(r3, kDisplacement)); | 1593 __ ldr(r0, MemOperand(r3, kDisplacement)); |
1594 __ Jump(lr); | 1594 __ Jump(lr); |
1595 | 1595 |
1596 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 1596 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
1597 // by calling the runtime system. | 1597 // by calling the runtime system. |
1598 __ bind(&slow); | 1598 __ bind(&slow); |
1599 __ push(r1); | 1599 __ push(r1); |
1600 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1600 __ TailCallRuntime(Runtime::kArguments, 1, 1); |
1601 } | 1601 } |
1602 | 1602 |
1603 | 1603 |
1604 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1604 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
1605 // sp[0] : number of parameters | 1605 // sp[0] : number of parameters |
1606 // sp[4] : receiver displacement | 1606 // sp[4] : receiver displacement |
1607 // sp[8] : function | 1607 // sp[8] : function |
1608 | 1608 |
1609 // Check if the calling frame is an arguments adaptor frame. | 1609 // Check if the calling frame is an arguments adaptor frame. |
1610 Label runtime; | 1610 Label runtime; |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3305 masm, r1, r5, r2, r3, String::TWO_BYTE_ENCODING); | 3305 masm, r1, r5, r2, r3, String::TWO_BYTE_ENCODING); |
3306 | 3306 |
3307 __ bind(&return_r0); | 3307 __ bind(&return_r0); |
3308 Counters* counters = isolate()->counters(); | 3308 Counters* counters = isolate()->counters(); |
3309 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); | 3309 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); |
3310 __ Drop(3); | 3310 __ Drop(3); |
3311 __ Ret(); | 3311 __ Ret(); |
3312 | 3312 |
3313 // Just jump to runtime to create the sub string. | 3313 // Just jump to runtime to create the sub string. |
3314 __ bind(&runtime); | 3314 __ bind(&runtime); |
3315 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); | 3315 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
3316 | 3316 |
3317 __ bind(&single_char); | 3317 __ bind(&single_char); |
3318 // r0: original string | 3318 // r0: original string |
3319 // r1: instance type | 3319 // r1: instance type |
3320 // r2: length | 3320 // r2: length |
3321 // r3: from index (untagged) | 3321 // r3: from index (untagged) |
3322 __ SmiTag(r3, r3); | 3322 __ SmiTag(r3, r3); |
3323 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, | 3323 StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, |
3324 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3324 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
3325 generator.GenerateFast(masm); | 3325 generator.GenerateFast(masm); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3492 __ JumpIfNotBothSequentialOneByteStrings(r1, r0, r2, r3, &runtime); | 3492 __ JumpIfNotBothSequentialOneByteStrings(r1, r0, r2, r3, &runtime); |
3493 | 3493 |
3494 // Compare flat one-byte strings natively. Remove arguments from stack first. | 3494 // Compare flat one-byte strings natively. Remove arguments from stack first. |
3495 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); | 3495 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); |
3496 __ add(sp, sp, Operand(2 * kPointerSize)); | 3496 __ add(sp, sp, Operand(2 * kPointerSize)); |
3497 StringHelper::GenerateCompareFlatOneByteStrings(masm, r1, r0, r2, r3, r4, r5); | 3497 StringHelper::GenerateCompareFlatOneByteStrings(masm, r1, r0, r2, r3, r4, r5); |
3498 | 3498 |
3499 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 3499 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
3500 // tagged as a small integer. | 3500 // tagged as a small integer. |
3501 __ bind(&runtime); | 3501 __ bind(&runtime); |
3502 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3502 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3503 } | 3503 } |
3504 | 3504 |
3505 | 3505 |
3506 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3506 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
3507 // ----------- S t a t e ------------- | 3507 // ----------- S t a t e ------------- |
3508 // -- r1 : left | 3508 // -- r1 : left |
3509 // -- r0 : right | 3509 // -- r0 : right |
3510 // -- lr : return address | 3510 // -- lr : return address |
3511 // ----------------------------------- | 3511 // ----------------------------------- |
3512 | 3512 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, | 3773 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
3774 tmp2, tmp3, tmp4); | 3774 tmp2, tmp3, tmp4); |
3775 } | 3775 } |
3776 | 3776 |
3777 // Handle more complex cases in runtime. | 3777 // Handle more complex cases in runtime. |
3778 __ bind(&runtime); | 3778 __ bind(&runtime); |
3779 __ Push(left, right); | 3779 __ Push(left, right); |
3780 if (equality) { | 3780 if (equality) { |
3781 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3781 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
3782 } else { | 3782 } else { |
3783 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3783 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3784 } | 3784 } |
3785 | 3785 |
3786 __ bind(&miss); | 3786 __ bind(&miss); |
3787 GenerateMiss(masm); | 3787 GenerateMiss(masm); |
3788 } | 3788 } |
3789 | 3789 |
3790 | 3790 |
3791 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 3791 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
3792 DCHECK(state() == CompareICState::OBJECT); | 3792 DCHECK(state() == CompareICState::OBJECT); |
3793 Label miss; | 3793 Label miss; |
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5534 MemOperand(fp, 6 * kPointerSize), NULL); | 5534 MemOperand(fp, 6 * kPointerSize), NULL); |
5535 } | 5535 } |
5536 | 5536 |
5537 | 5537 |
5538 #undef __ | 5538 #undef __ |
5539 | 5539 |
5540 } // namespace internal | 5540 } // namespace internal |
5541 } // namespace v8 | 5541 } // namespace v8 |
5542 | 5542 |
5543 #endif // V8_TARGET_ARCH_ARM | 5543 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |