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

linkage.h File Reference


Detailed Description

Runtime linkages between major data structures.

Of particular interest are the linkages between thread, class, and object areas.

Several useful macros are defined here. They are used to associate an object instance with its ClassFile structure, its class definition, and its thread definition, where applicable.

The macro CLASS_OBJECT_LINKAGE() associates a class definition with its object instance. The macro OBJECT_CLASS_LINKAGE() associates an object instance with its class definition.

The macro THREAD_OBJECT_LINKAGE() associates a thread definition with its object instance. The macro OBJECT_THREAD_LINKAGE() associates an object instance with its thread definition. This functionality is only meaningful when the object is a java.lang.Thread.

The information stored in that object table entry points to both the ClassFile storage for that class and to the class table entry for that class.

Control

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

Go to the source code of this file.

Defines

#define CLASS_OBJECT_LINKAGE(clsidx)   (&OBJECT(CLASS(clsidx).class_objhash).table_linkage)
 Retrieve class information about a class from its class object.
#define OBJECT_CLASS_LINKAGE(objhash)   (&OBJECT(objhash).table_linkage)
 Retrieve class information about an object from its class.
#define OBJECT_OBJECT_LINKAGE(objhash)
 Retrieve object information about an object from itself.
#define OBJECT_THREAD_LINKAGE(objhash)
 Retrieve thread information about an object from its thread entry.
#define THREAD_OBJECT_LINKAGE(thridx)
 Retrieve object information about a thread from its thread object instance.
#define VERIFY_OBJECT_THREAD_LINKAGE(objhash)
 Verify that a thread slot is in use, is not a null thread, and contains a valid thread object hash.
#define VERIFY_THREAD_LINKAGE(thridx)
 Verify that a thread slot is in use, is not a null thread, and contains a valid, non-null, thread object hash that is definitely marked as a thread object.

Functions

 ARCH_COPYRIGHT_APACHE (linkage, h,"$URL: https://svn.apache.org/path/name/linkage.h $ $Id: linkage.h 0 09/28/2005 dlydick $")
rboolean linkage_resolve_class (jvm_class_index clsidx, rboolean find_registerNatives)
 Resolve class table and object table linkages for a class file, typically one just loaded by class_static_new().
rboolean linkage_unresolve_class (jvm_class_index clsidx)
 Unresolve class table and object table linkages for a class file that is getting ready to be unloaded.


Define Documentation

#define CLASS_OBJECT_LINKAGE clsidx   )     (&OBJECT(CLASS(clsidx).class_objhash).table_linkage)
 

Retrieve class information about a class from its class object.

Parameters:
clsidx Class table index of class definition for which to locate its class definition jvm_table_linkage.
Returns:
(jvm_table_linkage *) to object table class linkage entry

Definition at line 79 of file linkage.h.

Referenced by attribute_find_in_class_by_cp_entry(), attribute_find_in_class_by_enum(), attribute_find_in_field_by_cp_entry(), attribute_find_in_field_by_enum(), attribute_find_in_method_by_cp_entry(), attribute_find_in_method_by_enum(), class_load_from_prchar(), field_find_by_cp_entry(), jvmutil_print_errtype_stack(), jvmutil_print_stack_common(), linkage_resolve_class(), method_find_by_cp_entry(), method_return_type(), object_run_method(), opcode_load_run_throwable(), opcode_run(), and thread_new().

#define OBJECT_CLASS_LINKAGE objhash   )     (&OBJECT(objhash).table_linkage)
 

Retrieve class information about an object from its class.

Parameters:
objhash Object hash of object for which to locate its class table entry.
Returns:
(jvm_table_linkage *) to object table class linkage entry

Definition at line 95 of file linkage.h.

Referenced by field_index_get_object_instance_pjvalue(), field_index_put_object_instance_pjvalue(), field_name_get_object_instance_pjvalue(), field_name_put_object_instance_pjvalue(), jlClass_isArray(), jlObject_getClass(), and jlObject_wait4ever().

#define VERIFY_THREAD_LINKAGE thridx   ) 
 

Value:

(((thridx != jvm_thread_index_null) &&                        \
     (THREAD(thridx).status & THREAD_STATUS_INUSE) &&            \
     (!(THREAD(thridx).status & THREAD_STATUS_NULL)) &&          \
     (THREAD(thridx).thread_objhash != jvm_object_hash_null)&&   \
     (OBJECT(THREAD(thridx).thread_objhash).status &             \
                                        OBJECT_STATUS_INUSE) &&  \
     (!(OBJECT(THREAD(thridx).thread_objhash).status &           \
                                        OBJECT_STATUS_NULL)) &&  \
     (OBJECT(THREAD(thridx).thread_objhash).status &             \
                                        OBJECT_STATUS_THREAD))   \
    ? rtrue                                                      \
    : rfalse)
