blob: 6353a9b7bfe442f61222021d49aeb626858ae408 [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 {
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080025class Object;
26} // namespace mirror
27
Mathieu Chartiere401d142015-04-22 13:56:20 -070028class ArtMethod;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070029union JValue;
Ian Rogers306057f2012-11-26 12:45:53 -080030class ShadowFrame;
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070031class Thread;
32
33namespace interpreter {
34
Brian Carlstromea46f952013-07-30 01:26:50 -070035// Called by ArtMethod::Invoke, shadow frames arguments are taken from the args array.
Mathieu Chartiere401d142015-04-22 13:56:20 -070036extern void EnterInterpreterFromInvoke(Thread* self, ArtMethod* method,
Jeff Hao6474d192013-03-26 14:08:09 -070037 mirror::Object* receiver, uint32_t* args, JValue* result)
Mathieu Chartier90443472015-07-16 20:32:27 -070038 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070039
Nicolas Geoffray73be1e82015-09-17 15:22:56 +010040// 'from_code' denotes whether the deoptimization was explicitly triggered by compiled code.
41extern void EnterInterpreterFromDeoptimize(Thread* self, ShadowFrame* shadow_frame, bool from_code,
Ian Rogers62d6c772013-02-27 08:32:07 -080042 JValue* ret_val)
Mathieu Chartier90443472015-07-16 20:32:27 -070043 SHARED_REQUIRES(Locks::mutator_lock_);
Jeff Hao11ffc2d2013-02-01 11:52:17 -080044
Ian Rogerse94652f2014-12-02 11:13:19 -080045extern JValue EnterInterpreterFromEntryPoint(Thread* self, const DexFile::CodeItem* code_item,
Ian Rogers6f3dbba2014-10-14 17:41:57 -070046 ShadowFrame* shadow_frame)
Mathieu Chartier90443472015-07-16 20:32:27 -070047 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers7db619b2013-01-16 18:35:48 -080048
Andreas Gampe3cfa4d02015-10-06 17:04:01 -070049void ArtInterpreterToInterpreterBridge(Thread* self, const DexFile::CodeItem* code_item,
50 ShadowFrame* shadow_frame, JValue* result)
51 SHARED_REQUIRES(Locks::mutator_lock_);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070052
buzbee1452bee2015-03-06 14:43:04 -080053// One-time sanity check.
54void CheckInterpreterAsmConstants();
55
56void InitInterpreterTls(Thread* self);
57
Ian Rogers6f3dbba2014-10-14 17:41:57 -070058} // namespace interpreter
59
Ian Rogers2fa6b2e2012-10-17 00:10:17 -070060} // namespace art
61
Brian Carlstromfc0e3212013-07-17 14:40:12 -070062#endif // ART_RUNTIME_INTERPRETER_INTERPRETER_H_