comparison src/share/vm/oops/klassVtable.hpp @ 697:922aedc96ef5

Merge
author ysr
date Fri, 03 Apr 2009 15:59:19 -0700
parents d3676b4cb78c
children c18cbe5936b8
comparison
equal deleted inserted replaced
696:f18338cf04b0 697:922aedc96ef5
1 /* 1 /*
2 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
68 void initialize_vtable(bool checkconstraints, TRAPS); // initialize vtable of a new klass 68 void initialize_vtable(bool checkconstraints, TRAPS); // initialize vtable of a new klass
69 69
70 // conputes vtable length (in words) and the number of miranda methods 70 // conputes vtable length (in words) and the number of miranda methods
71 static void compute_vtable_size_and_num_mirandas(int &vtable_length, int &num_miranda_methods, 71 static void compute_vtable_size_and_num_mirandas(int &vtable_length, int &num_miranda_methods,
72 klassOop super, objArrayOop methods, 72 klassOop super, objArrayOop methods,
73 AccessFlags class_flags, oop classloader, 73 AccessFlags class_flags, Handle classloader,
74 symbolOop classname, objArrayOop local_interfaces); 74 symbolHandle classname, objArrayOop local_interfaces,
75 TRAPS);
75 76
76 // RedefineClasses() API support: 77 // RedefineClasses() API support:
77 // If any entry of this vtable points to any of old_methods, 78 // If any entry of this vtable points to any of old_methods,
78 // replace it with the corresponding new_method. 79 // replace it with the corresponding new_method.
79 // trace_name_printed is set to true if the current call has 80 // trace_name_printed is set to true if the current call has
109 #endif 110 #endif
110 111
111 protected: 112 protected:
112 friend class vtableEntry; 113 friend class vtableEntry;
113 private: 114 private:
115 enum { VTABLE_TRANSITIVE_OVERRIDE_VERSION = 51 } ;
114 void copy_vtable_to(vtableEntry* start); 116 void copy_vtable_to(vtableEntry* start);
115 int initialize_from_super(KlassHandle super); 117 int initialize_from_super(KlassHandle super);
116 int index_of(methodOop m, int len) const; // same as index_of, but search only up to len 118 int index_of(methodOop m, int len) const; // same as index_of, but search only up to len
117 void put_method_at(methodOop m, int index); 119 void put_method_at(methodOop m, int index);
118 static bool needs_new_vtable_entry(methodOop m, klassOop super, oop classloader, symbolOop classname, AccessFlags access_flags); 120 static bool needs_new_vtable_entry(methodHandle m, klassOop super, Handle classloader, symbolHandle classname, AccessFlags access_flags, TRAPS);
119 AccessType vtable_accessibility_at(int i); 121
120 122 bool update_inherited_vtable(instanceKlass* klass, methodHandle target_method, int super_vtable_len, bool checkconstraints, TRAPS);
121 bool update_super_vtable(instanceKlass* klass, methodHandle target_method, int super_vtable_len, bool checkconstraints, TRAPS); 123 instanceKlass* find_transitive_override(instanceKlass* initialsuper, methodHandle target_method, int vtable_index,
124 Handle target_loader, symbolHandle target_classname, Thread* THREAD);
122 125
123 // support for miranda methods 126 // support for miranda methods
124 bool is_miranda_entry_at(int i); 127 bool is_miranda_entry_at(int i);
125 void fill_in_mirandas(int& initialized); 128 void fill_in_mirandas(int& initialized);
126 static bool is_miranda(methodOop m, objArrayOop class_methods, klassOop super); 129 static bool is_miranda(methodOop m, objArrayOop class_methods, klassOop super);
296 static int compute_itable_size(objArrayHandle transitive_interfaces); 299 static int compute_itable_size(objArrayHandle transitive_interfaces);
297 static void setup_itable_offset_table(instanceKlassHandle klass); 300 static void setup_itable_offset_table(instanceKlassHandle klass);
298 301
299 // Resolving of method to index 302 // Resolving of method to index
300 static int compute_itable_index(methodOop m); 303 static int compute_itable_index(methodOop m);
304 // ...and back again:
305 static methodOop method_for_itable_index(klassOop klass, int itable_index);
301 306
302 // Debugging/Statistics 307 // Debugging/Statistics
303 static void print_statistics() PRODUCT_RETURN; 308 static void print_statistics() PRODUCT_RETURN;
304 private: 309 private:
305 intptr_t* vtable_start() const { return ((intptr_t*)_klass()) + _table_offset; } 310 intptr_t* vtable_start() const { return ((intptr_t*)_klass()) + _table_offset; }