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
, void* b
)
52 SlowPathReturnType result
;
58 typedef int64_t SlowPathReturnType
;
60 inline SlowPathReturnType
encodeResult(void* a
, void* b
)
75 extern "C" SlowPathReturnType
llint_trace_operand(ExecState
*, Instruction
*, int fromWhere
, int operand
);
76 extern "C" SlowPathReturnType
llint_trace_value(ExecState
*, Instruction
*, int fromWhere
, int operand
);
78 #define LLINT_SLOW_PATH_DECL(name) \
79 extern "C" SlowPathReturnType llint_##name(ExecState* exec, Instruction* pc)
81 LLINT_SLOW_PATH_DECL(trace_prologue
);
82 LLINT_SLOW_PATH_DECL(trace_prologue_function_for_call
);
83 LLINT_SLOW_PATH_DECL(trace_prologue_function_for_construct
);
84 LLINT_SLOW_PATH_DECL(trace_arityCheck_for_call
);
85 LLINT_SLOW_PATH_DECL(trace_arityCheck_for_construct
);
86 LLINT_SLOW_PATH_DECL(trace
);
87 LLINT_SLOW_PATH_DECL(special_trace
);
88 LLINT_SLOW_PATH_DECL(entry_osr
);
89 LLINT_SLOW_PATH_DECL(entry_osr_function_for_call
);
90 LLINT_SLOW_PATH_DECL(entry_osr_function_for_construct
);
91 LLINT_SLOW_PATH_DECL(entry_osr_function_for_call_arityCheck
);
92 LLINT_SLOW_PATH_DECL(entry_osr_function_for_construct_arityCheck
);
93 LLINT_SLOW_PATH_DECL(loop_osr
);
94 LLINT_SLOW_PATH_DECL(replace
);
95 LLINT_SLOW_PATH_DECL(register_file_check
);
96 LLINT_SLOW_PATH_DECL(slow_path_call_arityCheck
);
97 LLINT_SLOW_PATH_DECL(slow_path_construct_arityCheck
);
98 LLINT_SLOW_PATH_DECL(slow_path_create_activation
);
99 LLINT_SLOW_PATH_DECL(slow_path_create_arguments
);
100 LLINT_SLOW_PATH_DECL(slow_path_create_this
);
101 LLINT_SLOW_PATH_DECL(slow_path_convert_this
);
102 LLINT_SLOW_PATH_DECL(slow_path_new_object
);
103 LLINT_SLOW_PATH_DECL(slow_path_new_array
);
104 LLINT_SLOW_PATH_DECL(slow_path_new_array_buffer
);
105 LLINT_SLOW_PATH_DECL(slow_path_new_regexp
);
106 LLINT_SLOW_PATH_DECL(slow_path_not
);
107 LLINT_SLOW_PATH_DECL(slow_path_eq
);
108 LLINT_SLOW_PATH_DECL(slow_path_neq
);
109 LLINT_SLOW_PATH_DECL(slow_path_stricteq
);
110 LLINT_SLOW_PATH_DECL(slow_path_nstricteq
);
111 LLINT_SLOW_PATH_DECL(slow_path_less
);
112 LLINT_SLOW_PATH_DECL(slow_path_lesseq
);
113 LLINT_SLOW_PATH_DECL(slow_path_greater
);
114 LLINT_SLOW_PATH_DECL(slow_path_greatereq
);
115 LLINT_SLOW_PATH_DECL(slow_path_pre_inc
);
116 LLINT_SLOW_PATH_DECL(slow_path_pre_dec
);
117 LLINT_SLOW_PATH_DECL(slow_path_post_inc
);
118 LLINT_SLOW_PATH_DECL(slow_path_post_dec
);
119 LLINT_SLOW_PATH_DECL(slow_path_to_jsnumber
);
120 LLINT_SLOW_PATH_DECL(slow_path_negate
);
121 LLINT_SLOW_PATH_DECL(slow_path_add
);
122 LLINT_SLOW_PATH_DECL(slow_path_mul
);
123 LLINT_SLOW_PATH_DECL(slow_path_sub
);
124 LLINT_SLOW_PATH_DECL(slow_path_div
);
125 LLINT_SLOW_PATH_DECL(slow_path_mod
);
126 LLINT_SLOW_PATH_DECL(slow_path_lshift
);
127 LLINT_SLOW_PATH_DECL(slow_path_rshift
);
128 LLINT_SLOW_PATH_DECL(slow_path_urshift
);
129 LLINT_SLOW_PATH_DECL(slow_path_bitand
);
130 LLINT_SLOW_PATH_DECL(slow_path_bitor
);
131 LLINT_SLOW_PATH_DECL(slow_path_bitxor
);
132 LLINT_SLOW_PATH_DECL(slow_path_check_has_instance
);
133 LLINT_SLOW_PATH_DECL(slow_path_instanceof
);
134 LLINT_SLOW_PATH_DECL(slow_path_typeof
);
135 LLINT_SLOW_PATH_DECL(slow_path_is_object
);
136 LLINT_SLOW_PATH_DECL(slow_path_is_function
);
137 LLINT_SLOW_PATH_DECL(slow_path_in
);
138 LLINT_SLOW_PATH_DECL(slow_path_resolve
);
139 LLINT_SLOW_PATH_DECL(slow_path_resolve_skip
);
140 LLINT_SLOW_PATH_DECL(slow_path_resolve_global
);
141 LLINT_SLOW_PATH_DECL(slow_path_resolve_global_dynamic
);
142 LLINT_SLOW_PATH_DECL(slow_path_resolve_for_resolve_global_dynamic
);
143 LLINT_SLOW_PATH_DECL(slow_path_resolve_base
);
144 LLINT_SLOW_PATH_DECL(slow_path_ensure_property_exists
);
145 LLINT_SLOW_PATH_DECL(slow_path_resolve_with_base
);
146 LLINT_SLOW_PATH_DECL(slow_path_resolve_with_this
);
147 LLINT_SLOW_PATH_DECL(slow_path_get_by_id
);
148 LLINT_SLOW_PATH_DECL(slow_path_get_arguments_length
);
149 LLINT_SLOW_PATH_DECL(slow_path_put_by_id
);
150 LLINT_SLOW_PATH_DECL(slow_path_del_by_id
);
151 LLINT_SLOW_PATH_DECL(slow_path_get_by_val
);
152 LLINT_SLOW_PATH_DECL(slow_path_get_argument_by_val
);
153 LLINT_SLOW_PATH_DECL(slow_path_get_by_pname
);
154 LLINT_SLOW_PATH_DECL(slow_path_put_by_val
);
155 LLINT_SLOW_PATH_DECL(slow_path_del_by_val
);
156 LLINT_SLOW_PATH_DECL(slow_path_put_by_index
);
157 LLINT_SLOW_PATH_DECL(slow_path_put_getter_setter
);
158 LLINT_SLOW_PATH_DECL(slow_path_jmp_scopes
);
159 LLINT_SLOW_PATH_DECL(slow_path_jtrue
);
160 LLINT_SLOW_PATH_DECL(slow_path_jfalse
);
161 LLINT_SLOW_PATH_DECL(slow_path_jless
);
162 LLINT_SLOW_PATH_DECL(slow_path_jnless
);
163 LLINT_SLOW_PATH_DECL(slow_path_jgreater
);
164 LLINT_SLOW_PATH_DECL(slow_path_jngreater
);
165 LLINT_SLOW_PATH_DECL(slow_path_jlesseq
);
166 LLINT_SLOW_PATH_DECL(slow_path_jnlesseq
);
167 LLINT_SLOW_PATH_DECL(slow_path_jgreatereq
);
168 LLINT_SLOW_PATH_DECL(slow_path_jngreatereq
);
169 LLINT_SLOW_PATH_DECL(slow_path_switch_imm
);
170 LLINT_SLOW_PATH_DECL(slow_path_switch_char
);
171 LLINT_SLOW_PATH_DECL(slow_path_switch_string
);
172 LLINT_SLOW_PATH_DECL(slow_path_new_func
);
173 LLINT_SLOW_PATH_DECL(slow_path_new_func_exp
);
174 LLINT_SLOW_PATH_DECL(slow_path_call
);
175 LLINT_SLOW_PATH_DECL(slow_path_construct
);
176 LLINT_SLOW_PATH_DECL(slow_path_call_varargs
);
177 LLINT_SLOW_PATH_DECL(slow_path_call_eval
);
178 LLINT_SLOW_PATH_DECL(slow_path_tear_off_activation
);
179 LLINT_SLOW_PATH_DECL(slow_path_tear_off_arguments
);
180 LLINT_SLOW_PATH_DECL(slow_path_strcat
);
181 LLINT_SLOW_PATH_DECL(slow_path_to_primitive
);
182 LLINT_SLOW_PATH_DECL(slow_path_get_pnames
);
183 LLINT_SLOW_PATH_DECL(slow_path_next_pname
);
184 LLINT_SLOW_PATH_DECL(slow_path_push_scope
);
185 LLINT_SLOW_PATH_DECL(slow_path_pop_scope
);
186 LLINT_SLOW_PATH_DECL(slow_path_push_new_scope
);
187 LLINT_SLOW_PATH_DECL(slow_path_throw
);
188 LLINT_SLOW_PATH_DECL(slow_path_throw_reference_error
);
189 LLINT_SLOW_PATH_DECL(slow_path_debug
);
190 LLINT_SLOW_PATH_DECL(slow_path_profile_will_call
);
191 LLINT_SLOW_PATH_DECL(slow_path_profile_did_call
);
192 LLINT_SLOW_PATH_DECL(throw_from_native_call
);
194 } } // namespace JSC::LLInt
196 #endif // ENABLE(LLINT)
198 #endif // LLIntSlowPaths_h