2 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef LLIntSlowPaths_h
27 #define LLIntSlowPaths_h
29 #include <wtf/Platform.h>
30 #include <wtf/StdLibExtras.h>
42 // According to C++ rules, a type used for the return signature of function with C linkage (i.e.
43 // 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
44 // warnings, or worse, a change in the ABI used to return these types.
45 struct SlowPathReturnType
{
50 inline SlowPathReturnType
encodeResult(void* a
, ExecState
* b
)
52 SlowPathReturnType result
;
58 inline void decodeResult(SlowPathReturnType result
, void*& a
, ExecState
*& b
)
64 #else // USE(JSVALUE32_64)
65 typedef int64_t SlowPathReturnType
;
73 } SlowPathReturnTypeEncoding
;
75 inline SlowPathReturnType
encodeResult(void* a
, ExecState
* b
)
77 SlowPathReturnTypeEncoding u
;
83 inline void decodeResult(SlowPathReturnType result
, void*& a
, ExecState
*& b
)
85 SlowPathReturnTypeEncoding u
;
90 #endif // USE(JSVALUE32_64)
92 extern "C" SlowPathReturnType
llint_trace_operand(ExecState
*, Instruction
*, int fromWhere
, int operand
);
93 extern "C" SlowPathReturnType
llint_trace_value(ExecState
*, Instruction
*, int fromWhere
, int operand
);
95 #define LLINT_SLOW_PATH_DECL(name) \
96 extern "C" SlowPathReturnType llint_##name(ExecState* exec, Instruction* pc)
98 #define LLINT_SLOW_PATH_HIDDEN_DECL(name) \
99 LLINT_SLOW_PATH_DECL(name) WTF_INTERNAL
101 LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue
);
102 LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue_function_for_call
);
103 LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue_function_for_construct
);
104 LLINT_SLOW_PATH_HIDDEN_DECL(trace_arityCheck_for_call
);
105 LLINT_SLOW_PATH_HIDDEN_DECL(trace_arityCheck_for_construct
);
106 LLINT_SLOW_PATH_HIDDEN_DECL(trace
);
107 LLINT_SLOW_PATH_HIDDEN_DECL(special_trace
);
108 LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr
);
109 LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_call
);
110 LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_construct
);
111 LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_call_arityCheck
);
112 LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_construct_arityCheck
);
113 LLINT_SLOW_PATH_HIDDEN_DECL(loop_osr
);
114 LLINT_SLOW_PATH_HIDDEN_DECL(replace
);
115 LLINT_SLOW_PATH_HIDDEN_DECL(stack_check
);
116 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_arityCheck
);
117 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct_arityCheck
);
118 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_create_activation
);
119 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_create_arguments
);
120 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_create_this
);
121 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_convert_this
);
122 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_object
);
123 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_array
);
124 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_array_with_size
);
125 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_array_buffer
);
126 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_regexp
);
127 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_not
);
128 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_eq
);
129 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_neq
);
130 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_stricteq
);
131 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_nstricteq
);
132 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_less
);
133 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_lesseq
);
134 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_greater
);
135 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_greatereq
);
136 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_pre_inc
);
137 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_pre_dec
);
138 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_to_number
);
139 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_negate
);
140 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_add
);
141 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_mul
);
142 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_sub
);
143 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_div
);
144 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_mod
);
145 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_lshift
);
146 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_rshift
);
147 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_urshift
);
148 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_bitand
);
149 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_bitor
);
150 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_bitxor
);
151 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_check_has_instance
);
152 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_instanceof
);
153 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_typeof
);
154 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_is_object
);
155 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_is_function
);
156 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_in
);
157 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve
);
158 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_to_base
);
159 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_base
);
160 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_with_base
);
161 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_resolve_with_this
);
162 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_init_global_const_check
);
163 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id
);
164 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_arguments_length
);
165 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_id
);
166 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_id
);
167 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_val
);
168 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_argument_by_val
);
169 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_pname
);
170 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_val
);
171 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_val
);
172 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_index
);
173 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_getter_setter
);
174 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jtrue
);
175 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jfalse
);
176 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jless
);
177 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jnless
);
178 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jgreater
);
179 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jngreater
);
180 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jlesseq
);
181 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jnlesseq
);
182 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jgreatereq
);
183 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jngreatereq
);
184 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_imm
);
185 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_char
);
186 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_string
);
187 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func
);
188 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func_exp
);
189 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call
);
190 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct
);
191 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_varargs
);
192 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval
);
193 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_activation
);
194 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_arguments
);
195 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_strcat
);
196 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_to_primitive
);
197 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_pnames
);
198 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_next_pname
);
199 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_push_with_scope
);
200 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_pop_scope
);
201 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_push_name_scope
);
202 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw
);
203 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw_static_error
);
204 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_watchdog_timer
);
205 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_debug
);
206 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_will_call
);
207 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_did_call
);
208 LLINT_SLOW_PATH_HIDDEN_DECL(throw_from_native_call
);
210 } } // namespace JSC::LLInt
212 #endif // ENABLE(LLINT)
214 #endif // LLIntSlowPaths_h