comparison src/share/vm/oops/methodOop.hpp @ 2177:3582bf76420e

6990754: Use native memory and reference counting to implement SymbolTable Summary: move symbols from permgen into C heap and reference count them Reviewed-by: never, acorn, jmasa, stefank
author coleenp
date Thu, 27 Jan 2011 16:11:27 -0800
parents 8012aa3ccede
children c5a923563727 15d6977f04b0
comparison
equal deleted inserted replaced
2176:27e4ea99855d 2177:3582bf76420e
159 // access flag 159 // access flag
160 AccessFlags access_flags() const { return _access_flags; } 160 AccessFlags access_flags() const { return _access_flags; }
161 void set_access_flags(AccessFlags flags) { _access_flags = flags; } 161 void set_access_flags(AccessFlags flags) { _access_flags = flags; }
162 162
163 // name 163 // name
164 symbolOop name() const { return _constants->symbol_at(name_index()); } 164 Symbol* name() const { return _constants->symbol_at(name_index()); }
165 int name_index() const { return constMethod()->name_index(); } 165 int name_index() const { return constMethod()->name_index(); }
166 void set_name_index(int index) { constMethod()->set_name_index(index); } 166 void set_name_index(int index) { constMethod()->set_name_index(index); }
167 167
168 // signature 168 // signature
169 symbolOop signature() const { return _constants->symbol_at(signature_index()); } 169 Symbol* signature() const { return _constants->symbol_at(signature_index()); }
170 int signature_index() const { return constMethod()->signature_index(); } 170 int signature_index() const { return constMethod()->signature_index(); }
171 void set_signature_index(int index) { constMethod()->set_signature_index(index); } 171 void set_signature_index(int index) { constMethod()->set_signature_index(index); }
172 172
173 // generics support 173 // generics support
174 symbolOop generic_signature() const { int idx = generic_signature_index(); return ((idx != 0) ? _constants->symbol_at(idx) : (symbolOop)NULL); } 174 Symbol* generic_signature() const { int idx = generic_signature_index(); return ((idx != 0) ? _constants->symbol_at(idx) : (Symbol*)NULL); }
175 int generic_signature_index() const { return constMethod()->generic_signature_index(); } 175 int generic_signature_index() const { return constMethod()->generic_signature_index(); }
176 void set_generic_signature_index(int index) { constMethod()->set_generic_signature_index(index); } 176 void set_generic_signature_index(int index) { constMethod()->set_generic_signature_index(index); }
177 177
178 // annotations support 178 // annotations support
179 typeArrayOop annotations() const { return instanceKlass::cast(method_holder())->get_method_annotations_of(method_idnum()); } 179 typeArrayOop annotations() const { return instanceKlass::cast(method_holder())->get_method_annotations_of(method_idnum()); }
191 // area if a buffer is not provided by the caller. 191 // area if a buffer is not provided by the caller.
192 char* name_and_sig_as_C_string(); 192 char* name_and_sig_as_C_string();
193 char* name_and_sig_as_C_string(char* buf, int size); 193 char* name_and_sig_as_C_string(char* buf, int size);
194 194
195 // Static routine in the situations we don't have a methodOop 195 // Static routine in the situations we don't have a methodOop
196 static char* name_and_sig_as_C_string(Klass* klass, symbolOop method_name, symbolOop signature); 196 static char* name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature);
197 static char* name_and_sig_as_C_string(Klass* klass, symbolOop method_name, symbolOop signature, char* buf, int size); 197 static char* name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature, char* buf, int size);
198 198
199 Bytecodes::Code java_code_at(int bci) const { 199 Bytecodes::Code java_code_at(int bci) const {
200 return Bytecodes::java_code_at(this, bcp_from(bci)); 200 return Bytecodes::java_code_at(this, bcp_from(bci));
201 } 201 }
202 Bytecodes::Code code_at(int bci) const { 202 Bytecodes::Code code_at(int bci) const {
431 431
432 // method holder (the klassOop holding this method) 432 // method holder (the klassOop holding this method)
433 klassOop method_holder() const { return _constants->pool_holder(); } 433 klassOop method_holder() const { return _constants->pool_holder(); }
434 434
435 void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments) 435 void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments)
436 symbolOop klass_name() const; // returns the name of the method holder 436 Symbol* klass_name() const; // returns the name of the method holder
437 BasicType result_type() const; // type of the method result 437 BasicType result_type() const; // type of the method result
438 int result_type_index() const; // type index of the method result 438 int result_type_index() const; // type index of the method result
439 bool is_returning_oop() const { BasicType r = result_type(); return (r == T_OBJECT || r == T_ARRAY); } 439 bool is_returning_oop() const { BasicType r = result_type(); return (r == T_OBJECT || r == T_ARRAY); }
440 bool is_returning_fp() const { BasicType r = result_type(); return (r == T_FLOAT || r == T_DOUBLE); } 440 bool is_returning_fp() const { BasicType r = result_type(); return (r == T_FLOAT || r == T_DOUBLE); }
441 441
562 bool is_overridden_in(klassOop k) const; 562 bool is_overridden_in(klassOop k) const;
563 563
564 // JSR 292 support 564 // JSR 292 support
565 bool is_method_handle_invoke() const { return access_flags().is_method_handle_invoke(); } 565 bool is_method_handle_invoke() const { return access_flags().is_method_handle_invoke(); }
566 static bool is_method_handle_invoke_name(vmSymbols::SID name_sid); 566 static bool is_method_handle_invoke_name(vmSymbols::SID name_sid);
567 static bool is_method_handle_invoke_name(symbolOop name) { 567 static bool is_method_handle_invoke_name(Symbol* name) {
568 return is_method_handle_invoke_name(vmSymbols::find_sid(name)); 568 return is_method_handle_invoke_name(vmSymbols::find_sid(name));
569 } 569 }
570 // Tests if this method is an internal adapter frame from the 570 // Tests if this method is an internal adapter frame from the
571 // MethodHandleCompiler. 571 // MethodHandleCompiler.
572 bool is_method_handle_adapter() const; 572 bool is_method_handle_adapter() const;
573 static methodHandle make_invoke_method(KlassHandle holder, 573 static methodHandle make_invoke_method(KlassHandle holder,
574 symbolHandle name, //invokeExact or invokeGeneric 574 Symbol* name, //invokeExact or invokeGeneric
575 symbolHandle signature, //anything at all 575 Symbol* signature, //anything at all
576 Handle method_type, 576 Handle method_type,
577 TRAPS); 577 TRAPS);
578 // these operate only on invoke methods: 578 // these operate only on invoke methods:
579 oop method_handle_type() const; 579 oop method_handle_type() const;
580 static jint* method_type_offsets_chain(); // series of pointer-offsets, terminated by -1 580 static jint* method_type_offsets_chain(); // series of pointer-offsets, terminated by -1