blob: ffadd034287b950f2be4528100a2c8ae5af734f0 [file] [log] [blame]
Vladimir Markoeebb8212018-06-05 14:57:24 +01001/*
2 * Copyright (C) 2018 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_COMPILER_OPTIMIZING_INTRINSIC_OBJECTS_H_
18#define ART_COMPILER_OPTIMIZING_INTRINSIC_OBJECTS_H_
19
20#include "base/mutex.h"
21
22namespace art {
23
24class ClassLinker;
25template <class MirrorType> class ObjPtr;
26class MemberOffset;
27class Thread;
28
29namespace mirror {
30class Object;
31template <class T> class ObjectArray;
32} // namespace mirror
33
34class IntrinsicObjects {
35 public:
36 static ObjPtr<mirror::ObjectArray<mirror::Object>> AllocateBootImageLiveObjects(
37 Thread* self,
38 ClassLinker* class_linker) REQUIRES_SHARED(Locks::mutator_lock_);
39
40 // Functions for retrieving data for Integer.valueOf().
41 static ObjPtr<mirror::ObjectArray<mirror::Object>> GetIntegerValueOfCache(
42 ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects)
43 REQUIRES_SHARED(Locks::mutator_lock_);
44 static ObjPtr<mirror::Object> GetIntegerValueOfObject(
45 ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects,
46 uint32_t index) REQUIRES_SHARED(Locks::mutator_lock_);
47 static MemberOffset GetIntegerValueOfArrayDataOffset(
48 ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects)
49 REQUIRES_SHARED(Locks::mutator_lock_);
50};
51
52} // namespace art
53
54#endif // ART_COMPILER_OPTIMIZING_INTRINSIC_OBJECTS_H_