1 /* |
1 /* |
2 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2019, 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. |
629 mcs->set_rate(0.0F); |
629 mcs->set_rate(0.0F); |
630 mh->set_prev_event_count(0); |
630 mh->set_prev_event_count(0); |
631 mh->set_prev_time(0); |
631 mh->set_prev_time(0); |
632 #endif |
632 #endif |
633 } |
633 } |
|
634 WB_END |
|
635 |
|
636 WB_ENTRY(void, WB_MarkMethodProfiled(JNIEnv* env, jobject o, jobject method)) |
|
637 jmethodID jmid = reflected_method_to_jmid(thread, env, method); |
|
638 CHECK_JNI_EXCEPTION(env); |
|
639 methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); |
|
640 |
|
641 MethodData* mdo = mh->method_data(); |
|
642 if (mdo == NULL) { |
|
643 Method::build_interpreter_method_data(mh, CHECK_AND_CLEAR); |
|
644 mdo = mh->method_data(); |
|
645 } |
|
646 mdo->init(); |
|
647 InvocationCounter* icnt = mdo->invocation_counter(); |
|
648 InvocationCounter* bcnt = mdo->backedge_counter(); |
|
649 // set i-counter according to AdvancedThresholdPolicy::is_method_profiled |
|
650 // because SimpleThresholdPolicy::call_predicate_helper uses > in jdk8u, that's why we need to plus one. |
|
651 icnt->set(InvocationCounter::wait_for_compile, Tier4MinInvocationThreshold + 1); |
|
652 bcnt->set(InvocationCounter::wait_for_compile, Tier4CompileThreshold + 1); |
634 WB_END |
653 WB_END |
635 |
654 |
636 template <typename T> |
655 template <typename T> |
637 static bool GetVMFlag(JavaThread* thread, JNIEnv* env, jstring name, T* value, bool (*TAt)(const char*, T*)) { |
656 static bool GetVMFlag(JavaThread* thread, JNIEnv* env, jstring name, T* value, bool (*TAt)(const char*, T*)) { |
638 if (name == NULL) { |
657 if (name == NULL) { |
1121 CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetForceInlineMethod}, |
1140 CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetForceInlineMethod}, |
1122 {CC"enqueueMethodForCompilation", |
1141 {CC"enqueueMethodForCompilation", |
1123 CC"(Ljava/lang/reflect/Executable;II)Z", (void*)&WB_EnqueueMethodForCompilation}, |
1142 CC"(Ljava/lang/reflect/Executable;II)Z", (void*)&WB_EnqueueMethodForCompilation}, |
1124 {CC"clearMethodState", |
1143 {CC"clearMethodState", |
1125 CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState}, |
1144 CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState}, |
|
1145 {CC"markMethodProfiled", |
|
1146 CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_MarkMethodProfiled}, |
1126 {CC"setBooleanVMFlag", CC"(Ljava/lang/String;Z)V",(void*)&WB_SetBooleanVMFlag}, |
1147 {CC"setBooleanVMFlag", CC"(Ljava/lang/String;Z)V",(void*)&WB_SetBooleanVMFlag}, |
1127 {CC"setIntxVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetIntxVMFlag}, |
1148 {CC"setIntxVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetIntxVMFlag}, |
1128 {CC"setUintxVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUintxVMFlag}, |
1149 {CC"setUintxVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUintxVMFlag}, |
1129 {CC"setUint64VMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUint64VMFlag}, |
1150 {CC"setUint64VMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUint64VMFlag}, |
1130 {CC"setDoubleVMFlag", CC"(Ljava/lang/String;D)V",(void*)&WB_SetDoubleVMFlag}, |
1151 {CC"setDoubleVMFlag", CC"(Ljava/lang/String;D)V",(void*)&WB_SetDoubleVMFlag}, |