90 int limit() const { return CompileThreshold; } |
90 int limit() const { return CompileThreshold; } |
91 Action action() const { return _action[state()]; } |
91 Action action() const { return _action[state()]; } |
92 int count() const { return _counter >> number_of_noncount_bits; } |
92 int count() const { return _counter >> number_of_noncount_bits; } |
93 |
93 |
94 #ifdef CC_INTERP |
94 #ifdef CC_INTERP |
|
95 static int InterpreterInvocationLimit; // CompileThreshold scaled for interpreter use |
|
96 static int InterpreterBackwardBranchLimit; // A separate threshold for on stack replacement |
|
97 |
95 // Test counter using scaled limits like the asm interpreter would do rather than doing |
98 // Test counter using scaled limits like the asm interpreter would do rather than doing |
96 // the shifts to normalize the counter. |
99 // the shifts to normalize the counter. |
97 // Checks sum of invocation_counter and backedge_counter as the template interpreter does. |
100 // Checks sum of invocation_counter and backedge_counter as the template interpreter does. |
98 bool reached_InvocationLimit(InvocationCounter *back_edge_count) const { |
101 bool reached_InvocationLimit(InvocationCounter *back_edge_count) const { |
99 return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= |
102 return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= |
100 (unsigned int) InterpreterInvocationLimit; |
103 (unsigned int) InterpreterInvocationLimit; |
101 } |
104 } |
102 bool reached_BackwardBranchLimit(InvocationCounter *back_edge_count) const { |
105 bool reached_BackwardBranchLimit(InvocationCounter *back_edge_count) const { |
103 return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= |
106 return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= |
104 (unsigned int) InterpreterBackwardBranchLimit; |
107 (unsigned int) InterpreterBackwardBranchLimit; |
105 } |
|
106 // Do this just like asm interpreter does for max speed. |
|
107 bool reached_ProfileLimit(InvocationCounter *back_edge_count) const { |
|
108 return (_counter & count_mask) + (back_edge_count->_counter & count_mask) >= |
|
109 (unsigned int) InterpreterProfileLimit; |
|
110 } |
108 } |
111 #endif // CC_INTERP |
109 #endif // CC_INTERP |
112 |
110 |
113 void increment() { _counter += count_increment; } |
111 void increment() { _counter += count_increment; } |
114 |
112 |