OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3768 StringHelper::GenerateCopyCharacters(masm, rbx, rcx, r14, false); | 3768 StringHelper::GenerateCopyCharacters(masm, rbx, rcx, r14, false); |
3769 // rbx: next character of result | 3769 // rbx: next character of result |
3770 // rdx: first char of second string | 3770 // rdx: first char of second string |
3771 // r15: length of second string | 3771 // r15: length of second string |
3772 StringHelper::GenerateCopyCharacters(masm, rbx, rdx, r15, false); | 3772 StringHelper::GenerateCopyCharacters(masm, rbx, rdx, r15, false); |
3773 __ IncrementCounter(counters->string_add_native(), 1); | 3773 __ IncrementCounter(counters->string_add_native(), 1); |
3774 __ ret(2 * kPointerSize); | 3774 __ ret(2 * kPointerSize); |
3775 | 3775 |
3776 // Just jump to runtime to add the two strings. | 3776 // Just jump to runtime to add the two strings. |
3777 __ bind(&call_runtime); | 3777 __ bind(&call_runtime); |
3778 | 3778 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
3779 if ((flags_ & STRING_ADD_ERECT_FRAME) != 0) { | |
3780 GenerateRegisterArgsPop(masm, rcx); | |
3781 // Build a frame | |
3782 { | |
3783 FrameScope scope(masm, StackFrame::INTERNAL); | |
3784 GenerateRegisterArgsPush(masm); | |
3785 __ CallRuntime(Runtime::kStringAdd, 2); | |
3786 } | |
3787 __ Ret(); | |
3788 } else { | |
3789 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | |
3790 } | |
3791 | 3779 |
3792 if (call_builtin.is_linked()) { | 3780 if (call_builtin.is_linked()) { |
3793 __ bind(&call_builtin); | 3781 __ bind(&call_builtin); |
3794 if ((flags_ & STRING_ADD_ERECT_FRAME) != 0) { | 3782 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); |
3795 GenerateRegisterArgsPop(masm, rcx); | |
3796 // Build a frame | |
3797 { | |
3798 FrameScope scope(masm, StackFrame::INTERNAL); | |
3799 GenerateRegisterArgsPush(masm); | |
3800 __ InvokeBuiltin(builtin_id, CALL_FUNCTION); | |
3801 } | |
3802 __ Ret(); | |
3803 } else { | |
3804 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); | |
3805 } | |
3806 } | 3783 } |
3807 } | 3784 } |
3808 | 3785 |
3809 | 3786 |
3810 void StringAddStub::GenerateRegisterArgsPush(MacroAssembler* masm) { | 3787 void StringAddStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
3811 __ push(rax); | 3788 __ push(rax); |
3812 __ push(rdx); | 3789 __ push(rdx); |
3813 } | 3790 } |
3814 | 3791 |
3815 | 3792 |
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5838 __ bind(&fast_elements_case); | 5815 __ bind(&fast_elements_case); |
5839 GenerateCase(masm, FAST_ELEMENTS); | 5816 GenerateCase(masm, FAST_ELEMENTS); |
5840 } | 5817 } |
5841 | 5818 |
5842 | 5819 |
5843 #undef __ | 5820 #undef __ |
5844 | 5821 |
5845 } } // namespace v8::internal | 5822 } } // namespace v8::internal |
5846 | 5823 |
5847 #endif // V8_TARGET_ARCH_X64 | 5824 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |