1/*
2 * Copyright (C) 2011-2018 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#pragma once
27
28#include "CommonSlowPaths.h"
29#include <wtf/StdLibExtras.h>
30
31namespace JSC {
32
33class CallFrame;
34struct Instruction;
35struct ProtoCallFrame;
36
37namespace LLInt {
38
39extern "C" SlowPathReturnType llint_trace_operand(CallFrame*, const Instruction*, int fromWhere, int operand);
40extern "C" SlowPathReturnType llint_trace_value(CallFrame*, const Instruction*, int fromWhere, VirtualRegister operand);
41extern "C" void llint_write_barrier_slow(CallFrame*, JSCell*) WTF_INTERNAL;
42
43#define LLINT_SLOW_PATH_DECL(name) \
44 extern "C" SlowPathReturnType llint_##name(CallFrame* callFrame, const Instruction* pc)
45
46#define LLINT_SLOW_PATH_HIDDEN_DECL(name) \
47 LLINT_SLOW_PATH_DECL(name) WTF_INTERNAL
48
49LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue);
50LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue_function_for_call);
51LLINT_SLOW_PATH_HIDDEN_DECL(trace_prologue_function_for_construct);
52LLINT_SLOW_PATH_HIDDEN_DECL(trace_arityCheck_for_call);
53LLINT_SLOW_PATH_HIDDEN_DECL(trace_arityCheck_for_construct);
54LLINT_SLOW_PATH_HIDDEN_DECL(trace);
55LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr);
56LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_call);
57LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_construct);
58LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_call_arityCheck);
59LLINT_SLOW_PATH_HIDDEN_DECL(entry_osr_function_for_construct_arityCheck);
60LLINT_SLOW_PATH_HIDDEN_DECL(loop_osr);
61LLINT_SLOW_PATH_HIDDEN_DECL(replace);
62LLINT_SLOW_PATH_HIDDEN_DECL(stack_check);
63LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_object);
64LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_array);
65LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_array_with_size);
66LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_regexp);
67LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_instanceof);
68LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_instanceof_custom);
69LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_try_get_by_id);
70LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id_direct);
71LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id);
72LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_id);
73LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_id);
74LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_val);
75LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_argument_by_val);
76LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_val);
77LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_val_direct);
78LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_val);
79LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_getter_by_id);
80LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_setter_by_id);
81LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_getter_setter_by_id);
82LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_getter_by_val);
83LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_setter_by_val);
84LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jtrue);
85LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jfalse);
86LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jless);
87LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jnless);
88LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jgreater);
89LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jngreater);
90LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jlesseq);
91LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jnlesseq);
92LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jgreatereq);
93LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jngreatereq);
94LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jeq);
95LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jneq);
96LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jstricteq);
97LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_jnstricteq);
98LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_imm);
99LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_char);
100LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_string);
101LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func);
102LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func_exp);
103LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_generator_func);
104LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_generator_func_exp);
105LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_async_generator_func);
106LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_async_generator_func_exp);
107LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_async_func);
108LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_async_func_exp);
109LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_set_function_name);
110LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call);
111LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tail_call);
112LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct);
113LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_size_frame_for_varargs);
114LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_size_frame_for_forward_arguments);
115LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_varargs);
116LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tail_call_varargs);
117LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tail_call_forward_arguments);
118LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct_varargs);
119LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval);
120LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval_wide16);
121LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval_wide32);
122LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_arguments);
123LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_strcat);
124LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_to_primitive);
125LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw);
126LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_traps);
127LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_debug);
128LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_exception);
129LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_from_scope);
130LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_to_scope);
131LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_check_if_exception_is_uncatchable_and_notify_profiler);
132LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_catch);
133LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_log_shadow_chicken_prologue);
134LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_log_shadow_chicken_tail);
135LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_super_sampler_begin);
136LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_super_sampler_end);
137LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_out_of_line_jump_target);
138extern "C" SlowPathReturnType llint_throw_stack_overflow_error(VM*, ProtoCallFrame*) WTF_INTERNAL;
139#if ENABLE(C_LOOP)
140extern "C" SlowPathReturnType llint_stack_check_at_vm_entry(VM*, Register*) WTF_INTERNAL;
141#endif
142extern "C" NO_RETURN_DUE_TO_CRASH void llint_crash() WTF_INTERNAL;
143
144} } // namespace JSC::LLInt
145