Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/advancedThresholdPolicy.cpp @ 10132:5b6512efcdc4
Merge
author | dcubed |
---|---|
date | Fri, 19 Apr 2013 16:51:27 -0700 |
parents | aeaca88565e6 |
children | 91eba9f82325 |
comparison
equal
deleted
inserted
replaced
10130:6f817ce50129 | 10132:5b6512efcdc4 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
72 set_start_time(os::javaTimeMillis()); | 72 set_start_time(os::javaTimeMillis()); |
73 } | 73 } |
74 | 74 |
75 // update_rate() is called from select_task() while holding a compile queue lock. | 75 // update_rate() is called from select_task() while holding a compile queue lock. |
76 void AdvancedThresholdPolicy::update_rate(jlong t, Method* m) { | 76 void AdvancedThresholdPolicy::update_rate(jlong t, Method* m) { |
77 JavaThread* THREAD = JavaThread::current(); | |
77 if (is_old(m)) { | 78 if (is_old(m)) { |
78 // We don't remove old methods from the queue, | 79 // We don't remove old methods from the queue, |
79 // so we can just zero the rate. | 80 // so we can just zero the rate. |
80 m->set_rate(0); | 81 m->set_rate(0, THREAD); |
81 return; | 82 return; |
82 } | 83 } |
83 | 84 |
84 // We don't update the rate if we've just came out of a safepoint. | 85 // We don't update the rate if we've just came out of a safepoint. |
85 // delta_s is the time since last safepoint in milliseconds. | 86 // delta_s is the time since last safepoint in milliseconds. |
91 | 92 |
92 // We should be running for at least 1ms. | 93 // We should be running for at least 1ms. |
93 if (delta_s >= TieredRateUpdateMinTime) { | 94 if (delta_s >= TieredRateUpdateMinTime) { |
94 // And we must've taken the previous point at least 1ms before. | 95 // And we must've taken the previous point at least 1ms before. |
95 if (delta_t >= TieredRateUpdateMinTime && delta_e > 0) { | 96 if (delta_t >= TieredRateUpdateMinTime && delta_e > 0) { |
96 m->set_prev_time(t); | 97 m->set_prev_time(t, THREAD); |
97 m->set_prev_event_count(event_count); | 98 m->set_prev_event_count(event_count, THREAD); |
98 m->set_rate((float)delta_e / (float)delta_t); // Rate is events per millisecond | 99 m->set_rate((float)delta_e / (float)delta_t, THREAD); // Rate is events per millisecond |
99 } else | 100 } else |
100 if (delta_t > TieredRateUpdateMaxTime && delta_e == 0) { | 101 if (delta_t > TieredRateUpdateMaxTime && delta_e == 0) { |
101 // If nothing happened for 25ms, zero the rate. Don't modify prev values. | 102 // If nothing happened for 25ms, zero the rate. Don't modify prev values. |
102 m->set_rate(0); | 103 m->set_rate(0, THREAD); |
103 } | 104 } |
104 } | 105 } |
105 } | 106 } |
106 | 107 |
107 // Check if this method has been stale from a given number of milliseconds. | 108 // Check if this method has been stale from a given number of milliseconds. |