Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/simpleThresholdPolicy.hpp @ 4825:20334ed5ed3c
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
Summary: Make sure that CompilationPolicy::event() doesn't throw exceptions
Reviewed-by: kvn, never
author | iveresov |
---|---|
date | Thu, 26 Jan 2012 12:15:24 -0800 |
parents | 973293defacd |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
4824:5dbed2f542ff | 4825:20334ed5ed3c |
---|---|
65 enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT }; | 65 enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT }; |
66 void print_event(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level); | 66 void print_event(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level); |
67 // Print policy-specific information if necessary | 67 // Print policy-specific information if necessary |
68 virtual void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { } | 68 virtual void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { } |
69 // Check if the method can be compiled, change level if necessary | 69 // Check if the method can be compiled, change level if necessary |
70 void compile(methodHandle mh, int bci, CompLevel level, TRAPS); | 70 void compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread); |
71 // Submit a given method for compilation | 71 // Submit a given method for compilation |
72 virtual void submit_compile(methodHandle mh, int bci, CompLevel level, TRAPS); | 72 virtual void submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread); |
73 // Simple methods are as good being compiled with C1 as C2. | 73 // Simple methods are as good being compiled with C1 as C2. |
74 // This function tells if it's such a function. | 74 // This function tells if it's such a function. |
75 inline bool is_trivial(methodOop method); | 75 inline bool is_trivial(methodOop method); |
76 | 76 |
77 // Predicate helpers are used by .*_predicate() methods as well as others. | 77 // Predicate helpers are used by .*_predicate() methods as well as others. |
86 return (CompLevel)nm->comp_level(); | 86 return (CompLevel)nm->comp_level(); |
87 } | 87 } |
88 return CompLevel_none; | 88 return CompLevel_none; |
89 } | 89 } |
90 virtual void method_invocation_event(methodHandle method, methodHandle inlinee, | 90 virtual void method_invocation_event(methodHandle method, methodHandle inlinee, |
91 CompLevel level, nmethod* nm, TRAPS); | 91 CompLevel level, nmethod* nm, JavaThread* thread); |
92 virtual void method_back_branch_event(methodHandle method, methodHandle inlinee, | 92 virtual void method_back_branch_event(methodHandle method, methodHandle inlinee, |
93 int bci, CompLevel level, nmethod* nm, TRAPS); | 93 int bci, CompLevel level, nmethod* nm, JavaThread* thread); |
94 public: | 94 public: |
95 SimpleThresholdPolicy() : _c1_count(0), _c2_count(0) { } | 95 SimpleThresholdPolicy() : _c1_count(0), _c2_count(0) { } |
96 virtual int compiler_count(CompLevel comp_level) { | 96 virtual int compiler_count(CompLevel comp_level) { |
97 if (is_c1_compile(comp_level)) return c1_count(); | 97 if (is_c1_compile(comp_level)) return c1_count(); |
98 if (is_c2_compile(comp_level)) return c2_count(); | 98 if (is_c2_compile(comp_level)) return c2_count(); |
102 virtual void do_safepoint_work() { } | 102 virtual void do_safepoint_work() { } |
103 virtual void delay_compilation(methodOop method) { } | 103 virtual void delay_compilation(methodOop method) { } |
104 virtual void disable_compilation(methodOop method) { } | 104 virtual void disable_compilation(methodOop method) { } |
105 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr); | 105 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr); |
106 virtual nmethod* event(methodHandle method, methodHandle inlinee, | 106 virtual nmethod* event(methodHandle method, methodHandle inlinee, |
107 int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS); | 107 int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread); |
108 // Select task is called by CompileBroker. We should return a task or NULL. | 108 // Select task is called by CompileBroker. We should return a task or NULL. |
109 virtual CompileTask* select_task(CompileQueue* compile_queue); | 109 virtual CompileTask* select_task(CompileQueue* compile_queue); |
110 // Tell the runtime if we think a given method is adequately profiled. | 110 // Tell the runtime if we think a given method is adequately profiled. |
111 virtual bool is_mature(methodOop method); | 111 virtual bool is_mature(methodOop method); |
112 // Initialize: set compiler thread count | 112 // Initialize: set compiler thread count |