< prev index next >

hotspot/src/share/vm/oops/methodData.hpp

Print this page
rev 6907 : 8056071: compiler/whitebox/IsMethodCompilableTest.java fails with 'method() is not compilable after 3 iterations'
Summary: Always use MDO if valid and always compile trivial methods with C1 if available.
Reviewed-by: kvn, iveresov


2082   // These counters are used to determine the exact age of MDO.
2083   // We need those because in tiered a method can be concurrently
2084   // executed at different levels.
2085   InvocationCounter _invocation_counter;
2086   // Same for backedges.
2087   InvocationCounter _backedge_counter;
2088   // Counter values at the time profiling started.
2089   int               _invocation_counter_start;
2090   int               _backedge_counter_start;
2091 
2092 #if INCLUDE_RTM_OPT
2093   // State of RTM code generation during compilation of the method
2094   int               _rtm_state;
2095 #endif
2096 
2097   // Number of loops and blocks is computed when compiling the first
2098   // time with C1. It is used to determine if method is trivial.
2099   short             _num_loops;
2100   short             _num_blocks;
2101   // Does this method contain anything worth profiling?
2102   bool              _would_profile;

2103 
2104   // Size of _data array in bytes.  (Excludes header and extra_data fields.)
2105   int _data_size;
2106 
2107   // data index for the area dedicated to parameters. -1 if no
2108   // parameter profiling.
2109   int _parameters_type_data_di;
2110 
2111   // Beginning of the data entries
2112   intptr_t _data[1];
2113 
2114   // Helper for size computation
2115   static int compute_data_size(BytecodeStream* stream);
2116   static int bytecode_cell_count(Bytecodes::Code code);
2117   static bool is_speculative_trap_bytecode(Bytecodes::Code code);
2118   enum { no_profile_data = -1, variable_cell_count = -2 };
2119 
2120   // Helper for initialization
2121   DataLayout* data_layout_at(int data_index) const {
2122     assert(data_index % sizeof(intptr_t) == 0, "unaligned");


2251 
2252   InvocationCounter* invocation_counter()     { return &_invocation_counter; }
2253   InvocationCounter* backedge_counter()       { return &_backedge_counter;   }
2254 
2255 #if INCLUDE_RTM_OPT
2256   int rtm_state() const {
2257     return _rtm_state;
2258   }
2259   void set_rtm_state(RTMState rstate) {
2260     _rtm_state = (int)rstate;
2261   }
2262   void atomic_set_rtm_state(RTMState rstate) {
2263     Atomic::store((int)rstate, &_rtm_state);
2264   }
2265 
2266   static int rtm_state_offset_in_bytes() {
2267     return offset_of(MethodData, _rtm_state);
2268   }
2269 #endif
2270 
2271   void set_would_profile(bool p)              { _would_profile = p;    }
2272   bool would_profile() const                  { return _would_profile; }
2273 
2274   int num_loops() const                       { return _num_loops;  }
2275   void set_num_loops(int n)                   { _num_loops = n;     }
2276   int num_blocks() const                      { return _num_blocks; }
2277   void set_num_blocks(int n)                  { _num_blocks = n;    }
2278 
2279   bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
2280   static int mileage_of(Method* m);
2281 
2282   // Support for interprocedural escape analysis, from Thomas Kotzmann.
2283   enum EscapeFlag {
2284     estimated    = 1 << 0,
2285     return_local = 1 << 1,
2286     return_allocated = 1 << 2,
2287     allocated_escapes = 1 << 3,
2288     unknown_modified = 1 << 4
2289   };
2290 
2291   intx eflags()                                  { return _eflags; }
2292   intx arg_local()                               { return _arg_local; }




2082   // These counters are used to determine the exact age of MDO.
2083   // We need those because in tiered a method can be concurrently
2084   // executed at different levels.
2085   InvocationCounter _invocation_counter;
2086   // Same for backedges.
2087   InvocationCounter _backedge_counter;
2088   // Counter values at the time profiling started.
2089   int               _invocation_counter_start;
2090   int               _backedge_counter_start;
2091 
2092 #if INCLUDE_RTM_OPT
2093   // State of RTM code generation during compilation of the method
2094   int               _rtm_state;
2095 #endif
2096 
2097   // Number of loops and blocks is computed when compiling the first
2098   // time with C1. It is used to determine if method is trivial.
2099   short             _num_loops;
2100   short             _num_blocks;
2101   // Does this method contain anything worth profiling?
2102   enum WouldProfile {unknown, no_profile, profile};
2103   WouldProfile      _would_profile;
2104 
2105   // Size of _data array in bytes.  (Excludes header and extra_data fields.)
2106   int _data_size;
2107 
2108   // data index for the area dedicated to parameters. -1 if no
2109   // parameter profiling.
2110   int _parameters_type_data_di;
2111 
2112   // Beginning of the data entries
2113   intptr_t _data[1];
2114 
2115   // Helper for size computation
2116   static int compute_data_size(BytecodeStream* stream);
2117   static int bytecode_cell_count(Bytecodes::Code code);
2118   static bool is_speculative_trap_bytecode(Bytecodes::Code code);
2119   enum { no_profile_data = -1, variable_cell_count = -2 };
2120 
2121   // Helper for initialization
2122   DataLayout* data_layout_at(int data_index) const {
2123     assert(data_index % sizeof(intptr_t) == 0, "unaligned");


2252 
2253   InvocationCounter* invocation_counter()     { return &_invocation_counter; }
2254   InvocationCounter* backedge_counter()       { return &_backedge_counter;   }
2255 
2256 #if INCLUDE_RTM_OPT
2257   int rtm_state() const {
2258     return _rtm_state;
2259   }
2260   void set_rtm_state(RTMState rstate) {
2261     _rtm_state = (int)rstate;
2262   }
2263   void atomic_set_rtm_state(RTMState rstate) {
2264     Atomic::store((int)rstate, &_rtm_state);
2265   }
2266 
2267   static int rtm_state_offset_in_bytes() {
2268     return offset_of(MethodData, _rtm_state);
2269   }
2270 #endif
2271 
2272   void set_would_profile(bool p)              { _would_profile = p ? profile : no_profile; }
2273   bool would_profile() const                  { return _would_profile != no_profile; }
2274 
2275   int num_loops() const                       { return _num_loops;  }
2276   void set_num_loops(int n)                   { _num_loops = n;     }
2277   int num_blocks() const                      { return _num_blocks; }
2278   void set_num_blocks(int n)                  { _num_blocks = n;    }
2279 
2280   bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
2281   static int mileage_of(Method* m);
2282 
2283   // Support for interprocedural escape analysis, from Thomas Kotzmann.
2284   enum EscapeFlag {
2285     estimated    = 1 << 0,
2286     return_local = 1 << 1,
2287     return_allocated = 1 << 2,
2288     allocated_escapes = 1 << 3,
2289     unknown_modified = 1 << 4
2290   };
2291 
2292   intx eflags()                                  { return _eflags; }
2293   intx arg_local()                               { return _arg_local; }


< prev index next >