Elliott Hughes | 0f3c553 | 2012-03-30 14:51:51 -0700 | [diff] [blame] | 1 | /* |
| 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 Liao | a8a9c34 | 2012-03-03 22:35:16 -0800 | [diff] [blame] | 16 | |
| 17 | #ifndef ART_SRC_COMPILER_LLVM_RUNTIME_SUPPORT_LLVM_H_ |
| 18 | #define ART_SRC_COMPILER_LLVM_RUNTIME_SUPPORT_LLVM_H_ |
| 19 | |
| 20 | namespace art { |
| 21 | |
TDYa127 | 5bb8601 | 2012-04-11 05:57:28 -0700 | [diff] [blame] | 22 | namespace compiler_llvm { |
| 23 | namespace special_stub { |
| 24 | enum SpecialStub { |
| 25 | kProxyStub = 16, |
| 26 | kMaxSpecialStub |
| 27 | }; |
| 28 | } |
| 29 | } // namespace compiler_llvm |
| 30 | |
| 31 | |
TDYa127 | 8532191 | 2012-04-01 15:24:56 -0700 | [diff] [blame] | 32 | class Method; |
| 33 | class Object; |
| 34 | |
Shih-wei Liao | 113f4fc | 2012-03-04 14:28:35 -0800 | [diff] [blame] | 35 | //---------------------------------------------------------------------------- |
| 36 | // Thread |
| 37 | //---------------------------------------------------------------------------- |
| 38 | |
Shih-wei Liao | a8a9c34 | 2012-03-03 22:35:16 -0800 | [diff] [blame] | 39 | void art_push_shadow_frame_from_code(void* new_shadow_frame); |
| 40 | |
| 41 | void art_pop_shadow_frame_from_code(); |
| 42 | |
Shih-wei Liao | 113f4fc | 2012-03-04 14:28:35 -0800 | [diff] [blame] | 43 | |
| 44 | //---------------------------------------------------------------------------- |
| 45 | // Exception |
| 46 | //---------------------------------------------------------------------------- |
| 47 | |
Shih-wei Liao | a8a9c34 | 2012-03-03 22:35:16 -0800 | [diff] [blame] | 48 | bool art_is_exception_pending_from_code(); |
| 49 | |
Shih-wei Liao | 113f4fc | 2012-03-04 14:28:35 -0800 | [diff] [blame] | 50 | void art_throw_div_zero_from_code(); |
| 51 | |
| 52 | void art_throw_array_bounds_from_code(int32_t length, int32_t index); |
| 53 | |
| 54 | void art_throw_no_such_method_from_code(int32_t method_idx); |
| 55 | |
TDYa127 | 3f9137d | 2012-04-08 15:59:19 -0700 | [diff] [blame] | 56 | void art_throw_null_pointer_exception_from_code(uint32_t dex_pc); |
Shih-wei Liao | 113f4fc | 2012-03-04 14:28:35 -0800 | [diff] [blame] | 57 | |
TDYa127 | 4165a83 | 2012-04-03 17:47:16 -0700 | [diff] [blame] | 58 | void art_throw_stack_overflow_from_code(); |
Shih-wei Liao | 113f4fc | 2012-03-04 14:28:35 -0800 | [diff] [blame] | 59 | |
| 60 | void art_throw_exception_from_code(Object* exception); |
| 61 | |
Logan Chien | 736df02 | 2012-04-27 16:25:57 +0800 | [diff] [blame] | 62 | int32_t art_find_catch_block_from_code(Method* current_method, |
| 63 | uint32_t ti_offset); |
Shih-wei Liao | 113f4fc | 2012-03-04 14:28:35 -0800 | [diff] [blame] | 64 | |
| 65 | |
TDYa127 | 706e9b6 | 2012-04-19 12:24:26 -0700 | [diff] [blame] | 66 | void art_test_suspend_from_code(Thread* thread); |
Shih-wei Liao | a8a9c34 | 2012-03-03 22:35:16 -0800 | [diff] [blame] | 67 | |
| 68 | void art_set_current_thread_from_code(void* thread_object_addr); |
| 69 | |
Logan Chien | 2771fb1 | 2012-03-06 16:28:35 +0800 | [diff] [blame] | 70 | //---------------------------------------------------------------------------- |
| 71 | // Runtime Support Function Lookup Callback |
| 72 | //---------------------------------------------------------------------------- |
| 73 | |
| 74 | void* art_find_runtime_support_func(void* context, char const* name); |
| 75 | |
TDYa127 | 0b686e5 | 2012-04-09 22:43:35 -0700 | [diff] [blame] | 76 | const void* art_fix_stub_from_code(Method* called); |
TDYa127 | 8532191 | 2012-04-01 15:24:56 -0700 | [diff] [blame] | 77 | |
Shih-wei Liao | a8a9c34 | 2012-03-03 22:35:16 -0800 | [diff] [blame] | 78 | } // namespace art |
| 79 | |
| 80 | #endif // ART_SRC_COMPILER_LLVM_RUNTIME_SUPPORT_LLVM_H_ |