Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

method.h File Reference


Detailed Description

Method management functions for the JVM.

Control

$URL: https://svn.apache.org/path/name/method.h $ $Id: method.h 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file method.h.

Go to the source code of this file.

Defines

#define METHOD(clsidx, mthidx)   (CLASS_OBJECT_LINKAGE(clsidx)->pcfs->methods[mthidx])
 Access structures of a class' method table at certain index.

Functions

 ARCH_COPYRIGHT_APACHE (method, h,"$URL: https://svn.apache.org/path/name/method.h $ $Id: method.h 0 09/28/2005 dlydick $")
jvm_method_index method_find_by_cp_entry (jvm_class_index clsidx, cp_info_dup *mthname, cp_info_dup *mthdesc)
 Locate the method_info index for a normal method in a class using a constant_pool entry to the name and description of the method.
jvm_method_index method_find_by_prchar (jvm_class_index clsidx, rchar *mthname, rchar *mthdesc)
 Retrieve by (rchar *) name a method index to a method in a class.
jvm_basetype method_return_type (jvm_class_index clsidx, jvm_constant_pool_index mthdescidx)
 Extract method return type from descriptor.


Define Documentation

#define METHOD clsidx,
mthidx   )     (CLASS_OBJECT_LINKAGE(clsidx)->pcfs->methods[mthidx])
 

Access structures of a class' method table at certain index.

Each class has a table of methods, divided into virtual methods within the Java code and native methods referenced from the Java code and implemented in some outside object library. They may be distinquished by the ACC_NATIVE status bit in rclass.status This macro references one of them using the clsidx index for the class and mthidx for the method table entry in that class.

Parameters:
clsidx Class table index into the global rjvm.class[] array (via pjvm->class[]).
mthidx Index into method table for this class.
Returns:
pointer to a method table entry

Definition at line 66 of file method.h.

Referenced by linkage_resolve_class().


Function Documentation

ARCH_COPYRIGHT_APACHE method  ,
,
"$URL: https://svn.apache.org/path/name/method.h $ $Id: method.h 0 09/28/2005 dlydick $" 
 

jvm_method_index method_find_by_cp_entry jvm_class_index  clsidx,
cp_info_dup mthname,
cp_info_dup mthdesc
 

Locate the method_info index for a normal method in a class using a constant_pool entry to the name and description of the method.

Parameters:
clsidx Class index of class whose method is to be located.
mthname UTF8 constant_pool entry of name of method in class.
mthdesc UTF8 constant_pool entry of description of method parameters and return type.
Returns:
method table index of this method in class or jvm_method_index_bad if not found.
Throws: nothing. Let caller throw an error like JVMCLASS_JAVA_LANG_NOSUCHMETHODERROR if it is useful at that point. The purpose of this function is simply to locate the method, not make a value judgment on the meaning of the search result.

Definition at line 86 of file method.c.

References CLASS_OBJECT_LINKAGE, CONSTANT_Utf8, EXIT_JVM_METHOD, exit_throw_exception(), jvm_class_index_null, jvm_method_index_bad, JVMCLASS_JAVA_LANG_INTERNALERROR, ClassFile::methods, ClassFile::methods_count, method_info::name_index, PTR_THIS_CP_Utf8, CONSTANT_Utf8_info::tag, and utf_pcfs_strcmp().

Referenced by linkage_resolve_class(), and method_find_by_prchar().

jvm_method_index method_find_by_prchar jvm_class_index  clsidx,
rchar mthname,
rchar mthdesc
 

Retrieve by (rchar *) name a method index to a method in a class.

Parameters:
clsidx Class index of class whose method is to be located.
mthname Null-terminated string of name of method in class.
mthdesc Null-terminated string of description of method parameters and return type.
Returns:
method index of located method in class, otherwise jvm_method_index_bad.

Definition at line 158 of file method.c.

References HEAP_FREE_DATA, method_find_by_cp_entry(), and nts_prchar2utf().

Referenced by class_load_from_prchar(), object_run_method(), and opcode_run().

jvm_basetype method_return_type jvm_class_index  clsidx,
jvm_constant_pool_index  mthdescidx
 

Extract method return type from descriptor.

Parameters:
clsidx Class table index of method to examine.
mthdescidx Class file constant_pool index of method descriptor to examine. This entry must be a CONSTANT_Utf8_info string containing the descriptor of an unqualified method name.
Returns:
Primative base type of method return value or LOCAL_BASETYPE_ERROR if not found.
< Open parameter list

< Signed byte

< Unicode character

< Double-precision floating-point value

< Single-precision floating-point value

< Integer

< Long integer

< an instance of class '/class/name'

< Signed short

< Boolean, true or false

< Reference to one array dimension

< No return type, instead: (rvoid) fn(p1,p2,...)

Todo:
Should this throw a VerifyError instead? Is it better to let caller do this?
< Invalid basetype due to malformed tag or other error (not in spec)

Definition at line 192 of file method.c.

References BASETYPE_CHAR_ARRAY, BASETYPE_CHAR_B, BASETYPE_CHAR_C, BASETYPE_CHAR_D, BASETYPE_CHAR_F, BASETYPE_CHAR_I, BASETYPE_CHAR_J, BASETYPE_CHAR_L, BASETYPE_CHAR_S, BASETYPE_CHAR_Z, CONSTANT_Utf8_info::bytes, CLASS_OBJECT_LINKAGE, CONSTANT_Utf8_info::length, LOCAL_BASETYPE_ERROR, METHOD_CHAR_CLOSE_PARM, METHOD_CHAR_VOID, and PTR_THIS_CP_Utf8.


Generated on Fri Sep 30 19:00:30 2005 by  doxygen 1.4.4