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

Split Split Close
Expand all
Collapse all
          --- old/hotspot/src/share/vm/oops/methodData.hpp
          +++ new/hotspot/src/share/vm/oops/methodData.hpp
↓ open down ↓ 2091 lines elided ↑ open up ↑
2092 2092  #if INCLUDE_RTM_OPT
2093 2093    // State of RTM code generation during compilation of the method
2094 2094    int               _rtm_state;
2095 2095  #endif
2096 2096  
2097 2097    // Number of loops and blocks is computed when compiling the first
2098 2098    // time with C1. It is used to determine if method is trivial.
2099 2099    short             _num_loops;
2100 2100    short             _num_blocks;
2101 2101    // Does this method contain anything worth profiling?
2102      -  bool              _would_profile;
     2102 +  enum WouldProfile {unknown, no_profile, profile};
     2103 +  WouldProfile      _would_profile;
2103 2104  
2104 2105    // Size of _data array in bytes.  (Excludes header and extra_data fields.)
2105 2106    int _data_size;
2106 2107  
2107 2108    // data index for the area dedicated to parameters. -1 if no
2108 2109    // parameter profiling.
2109 2110    int _parameters_type_data_di;
2110 2111  
2111 2112    // Beginning of the data entries
2112 2113    intptr_t _data[1];
↓ open down ↓ 148 lines elided ↑ open up ↑
2261 2262    }
2262 2263    void atomic_set_rtm_state(RTMState rstate) {
2263 2264      Atomic::store((int)rstate, &_rtm_state);
2264 2265    }
2265 2266  
2266 2267    static int rtm_state_offset_in_bytes() {
2267 2268      return offset_of(MethodData, _rtm_state);
2268 2269    }
2269 2270  #endif
2270 2271  
2271      -  void set_would_profile(bool p)              { _would_profile = p;    }
2272      -  bool would_profile() const                  { return _would_profile; }
     2272 +  void set_would_profile(bool p)              { _would_profile = p ? profile : no_profile; }
     2273 +  bool would_profile() const                  { return _would_profile != no_profile; }
2273 2274  
2274 2275    int num_loops() const                       { return _num_loops;  }
2275 2276    void set_num_loops(int n)                   { _num_loops = n;     }
2276 2277    int num_blocks() const                      { return _num_blocks; }
2277 2278    void set_num_blocks(int n)                  { _num_blocks = n;    }
2278 2279  
2279 2280    bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
2280 2281    static int mileage_of(Method* m);
2281 2282  
2282 2283    // Support for interprocedural escape analysis, from Thomas Kotzmann.
↓ open down ↓ 199 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX