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. */
55 /* Load mask registers. */
56 movq $0xFFFF800000000000, %r13
57 movq $0x00007FFFFFFFFFFF, %r14
59 /* Build the JIT frame.
62 * rcx = inlineCallCount
65 pushq %rsi /* entryFp */
66 pushq %rcx /* inlineCallCount */
71 /* Space for the rest of the VMFrame. */
74 /* This is actually part of the VMFrame. */
77 /* Set cx->regs and set the active frame. Save rdx and align frame in one. */
82 call PushActiveVMFrame
84 /* Jump into into the JIT'd code. */
86 .size JaegerTrampoline, . - JaegerTrampoline
88 / void JaegerTrampolineReturn()
89 .global JaegerTrampolineReturn
90 .type JaegerTrampolineReturn, @function
91 JaegerTrampolineReturn:
106 .size JaegerTrampolineReturn, . - JaegerTrampolineReturn
109 / void *JaegerThrowpoline(js::VMFrame *vmFrame)
110 .global JaegerThrowpoline
111 .type JaegerThrowpoline, @function
114 call js_InternalThrow
120 call PopActiveVMFrame
130 .size JaegerThrowpoline, . - JaegerThrowpoline
132 .global InjectJaegerReturn
133 .type InjectJaegerReturn, @function
135 movq 0x30(%rbx), %rcx /* load fp->rval_ into typeReg */
136 movq 0x28(%rbx), %rax /* fp->ncode_ */
138 /* Reimplementation of PunboxAssembler::loadValueAsComponents() */
139 movq %r14, %rdx /* payloadReg = payloadMaskReg */
143 movq 0x38(%rsp), %rbx /* f.fp */
144 jmp *%rax /* return. */
145 .size InjectJaegerReturn, . - InjectJaegerReturn