OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2697 // sp: stack pointer (restored as callee's sp after C call) | 2697 // sp: stack pointer (restored as callee's sp after C call) |
2698 // cp: current context (C callee-saved) | 2698 // cp: current context (C callee-saved) |
2699 | 2699 |
2700 // Result returned in r0 or r0+r1 by default. | 2700 // Result returned in r0 or r0+r1 by default. |
2701 | 2701 |
2702 // NOTE: Invocations of builtins may return failure objects | 2702 // NOTE: Invocations of builtins may return failure objects |
2703 // instead of a proper result. The builtin entry handles | 2703 // instead of a proper result. The builtin entry handles |
2704 // this by performing a garbage collection and retrying the | 2704 // this by performing a garbage collection and retrying the |
2705 // builtin once. | 2705 // builtin once. |
2706 | 2706 |
2707 // r0 is argc. | |
2708 // Compute callee's stack pointer before making changes and save it as | |
2709 // ip register so that it is restored as sp register on exit, thereby | |
2710 // popping the args. | |
antonm
2011/01/21 17:56:36
I think you should add a reference to EnterExitFra
Zaheer
2011/01/24 09:43:31
Done.
| |
2711 | |
2712 // ip = sp + kPointerSize * #args; | |
2713 __ add(ip, sp, Operand(r0, LSL, kPointerSizeLog2)); | |
2714 | |
2715 // Compute the argv pointer and keep it in a callee-saved register. | |
2716 __ sub(r6, ip, Operand(kPointerSize)); | |
2717 | |
2707 // Enter the exit frame that transitions from JavaScript to C++. | 2718 // Enter the exit frame that transitions from JavaScript to C++. |
2708 __ EnterExitFrame(save_doubles_); | 2719 __ EnterExitFrame(save_doubles_, 1); // 1 pending push after this call. |
2720 | |
2721 // Setup argc and the builtin function in callee-saved registers. | |
2722 __ mov(r4, Operand(r0)); | |
2723 __ mov(r5, Operand(r1)); | |
Erik Corry
2011/01/21 14:28:40
I don't see the benefit of moving this outside the
Zaheer
2011/01/24 09:43:31
Updated comment in macro-assembler-arm.h.
| |
2709 | 2724 |
2710 // r4: number of arguments (C callee-saved) | 2725 // r4: number of arguments (C callee-saved) |
2711 // r5: pointer to builtin function (C callee-saved) | 2726 // r5: pointer to builtin function (C callee-saved) |
2712 // r6: pointer to first argument (C callee-saved) | 2727 // r6: pointer to first argument (C callee-saved) |
2713 | 2728 |
2714 Label throw_normal_exception; | 2729 Label throw_normal_exception; |
2715 Label throw_termination_exception; | 2730 Label throw_termination_exception; |
2716 Label throw_out_of_memory_exception; | 2731 Label throw_out_of_memory_exception; |
2717 | 2732 |
2718 // Call into the runtime system. | 2733 // Call into the runtime system. |
(...skipping 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4974 __ LeaveInternalFrame(); | 4989 __ LeaveInternalFrame(); |
4975 // Compute the entry point of the rewritten stub. | 4990 // Compute the entry point of the rewritten stub. |
4976 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 4991 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
4977 // Restore registers. | 4992 // Restore registers. |
4978 __ pop(lr); | 4993 __ pop(lr); |
4979 __ pop(r0); | 4994 __ pop(r0); |
4980 __ pop(r1); | 4995 __ pop(r1); |
4981 __ Jump(r2); | 4996 __ Jump(r2); |
4982 } | 4997 } |
4983 | 4998 |
4999 void DirectCEntryStub::Generate(MacroAssembler* masm) { | |
5000 __ ldr(pc, MemOperand(fp, ExitFrameConstants::kPCOffset)); | |
5001 } | |
4984 | 5002 |
4985 #undef __ | 5003 #undef __ |
4986 | 5004 |
4987 } } // namespace v8::internal | 5005 } } // namespace v8::internal |
4988 | 5006 |
4989 #endif // V8_TARGET_ARCH_ARM | 5007 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |