src/share/vm/oops/methodData.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8067713 Sdiff src/share/vm/oops

src/share/vm/oops/methodData.hpp

Print this page




 237   static int flag_number_to_byte_constant(int flag_number) {
 238     assert(0 <= flag_number && flag_number < flag_limit, "oob");
 239     DataLayout temp; temp.set_header(0);
 240     temp.set_flag_at(flag_number);
 241     return temp._header._struct._flags;
 242   }
 243   // Return a value which, when or-ed as a word into _header, sets the flag.
 244   static intptr_t flag_mask_to_header_mask(int byte_constant) {
 245     DataLayout temp; temp.set_header(0);
 246     temp._header._struct._flags = byte_constant;
 247     return temp._header._bits;
 248   }
 249 
 250   ProfileData* data_in();
 251 
 252   // GC support
 253   void clean_weak_klass_links(BoolObjectClosure* cl);
 254 
 255   // Redefinition support
 256   void clean_weak_method_links();

 257 };
 258 
 259 
 260 // ProfileData class hierarchy
 261 class ProfileData;
 262 class   BitData;
 263 class     CounterData;
 264 class       ReceiverTypeData;
 265 class         VirtualCallData;
 266 class           VirtualCallTypeData;
 267 class       RetData;
 268 class       CallTypeData;
 269 class   JumpData;
 270 class     BranchData;
 271 class   ArrayData;
 272 class     MultiBranchData;
 273 class     ArgInfoData;
 274 class     ParametersTypeData;
 275 class   SpeculativeTrapData;
 276 


 494     return is_VirtualCallTypeData() ? (VirtualCallTypeData*)this : NULL;
 495   }
 496   ParametersTypeData* as_ParametersTypeData() const {
 497     assert(is_ParametersTypeData(), "wrong type");
 498     return is_ParametersTypeData() ? (ParametersTypeData*)this : NULL;
 499   }
 500   SpeculativeTrapData* as_SpeculativeTrapData() const {
 501     assert(is_SpeculativeTrapData(), "wrong type");
 502     return is_SpeculativeTrapData() ? (SpeculativeTrapData*)this : NULL;
 503   }
 504 
 505 
 506   // Subclass specific initialization
 507   virtual void post_initialize(BytecodeStream* stream, MethodData* mdo) {}
 508 
 509   // GC support
 510   virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) {}
 511 
 512   // Redefinition support
 513   virtual void clean_weak_method_links() {}

 514 
 515   // CI translation: ProfileData can represent both MethodDataOop data
 516   // as well as CIMethodData data. This function is provided for translating
 517   // an oop in a ProfileData to the ci equivalent. Generally speaking,
 518   // most ProfileData don't require any translation, so we provide the null
 519   // translation here, and the required translators are in the ci subclasses.
 520   virtual void translate_from(const ProfileData* data) {}
 521 
 522   virtual void print_data_on(outputStream* st, const char* extra = NULL) const {
 523     ShouldNotReachHere();
 524   }
 525 
 526   void print_data_on(outputStream* st, const MethodData* md) const;
 527 
 528   void print_shared(outputStream* st, const char* name, const char* extra) const;
 529   void tab(outputStream* st, bool first = false) const;
 530 };
 531 
 532 // BitData
 533 //


1954   SpeculativeTrapData(DataLayout* layout) : ProfileData(layout) {
1955     assert(layout->tag() == DataLayout::speculative_trap_data_tag, "wrong type");
1956   }
1957 
1958   virtual bool is_SpeculativeTrapData() const { return true; }
1959 
1960   static int static_cell_count() {
1961     return speculative_trap_cell_count;
1962   }
1963 
1964   virtual int cell_count() const {
1965     return static_cell_count();
1966   }
1967 
1968   // Direct accessor
1969   Method* method() const {
1970     return (Method*)intptr_at(speculative_trap_method);
1971   }
1972 
1973   void set_method(Method* m) {

1974     set_intptr_at(speculative_trap_method, (intptr_t)m);
1975   }
1976 
1977   static ByteSize method_offset() {
1978     return cell_offset(speculative_trap_method);
1979   }
1980 
1981   virtual void print_data_on(outputStream* st, const char* extra = NULL) const;
1982 };
1983 
1984 // MethodData*
1985 //
1986 // A MethodData* holds information which has been collected about
1987 // a method.  Its layout looks like this:
1988 //
1989 // -----------------------------
1990 // | header                    |
1991 // | klass                     |
1992 // -----------------------------
1993 // | method                    |


2463   void print_value_on(outputStream* st) const;
2464 
2465   // printing support for method data
2466   void print_data_on(outputStream* st) const;
2467 
2468   const char* internal_name() const { return "{method data}"; }
2469 
2470   // verification
2471   void verify_on(outputStream* st);
2472   void verify_data_on(outputStream* st);
2473 
2474   static bool profile_parameters_for_method(methodHandle m);
2475   static bool profile_arguments();
2476   static bool profile_arguments_jsr292_only();
2477   static bool profile_return();
2478   static bool profile_parameters();
2479   static bool profile_return_jsr292_only();
2480 
2481   void clean_method_data(BoolObjectClosure* is_alive);
2482   void clean_weak_method_links();

2483   Mutex* extra_data_lock() { return &_extra_data_lock; }
2484 };
2485 
2486 #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP


 237   static int flag_number_to_byte_constant(int flag_number) {
 238     assert(0 <= flag_number && flag_number < flag_limit, "oob");
 239     DataLayout temp; temp.set_header(0);
 240     temp.set_flag_at(flag_number);
 241     return temp._header._struct._flags;
 242   }
 243   // Return a value which, when or-ed as a word into _header, sets the flag.
 244   static intptr_t flag_mask_to_header_mask(int byte_constant) {
 245     DataLayout temp; temp.set_header(0);
 246     temp._header._struct._flags = byte_constant;
 247     return temp._header._bits;
 248   }
 249 
 250   ProfileData* data_in();
 251 
 252   // GC support
 253   void clean_weak_klass_links(BoolObjectClosure* cl);
 254 
 255   // Redefinition support
 256   void clean_weak_method_links();
 257   DEBUG_ONLY(void verify_clean_weak_method_links();)
 258 };
 259 
 260 
 261 // ProfileData class hierarchy
 262 class ProfileData;
 263 class   BitData;
 264 class     CounterData;
 265 class       ReceiverTypeData;
 266 class         VirtualCallData;
 267 class           VirtualCallTypeData;
 268 class       RetData;
 269 class       CallTypeData;
 270 class   JumpData;
 271 class     BranchData;
 272 class   ArrayData;
 273 class     MultiBranchData;
 274 class     ArgInfoData;
 275 class     ParametersTypeData;
 276 class   SpeculativeTrapData;
 277 


 495     return is_VirtualCallTypeData() ? (VirtualCallTypeData*)this : NULL;
 496   }
 497   ParametersTypeData* as_ParametersTypeData() const {
 498     assert(is_ParametersTypeData(), "wrong type");
 499     return is_ParametersTypeData() ? (ParametersTypeData*)this : NULL;
 500   }
 501   SpeculativeTrapData* as_SpeculativeTrapData() const {
 502     assert(is_SpeculativeTrapData(), "wrong type");
 503     return is_SpeculativeTrapData() ? (SpeculativeTrapData*)this : NULL;
 504   }
 505 
 506 
 507   // Subclass specific initialization
 508   virtual void post_initialize(BytecodeStream* stream, MethodData* mdo) {}
 509 
 510   // GC support
 511   virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) {}
 512 
 513   // Redefinition support
 514   virtual void clean_weak_method_links() {}
 515   DEBUG_ONLY(virtual void verify_clean_weak_method_links() {})
 516 
 517   // CI translation: ProfileData can represent both MethodDataOop data
 518   // as well as CIMethodData data. This function is provided for translating
 519   // an oop in a ProfileData to the ci equivalent. Generally speaking,
 520   // most ProfileData don't require any translation, so we provide the null
 521   // translation here, and the required translators are in the ci subclasses.
 522   virtual void translate_from(const ProfileData* data) {}
 523 
 524   virtual void print_data_on(outputStream* st, const char* extra = NULL) const {
 525     ShouldNotReachHere();
 526   }
 527 
 528   void print_data_on(outputStream* st, const MethodData* md) const;
 529 
 530   void print_shared(outputStream* st, const char* name, const char* extra) const;
 531   void tab(outputStream* st, bool first = false) const;
 532 };
 533 
 534 // BitData
 535 //


1956   SpeculativeTrapData(DataLayout* layout) : ProfileData(layout) {
1957     assert(layout->tag() == DataLayout::speculative_trap_data_tag, "wrong type");
1958   }
1959 
1960   virtual bool is_SpeculativeTrapData() const { return true; }
1961 
1962   static int static_cell_count() {
1963     return speculative_trap_cell_count;
1964   }
1965 
1966   virtual int cell_count() const {
1967     return static_cell_count();
1968   }
1969 
1970   // Direct accessor
1971   Method* method() const {
1972     return (Method*)intptr_at(speculative_trap_method);
1973   }
1974 
1975   void set_method(Method* m) {
1976     assert(!m->is_old(), "cannot add old methods");
1977     set_intptr_at(speculative_trap_method, (intptr_t)m);
1978   }
1979 
1980   static ByteSize method_offset() {
1981     return cell_offset(speculative_trap_method);
1982   }
1983 
1984   virtual void print_data_on(outputStream* st, const char* extra = NULL) const;
1985 };
1986 
1987 // MethodData*
1988 //
1989 // A MethodData* holds information which has been collected about
1990 // a method.  Its layout looks like this:
1991 //
1992 // -----------------------------
1993 // | header                    |
1994 // | klass                     |
1995 // -----------------------------
1996 // | method                    |


2466   void print_value_on(outputStream* st) const;
2467 
2468   // printing support for method data
2469   void print_data_on(outputStream* st) const;
2470 
2471   const char* internal_name() const { return "{method data}"; }
2472 
2473   // verification
2474   void verify_on(outputStream* st);
2475   void verify_data_on(outputStream* st);
2476 
2477   static bool profile_parameters_for_method(methodHandle m);
2478   static bool profile_arguments();
2479   static bool profile_arguments_jsr292_only();
2480   static bool profile_return();
2481   static bool profile_parameters();
2482   static bool profile_return_jsr292_only();
2483 
2484   void clean_method_data(BoolObjectClosure* is_alive);
2485   void clean_weak_method_links();
2486   DEBUG_ONLY(void verify_clean_weak_method_links();)
2487   Mutex* extra_data_lock() { return &_extra_data_lock; }
2488 };
2489 
2490 #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP
src/share/vm/oops/methodData.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File