blob: 0750eb5c4938c23cf56512cb07ff5703921d33f4 [file] [log] [blame]
Ian Rogers2fa6b2e2012-10-17 00:10:17 -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
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_RUNTIME_INTERPRETER_INTERPRETER_H_
18#define ART_RUNTIME_INTERPRETER_INTERPRETER_H_
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070019
Ian Rogers719d1a32014-03-06 12:13:39 -080020#include "base/mutex.h"
Ian Rogers7db619b2013-01-16 18:35:48 -080021#include "dex_file.h"
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070022
23namespace art {
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080024namespace mirror {
Brian Carlstromea46f952013-07-30 01:26:50 -070025class ArtMethod;
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080026class Object;
27} // namespace mirror
28
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070029union JValue;
Ian Rogers7db619b2013-01-16 18:35:48 -080030class MethodHelper;
Ian Rogers306057f2012-11-26 12:45:53 -080031class ShadowFrame;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070032class Thread;
33
34namespace interpreter {
35
Brian Carlstromea46f952013-07-30 01:26:50 -070036// Called by ArtMethod::Invoke, shadow frames arguments are taken from the args array.
37extern void EnterInterpreterFromInvoke(Thread* self, mirror::ArtMethod* method,
Jeff Hao6474d192013-03-26 14:08:09 -070038 mirror::Object* receiver, uint32_t* args, JValue* result)
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070039 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
40
Ian Rogers62d6c772013-02-27 08:32:07 -080041extern void EnterInterpreterFromDeoptimize(Thread* self, ShadowFrame* shadow_frame,
42 JValue* ret_val)
Jeff Hao11ffc2d2013-02-01 11:52:17 -080043 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
44
Ian Rogers7db619b2013-01-16 18:35:48 -080045extern JValue EnterInterpreterFromStub(Thread* self, MethodHelper& mh,
46 const DexFile::CodeItem* code_item,
47 ShadowFrame& shadow_frame)
48 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
49
Ian Rogers848871b2013-08-05 10:56:33 -070050extern "C" void artInterpreterToInterpreterBridge(Thread* self, MethodHelper& mh,
51 const DexFile::CodeItem* code_item,
52 ShadowFrame* shadow_frame, JValue* result)
Jeff Hao16743632013-05-08 10:59:04 -070053 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
54
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070055} // namespace interpreter
Ian Rogers0f40ac32013-08-13 22:10:30 -070056
57extern "C" void artInterpreterToCompiledCodeBridge(Thread* self, MethodHelper& mh,
58 const DexFile::CodeItem* code_item,
59 ShadowFrame* shadow_frame, JValue* result)
60 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
61
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070062} // namespace art
63
Brian Carlstromfc0e3212013-07-17 14:40:12 -070064#endif // ART_RUNTIME_INTERPRETER_INTERPRETER_H_