1 / -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 / ***** BEGIN LICENSE BLOCK *****
3 / Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 / The contents of this file are subject to the Mozilla Public License Version
6 / 1.1 (the "License")/ you may not use this file except in compliance with
7 / the License. You may obtain a copy of the License at
8 / http://www.mozilla.org/MPL/
10 / Software distributed under the License is distributed on an "AS IS" basis,
11 / WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 / for the specific language governing rights and limitations under the
15 / The Original Code is mozilla.org code.
17 / The Initial Developer of the Original Code is Mozilla Japan.
18 / Portions created by the Initial Developer are Copyright (C) 2010
19 / the Initial Developer. All Rights Reserved.
22 / Leon Sha <leon.sha@sun.com>
24 / Alternatively, the contents of this file may be used under the terms of
25 / either the GNU General Public License Version 2 or later (the "GPL"), or
26 / the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 / in which case the provisions of the GPL or the LGPL are applicable instead
28 / of those above. If you wish to allow use of your version of this file only
29 / under the terms of either the GPL or the LGPL, and not to allow others to
30 / use your version of this file under the terms of the MPL, indicate your
31 / decision by deleting the provisions above and replace them with the notice
32 / and other provisions required by the GPL or the LGPL. If you do not delete
33 / the provisions above, a recipient may use your version of this file under
34 / the terms of any one of the MPL, the GPL or the LGPL.
36 / ***** END LICENSE BLOCK *****
40 / JSBool JaegerTrampoline(JSContext *cx, JSStackFrame *fp, void *code,
41 / JSFrameRegs *regs, uintptr_t inlineCallCount)
42 .global JaegerTrampoline
43 .type JaegerTrampoline, @function
48 /* Save non-volatile registers. */
53 /* Build the JIT frame. Push fields in order, */
54 /* then align the stack to form esp == VMFrame. */
55 movl 12(%ebp), %ebx /* fp */
56 pushl %ebx /* entryFp */
57 pushl 20(%ebp) /* stackLimit */
58 pushl 8(%ebp) /* cx */
62 /* Jump into the JIT'd code. */
63 /* No fastcall for sunstudio. */
66 call PushActiveVMFrame
69 .size JaegerTrampoline, . - JaegerTrampoline
71 / void JaegerTrampolineReturn()
72 .global JaegerTrampolineReturn
73 .type JaegerTrampolineReturn, @function
74 JaegerTrampolineReturn:
87 .size JaegerTrampolineReturn, . - JaegerTrampolineReturn
90 / void *JaegerThrowpoline(js::VMFrame *vmFrame)
91 .global JaegerThrowpoline
92 .type JaegerThrowpoline, @function
94 /* For Sun Studio there is no fast call. */
95 /* We add the stack by 16 before. */
97 /* Align the stack to 16 bytes. */
102 call js_InternalThrow
103 /* Bump the stack by 0x2c, as in the basic trampoline, but */
104 /* also one more word to clean up the stack for jsl_InternalThrow,*/
105 /* and another to balance the alignment above. */
112 call PopActiveVMFrame
121 .size JaegerThrowpoline, . - JaegerThrowpoline
123 .global InjectJaegerReturn
124 .type InjectJaegerReturn, @function
126 movl 0x18(%ebx), %edx /* fp->rval_ data */
127 movl 0x1C(%ebx), %ecx /* fp->rval_ type */
128 movl 0x14(%ebx), %eax /* fp->ncode_ */
129 /* For Sun Studio there is no fast call. */
130 /* We add the stack by 16 before. */
132 /* Restore frame regs. */
133 movl 0x1C(%esp), %ebx /* f.fp */
135 .size InjectJaegerReturn, . - InjectJaegerReturn