Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/runtime/compilationPolicy.hpp
          +++ new/src/share/vm/runtime/compilationPolicy.hpp
↓ open down ↓ 51 lines elided ↑ open up ↑
  52   52    static bool must_be_compiled(methodHandle m, int comp_level = CompLevel_all);
  53   53    // m is allowed to be compiled
  54   54    static bool can_be_compiled(methodHandle m, int comp_level = CompLevel_all);
  55   55    static bool is_compilation_enabled();
  56   56    static void set_policy(CompilationPolicy* policy) { _policy = policy; }
  57   57    static CompilationPolicy* policy()                { return _policy; }
  58   58  
  59   59    // Profiling
  60   60    elapsedTimer* accumulated_time() { return &_accumulated_time; }
  61   61    void print_time() PRODUCT_RETURN;
       62 +  // Return initial compile level that is used with Xcomp
       63 +  virtual CompLevel initial_compile_level() = 0;
  62   64    virtual int compiler_count(CompLevel comp_level) = 0;
  63   65    // main notification entry, return a pointer to an nmethod if the OSR is required,
  64   66    // returns NULL otherwise.
  65   67    virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS) = 0;
  66   68    // safepoint() is called at the end of the safepoint
  67   69    virtual void do_safepoint_work() = 0;
  68   70    // reprofile request
  69   71    virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0;
  70   72    // delay_compilation(method) can be called by any component of the runtime to notify the policy
  71   73    // that it's recommended to delay the complation of this method.
↓ open down ↓ 15 lines elided ↑ open up ↑
  87   89  class NonTieredCompPolicy : public CompilationPolicy {
  88   90    int _compiler_count;
  89   91  protected:
  90   92    static void trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci);
  91   93    static void trace_osr_request(methodHandle method, nmethod* osr, int bci);
  92   94    static void trace_osr_completion(nmethod* osr_nm);
  93   95    void reset_counter_for_invocation_event(methodHandle method);
  94   96    void reset_counter_for_back_branch_event(methodHandle method);
  95   97  public:
  96   98    NonTieredCompPolicy() : _compiler_count(0) { }
       99 +  virtual CompLevel initial_compile_level() { return CompLevel_initial_compile; }
  97  100    virtual int compiler_count(CompLevel comp_level);
  98  101    virtual void do_safepoint_work();
  99  102    virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
 100  103    virtual void delay_compilation(methodOop method);
 101  104    virtual void disable_compilation(methodOop method);
 102  105    virtual bool is_mature(methodOop method);
 103  106    virtual void initialize();
 104  107    virtual CompileTask* select_task(CompileQueue* compile_queue);
 105  108    virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS);
 106  109    virtual void method_invocation_event(methodHandle m, TRAPS) = 0;
↓ open down ↓ 34 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX