blob: f8228c51e632054147b8c578c98079430ca98a82 [file] [log] [blame]
Elliott Hughes0f3c5532012-03-30 14:51:51 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -080016
17#ifndef ART_SRC_COMPILER_LLVM_RUNTIME_SUPPORT_LLVM_H_
18#define ART_SRC_COMPILER_LLVM_RUNTIME_SUPPORT_LLVM_H_
19
20namespace art {
21
TDYa1275bb86012012-04-11 05:57:28 -070022namespace compiler_llvm {
23namespace special_stub {
24 enum SpecialStub {
25 kProxyStub = 16,
26 kMaxSpecialStub
27 };
28}
29} // namespace compiler_llvm
30
31
TDYa12785321912012-04-01 15:24:56 -070032class Method;
33class Object;
34
Shih-wei Liao113f4fc2012-03-04 14:28:35 -080035//----------------------------------------------------------------------------
36// Thread
37//----------------------------------------------------------------------------
38
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -080039void art_push_shadow_frame_from_code(void* new_shadow_frame);
40
41void art_pop_shadow_frame_from_code();
42
Shih-wei Liao113f4fc2012-03-04 14:28:35 -080043
44//----------------------------------------------------------------------------
45// Exception
46//----------------------------------------------------------------------------
47
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -080048bool art_is_exception_pending_from_code();
49
Shih-wei Liao113f4fc2012-03-04 14:28:35 -080050void art_throw_div_zero_from_code();
51
52void art_throw_array_bounds_from_code(int32_t length, int32_t index);
53
54void art_throw_no_such_method_from_code(int32_t method_idx);
55
TDYa1273f9137d2012-04-08 15:59:19 -070056void art_throw_null_pointer_exception_from_code(uint32_t dex_pc);
Shih-wei Liao113f4fc2012-03-04 14:28:35 -080057
TDYa1274165a832012-04-03 17:47:16 -070058void art_throw_stack_overflow_from_code();
Shih-wei Liao113f4fc2012-03-04 14:28:35 -080059
60void art_throw_exception_from_code(Object* exception);
61
Logan Chien736df022012-04-27 16:25:57 +080062int32_t art_find_catch_block_from_code(Method* current_method,
63 uint32_t ti_offset);
Shih-wei Liao113f4fc2012-03-04 14:28:35 -080064
65
TDYa127706e9b62012-04-19 12:24:26 -070066void art_test_suspend_from_code(Thread* thread);
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -080067
68void art_set_current_thread_from_code(void* thread_object_addr);
69
Logan Chien2771fb12012-03-06 16:28:35 +080070//----------------------------------------------------------------------------
71// Runtime Support Function Lookup Callback
72//----------------------------------------------------------------------------
73
74void* art_find_runtime_support_func(void* context, char const* name);
75
TDYa1270b686e52012-04-09 22:43:35 -070076const void* art_fix_stub_from_code(Method* called);
TDYa12785321912012-04-01 15:24:56 -070077
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -080078} // namespace art
79
80#endif // ART_SRC_COMPILER_LLVM_RUNTIME_SUPPORT_LLVM_H_