blob: 62f359346e98347d34e79abdd44c02213256ead1 [file] [log] [blame]
Elliott Hughes2faa5f12012-01-30 14:42:07 -08001/*
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 Rogers9651f422011-09-19 20:26:07 -070016
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_RUNTIME_ASM_SUPPORT_H_
18#define ART_RUNTIME_ASM_SUPPORT_H_
Ian Rogers9651f422011-09-19 20:26:07 -070019
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070020#include "read_barrier_c.h"
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -080021
Ian Rogers4b07f172013-02-07 08:29:42 -080022// Value loaded into rSUSPEND for quick. When this value is counted down to zero we do a suspend
23// check.
Ian Rogers4a510d82011-10-09 14:30:24 -070024#define SUSPEND_CHECK_INTERVAL (1000)
25
Ian Rogersd9c4fc92013-10-01 19:45:43 -070026// Offsets within java.lang.Object.
Ian Rogersa9a82542013-10-04 11:17:26 -070027#define CLASS_OFFSET 0
Ian Rogersd9c4fc92013-10-01 19:45:43 -070028#define LOCK_WORD_OFFSET 4
29
Hiroshi Yamauchi624468c2014-03-31 15:14:47 -070030#ifndef USE_BAKER_OR_BROOKS_READ_BARRIER
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -080031
Ian Rogersa9a82542013-10-04 11:17:26 -070032// 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 Rogers4b07f172013-02-07 08:29:42 -080039// Offsets within java.lang.String.
buzbeefc9e6fa2012-03-23 15:14:29 -070040#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 Hao88474b42013-10-23 16:24:40 -070045// Offsets within java.lang.Method.
Ian Rogers5ddb4102014-01-07 08:58:46 -080046#define METHOD_DEX_CACHE_METHODS_OFFSET 12
Ian Rogersef7d42f2014-01-06 12:55:46 -080047#define METHOD_PORTABLE_CODE_OFFSET 40
48#define METHOD_QUICK_CODE_OFFSET 48
Jeff Hao5d917302013-02-27 17:57:33 -080049
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -080050#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 Carlstromfc0e3212013-07-17 14:40:12 -070072#endif // ART_RUNTIME_ASM_SUPPORT_H_