diff options
| author | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-23 18:44:43 +0000 |
|---|---|---|
| committer | kseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-23 18:44:43 +0000 |
| commit | 1006fe52a9bfcab1387e9aeaa7d9ceeb26604bb4 (patch) | |
| tree | 851ca1946e5e0ce049a3eb008b9ffc2fd099513e /libjava/java/lang/natClass.cc | |
| parent | 138f59be670f9c73dfea48ac4153227f92e30ec7 (diff) | |
| download | ppe42-gcc-1006fe52a9bfcab1387e9aeaa7d9ceeb26604bb4.tar.gz ppe42-gcc-1006fe52a9bfcab1387e9aeaa7d9ceeb26604bb4.zip | |
* java/lang/Class.h (_Jv_FindInterpreterMethod): Add new declaration.
* java/lang/natClass.cc (_Jv_FindInterpreterMethod): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110142 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/natClass.cc')
| -rw-r--r-- | libjava/java/lang/natClass.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index bd68eb22435..951bab974cc 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -1,6 +1,6 @@ // natClass.cc - Implementation of java.lang.Class native methods. -/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation This file is part of libgcj. @@ -1220,3 +1220,29 @@ _Jv_getInterfaceMethod (jclass search_class, jclass &found_class, int &index, return false; } + +#ifdef INTERPRETER +_Jv_InterpMethod* +_Jv_FindInterpreterMethod (jclass klass, jmethodID desired_method) +{ + using namespace java::lang::reflect; + + _Jv_InterpClass* iclass + = reinterpret_cast<_Jv_InterpClass*> (klass->aux_info); + _Jv_MethodBase** imethods = _Jv_GetFirstMethod (iclass); + + for (int i = 0; i < JvNumMethods (klass); ++i) + { + _Jv_MethodBase* imeth = imethods[i]; + _Jv_ushort accflags = klass->methods[i].accflags; + if ((accflags & (Modifier::NATIVE | Modifier::ABSTRACT)) == 0) + { + _Jv_InterpMethod* im = reinterpret_cast<_Jv_InterpMethod*> (imeth); + if (im->get_method () == desired_method) + return im; + } + } + + return NULL; +} +#endif |

