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