OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4667 // r5: first character of result. | 4667 // r5: first character of result. |
4668 StringHelper::GenerateCopyCharacters(masm, r5, r6, r2, r4, false); | 4668 StringHelper::GenerateCopyCharacters(masm, r5, r6, r2, r4, false); |
4669 // r5: next character of result. | 4669 // r5: next character of result. |
4670 StringHelper::GenerateCopyCharacters(masm, r5, r1, r3, r4, false); | 4670 StringHelper::GenerateCopyCharacters(masm, r5, r1, r3, r4, false); |
4671 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); | 4671 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); |
4672 __ add(sp, sp, Operand(2 * kPointerSize)); | 4672 __ add(sp, sp, Operand(2 * kPointerSize)); |
4673 __ Ret(); | 4673 __ Ret(); |
4674 | 4674 |
4675 // Just jump to runtime to add the two strings. | 4675 // Just jump to runtime to add the two strings. |
4676 __ bind(&call_runtime); | 4676 __ bind(&call_runtime); |
4677 if ((flags_ & STRING_ADD_ERECT_FRAME) != 0) { | 4677 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
4678 GenerateRegisterArgsPop(masm); | |
4679 // Build a frame | |
4680 { | |
4681 FrameScope scope(masm, StackFrame::INTERNAL); | |
4682 GenerateRegisterArgsPush(masm); | |
4683 __ CallRuntime(Runtime::kStringAdd, 2); | |
4684 } | |
4685 __ Ret(); | |
4686 } else { | |
4687 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | |
4688 } | |
4689 | 4678 |
4690 if (call_builtin.is_linked()) { | 4679 if (call_builtin.is_linked()) { |
4691 __ bind(&call_builtin); | 4680 __ bind(&call_builtin); |
4692 if ((flags_ & STRING_ADD_ERECT_FRAME) != 0) { | 4681 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); |
4693 GenerateRegisterArgsPop(masm); | |
4694 // Build a frame | |
4695 { | |
4696 FrameScope scope(masm, StackFrame::INTERNAL); | |
4697 GenerateRegisterArgsPush(masm); | |
4698 __ InvokeBuiltin(builtin_id, CALL_FUNCTION); | |
4699 } | |
4700 __ Ret(); | |
4701 } else { | |
4702 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); | |
4703 } | |
4704 } | 4682 } |
4705 } | 4683 } |
4706 | 4684 |
4707 | 4685 |
4708 void StringAddStub::GenerateRegisterArgsPush(MacroAssembler* masm) { | 4686 void StringAddStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
4709 __ push(r0); | 4687 __ push(r0); |
4710 __ push(r1); | 4688 __ push(r1); |
4711 } | 4689 } |
4712 | 4690 |
4713 | 4691 |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6090 __ bind(&fast_elements_case); | 6068 __ bind(&fast_elements_case); |
6091 GenerateCase(masm, FAST_ELEMENTS); | 6069 GenerateCase(masm, FAST_ELEMENTS); |
6092 } | 6070 } |
6093 | 6071 |
6094 | 6072 |
6095 #undef __ | 6073 #undef __ |
6096 | 6074 |
6097 } } // namespace v8::internal | 6075 } } // namespace v8::internal |
6098 | 6076 |
6099 #endif // V8_TARGET_ARCH_ARM | 6077 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |