comparison src/share/vm/oops/methodOop.hpp @ 856:75596850f863

6862576: vmIntrinsics needs cleanup in order to support JSR 292 intrinsics Summary: remove useless lazy evaluation of intrinsics; add LAST_COMPILER_INLINE to help categorize them Reviewed-by: kvn
author jrose
date Tue, 21 Jul 2009 16:56:06 -0700
parents be93aad57795
children 74a5db69c1fe
comparison
equal deleted inserted replaced
854:606c988ff684 856:75596850f863
102 #endif 102 #endif
103 u2 _method_size; // size of this object 103 u2 _method_size; // size of this object
104 u2 _max_stack; // Maximum number of entries on the expression stack 104 u2 _max_stack; // Maximum number of entries on the expression stack
105 u2 _max_locals; // Number of local variables used by this method 105 u2 _max_locals; // Number of local variables used by this method
106 u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words 106 u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
107 u1 _intrinsic_id_cache; // Cache for intrinsic_id; 0 or 1+vmInt::ID 107 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
108 u1 _highest_tier_compile; // Highest compile level this method has ever seen. 108 u1 _highest_tier_compile; // Highest compile level this method has ever seen.
109 u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting 109 u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting
110 u2 _number_of_breakpoints; // fullspeed debugging support 110 u2 _number_of_breakpoints; // fullspeed debugging support
111 InvocationCounter _invocation_counter; // Incremented before each activation of the method - used to trigger frequency-based optimizations 111 InvocationCounter _invocation_counter; // Incremented before each activation of the method - used to trigger frequency-based optimizations
112 InvocationCounter _backedge_counter; // Incremented before each backedge taken - used to trigger frequencey-based optimizations 112 InvocationCounter _backedge_counter; // Incremented before each backedge taken - used to trigger frequencey-based optimizations
222 int max_locals() const { return _max_locals; } 222 int max_locals() const { return _max_locals; }
223 void set_max_locals(int size) { _max_locals = size; } 223 void set_max_locals(int size) { _max_locals = size; }
224 int highest_tier_compile() { return _highest_tier_compile;} 224 int highest_tier_compile() { return _highest_tier_compile;}
225 void set_highest_tier_compile(int level) { _highest_tier_compile = level;} 225 void set_highest_tier_compile(int level) { _highest_tier_compile = level;}
226 226
227 void clear_intrinsic_id_cache() { _intrinsic_id_cache = 0; }
228
229 // Count of times method was exited via exception while interpreting 227 // Count of times method was exited via exception while interpreting
230 void interpreter_throwout_increment() { 228 void interpreter_throwout_increment() {
231 if (_interpreter_throwout_count < 65534) { 229 if (_interpreter_throwout_count < 65534) {
232 _interpreter_throwout_count++; 230 _interpreter_throwout_count++;
233 } 231 }
569 // JNI static invoke cached itable index accessors 567 // JNI static invoke cached itable index accessors
570 int cached_itable_index() { return instanceKlass::cast(method_holder())->cached_itable_index(method_idnum()); } 568 int cached_itable_index() { return instanceKlass::cast(method_holder())->cached_itable_index(method_idnum()); }
571 void set_cached_itable_index(int index) { instanceKlass::cast(method_holder())->set_cached_itable_index(method_idnum(), index); } 569 void set_cached_itable_index(int index) { instanceKlass::cast(method_holder())->set_cached_itable_index(method_idnum(), index); }
572 570
573 // Support for inlining of intrinsic methods 571 // Support for inlining of intrinsic methods
574 vmIntrinsics::ID intrinsic_id() const { // returns zero if not an intrinsic 572 vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; }
575 const u1& cache = _intrinsic_id_cache; 573 void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u1) id; }
576 if (cache != 0) { 574
577 return (vmIntrinsics::ID)(cache - 1); 575 // Helper routines for intrinsic_id() and vmIntrinsics::method().
578 } else { 576 void init_intrinsic_id(); // updates from _none if a match
579 vmIntrinsics::ID id = compute_intrinsic_id(); 577 static vmSymbols::SID klass_id_for_intrinsics(klassOop holder);
580 *(u1*)&cache = ((u1) id) + 1; // force the cache to be non-const
581 vmIntrinsics::verify_method(id, (methodOop) this);
582 assert((vmIntrinsics::ID)(cache - 1) == id, "proper conversion");
583 return id;
584 }
585 }
586 578
587 // On-stack replacement support 579 // On-stack replacement support
588 bool has_osr_nmethod() { return instanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci) != NULL; } 580 bool has_osr_nmethod() { return instanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci) != NULL; }
589 nmethod* lookup_osr_nmethod_for(int bci) { return instanceKlass::cast(method_holder())->lookup_osr_nmethod(this, bci); } 581 nmethod* lookup_osr_nmethod_for(int bci) { return instanceKlass::cast(method_holder())->lookup_osr_nmethod(this, bci); }
590 582
632 bool idempotent = false); 624 bool idempotent = false);
633 625
634 // size of parameters 626 // size of parameters
635 void set_size_of_parameters(int size) { _size_of_parameters = size; } 627 void set_size_of_parameters(int size) { _size_of_parameters = size; }
636 private: 628 private:
637
638 // Helper routine for intrinsic_id().
639 vmIntrinsics::ID compute_intrinsic_id() const;
640 629
641 // Inlined elements 630 // Inlined elements
642 address* native_function_addr() const { assert(is_native(), "must be native"); return (address*) (this+1); } 631 address* native_function_addr() const { assert(is_native(), "must be native"); return (address*) (this+1); }
643 address* signature_handler_addr() const { return native_function_addr() + 1; } 632 address* signature_handler_addr() const { return native_function_addr() + 1; }
644 633