Verify that a thread slot is in use, is not a null thread, and contains a valid, non-null, thread object hash that is definitely marked as a thread object.

Parameters:
thridx Thread table index of thread to verify its thread table entry.
Returns:
rtrue if this thread index indicates a valid thread table slot, otherwise rfalse.

Definition at line 115 of file linkage.h.

Referenced by jlObject_wait4ever(), jlObject_waittimed(), jlThread_checkAccess(), jlThread_countStackFrames(), jlThread_interrupt(), jlThread_isAlive(), jlThread_isDaemon(), jlThread_setDaemon(), jlThread_setPriority(), and jlThread_start().

#define THREAD_OBJECT_LINKAGE thridx   ) 
 

Value:

((THREAD(thridx).thread_objhash != jvm_object_hash_null)  \
     ? (&OBJECT(THREAD(thridx).thread_objhash).table_linkage) \
     : (jvm_table_linkage *) rnull)
Retrieve object information about a thread from its thread object instance.

Parameters:
thridx Thread table index of thread definition for which to locate its class definition jvm_table_linkage.
Returns:
(jvm_table_linkage *) to object table class linkage entry
Note:
This macro will return rnull if the object hash in this slot is a jvm_thread_index_null reference.

Definition at line 150 of file linkage.h.

#define OBJECT_THREAD_LINKAGE objhash   ) 
 

Value:

(((OBJECT(objhash).status & OBJECT_STATUS_INUSE) &&                \
      (OBJECT(objhash).status & OBJECT_STATUS_THREAD) &&               \
      (jvm_thread_index_null != OBJECT(objhash).table_linkage.thridx)) \
     ? (&OBJECT(objhash).table_linkage)                                \
     : ((jvm_table_linkage *) rnull))
Retrieve thread information about an object from its thread entry.

Parameters:
objhash Object hash of object for which to locate its thread table entry.
Returns:
(jvm_table_linkage *) to object table class linkage entry of java.lang.Thread class object.
Note:
This macro will return rnull if the object in this slot is not a java.lang.Thread object and one which indexes a valid thread.

Definition at line 176 of file linkage.h.

Referenced by jlObject_wait4ever(), jlObject_waittimed(), jlThread_checkAccess(), jlThread_countStackFrames(), jlThread_destroy(), jlThread_interrupt(), jlThread_isAlive(), jlThread_isDaemon(), jlThread_setDaemon(), jlThread_setPriority(), and jlThread_start().

#define VERIFY_OBJECT_THREAD_LINKAGE objhash   ) 
 

Value:

((rnull != (OBJECT_THREAD_LINKAGE(objhash))) \
    ? rtrue                                     \
    : rfalse)
Verify that a thread slot is in use, is not a null thread, and contains a valid thread object hash.

Parameters:
objhash Object hash of object for which to verify its thread linkage and its thread table entry.
Returns:
rtrue if this object hash indicates a valid thread linkage and a thread table slot, otherwise rfalse.

Definition at line 199 of file linkage.h.

Referenced by jlObject_wait4ever(), jlObject_waittimed(), jlThread_checkAccess(), jlThread_countStackFrames(), jlThread_interrupt(), jlThread_isAlive(), jlThread_isDaemon(), jlThread_setDaemon(), jlThread_setPriority(), and jlThread_start().

#define OBJECT_OBJECT_LINKAGE objhash   ) 
 

Value:

((OBJECT(objhash).status & OBJECT_STATUS_INUSE) \
     ? (&OBJECT(objhash).table_linkage)             \
     : (jvm_table_linkage *) rnull)
Retrieve object information about an object from itself.

Parameters:
objhash Object hash of object for which to locate its class definition jvm_table_linkage.
Returns:
(jvm_table_linkage *) to object table class linkage entry
Note:
This macro will return rnull if the object hash in this slot is a jvm_object_hash_null reference.

Definition at line 227 of file linkage.h.

Referenced by object_instance_finalize(), and object_new_setup().


Function Documentation

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

rboolean linkage_resolve_class jvm_class_index  clsidx,
rboolean  find_registerNatives
 

Resolve class table and object table linkages for a class file, typically one just loaded by class_static_new().

Parameters:
clsidx Class table index to class to resolve against all loaded classes.
find_registerNatives When rtrue, will return the ordinal for JVMCFG_JLOBJECT_NMO_REGISTER and JVMCFG_JLOBJECT_NMO_UNREGISTER as well as the other ordinals. Once JVM initialization is complete, this should always be rfalse because all future classes should never have local ordinals.
Returns:
rtrue if class was completely resolved, rfalse otherwise.
rtrue/rfalse irrelevant here

