summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Class.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2013-09-19 02:56:49 -0700
committer Ian Rogers <irogers@google.com> 2013-09-21 22:00:10 -0700
commitee39a10e45a6a0880e8b829525c40d6055818560 (patch)
tree88cf2b0765ffc8cc96aa2f895254fbf799d0eb40 /runtime/native/java_lang_Class.cc
parent7d690ba929a2a02e2b6344749561d49e2c0d55d2 (diff)
Use class def index from java.lang.Class.
Bug: 10244719 This removes the computation of the dex file index, when necessary this is computed by searching the dex file. Its only necessary in dalvik.system.DexFile.defineClassNative and DexFile::FindInClassPath, the latter not showing up significantly in profiling with this change. (cherry-picked from 8b2c0b9abc3f520495f4387ea040132ba85cae69) Change-Id: I20c73a3b17d86286428ab0fd21bc13f51f36c85c
Diffstat (limited to 'runtime/native/java_lang_Class.cc')
-rw-r--r--runtime/native/java_lang_Class.cc31
1 files changed, 0 insertions, 31 deletions
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index a7296996da..d3011cb013 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -78,35 +78,6 @@ static jclass Class_classForName(JNIEnv* env, jclass, jstring javaName, jboolean
return soa.AddLocalReference<jclass>(c);
}
-static jint Class_getAnnotationDirectoryOffset(JNIEnv* env, jclass javaClass) {
- ScopedObjectAccess soa(env);
- mirror::Class* c = DecodeClass(soa, javaClass);
- if (c->IsPrimitive() || c->IsArrayClass() || c->IsProxyClass()) {
- return 0; // primitive, array and proxy classes don't have class definitions
- }
- const DexFile::ClassDef* class_def = ClassHelper(c).GetClassDef();
- if (class_def == NULL) {
- return 0; // not found
- } else {
- return class_def->annotations_off_;
- }
-}
-
-static jobject Class_getDex(JNIEnv* env, jobject javaClass) {
- ScopedObjectAccess soa(env);
- mirror::Class* c = DecodeClass(soa, javaClass);
-
- mirror::DexCache* dex_cache = c->GetDexCache();
- if (dex_cache == NULL) {
- return NULL;
- }
- const DexFile* dex_file = dex_cache->GetDexFile();
- if (dex_file == NULL) {
- return NULL;
- }
- return dex_file->GetDexObject(env);
-}
-
static jstring Class_getNameNative(JNIEnv* env, jobject javaThis) {
ScopedObjectAccess soa(env);
mirror::Class* c = DecodeClass(soa, javaThis);
@@ -122,8 +93,6 @@ static jobjectArray Class_getProxyInterfaces(JNIEnv* env, jobject javaThis) {
static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Class, classForName, "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;"),
- NATIVE_METHOD(Class, getAnnotationDirectoryOffset, "()I"),
- NATIVE_METHOD(Class, getDex, "()Lcom/android/dex/Dex;"),
NATIVE_METHOD(Class, getNameNative, "()Ljava/lang/String;"),
NATIVE_METHOD(Class, getProxyInterfaces, "()[Ljava/lang/Class;"),
};