Path: blob/master/runtime/codert_vm/runtimeInstrumentation.h
5986 views
/*******************************************************************************1* Copyright (c) 1991, 2021 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122#ifndef runtimeinstrumentation_h23#define runtimeinstrumentation_h2425#include "j9.h"26#include "j9consts.h"2728/**29* Initialize VM support for JIT runtime instrumentation. The JIT must call this30* function during startup (before calling updateJITRuntimeInstrumentationFlags).31*32* @param[in] vm The J9JavaVM pointer33*34* @return 0 on success35*/36UDATA37initializeJITRuntimeInstrumentation(J9JavaVM *vm);3839/**40* Terminate VM support for JIT runtime instrumentation. The JIT must call this41* function during shutdown.42*43* @param[in] vm The J9JavaVM pointer44*/45void46shutdownJITRuntimeInstrumentation(J9JavaVM *vm);4748/**49* Request an update to the JIT runtime instrumentation flags on the given J9VMThread.50* The update will take place asynchronously, at the next async check in the target thread.51* This call assumes that a valid control block has been installed by the JIT before any52* of the flag bits are enabled.53*54* This function will return an error if J9_PRIVATE_FLAGS_RI_INITIALIZED55* is not set in the privateFlags of the target thread. This will be set if the call to the port library56* function j9ri_authorize_current_thread() succeeded when the thread was created.57*58* The following constants represent valid bits in newFlags:59*60* J9_JIT_TOGGLE_RI_ON_TRANSITION61* This flag is used to control whether or not the VM calls j9ri_disable62* when transitioning from compiled code to the interpreter, and j9ri_enable63* when transitioning from the interpreter to compiled code.64*65* J9_JIT_TOGGLE_RI_IN_COMPILED_CODE66* This flag is used by the compiled code to guard inline sequences to enable and67* disable runtime instrumentation.68*69* @param[in] targetThread The J9VMThread to update70* @param[in] newFlags The new value of the RI flags field71*72* @return 0 on success (thread is authorized)73*/74UDATA75updateJITRuntimeInstrumentationFlags(J9VMThread *targetThread, UDATA newFlags);7677#endif787980