OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 ARGUMENTS_DONT_CONTAIN_RECEIVER); | 585 ARGUMENTS_DONT_CONTAIN_RECEIVER); |
586 __ movp(rax, adaptor_args.GetArgumentOperand(0)); | 586 __ movp(rax, adaptor_args.GetArgumentOperand(0)); |
587 __ Ret(); | 587 __ Ret(); |
588 | 588 |
589 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 589 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
590 // by calling the runtime system. | 590 // by calling the runtime system. |
591 __ bind(&slow); | 591 __ bind(&slow); |
592 __ PopReturnAddressTo(rbx); | 592 __ PopReturnAddressTo(rbx); |
593 __ Push(rdx); | 593 __ Push(rdx); |
594 __ PushReturnAddressFrom(rbx); | 594 __ PushReturnAddressFrom(rbx); |
595 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 595 __ TailCallRuntime(Runtime::kArguments, 1, 1); |
596 } | 596 } |
597 | 597 |
598 | 598 |
599 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 599 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
600 // Stack layout: | 600 // Stack layout: |
601 // rsp[0] : return address | 601 // rsp[0] : return address |
602 // rsp[8] : number of parameters (tagged) | 602 // rsp[8] : number of parameters (tagged) |
603 // rsp[16] : receiver displacement | 603 // rsp[16] : receiver displacement |
604 // rsp[24] : function | 604 // rsp[24] : function |
605 // Registers used over the whole function: | 605 // Registers used over the whole function: |
(...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3268 // rcx: result length | 3268 // rcx: result length |
3269 // rdi: first character of result | 3269 // rdi: first character of result |
3270 // r14: character of sub string start | 3270 // r14: character of sub string start |
3271 StringHelper::GenerateCopyCharacters( | 3271 StringHelper::GenerateCopyCharacters( |
3272 masm, rdi, r14, rcx, String::TWO_BYTE_ENCODING); | 3272 masm, rdi, r14, rcx, String::TWO_BYTE_ENCODING); |
3273 __ IncrementCounter(counters->sub_string_native(), 1); | 3273 __ IncrementCounter(counters->sub_string_native(), 1); |
3274 __ ret(SUB_STRING_ARGUMENT_COUNT * kPointerSize); | 3274 __ ret(SUB_STRING_ARGUMENT_COUNT * kPointerSize); |
3275 | 3275 |
3276 // Just jump to runtime to create the sub string. | 3276 // Just jump to runtime to create the sub string. |
3277 __ bind(&runtime); | 3277 __ bind(&runtime); |
3278 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); | 3278 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
3279 | 3279 |
3280 __ bind(&single_char); | 3280 __ bind(&single_char); |
3281 // rax: string | 3281 // rax: string |
3282 // rbx: instance type | 3282 // rbx: instance type |
3283 // rcx: sub string length (smi) | 3283 // rcx: sub string length (smi) |
3284 // rdx: from index (smi) | 3284 // rdx: from index (smi) |
3285 StringCharAtGenerator generator(rax, rdx, rcx, rax, &runtime, &runtime, | 3285 StringCharAtGenerator generator(rax, rdx, rcx, rax, &runtime, &runtime, |
3286 &runtime, STRING_INDEX_IS_NUMBER, | 3286 &runtime, STRING_INDEX_IS_NUMBER, |
3287 RECEIVER_IS_STRING); | 3287 RECEIVER_IS_STRING); |
3288 generator.GenerateFast(masm); | 3288 generator.GenerateFast(masm); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3505 // Drop arguments from the stack | 3505 // Drop arguments from the stack |
3506 __ PopReturnAddressTo(rcx); | 3506 __ PopReturnAddressTo(rcx); |
3507 __ addp(rsp, Immediate(2 * kPointerSize)); | 3507 __ addp(rsp, Immediate(2 * kPointerSize)); |
3508 __ PushReturnAddressFrom(rcx); | 3508 __ PushReturnAddressFrom(rcx); |
3509 StringHelper::GenerateCompareFlatOneByteStrings(masm, rdx, rax, rcx, rbx, rdi, | 3509 StringHelper::GenerateCompareFlatOneByteStrings(masm, rdx, rax, rcx, rbx, rdi, |
3510 r8); | 3510 r8); |
3511 | 3511 |
3512 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 3512 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
3513 // tagged as a small integer. | 3513 // tagged as a small integer. |
3514 __ bind(&runtime); | 3514 __ bind(&runtime); |
3515 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3515 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3516 } | 3516 } |
3517 | 3517 |
3518 | 3518 |
3519 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3519 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
3520 // ----------- S t a t e ------------- | 3520 // ----------- S t a t e ------------- |
3521 // -- rdx : left | 3521 // -- rdx : left |
3522 // -- rax : right | 3522 // -- rax : right |
3523 // -- rsp[0] : return address | 3523 // -- rsp[0] : return address |
3524 // ----------------------------------- | 3524 // ----------------------------------- |
3525 | 3525 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3803 | 3803 |
3804 // Handle more complex cases in runtime. | 3804 // Handle more complex cases in runtime. |
3805 __ bind(&runtime); | 3805 __ bind(&runtime); |
3806 __ PopReturnAddressTo(tmp1); | 3806 __ PopReturnAddressTo(tmp1); |
3807 __ Push(left); | 3807 __ Push(left); |
3808 __ Push(right); | 3808 __ Push(right); |
3809 __ PushReturnAddressFrom(tmp1); | 3809 __ PushReturnAddressFrom(tmp1); |
3810 if (equality) { | 3810 if (equality) { |
3811 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3811 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
3812 } else { | 3812 } else { |
3813 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3813 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3814 } | 3814 } |
3815 | 3815 |
3816 __ bind(&miss); | 3816 __ bind(&miss); |
3817 GenerateMiss(masm); | 3817 GenerateMiss(masm); |
3818 } | 3818 } |
3819 | 3819 |
3820 | 3820 |
3821 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 3821 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
3822 DCHECK(state() == CompareICState::OBJECT); | 3822 DCHECK(state() == CompareICState::OBJECT); |
3823 Label miss; | 3823 Label miss; |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5587 kStackSpace, nullptr, return_value_operand, NULL); | 5587 kStackSpace, nullptr, return_value_operand, NULL); |
5588 } | 5588 } |
5589 | 5589 |
5590 | 5590 |
5591 #undef __ | 5591 #undef __ |
5592 | 5592 |
5593 } // namespace internal | 5593 } // namespace internal |
5594 } // namespace v8 | 5594 } // namespace v8 |
5595 | 5595 |
5596 #endif // V8_TARGET_ARCH_X64 | 5596 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |