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

field.h File Reference


Detailed Description

Field management functions for the JVM.

Control

$URL: https://svn.apache.org/path/name/field.h $ $Id: field.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 field.h.

#include "jvalue.h"

Go to the source code of this file.

Defines

#define FIELD(clsidx, fldidx)   (CLASS_OBJECT_LINKAGE(clsidx)->pcfs->fields[fldidx])
 Access structures of a class' field table at certain index.

Functions

 ARCH_COPYRIGHT_APACHE (field, h,"$URL: https://svn.apache.org/path/name/field.h $ $Id: field.h 0 09/28/2005 dlydick $")
jvm_field_index field_find_by_cp_entry (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc)
 Locate the field_info index for a field in a class.
jvm_field_lookup_index field_index_get_class_static_lookup (jvm_class_index clsidx, jvm_field_index fldidx)
 Retrieve by field index a field lookup index to a static class instance field.
jvaluefield_index_get_class_static_pjvalue (jvm_class_index clsidx, jvm_field_index fldidx)
 Retrieve by field index the value of a static class instance field.
jvm_field_lookup_index field_index_get_object_instance_lookup (jvm_class_index clsidx, jvm_field_index fldidx)
 Retrieve by field index a field lookup index to an object instance field.
jvaluefield_index_get_object_instance_pjvalue (jvm_object_hash objhash, jvm_field_index fldidx)
 Retrieve by field index the value of an object instance field.
rboolean field_index_is_class_static (jvm_class_index clsidx, jvm_field_index fldidx)
 Determine if a field index is to a static class instance field or not.
rboolean field_index_is_object_instance (jvm_class_index clsidx, jvm_field_index fldidx)
 Determine if a field index is to an object instance field or not.
jvm_field_index field_index_put_class_static_pjvalue (jvm_class_index clsidx, jvm_field_index fldidx, jvalue *_jvalue)
 Store by field index the value of a static class instance field.
jvm_field_index field_index_put_object_instance_pjvalue (jvm_object_hash objhash, jvm_field_index fldidx, jvalue *_jvalue)
 Store by field index the value of an object instance field.
jvm_field_lookup_index field_name_get_class_static_lookup (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc)
 Retrieve by name/descriptor a field lookup index to a static class instance field.
jvaluefield_name_get_class_static_pjvalue (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc)
 Retrieve by name the value of a static class instance field.
jvm_field_lookup_index field_name_get_object_instance_lookup (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc)
 Retrieve by name/descriptor a field lookup index to an object instance field.
jvaluefield_name_get_object_instance_pjvalue (jvm_object_hash objhash, cp_info_dup *fldname, cp_info_dup *flddesc)
 Retrieve by name the value of an object instance field.
rboolean field_name_is_class_static (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc)
 Determine if a field name/descriptor is a static class instance field or not.
rboolean field_name_is_object_instance (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc)
 Determine if a field name/descriptor is to an object instance field or not.
jvm_field_index field_name_put_class_static_pjvalue (jvm_class_index clsidx, cp_info_dup *fldname, cp_info_dup *flddesc, jvalue *_jvalue)
 Store by name/descriptor the value of a static class instance field.
jvm_field_index field_name_put_object_instance_pjvalue (jvm_object_hash objhash, cp_info_dup *fldname, cp_info_dup *flddesc, jvalue *_jvalue)
 Store by name/descriptor the value of an object instance field.


Define Documentation

#define FIELD clsidx,
fldidx   )     (CLASS_OBJECT_LINKAGE(clsidx)->pcfs->fields[fldidx])
 

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

Each class has a table of fields, divided into class static fields and object instance fields. This macro references one of them using the clsidx index for the class and fldidx for the field table entry in that class.

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

Definition at line 66 of file field.h.

Referenced by linkage_resolve_class().


Function Documentation

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

jvm_field_index field_find_by_cp_entry jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc
 

Locate the field_info index for a field in a class.

This works both with object instance fields and static class instance fields.

Parameters:
clsidx Class index of class whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
field table index of this field in class or jvm_field_index_bad if not found.
Exceptions:
nothing. Let caller throw an error like JVMCLASS_JAVA_LANG_NOSUCHFIELDERROR if it is useful at that point. The purpose of this function is simply to locate the field, not make a value judgment on the meaning of the search result.

Definition at line 86 of file field.c.

References CLASS_OBJECT_LINKAGE, EXIT_JVM_FIELD, exit_throw_exception(), ClassFile::fields, ClassFile::fields_count, jvm_class_index_null, jvm_field_index_bad, JVMCLASS_JAVA_LANG_INTERNALERROR, field_info::name_index, PTR_THIS_CP_Utf8, and utf_pcfs_strcmp().

Referenced by field_name_get_class_static_lookup(), field_name_get_class_static_pjvalue(), field_name_get_object_instance_lookup(), field_name_get_object_instance_pjvalue(), field_name_is_class_static(), field_name_is_object_instance(), field_name_put_class_static_pjvalue(), field_name_put_object_instance_pjvalue(), and linkage_resolve_class().

rboolean field_index_is_class_static jvm_class_index  clsidx,
jvm_field_index  fldidx
 

Determine if a field index is to a static class instance field or not.

Parameters:
clsidx Class index of class whose field is to be located.
fldidx Field index in class of field to be located
Returns:
rtrue if this field is a class static field, otherwise rfalse.

Definition at line 141 of file field.c.

References CLASS, jvm_field_index_bad, rfalse, and rtrue.

Referenced by field_name_is_class_static().

rboolean field_name_is_class_static jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc
 

Determine if a field name/descriptor is a static class instance field or not.

Parameters:
clsidx Class index of class whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
rtrue if this field is a class static field, otherwise rfalse.

Definition at line 190 of file field.c.

References field_find_by_cp_entry(), and field_index_is_class_static().

rboolean field_index_is_object_instance jvm_class_index  clsidx,
jvm_field_index  fldidx
 

Determine if a field index is to an object instance field or not.

Parameters:
clsidx Class index of class whose field is to be located.
fldidx Field index in class of field to be located
Returns:
rtrue if this field is an object instance field, otherwise rfalse.

Definition at line 216 of file field.c.

References CLASS, jvm_field_index_bad, rfalse, and rtrue.

Referenced by field_name_is_object_instance().

rboolean field_name_is_object_instance jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc
 

Determine if a field name/descriptor is to an object instance field or not.

Parameters:
clsidx Class index of class whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
rtrue if this field is an object instance field, otherwise rfalse.

Definition at line 266 of file field.c.

References field_find_by_cp_entry(), and field_index_is_object_instance().

jvm_field_lookup_index field_index_get_class_static_lookup jvm_class_index  clsidx,
jvm_field_index  fldidx
 

Retrieve by field index a field lookup index to a static class instance field.

Parameters:
clsidx Class index of class whose field is to be located.
fldidx Field index in class of field to be located
Returns:
class static field lookup index of located field, otherwise jvm_field_index_bad.

Definition at line 293 of file field.c.

References CLASS, jvm_field_index_bad, and jvm_field_lookup_index_bad.

Referenced by field_name_get_class_static_lookup(), and linkage_resolve_class().

jvm_field_lookup_index field_name_get_class_static_lookup jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc
 

Retrieve by name/descriptor a field lookup index to a static class instance field.

Parameters:
clsidx Class index of class whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
class static field lookup index of located field, otherwise jvm_field_index_bad.

Definition at line 343 of file field.c.

References field_find_by_cp_entry(), and field_index_get_class_static_lookup().

jvm_field_lookup_index field_index_get_object_instance_lookup jvm_class_index  clsidx,
jvm_field_index  fldidx
 

Retrieve by field index a field lookup index to an object instance field.

Parameters:
clsidx Class index of class whose field is to be located.
fldidx Field index in class of field to be located
Returns:
object instance field lookup index of located field, otherwise jvm_field_index_bad.

Definition at line 372 of file field.c.

References CLASS, jvm_field_index_bad, rfalse, and rtrue.

Referenced by field_name_get_object_instance_lookup(), and linkage_resolve_class().

jvm_field_lookup_index field_name_get_object_instance_lookup jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc
 

Retrieve by name/descriptor a field lookup index to an object instance field.

Parameters:
clsidx Class index of class whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
object instance field lookup index of located field, otherwise jvm_field_index_bad.

Definition at line 424 of file field.c.

References field_find_by_cp_entry(), and field_index_get_object_instance_lookup().

jvalue* field_index_get_class_static_pjvalue jvm_class_index  clsidx,
jvm_field_index  fldidx
 

Retrieve by field index the value of a static class instance field.

Parameters:
clsidx Class index of class whose field is to be located.
fldidx Field index in class of field to be located
Returns:
pointer to class static field data, otherwise rnull.

Definition at line 451 of file field.c.

References CLASS, jvm_field_index_bad, and rnull.

Referenced by field_name_get_class_static_pjvalue().

jvalue* field_name_get_class_static_pjvalue jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc
 

Retrieve by name the value of a static class instance field.

Parameters:
clsidx Class index of class whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
pointer to class static field data, otherwise rnull.

Definition at line 500 of file field.c.

References field_find_by_cp_entry(), and field_index_get_class_static_pjvalue().

jvalue* field_index_get_object_instance_pjvalue jvm_object_hash  objhash,
jvm_field_index  fldidx
 

Retrieve by field index the value of an object instance field.

Parameters:
objhash Object hash of object whose field is to be located.
fldidx Field index in class of field to be located
Returns:
Pointer to object instance field data, otherwise rnull.

Definition at line 526 of file field.c.

References CLASS, OBJECT, OBJECT_CLASS_LINKAGE, and rnull.

Referenced by field_name_get_object_instance_pjvalue().

jvalue* field_name_get_object_instance_pjvalue jvm_object_hash  objhash,
cp_info_dup fldname,
cp_info_dup flddesc
 

Retrieve by name the value of an object instance field.

Parameters:
objhash Object hash of object whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
Returns:
Pointer to object instance field data, otherwise rnull.

Definition at line 572 of file field.c.

References field_find_by_cp_entry(), field_index_get_object_instance_pjvalue(), and OBJECT_CLASS_LINKAGE.

jvm_field_index field_index_put_class_static_pjvalue jvm_class_index  clsidx,
jvm_field_index  fldidx,
jvalue _jvalue
 

Store by field index the value of a static class instance field.

Parameters:
clsidx Class index of class whose field is to be stored.
fldidx Field index in class of field to be stored.
_jvalue Data to be stored.
Returns:
Field index of field name if this is a valid class static field, else jvm_field_index_bad.

Definition at line 606 of file field.c.

References CLASS, and jvm_field_index_bad.

Referenced by field_name_put_class_static_pjvalue().

jvm_field_index field_name_put_class_static_pjvalue jvm_class_index  clsidx,
cp_info_dup fldname,
cp_info_dup flddesc,
jvalue _jvalue
 

Store by name/descriptor the value of a static class instance field.

Parameters:
clsidx Class index of class whose field is to be stored.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
_jvalue Data to be stored.
Returns:
Field index of field name if this is a valid class static field, else jvm_field_index_bad.

Definition at line 664 of file field.c.

References field_find_by_cp_entry(), and field_index_put_class_static_pjvalue().

jvm_field_index field_index_put_object_instance_pjvalue jvm_object_hash  objhash,
jvm_field_index  fldidx,
jvalue _jvalue
 

Store by field index the value of an object instance field.

Parameters:
objhash Object hash of object whose field is to be located.
fldidx Field index in class of field to be stored
_jvalue Data to be stored.
Returns:
Field index of field name if this is a valid object instance field, else jvm_field_index_bad.

Definition at line 697 of file field.c.

References CLASS, jvm_field_index_bad, OBJECT, and OBJECT_CLASS_LINKAGE.

Referenced by field_name_put_object_instance_pjvalue().

jvm_field_index field_name_put_object_instance_pjvalue jvm_object_hash  objhash,
cp_info_dup fldname,
cp_info_dup flddesc,
jvalue _jvalue
 

Store by name/descriptor the value of an object instance field.

Parameters:
objhash Object hash of object whose field is to be located.
fldname UTF8 constant_pool entry of name of field in class.
flddesc UTF8 constant_pool entry of description of field type.
_jvalue Data to be stored.
Returns:
Field index of field name if this is a valid object instance field, else jvm_field_index_bad.

Definition at line 751 of file field.c.

References field_find_by_cp_entry(), field_index_put_object_instance_pjvalue(), and OBJECT_CLASS_LINKAGE.


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