311 // exception handler table
312 bool has_exception_handler() const
313 { return constMethod()->has_exception_handler(); }
314 int exception_table_length() const
315 { return constMethod()->exception_table_length(); }
316 ExceptionTableElement* exception_table_start() const
317 { return constMethod()->exception_table_start(); }
318
319 // Finds the first entry point bci of an exception handler for an
320 // exception of klass ex_klass thrown at throw_bci. A value of NULL
321 // for ex_klass indicates that the exception klass is not known; in
322 // this case it matches any constraint class. Returns -1 if the
323 // exception cannot be handled in this method. The handler
324 // constraint classes are loaded if necessary. Note that this may
325 // throw an exception if loading of the constraint classes causes
326 // an IllegalAccessError (bugid 4307310) or an OutOfMemoryError.
327 // If an exception is thrown, returns the bci of the
328 // exception handler which caused the exception to be thrown, which
329 // is needed for proper retries. See, for example,
330 // InterpreterRuntime::exception_handler_for_exception.
331 static int fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass, int throw_bci, TRAPS);
332
333 // method data access
334 MethodData* method_data() const {
335 return _method_data;
336 }
337
338 void set_method_data(MethodData* data) {
339 // The store into method must be released. On platforms without
340 // total store order (TSO) the reference may become visible before
341 // the initialization of data otherwise.
342 OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
343 }
344
345 MethodCounters* method_counters() const {
346 return _method_counters;
347 }
348
349 void clear_method_counters() {
350 _method_counters = NULL;
351 }
799 // to provide a valid jmethodID; the only sanity checks are in asserts;
800 // result guaranteed not to be NULL.
801 inline static Method* resolve_jmethod_id(jmethodID mid) {
802 assert(mid != NULL, "JNI method id should not be null");
803 return *((Method**)mid);
804 }
805
806 // Use checked_resolve_jmethod_id() in situations where the caller
807 // should provide a valid jmethodID, but might not. NULL is returned
808 // when the jmethodID does not refer to a valid method.
809 static Method* checked_resolve_jmethod_id(jmethodID mid);
810
811 static void change_method_associated_with_jmethod_id(jmethodID old_jmid_ptr, Method* new_method);
812 static bool is_method_id(jmethodID mid);
813
814 // Clear methods
815 static void clear_jmethod_ids(ClassLoaderData* loader_data);
816 static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
817
818 // Get this method's jmethodID -- allocate if it doesn't exist
819 jmethodID jmethod_id() { methodHandle this_h(this);
820 return InstanceKlass::get_jmethod_id(method_holder(), this_h); }
821
822 // Lookup the jmethodID for this method. Return NULL if not found.
823 // NOTE that this function can be called from a signal handler
824 // (see AsyncGetCallTrace support for Forte Analyzer) and this
825 // needs to be async-safe. No allocation should be done and
826 // so handles are not used to avoid deadlock.
827 jmethodID find_jmethod_id_or_null() { return method_holder()->jmethod_id_or_null(this); }
828
829 // Support for inlining of intrinsic methods
830 vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; }
831 void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u2) id; }
832
833 // Helper routines for intrinsic_id() and vmIntrinsics::method().
834 void init_intrinsic_id(); // updates from _none if a match
835 static vmSymbols::SID klass_id_for_intrinsics(const Klass* holder);
836
837 bool caller_sensitive() {
838 return (_flags & _caller_sensitive) != 0;
839 }
840 void set_caller_sensitive(bool x) {
|
311 // exception handler table
312 bool has_exception_handler() const
313 { return constMethod()->has_exception_handler(); }
314 int exception_table_length() const
315 { return constMethod()->exception_table_length(); }
316 ExceptionTableElement* exception_table_start() const
317 { return constMethod()->exception_table_start(); }
318
319 // Finds the first entry point bci of an exception handler for an
320 // exception of klass ex_klass thrown at throw_bci. A value of NULL
321 // for ex_klass indicates that the exception klass is not known; in
322 // this case it matches any constraint class. Returns -1 if the
323 // exception cannot be handled in this method. The handler
324 // constraint classes are loaded if necessary. Note that this may
325 // throw an exception if loading of the constraint classes causes
326 // an IllegalAccessError (bugid 4307310) or an OutOfMemoryError.
327 // If an exception is thrown, returns the bci of the
328 // exception handler which caused the exception to be thrown, which
329 // is needed for proper retries. See, for example,
330 // InterpreterRuntime::exception_handler_for_exception.
331 static int fast_exception_handler_bci_for(methodHandle mh, Klass* ex_klass, int throw_bci, TRAPS);
332
333 // method data access
334 MethodData* method_data() const {
335 return _method_data;
336 }
337
338 void set_method_data(MethodData* data) {
339 // The store into method must be released. On platforms without
340 // total store order (TSO) the reference may become visible before
341 // the initialization of data otherwise.
342 OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
343 }
344
345 MethodCounters* method_counters() const {
346 return _method_counters;
347 }
348
349 void clear_method_counters() {
350 _method_counters = NULL;
351 }
799 // to provide a valid jmethodID; the only sanity checks are in asserts;
800 // result guaranteed not to be NULL.
801 inline static Method* resolve_jmethod_id(jmethodID mid) {
802 assert(mid != NULL, "JNI method id should not be null");
803 return *((Method**)mid);
804 }
805
806 // Use checked_resolve_jmethod_id() in situations where the caller
807 // should provide a valid jmethodID, but might not. NULL is returned
808 // when the jmethodID does not refer to a valid method.
809 static Method* checked_resolve_jmethod_id(jmethodID mid);
810
811 static void change_method_associated_with_jmethod_id(jmethodID old_jmid_ptr, Method* new_method);
812 static bool is_method_id(jmethodID mid);
813
814 // Clear methods
815 static void clear_jmethod_ids(ClassLoaderData* loader_data);
816 static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
817
818 // Get this method's jmethodID -- allocate if it doesn't exist
819 jmethodID jmethod_id() { return InstanceKlass::get_jmethod_id(method_holder(), this); }
820
821 // Lookup the jmethodID for this method. Return NULL if not found.
822 // NOTE that this function can be called from a signal handler
823 // (see AsyncGetCallTrace support for Forte Analyzer) and this
824 // needs to be async-safe. No allocation should be done and
825 // so handles are not used to avoid deadlock.
826 jmethodID find_jmethod_id_or_null() { return method_holder()->jmethod_id_or_null(this); }
827
828 // Support for inlining of intrinsic methods
829 vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; }
830 void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u2) id; }
831
832 // Helper routines for intrinsic_id() and vmIntrinsics::method().
833 void init_intrinsic_id(); // updates from _none if a match
834 static vmSymbols::SID klass_id_for_intrinsics(const Klass* holder);
835
836 bool caller_sensitive() {
837 return (_flags & _caller_sensitive) != 0;
838 }
839 void set_caller_sensitive(bool x) {
|