blob: 2b48fff9100ff7e363c70255e50126538ecb6da9 [file] [log] [blame]
Jeff Hao3c3911e2017-08-14 15:14:29 -07001/*
2 * Copyright (C) 2017 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
David Sehr9e734c72018-01-04 17:56:19 -080017#include "dex/dex_file.h"
Jeff Hao3c3911e2017-08-14 15:14:29 -070018
19#include "art_method-inl.h"
David Sehr312f3b22018-03-19 08:39:26 -070020#include "dex/method_reference.h"
Jeff Hao3c3911e2017-08-14 15:14:29 -070021#include "jni.h"
Jeff Hao3c3911e2017-08-14 15:14:29 -070022#include "mirror/class-inl.h"
23#include "mirror/executable.h"
24#include "scoped_thread_state_change-inl.h"
25#include "thread.h"
26
27namespace art {
28namespace {
29
30extern "C" JNIEXPORT jboolean JNICALL Java_Main_testCompiled(JNIEnv* env,
31 jclass,
32 jobject method) {
33 CHECK(method != nullptr);
34 ScopedObjectAccess soa(env);
35 ObjPtr<mirror::Executable> exec = soa.Decode<mirror::Executable>(method);
36 ArtMethod* art_method = exec->GetArtMethod();
37 return art_method->HasAnyCompiledCode();
38}
39
40} // namespace
41} // namespace art