ICs for scripted calls (bug 587698, r=dmandelin).
[mozilla-central.git] / js / src / methodjit / StubCalls.h
blob8b43c13ae856069200f08ace939d1a1323b06be5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: set ts=4 sw=4 et tw=99:
4 * ***** BEGIN LICENSE BLOCK *****
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/
12 * Software distributed under the License is distributed on an "AS IS" basis,
13 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 * for the specific language governing rights and limitations under the
15 * License.
17 * The Original Code is Mozilla SpiderMonkey JavaScript 1.9 code, released
18 * May 28, 2008.
20 * The Initial Developer of the Original Code is
21 * Brendan Eich <brendan@mozilla.org>
23 * Contributor(s):
24 * David Anderson <danderson@mozilla.com>
25 * David Mandelin <dmandelin@mozilla.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either of the GNU General Public License Version 2 or later (the "GPL"),
29 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
41 #ifndef jslogic_h__
42 #define jslogic_h__
44 #include "MethodJIT.h"
46 namespace js {
47 namespace mjit {
48 namespace stubs {
50 void JS_FASTCALL This(VMFrame &f);
51 void JS_FASTCALL ComputeThis(VMFrame &f);
52 JSObject * JS_FASTCALL NewInitArray(VMFrame &f);
53 JSObject * JS_FASTCALL NewInitObject(VMFrame &f);
54 JSObject * JS_FASTCALL NewArray(VMFrame &f, uint32 len);
55 void JS_FASTCALL Trap(VMFrame &f, jsbytecode *pc);
56 void JS_FASTCALL Debugger(VMFrame &f, jsbytecode *pc);
57 void JS_FASTCALL Interrupt(VMFrame &f, jsbytecode *pc);
58 void JS_FASTCALL InitElem(VMFrame &f, uint32 last);
59 void JS_FASTCALL InitProp(VMFrame &f, JSAtom *atom);
60 void JS_FASTCALL InitMethod(VMFrame &f, JSAtom *atom);
62 void JS_FASTCALL CheckStackQuota(VMFrame &f);
63 void * JS_FASTCALL CheckArity(VMFrame &f);
64 void * JS_FASTCALL CompileFunction(VMFrame &f);
65 void JS_FASTCALL SlowNew(VMFrame &f, uint32 argc);
66 void JS_FASTCALL SlowCall(VMFrame &f, uint32 argc);
67 void * JS_FASTCALL UncachedNew(VMFrame &f, uint32 argc);
68 void * JS_FASTCALL UncachedCall(VMFrame &f, uint32 argc);
70 JSBool JS_FASTCALL NewObject(VMFrame &f, uint32 argc);
71 void JS_FASTCALL Throw(VMFrame &f);
72 void JS_FASTCALL PutCallObject(VMFrame &f);
73 void JS_FASTCALL PutArgsObject(VMFrame &f);
74 void JS_FASTCALL GetCallObject(VMFrame &f);
75 void JS_FASTCALL WrapPrimitiveThis(VMFrame &f);
76 #if JS_MONOIC
77 void * JS_FASTCALL InvokeTracer(VMFrame &f, uint32 index);
78 #else
79 void * JS_FASTCALL InvokeTracer(VMFrame &f);
80 #endif
82 void * JS_FASTCALL LookupSwitch(VMFrame &f, jsbytecode *pc);
83 void * JS_FASTCALL TableSwitch(VMFrame &f, jsbytecode *origPc);
85 void JS_FASTCALL BindName(VMFrame &f);
86 JSObject * JS_FASTCALL BindGlobalName(VMFrame &f);
87 void JS_FASTCALL SetName(VMFrame &f, JSAtom *atom);
88 void JS_FASTCALL SetGlobalName(VMFrame &f, JSAtom *atom);
89 void JS_FASTCALL SetGlobalNameDumb(VMFrame &f, JSAtom *atom);
90 void JS_FASTCALL Name(VMFrame &f);
91 void JS_FASTCALL GetProp(VMFrame &f);
92 void JS_FASTCALL GetElem(VMFrame &f);
93 void JS_FASTCALL CallElem(VMFrame &f);
94 void JS_FASTCALL SetElem(VMFrame &f);
95 void JS_FASTCALL Length(VMFrame &f);
96 void JS_FASTCALL CallName(VMFrame &f);
97 void JS_FASTCALL GetUpvar(VMFrame &f, uint32 index);
98 void JS_FASTCALL GetGlobalName(VMFrame &f);
100 void JS_FASTCALL NameInc(VMFrame &f, JSAtom *atom);
101 void JS_FASTCALL NameDec(VMFrame &f, JSAtom *atom);
102 void JS_FASTCALL IncName(VMFrame &f, JSAtom *atom);
103 void JS_FASTCALL DecName(VMFrame &f, JSAtom *atom);
104 void JS_FASTCALL GlobalNameInc(VMFrame &f, JSAtom *atom);
105 void JS_FASTCALL GlobalNameDec(VMFrame &f, JSAtom *atom);
106 void JS_FASTCALL IncGlobalName(VMFrame &f, JSAtom *atom);
107 void JS_FASTCALL DecGlobalName(VMFrame &f, JSAtom *atom);
108 void JS_FASTCALL PropInc(VMFrame &f, JSAtom *atom);
109 void JS_FASTCALL PropDec(VMFrame &f, JSAtom *atom);
110 void JS_FASTCALL IncProp(VMFrame &f, JSAtom *atom);
111 void JS_FASTCALL DecProp(VMFrame &f, JSAtom *atom);
112 void JS_FASTCALL ElemInc(VMFrame &f);
113 void JS_FASTCALL ElemDec(VMFrame &f);
114 void JS_FASTCALL IncElem(VMFrame &f);
115 void JS_FASTCALL DecElem(VMFrame &f);
116 void JS_FASTCALL CallProp(VMFrame &f, JSAtom *atom);
118 void JS_FASTCALL DefFun(VMFrame &f, uint32 index);
119 JSObject * JS_FASTCALL DefLocalFun(VMFrame &f, JSFunction *fun);
120 JSObject * JS_FASTCALL DefLocalFun_FC(VMFrame &f, JSFunction *fun);
121 JSObject * JS_FASTCALL RegExp(VMFrame &f, JSObject *regex);
122 JSObject * JS_FASTCALL Lambda(VMFrame &f, JSFunction *fun);
123 JSObject * JS_FASTCALL LambdaForInit(VMFrame &f, JSFunction *fun);
124 JSObject * JS_FASTCALL LambdaForSet(VMFrame &f, JSFunction *fun);
125 JSObject * JS_FASTCALL LambdaJoinableForCall(VMFrame &f, JSFunction *fun);
126 JSObject * JS_FASTCALL LambdaJoinableForNull(VMFrame &f, JSFunction *fun);
127 JSObject * JS_FASTCALL FlatLambda(VMFrame &f, JSFunction *fun);
128 void JS_FASTCALL Arguments(VMFrame &f);
129 void JS_FASTCALL ArgSub(VMFrame &f, uint32 n);
130 void JS_FASTCALL EnterBlock(VMFrame &f, JSObject *obj);
131 void JS_FASTCALL LeaveBlock(VMFrame &f);
133 void JS_FASTCALL VpInc(VMFrame &f, Value *vp);
134 void JS_FASTCALL VpDec(VMFrame &f, Value *vp);
135 void JS_FASTCALL DecVp(VMFrame &f, Value *vp);
136 void JS_FASTCALL IncVp(VMFrame &f, Value *vp);
137 void JS_FASTCALL LocalInc(VMFrame &f, uint32 slot);
138 void JS_FASTCALL LocalDec(VMFrame &f, uint32 slot);
139 void JS_FASTCALL IncLocal(VMFrame &f, uint32 slot);
140 void JS_FASTCALL DecLocal(VMFrame &f, uint32 slot);
142 JSBool JS_FASTCALL LessThan(VMFrame &f);
143 JSBool JS_FASTCALL LessEqual(VMFrame &f);
144 JSBool JS_FASTCALL GreaterThan(VMFrame &f);
145 JSBool JS_FASTCALL GreaterEqual(VMFrame &f);
146 JSBool JS_FASTCALL Equal(VMFrame &f);
147 JSBool JS_FASTCALL NotEqual(VMFrame &f);
149 void JS_FASTCALL BitOr(VMFrame &f);
150 void JS_FASTCALL BitXor(VMFrame &f);
151 void JS_FASTCALL BitAnd(VMFrame &f);
152 void JS_FASTCALL BitNot(VMFrame &f);
153 void JS_FASTCALL Lsh(VMFrame &f);
154 void JS_FASTCALL Rsh(VMFrame &f);
155 void JS_FASTCALL Ursh(VMFrame &f);
156 void JS_FASTCALL Add(VMFrame &f);
157 void JS_FASTCALL Sub(VMFrame &f);
158 void JS_FASTCALL Mul(VMFrame &f);
159 void JS_FASTCALL Div(VMFrame &f);
160 void JS_FASTCALL Mod(VMFrame &f);
161 void JS_FASTCALL Neg(VMFrame &f);
162 void JS_FASTCALL Pos(VMFrame &f);
163 void JS_FASTCALL Not(VMFrame &f);
164 void JS_FASTCALL StrictEq(VMFrame &f);
165 void JS_FASTCALL StrictNe(VMFrame &f);
167 void JS_FASTCALL Iter(VMFrame &f, uint32 flags);
168 void JS_FASTCALL IterNext(VMFrame &f);
169 JSBool JS_FASTCALL IterMore(VMFrame &f);
170 void JS_FASTCALL EndIter(VMFrame &f);
171 void JS_FASTCALL ForName(VMFrame &f, JSAtom *atom);
173 JSBool JS_FASTCALL ValueToBoolean(VMFrame &f);
174 JSString * JS_FASTCALL TypeOf(VMFrame &f);
175 JSBool JS_FASTCALL InstanceOf(VMFrame &f);
176 void JS_FASTCALL FastInstanceOf(VMFrame &f);
177 void JS_FASTCALL ArgCnt(VMFrame &f);
178 void JS_FASTCALL Unbrand(VMFrame &f);
180 }}} /* namespace stubs,mjit,js */
182 extern "C" void *
183 js_InternalThrow(js::VMFrame &f);
185 #endif /* jslogic_h__ */