Elliott Hughes | 2faa5f1 | 2012-01-30 14:42:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 | */ |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 16 | |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 17 | #ifndef ART_RUNTIME_ASM_SUPPORT_H_ |
| 18 | #define ART_RUNTIME_ASM_SUPPORT_H_ |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 19 | |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 20 | #include "read_barrier_c.h" |
Hiroshi Yamauchi | 9d04a20 | 2014-01-31 13:35:49 -0800 | [diff] [blame] | 21 | |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 22 | // Value loaded into rSUSPEND for quick. When this value is counted down to zero we do a suspend |
| 23 | // check. |
Ian Rogers | 4a510d8 | 2011-10-09 14:30:24 -0700 | [diff] [blame] | 24 | #define SUSPEND_CHECK_INTERVAL (1000) |
| 25 | |
Ian Rogers | d9c4fc9 | 2013-10-01 19:45:43 -0700 | [diff] [blame] | 26 | // Offsets within java.lang.Object. |
Ian Rogers | a9a8254 | 2013-10-04 11:17:26 -0700 | [diff] [blame] | 27 | #define CLASS_OFFSET 0 |
Ian Rogers | d9c4fc9 | 2013-10-01 19:45:43 -0700 | [diff] [blame] | 28 | #define LOCK_WORD_OFFSET 4 |
| 29 | |
Hiroshi Yamauchi | 624468c | 2014-03-31 15:14:47 -0700 | [diff] [blame] | 30 | #ifndef USE_BAKER_OR_BROOKS_READ_BARRIER |
Hiroshi Yamauchi | 9d04a20 | 2014-01-31 13:35:49 -0800 | [diff] [blame] | 31 | |
Ian Rogers | a9a8254 | 2013-10-04 11:17:26 -0700 | [diff] [blame] | 32 | // Offsets within java.lang.Class. |
| 33 | #define CLASS_COMPONENT_TYPE_OFFSET 12 |
| 34 | |
| 35 | // Array offsets. |
| 36 | #define ARRAY_LENGTH_OFFSET 8 |
| 37 | #define OBJECT_ARRAY_DATA_OFFSET 12 |
| 38 | |
Ian Rogers | 4b07f17 | 2013-02-07 08:29:42 -0800 | [diff] [blame] | 39 | // Offsets within java.lang.String. |
buzbee | fc9e6fa | 2012-03-23 15:14:29 -0700 | [diff] [blame] | 40 | #define STRING_VALUE_OFFSET 8 |
| 41 | #define STRING_COUNT_OFFSET 12 |
| 42 | #define STRING_OFFSET_OFFSET 20 |
| 43 | #define STRING_DATA_OFFSET 12 |
| 44 | |
Jeff Hao | 88474b4 | 2013-10-23 16:24:40 -0700 | [diff] [blame] | 45 | // Offsets within java.lang.Method. |
Ian Rogers | 5ddb410 | 2014-01-07 08:58:46 -0800 | [diff] [blame] | 46 | #define METHOD_DEX_CACHE_METHODS_OFFSET 12 |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 47 | #define METHOD_PORTABLE_CODE_OFFSET 40 |
| 48 | #define METHOD_QUICK_CODE_OFFSET 48 |
Jeff Hao | 5d91730 | 2013-02-27 17:57:33 -0800 | [diff] [blame] | 49 | |
Hiroshi Yamauchi | 9d04a20 | 2014-01-31 13:35:49 -0800 | [diff] [blame] | 50 | #else |
| 51 | |
| 52 | // Offsets within java.lang.Class. |
| 53 | #define CLASS_COMPONENT_TYPE_OFFSET 20 |
| 54 | |
| 55 | // Array offsets. |
| 56 | #define ARRAY_LENGTH_OFFSET 16 |
| 57 | #define OBJECT_ARRAY_DATA_OFFSET 20 |
| 58 | |
| 59 | // Offsets within java.lang.String. |
| 60 | #define STRING_VALUE_OFFSET 16 |
| 61 | #define STRING_COUNT_OFFSET 20 |
| 62 | #define STRING_OFFSET_OFFSET 28 |
| 63 | #define STRING_DATA_OFFSET 20 |
| 64 | |
| 65 | // Offsets within java.lang.Method. |
| 66 | #define METHOD_DEX_CACHE_METHODS_OFFSET 20 |
| 67 | #define METHOD_PORTABLE_CODE_OFFSET 48 |
| 68 | #define METHOD_QUICK_CODE_OFFSET 56 |
| 69 | |
| 70 | #endif |
| 71 | |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 72 | #endif // ART_RUNTIME_ASM_SUPPORT_H_ |