< This slot contains a class

< Class linkages completed

< Ref first constant item

< Ref first constant item

< Declared static .

< Invalid basetype due to malformed tag or other error (not in spec)

< Declared static .

Todo:
What needs to happen when base type is BASETYPE_ARRAY or BASETYPE_ERROR or BASETYPE_VOID?
< Declared native ; implemented in a language other than Java.

< Declared native ; implemented in a language other than Java.

Todo:
Should this instance permit use of find_registerNatives since interaces are not a part of the JVM startup, just a few foundational classes? Should it just be rfalse instead?
< Convenient alias for DML5

< Class linkages completed

Definition at line 91 of file linkage.c.

References ACC_NATIVE, ACC_STATIC, attribute_find_in_method_by_enum(), CONSTANT_Utf8_info::bytes, cfmsgs_show_constant_pool(), CLASS, class_find_by_cp_entry(), CONSTANT_InterfaceMethodref_info::class_index, CONSTANT_Methodref_info::class_index, CONSTANT_Fieldref_info::class_index, CLASS_OBJECT_LINKAGE, CLASS_STATUS_INUSE, CLASS_STATUS_LINKED, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::clsidxJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::clsidxJVM, CONSTANT_Fieldref_info::LOCAL_Fieldref_binding::clsidxJVM, CONSTANT_Class_info::LOCAL_Class_binding::clsidxJVM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::codeatridxJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::codeatridxJVM, CONSTANT_Class, CONSTANT_CP_START_INDEX, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_Long, CONSTANT_Methodref, CONSTANT_NameAndType, ClassFile::constant_pool, CONSTANT_String, CONSTANT_Utf8, CP_TAG, CONSTANT_NameAndType_info::descriptor_index, DMLNORM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::excpatridxJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::excpatridxJVM, EXIT_JVM_ATTRIBUTE, EXIT_JVM_CLASS, exit_throw_exception(), FIELD, field_find_by_cp_entry(), field_index_get_class_static_lookup(), field_index_get_object_instance_lookup(), CONSTANT_Fieldref_info::LOCAL_Fieldref_binding::fluidxJVM, GC_CLASS_MKREF_FROM_CLASS, GENERIC_FAILURE1_VALUE, CONSTANT_Fieldref_info::LOCAL_Fieldref_binding::jvaluetypeJVM, jvm_attribute_index_bad, jvm_attribute_index_native, jvm_class_index_null, jvm_field_index_bad, jvm_field_lookup_index_bad, jvm_method_index_bad, JVMCLASS_JAVA_LANG_NOSUCHFIELDERROR, JVMCLASS_JAVA_LANG_NOSUCHMETHODERROR, LOCAL_BASETYPE_ERROR, CONSTANT_Class_info::LOCAL_Class_binding, LOCAL_CODE_ATTRIBUTE, LOCAL_EXCEPTIONS_ATTRIBUTE, CONSTANT_Fieldref_info::LOCAL_Fieldref_binding, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding, CONSTANT_Methodref_info::LOCAL_Methodref_binding, METHOD, method_find_by_cp_entry(), CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::mthidxJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::mthidxJVM, CONSTANT_InterfaceMethodref_info::name_and_type_index, CONSTANT_Methodref_info::name_and_type_index, CONSTANT_Fieldref_info::name_and_type_index, CONSTANT_NameAndType_info::name_index, CONSTANT_Class_info::name_index, native_locate_local_method(), CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::nmordJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::nmordJVM, CONSTANT_Fieldref_info::LOCAL_Fieldref_binding::oiflagJVM, PTR_THIS_CP_Class, PTR_THIS_CP_Fieldref, PTR_THIS_CP_InterfaceMethodref, PTR_THIS_CP_Methodref, PTR_THIS_CP_NameAndType, PTR_THIS_CP_Utf8, rfalse, rneither_true_nor_false, rnull, and rtrue.

Referenced by class_load_from_prchar().

rboolean linkage_unresolve_class jvm_class_index  clsidx  ) 
 

Unresolve class table and object table linkages for a class file that is getting ready to be unloaded.

Parameters:
clsidx Class table index to class to unresolve against all loaded classes.
Returns:
rtrue if class linkages were unresolved, rfalse otherwise.
< This slot contains a class

< Ref first constant item

< Ref first constant item

< Invalid basetype due to malformed tag or other error (not in spec)

< Convenient alias for DML5

< Class linkages completed

Definition at line 672 of file linkage.c.


Generated on Fri Sep 30 18:50:07 2005 by  doxygen 1.4.4