/* * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
#ifdef LINUX // Note. On Alpine Linux pthread.h includes calloc/malloc functions declaration. // We need to include pthread.h before the following stdlib names poisoning. #include <pthread.h> #endif
#ifdef DEBUG /* Just to make sure these interfaces are not used here. */ #undef free #define free(p) Donot use this interface. #undef malloc #define malloc(p) Donot use this interface. #undef calloc #define calloc(p) Donot use this interface. #undef realloc #define realloc(p) Donot use this interface. #undef strdup #define strdup(p) Donot use this interface. #endif
/* Definition of a CommonRef tracked by the backend for the frontend */ typedefstruct RefNode {
jlong seqNum; /* ID of reference, also key for hash table */
jobject ref; /* could be strong or weak */ struct RefNode *next; /* next RefNode* in bucket chain */
jint count; /* count of references */
jboolean isPinAll; /* true if this is a strong reference due to a commonRef_pinAll() */
jboolean isCommonPin; /* true if this is a strong reference due to a commonRef_pin() */
} RefNode;
/* Value of a NULL ID */ #define NULL_OBJECT_ID ((jlong)0)
/* * Globals used throughout the back end
*/
typedef jint FrameNumber;
typedefstruct {
jvmtiEnv *jvmti;
JavaVM *jvm; volatile jboolean vmDead; /* Once VM is dead it stays that way - don't put in init */
jboolean assertOn;
jboolean assertFatal;
jboolean vthreadsSupported; /* If true, debugging support for vthreads is enabled. */
jboolean includeVThreads; /* If true, VM.AllThreads includes vthreads. */
jboolean rememberVThreadsWhenDisconnected;
jboolean doerrorexit;
jboolean modifiedUtf8;
jboolean quiet;
/* Debug flags (bit mask) */ int debugflags;
/* Possible debug flags */ #define USE_ITERATE_THROUGH_HEAP 0X001
/* Common References static data */
jrawMonitorID refLock;
jlong nextSeqNum; unsigned pinAllCount;
RefNode **objectsByID; int objectsByIDsize; int objectsByIDcount;
/* Indication that the agent has been loaded */
jboolean isLoaded;
/* Indication that VM_DEATH has been received and the JVMTI callbacks have been cleared. */ volatile jboolean jvmtiCallBacksCleared;
/* For monitor wait events */ union { /* ei = EI_MONITOR_WAIT */
jlong timeout; /* ei = EI_MONITOR_WAITED */
jboolean timed_out;
} monitor;
} u;
} EventInfo;
/* Structure to hold dynamic array of objects */ typedefstruct ObjectBatch {
jobject *objects;
jint count;
} ObjectBatch;
/* * Modifier flags for classes, fields, methods
*/ #define MOD_PUBLIC 0x0001 /* visible to everyone */ #define MOD_PRIVATE 0x0002 /* visible only to the defining class */ #define MOD_PROTECTED 0x0004 /* visible to subclasses */ #define MOD_STATIC 0x0008 /* instance variable is static */ #define MOD_FINAL 0x0010 /* no further subclassing, overriding */ #define MOD_SYNCHRONIZED 0x0020 /* wrap method call in monitor lock */ #define MOD_VOLATILE 0x0040 /* can cache in registers */ #define MOD_TRANSIENT 0x0080 /* not persistent */ #define MOD_NATIVE 0x0100 /* implemented in C */ #define MOD_INTERFACE 0x0200 /* class is an interface */ #define MOD_ABSTRACT 0x0400 /* no definition provided */ /* * Additional modifiers not defined as such in the JVM spec
*/ #define MOD_SYNTHETIC 0xf0000000 /* not in source code */
/* * Local Reference management. The two macros below are used * throughout the back end whenever space for JNI local references * is needed in the current frame.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.