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

linkage.c File Reference


Detailed Description

Late binding linkages between classes.

This logic should be called each and every time a class is loaded or unloaded. When a new class is loaded, existing classes may have unresolved linkages to them that need to be filled in to point to the new class. Likewise, when a class is unloaded, the remaining classes need to have the linkages removed. In this manner, the class linkage status will stay current.

Control

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

#include "arch.h"
#include "jvmcfg.h"
#include "cfmacros.h"
#include "classfile.h"
#include "attribute.h"
#include "exit.h"
#include "field.h"
#include "gc.h"
#include "jvm.h"
#include "jvmclass.h"
#include "linkage.h"
#include "method.h"
#include "native.h"
#include "util.h"

Go to the source code of this file.

Functions

static void linkage_c_dummy (void)
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.

Variables

static char * linkage_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/linkage.c $ $Id: linkage.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable."


Function Documentation

static void linkage_c_dummy void   )  [static]
 

Definition at line 48 of file linkage.c.

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_Fieldref_info::class_index, CONSTANT_Methodref_info::class_index, CONSTANT_InterfaceMethodref_info::class_index, CLASS_OBJECT_LINKAGE, CLASS_STATUS_INUSE, CLASS_STATUS_LINKED, CONSTANT_Class_info::LOCAL_Class_binding::clsidxJVM, CONSTANT_Fieldref_info::LOCAL_Fieldref_binding::clsidxJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::clsidxJVM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::clsidxJVM, CONSTANT_Methodref_info::LOCAL_Methodref_binding::codeatridxJVM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_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_Methodref_info::LOCAL_Methodref_binding::excpatridxJVM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_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_Methodref_info::LOCAL_Methodref_binding::mthidxJVM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_binding::mthidxJVM, CONSTANT_Fieldref_info::name_and_type_index, CONSTANT_Methodref_info::name_and_type_index, CONSTANT_InterfaceMethodref_info::name_and_type_index, CONSTANT_Class_info::name_index, CONSTANT_NameAndType_info::name_index, native_locate_local_method(), CONSTANT_Methodref_info::LOCAL_Methodref_binding::nmordJVM, CONSTANT_InterfaceMethodref_info::LOCAL_InterfaceMethodref_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.


Variable Documentation

char* linkage_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/linkage.c $ $Id: linkage.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." [static]
 

Definition at line 48 of file linkage.c.


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