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 */ 16 17 #ifndef ART_RUNTIME_ASM_SUPPORT_H_ 18 #define ART_RUNTIME_ASM_SUPPORT_H_ 19 20 #include "read_barrier_c.h" 21 22 // Value loaded into rSUSPEND for quick. When this value is counted down to zero we do a suspend 23 // check. 24 #define SUSPEND_CHECK_INTERVAL (1000) 25 26 // Offsets within java.lang.Object. 27 #define CLASS_OFFSET 0 28 #define LOCK_WORD_OFFSET 4 29 30 #if !defined(USE_BAKER_OR_BROOKS_READ_BARRIER) 31 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 39 // Offsets within java.lang.String. 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 45 // Offsets within java.lang.Method. 46 #define METHOD_DEX_CACHE_METHODS_OFFSET 12 47 #if defined(ART_USE_PORTABLE_COMPILER) 48 #define METHOD_PORTABLE_CODE_OFFSET 40 49 #define METHOD_QUICK_CODE_OFFSET 48 50 #else 51 #define METHOD_PORTABLE_CODE_OFFSET 40 52 #define METHOD_QUICK_CODE_OFFSET 40 53 #endif // ART_USE_PORTABLE_COMPILER 54 55 #else 56 57 // Offsets within java.lang.Class. 58 #define CLASS_COMPONENT_TYPE_OFFSET 20 59 60 // Array offsets. 61 #define ARRAY_LENGTH_OFFSET 16 62 #define OBJECT_ARRAY_DATA_OFFSET 20 63 64 // Offsets within java.lang.String. 65 #define STRING_VALUE_OFFSET 16 66 #define STRING_COUNT_OFFSET 20 67 #define STRING_OFFSET_OFFSET 28 68 #define STRING_DATA_OFFSET 20 69 70 // Offsets within java.lang.Method. 71 #define METHOD_DEX_CACHE_METHODS_OFFSET 20 72 #define METHOD_PORTABLE_CODE_OFFSET 48 73 #define METHOD_QUICK_CODE_OFFSET 56 74 75 #endif // USE_BAKER_OR_BROOKS_READ_BARRIER 76 77 #endif // ART_RUNTIME_ASM_SUPPORT_H_ 78