mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
7057120: Tiered: Allow C1 to inline methods with loops
Recompile the enclosing methods without inlining of the method that has OSRed to level 4 or recompile the enclosing method at level 4. Reviewed-by: kvn, never
This commit is contained in:
parent
528a9bb452
commit
47caaa4c06
11 changed files with 128 additions and 50 deletions
|
@ -62,7 +62,7 @@ protected:
|
|||
void set_c1_count(int x) { _c1_count = x; }
|
||||
void set_c2_count(int x) { _c2_count = x; }
|
||||
|
||||
enum EventType { CALL, LOOP, COMPILE, KILL, UPDATE, REPROFILE };
|
||||
enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT };
|
||||
void print_event(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
|
||||
// Print policy-specific information if necessary
|
||||
virtual void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { }
|
||||
|
@ -88,9 +88,9 @@ protected:
|
|||
return CompLevel_none;
|
||||
}
|
||||
virtual void method_invocation_event(methodHandle method, methodHandle inlinee,
|
||||
CompLevel level, TRAPS);
|
||||
CompLevel level, nmethod* nm, TRAPS);
|
||||
virtual void method_back_branch_event(methodHandle method, methodHandle inlinee,
|
||||
int bci, CompLevel level, TRAPS);
|
||||
int bci, CompLevel level, nmethod* nm, TRAPS);
|
||||
public:
|
||||
SimpleThresholdPolicy() : _c1_count(0), _c2_count(0) { }
|
||||
virtual int compiler_count(CompLevel comp_level) {
|
||||
|
@ -101,17 +101,20 @@ public:
|
|||
virtual void do_safepoint_work() { }
|
||||
virtual void delay_compilation(methodOop method) { }
|
||||
virtual void disable_compilation(methodOop method) { }
|
||||
// TODO: we should honour reprofiling requests in the future. Currently reprofiling
|
||||
// would happen but not to the extent we would ideally like.
|
||||
virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
|
||||
virtual nmethod* event(methodHandle method, methodHandle inlinee,
|
||||
int branch_bci, int bci, CompLevel comp_level, TRAPS);
|
||||
int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS);
|
||||
// Select task is called by CompileBroker. We should return a task or NULL.
|
||||
virtual CompileTask* select_task(CompileQueue* compile_queue);
|
||||
// Tell the runtime if we think a given method is adequately profiled.
|
||||
virtual bool is_mature(methodOop method);
|
||||
// Initialize: set compiler thread count
|
||||
virtual void initialize();
|
||||
virtual bool should_not_inline(ciEnv* env, ciMethod* callee) {
|
||||
return (env->comp_level() == CompLevel_limited_profile ||
|
||||
env->comp_level() == CompLevel_full_profile) &&
|
||||
callee->has_loops();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue