]> git.saurik.com Git - apple/javascriptcore.git/blob - llint/LLIntSlowPaths.h
JavaScriptCore-1097.13.tar.gz
[apple/javascriptcore.git] / llint / LLIntSlowPaths.h
1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
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.
12 *
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.
24 */
25
26 #ifndef LLIntSlowPaths_h
27 #define LLIntSlowPaths_h
28
29 #include <wtf/Platform.h>
30 #include <wtf/StdLibExtras.h>
31
32 #if ENABLE(LLINT)
33
34 namespace JSC {
35
36 class ExecState;
37 struct Instruction;
38
39 namespace LLInt {
40
41 #if USE(JSVALUE64)
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 {
46 void* a;
47 void* b;
48 };
49
50 inline SlowPathReturnType encodeResult(void* a, void* b)
51 {
52 SlowPathReturnType result;
53 result.a = a;
54 result.b = b;
55 return result;
56 }
57 #else
58 typedef int64_t SlowPathReturnType;
59
60 inline SlowPathReturnType encodeResult(void* a, void* b)
61 {
62 union {
63 struct {
64 void* a;
65 void* b;
66 } pair;
67 int64_t i;
68 } u;
69 u.pair.a = a;
70 u.pair.b = b;
71 return u.i;
72 }
73 #endif
74
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);
77
78 #define LLINT_SLOW_PATH_DECL(name) \
79 extern "C" SlowPathReturnType llint_##name(ExecState* exec, Instruction* pc)
80
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);
193
194 } } // namespace JSC::LLInt
195
196 #endif // ENABLE(LLINT)
197
198 #endif // LLIntSlowPaths_h
199