equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2010, 2016, 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. |
190 if (sd->is_top()) break; |
190 if (sd->is_top()) break; |
191 } |
191 } |
192 } |
192 } |
193 |
193 |
194 nmethod* SimpleThresholdPolicy::event(const methodHandle& method, const methodHandle& inlinee, |
194 nmethod* SimpleThresholdPolicy::event(const methodHandle& method, const methodHandle& inlinee, |
195 int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) { |
195 int branch_bci, int bci, CompLevel comp_level, CompiledMethod* nm, JavaThread* thread) { |
196 if (comp_level == CompLevel_none && |
196 if (comp_level == CompLevel_none && |
197 JvmtiExport::can_post_interpreter_events() && |
197 JvmtiExport::can_post_interpreter_events() && |
198 thread->is_interp_only_mode()) { |
198 thread->is_interp_only_mode()) { |
199 return NULL; |
199 return NULL; |
200 } |
200 } |
390 } |
390 } |
391 |
391 |
392 |
392 |
393 // Handle the invocation event. |
393 // Handle the invocation event. |
394 void SimpleThresholdPolicy::method_invocation_event(const methodHandle& mh, const methodHandle& imh, |
394 void SimpleThresholdPolicy::method_invocation_event(const methodHandle& mh, const methodHandle& imh, |
395 CompLevel level, nmethod* nm, JavaThread* thread) { |
395 CompLevel level, CompiledMethod* nm, JavaThread* thread) { |
396 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
396 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
397 CompLevel next_level = call_event(mh(), level); |
397 CompLevel next_level = call_event(mh(), level); |
398 if (next_level != level) { |
398 if (next_level != level) { |
399 compile(mh, InvocationEntryBci, next_level, thread); |
399 compile(mh, InvocationEntryBci, next_level, thread); |
400 } |
400 } |
402 } |
402 } |
403 |
403 |
404 // Handle the back branch event. Notice that we can compile the method |
404 // Handle the back branch event. Notice that we can compile the method |
405 // with a regular entry from here. |
405 // with a regular entry from here. |
406 void SimpleThresholdPolicy::method_back_branch_event(const methodHandle& mh, const methodHandle& imh, |
406 void SimpleThresholdPolicy::method_back_branch_event(const methodHandle& mh, const methodHandle& imh, |
407 int bci, CompLevel level, nmethod* nm, JavaThread* thread) { |
407 int bci, CompLevel level, CompiledMethod* nm, JavaThread* thread) { |
408 // If the method is already compiling, quickly bail out. |
408 // If the method is already compiling, quickly bail out. |
409 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
409 if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
410 // Use loop event as an opportunity to also check there's been |
410 // Use loop event as an opportunity to also check there's been |
411 // enough calls. |
411 // enough calls. |
412 CompLevel cur_level = comp_level(mh()); |
412 CompLevel cur_level = comp_level(mh()); |