blob: 8c108a816d1a2829f7bf84a128da4a2f1f173d29 [file] [log] [blame]
Ian Rogers57b86d42012-03-27 16:05:41 -07001/*
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
Ian Rogers166db042013-07-26 12:05:57 -070017#ifndef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_
18#define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_
Ian Rogers57b86d42012-03-27 16:05:41 -070019
Ian Rogers848871b2013-08-05 10:56:33 -070020#include <jni.h>
21
22#include "base/macros.h"
23#include "offsets.h"
Ian Rogers57b86d42012-03-27 16:05:41 -070024
Ian Rogersdd7624d2014-03-14 17:43:00 -070025#define QUICK_ENTRYPOINT_OFFSET(ptr_size, x) \
26 Thread::QuickEntryPointOffset<ptr_size>(OFFSETOF_MEMBER(QuickEntryPoints, x))
Ian Rogers57b86d42012-03-27 16:05:41 -070027
28namespace art {
Ian Rogers848871b2013-08-05 10:56:33 -070029
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080030namespace mirror {
Brian Carlstromea46f952013-07-30 01:26:50 -070031class ArtMethod;
32class Class;
33class Object;
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080034} // namespace mirror
Ian Rogers848871b2013-08-05 10:56:33 -070035
Ian Rogers57b86d42012-03-27 16:05:41 -070036class Thread;
37
Ian Rogers166db042013-07-26 12:05:57 -070038// Pointers to functions that are called by quick compiler generated code via thread-local storage.
39struct PACKED(4) QuickEntryPoints {
Andreas Gampe98430592014-07-27 19:44:50 -070040#define ENTRYPOINT_ENUM(name, rettype, ...) rettype ( * p ## name )( __VA_ARGS__ );
41#include "quick_entrypoints_list.h"
42 QUICK_ENTRYPOINT_LIST(ENTRYPOINT_ENUM)
43#undef QUICK_ENTRYPOINT_LIST
44#undef ENTRYPOINT_ENUM
Ian Rogers57b86d42012-03-27 16:05:41 -070045};
46
Anwar Ghuloum63937db2013-05-24 09:08:32 -070047
Ian Rogers693ff612013-02-01 10:56:12 -080048// JNI entrypoints.
Ian Rogers1eb512d2013-10-18 15:42:20 -070049// TODO: NO_THREAD_SAFETY_ANALYSIS due to different control paths depending on fast JNI.
50extern uint32_t JniMethodStart(Thread* self) NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
Ian Rogers693ff612013-02-01 10:56:12 -080051extern uint32_t JniMethodStartSynchronized(jobject to_lock, Thread* self)
Ian Rogers1eb512d2013-10-18 15:42:20 -070052 NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
Ian Rogers693ff612013-02-01 10:56:12 -080053extern void JniMethodEnd(uint32_t saved_local_ref_cookie, Thread* self)
Ian Rogers1eb512d2013-10-18 15:42:20 -070054 NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
Ian Rogers693ff612013-02-01 10:56:12 -080055extern void JniMethodEndSynchronized(uint32_t saved_local_ref_cookie, jobject locked,
56 Thread* self)
Ian Rogers1eb512d2013-10-18 15:42:20 -070057 NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
Ian Rogers693ff612013-02-01 10:56:12 -080058extern mirror::Object* JniMethodEndWithReference(jobject result, uint32_t saved_local_ref_cookie,
59 Thread* self)
Ian Rogers1eb512d2013-10-18 15:42:20 -070060 NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
Ian Rogers693ff612013-02-01 10:56:12 -080061
62extern mirror::Object* JniMethodEndWithReferenceSynchronized(jobject result,
63 uint32_t saved_local_ref_cookie,
64 jobject locked, Thread* self)
Ian Rogers1eb512d2013-10-18 15:42:20 -070065 NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
Ian Rogers693ff612013-02-01 10:56:12 -080066
Ian Rogers57b86d42012-03-27 16:05:41 -070067} // namespace art
68
Ian Rogers166db042013-07-26 12:05:57 -070069#endif // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_