Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -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 | */ |
| 16 | |
| 17 | #ifndef ART_SRC_GREENLAND_RUNTIME_ENTRY_POINTS_H_ |
| 18 | #define ART_SRC_GREENLAND_RUNTIME_ENTRY_POINTS_H_ |
| 19 | |
| 20 | #include "macros.h" |
| 21 | |
| 22 | #include <stdint.h> |
| 23 | |
| 24 | #define RUNTIME_ENTRYPOINT(x) \ |
| 25 | (static_cast<uintptr_t>(OFFSETOF_MEMBER(Thread, runtime_entry_points_)) + \ |
| 26 | static_cast<uintptr_t>(OFFSETOF_MEMBER(RuntimeEntryPoints, x))) |
| 27 | |
| 28 | namespace art { |
| 29 | |
| 30 | class Method; |
| 31 | class Object; |
| 32 | class Thread; |
| 33 | |
| 34 | struct PACKED RuntimeEntryPoints { |
| 35 | //---------------------------------------------------------------------------- |
| 36 | // Thread |
| 37 | //---------------------------------------------------------------------------- |
| 38 | void (*TestSuspend)(Thread* thread); |
| 39 | |
| 40 | //---------------------------------------------------------------------------- |
| 41 | // Exception |
| 42 | //---------------------------------------------------------------------------- |
| 43 | int32_t (*FindCatchBlock)(Method* current_method, uint32_t ti_offset); |
| 44 | void (*ThrowIndexOutOfBounds)(int32_t length, int32_t index); |
| 45 | void (*ThrowNullPointerException)(unsigned dex_pc); |
| 46 | |
| 47 | //---------------------------------------------------------------------------- |
| 48 | // Alloc |
| 49 | //---------------------------------------------------------------------------- |
| 50 | Object* (*AllocArray)(uint32_t type_idx, Method* referrer, |
| 51 | uint32_t length, Thread* thread); |
| 52 | |
| 53 | Object* (*AllocArrayWithAccessCheck)(uint32_t type_idx, Method* referrer, |
| 54 | uint32_t length, Thread* thread); |
| 55 | |
| 56 | Object* (*CheckAndAllocArray)(uint32_t type_idx, Method* referrer, |
| 57 | uint32_t length, Thread* thread); |
| 58 | |
| 59 | Object* (*CheckAndAllocArrayWithAccessCheck)(uint32_t type_idx, |
| 60 | Method* referrer, |
| 61 | uint32_t length, |
| 62 | Thread* thread); |
| 63 | |
| 64 | //---------------------------------------------------------------------------- |
| 65 | // DexCache |
| 66 | //---------------------------------------------------------------------------- |
| 67 | Object* (*ResolveString)(Method* referrer, uint32_t string_idx); |
| 68 | |
| 69 | //---------------------------------------------------------------------------- |
| 70 | // Field |
| 71 | //---------------------------------------------------------------------------- |
| 72 | Object* (*GetObjectStatic)(uint32_t field_idx, Method* referrer); |
| 73 | |
| 74 | //---------------------------------------------------------------------------- |
| 75 | // Cast |
| 76 | //---------------------------------------------------------------------------- |
| 77 | void (*CheckPutArrayElement)(const Object* element, const Object* array); |
| 78 | |
| 79 | //---------------------------------------------------------------------------- |
| 80 | // JNI |
| 81 | //---------------------------------------------------------------------------- |
| 82 | }; |
| 83 | |
| 84 | // Initialize an entry point data structure. |
| 85 | void InitRuntimeEntryPoints(RuntimeEntryPoints* entry_points); |
| 86 | |
| 87 | } // namespace art |
| 88 | |
| 89 | #endif // ART_SRC_GREENLAND_RUNTIME_ENTRY_POINTS_H_ |