1 /*
   2  * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef _JAVASOFT_JVM_H_
  27 #define _JAVASOFT_JVM_H_
  28 
  29 #include <sys/stat.h>
  30 
  31 #include "jni.h"
  32 #include "jvm_md.h"
  33 
  34 #ifdef __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 /*
  39  * This file contains additional functions exported from the VM.
  40  * These functions are complementary to the standard JNI support.
  41  * There are three parts to this file:
  42  *
  43  * First, this file contains the VM-related functions needed by native
  44  * libraries in the standard Java API. For example, the java.lang.Object
  45  * class needs VM-level functions that wait for and notify monitors.
  46  *
  47  * Second, this file contains the functions and constant definitions
  48  * needed by the byte code verifier and class file format checker.
  49  * These functions allow the verifier and format checker to be written
  50  * in a VM-independent way.
  51  *
  52  * Third, this file contains various I/O and network operations needed
  53  * by the standard Java I/O and network APIs.
  54  */
  55 
  56 /*
  57  * Bump the version number when either of the following happens:
  58  *
  59  * 1. There is a change in JVM_* functions.
  60  *
  61  * 2. There is a change in the contract between VM and Java classes.
  62  *    For example, if the VM relies on a new private field in Thread
  63  *    class.
  64  */
  65 
  66 #define JVM_INTERFACE_VERSION 7
  67 
  68 JNIEXPORT jint JNICALL
  69 JVM_GetInterfaceVersion(void);
  70 
  71 /*************************************************************************
  72  PART 1: Functions for Native Libraries
  73  ************************************************************************/
  74 /*
  75  * java.lang.Object
  76  */
  77 JNIEXPORT jint JNICALL
  78 JVM_IHashCode(JNIEnv *env, jobject obj);
  79 
  80 JNIEXPORT void JNICALL
  81 JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms);
  82 
  83 JNIEXPORT void JNICALL
  84 JVM_MonitorNotify(JNIEnv *env, jobject obj);
  85 
  86 JNIEXPORT void JNICALL
  87 JVM_MonitorNotifyAll(JNIEnv *env, jobject obj);
  88 
  89 JNIEXPORT jobject JNICALL
  90 JVM_Clone(JNIEnv *env, jobject obj);
  91 
  92 /*
  93  * java.lang.String
  94  */
  95 JNIEXPORT jstring JNICALL
  96 JVM_InternString(JNIEnv *env, jstring str);
  97 
  98 /*
  99  * java.lang.System
 100  */
 101 JNIEXPORT jlong JNICALL
 102 JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);
 103 
 104 JNIEXPORT jlong JNICALL
 105 JVM_NanoTime(JNIEnv *env, jclass ignored);
 106 
 107 JNIEXPORT jlong JNICALL
 108 JVM_GetNanoTimeAdjustment(JNIEnv *env, jclass ignored, jlong offset_secs);
 109 
 110 JNIEXPORT void JNICALL
 111 JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
 112               jobject dst, jint dst_pos, jint length);
 113 
 114 /*
 115  * Return an array of all properties as alternating name and value pairs.
 116  */
 117 JNIEXPORT jobjectArray JNICALL
 118 JVM_GetProperties(JNIEnv *env);
 119 
 120 /*
 121  * java.lang.Runtime
 122  */
 123 JNIEXPORT void JNICALL
 124 JVM_BeforeHalt();
 125 
 126 JNIEXPORT void JNICALL
 127 JVM_Halt(jint code);
 128 
 129 JNIEXPORT void JNICALL
 130 JVM_GC(void);
 131 
 132 /* Returns the number of real-time milliseconds that have elapsed since the
 133  * least-recently-inspected heap object was last inspected by the garbage
 134  * collector.
 135  *
 136  * For simple stop-the-world collectors this value is just the time
 137  * since the most recent collection.  For generational collectors it is the
 138  * time since the oldest generation was most recently collected.  Other
 139  * collectors are free to return a pessimistic estimate of the elapsed time, or
 140  * simply the time since the last full collection was performed.
 141  *
 142  * Note that in the presence of reference objects, a given object that is no
 143  * longer strongly reachable may have to be inspected multiple times before it
 144  * can be reclaimed.
 145  */
 146 JNIEXPORT jlong JNICALL
 147 JVM_MaxObjectInspectionAge(void);
 148 
 149 JNIEXPORT jlong JNICALL
 150 JVM_TotalMemory(void);
 151 
 152 JNIEXPORT jlong JNICALL
 153 JVM_FreeMemory(void);
 154 
 155 JNIEXPORT jlong JNICALL
 156 JVM_MaxMemory(void);
 157 
 158 JNIEXPORT jint JNICALL
 159 JVM_ActiveProcessorCount(void);
 160 
 161 JNIEXPORT jboolean JNICALL
 162 JVM_IsUseContainerSupport(void);
 163 
 164 JNIEXPORT jlong JNICALL
 165 JVM_AddressOf(jobject obj);
 166 
 167 JNIEXPORT jlong JNICALL
 168 JVM_SizeOf(jobject obj);
 169 
 170 JNIEXPORT jlong JNICALL
 171 JVM_FieldOffsetOf(jobject field);
 172 
 173 JNIEXPORT jlong JNICALL
 174 JVM_FieldSizeOf(jobject field);
 175 
 176 JNIEXPORT jint JNICALL
 177 JVM_GetReferencedObjects(jobject obj, jobjectArray ref_buf);
 178 
 179 JNIEXPORT void * JNICALL
 180 JVM_LoadLibrary(const char *name);
 181 
 182 JNIEXPORT void JNICALL
 183 JVM_UnloadLibrary(void * handle);
 184 
 185 JNIEXPORT void * JNICALL
 186 JVM_FindLibraryEntry(void *handle, const char *name);
 187 
 188 JNIEXPORT jboolean JNICALL
 189 JVM_IsSupportedJNIVersion(jint version);
 190 
 191 JNIEXPORT jobjectArray JNICALL
 192 JVM_GetVmArguments(JNIEnv *env);
 193 
 194 JNIEXPORT void JNICALL
 195 JVM_InitializeFromArchive(JNIEnv* env, jclass cls);
 196 
 197 JNIEXPORT void JNICALL
 198 JVM_RegisterLambdaProxyClassForArchiving(JNIEnv* env, jclass caller,
 199                                          jstring invokedName,
 200                                          jobject invokedType,
 201                                          jobject methodType,
 202                                          jobject implMethodMember,
 203                                          jobject instantiatedMethodType,
 204                                          jclass lambdaProxyClass);
 205 
 206 JNIEXPORT jclass JNICALL
 207 JVM_LookupLambdaProxyClassFromArchive(JNIEnv* env, jclass caller,
 208                                       jstring invokedName,
 209                                       jobject invokedType,
 210                                       jobject methodType,
 211                                       jobject implMethodMember,
 212                                       jobject instantiatedMethodType,
 213                                       jboolean initialize);
 214 
 215 JNIEXPORT jboolean JNICALL
 216 JVM_IsCDSDumpingEnabled(JNIEnv* env);
 217 
 218 JNIEXPORT jboolean JNICALL
 219 JVM_IsCDSSharingEnabled(JNIEnv* env);
 220 
 221 JNIEXPORT jlong JNICALL
 222 JVM_GetRandomSeedForCDSDump();
 223 
 224 /*
 225  * java.lang.Throwable
 226  */
 227 JNIEXPORT void JNICALL
 228 JVM_FillInStackTrace(JNIEnv *env, jobject throwable);
 229 
 230 /*
 231  * java.lang.StackTraceElement
 232  */
 233 JNIEXPORT void JNICALL
 234 JVM_InitStackTraceElementArray(JNIEnv *env, jobjectArray elements, jobject throwable);
 235 
 236 JNIEXPORT void JNICALL
 237 JVM_InitStackTraceElement(JNIEnv* env, jobject element, jobject stackFrameInfo);
 238 
 239 /*
 240  * java.lang.NullPointerException
 241  */
 242 
 243 JNIEXPORT jstring JNICALL
 244 JVM_GetExtendedNPEMessage(JNIEnv *env, jthrowable throwable);
 245 
 246 /*
 247  * java.lang.StackWalker
 248  */
 249 enum {
 250   JVM_STACKWALK_FILL_CLASS_REFS_ONLY       = 0x2,
 251   JVM_STACKWALK_GET_CALLER_CLASS           = 0x04,
 252   JVM_STACKWALK_SHOW_HIDDEN_FRAMES         = 0x20,
 253   JVM_STACKWALK_FILL_LIVE_STACK_FRAMES     = 0x100
 254 };
 255 
 256 JNIEXPORT jobject JNICALL
 257 JVM_CallStackWalk(JNIEnv *env, jobject stackStream, jlong mode,
 258                   jint skip_frames, jint frame_count, jint start_index,
 259                   jobjectArray frames);
 260 
 261 JNIEXPORT jint JNICALL
 262 JVM_MoreStackWalk(JNIEnv *env, jobject stackStream, jlong mode, jlong anchor,
 263                   jint frame_count, jint start_index,
 264                   jobjectArray frames);
 265 
 266 /*
 267  * java.lang.Thread
 268  */
 269 JNIEXPORT void JNICALL
 270 JVM_StartThread(JNIEnv *env, jobject thread);
 271 
 272 JNIEXPORT void JNICALL
 273 JVM_StopThread(JNIEnv *env, jobject thread, jobject exception);
 274 
 275 JNIEXPORT jboolean JNICALL
 276 JVM_IsThreadAlive(JNIEnv *env, jobject thread);
 277 
 278 JNIEXPORT void JNICALL
 279 JVM_SuspendThread(JNIEnv *env, jobject thread);
 280 
 281 JNIEXPORT void JNICALL
 282 JVM_ResumeThread(JNIEnv *env, jobject thread);
 283 
 284 JNIEXPORT void JNICALL
 285 JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio);
 286 
 287 JNIEXPORT void JNICALL
 288 JVM_Yield(JNIEnv *env, jclass threadClass);
 289 
 290 JNIEXPORT void JNICALL
 291 JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis);
 292 
 293 JNIEXPORT jobject JNICALL
 294 JVM_CurrentThread(JNIEnv *env, jclass threadClass);
 295 
 296 JNIEXPORT void JNICALL
 297 JVM_Interrupt(JNIEnv *env, jobject thread);
 298 
 299 JNIEXPORT jboolean JNICALL
 300 JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj);
 301 
 302 JNIEXPORT void JNICALL
 303 JVM_DumpAllStacks(JNIEnv *env, jclass unused);
 304 
 305 JNIEXPORT jobjectArray JNICALL
 306 JVM_GetAllThreads(JNIEnv *env, jclass dummy);
 307 
 308 JNIEXPORT void JNICALL
 309 JVM_SetNativeThreadName(JNIEnv *env, jobject jthread, jstring name);
 310 
 311 /* getStackTrace() and getAllStackTraces() method */
 312 JNIEXPORT jobjectArray JNICALL
 313 JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads);
 314 
 315 /*
 316  * java.lang.SecurityManager
 317  */
 318 JNIEXPORT jobjectArray JNICALL
 319 JVM_GetClassContext(JNIEnv *env);
 320 
 321 /*
 322  * java.lang.Package
 323  */
 324 JNIEXPORT jstring JNICALL
 325 JVM_GetSystemPackage(JNIEnv *env, jstring name);
 326 
 327 JNIEXPORT jobjectArray JNICALL
 328 JVM_GetSystemPackages(JNIEnv *env);
 329 
 330 /*
 331  * java.lang.ref.Reference
 332  */
 333 JNIEXPORT jobject JNICALL
 334 JVM_GetAndClearReferencePendingList(JNIEnv *env);
 335 
 336 JNIEXPORT jboolean JNICALL
 337 JVM_HasReferencePendingList(JNIEnv *env);
 338 
 339 JNIEXPORT void JNICALL
 340 JVM_WaitForReferencePendingList(JNIEnv *env);
 341 
 342 /*
 343  * java.io.ObjectInputStream
 344  */
 345 JNIEXPORT jobject JNICALL
 346 JVM_LatestUserDefinedLoader(JNIEnv *env);
 347 
 348 /*
 349  * java.lang.reflect.Array
 350  */
 351 JNIEXPORT jint JNICALL
 352 JVM_GetArrayLength(JNIEnv *env, jobject arr);
 353 
 354 JNIEXPORT jobject JNICALL
 355 JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index);
 356 
 357 JNIEXPORT jvalue JNICALL
 358 JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode);
 359 
 360 JNIEXPORT void JNICALL
 361 JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val);
 362 
 363 JNIEXPORT void JNICALL
 364 JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v,
 365                              unsigned char vCode);
 366 
 367 JNIEXPORT jobject JNICALL
 368 JVM_NewArray(JNIEnv *env, jclass eltClass, jint length);
 369 
 370 JNIEXPORT jobject JNICALL
 371 JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim);
 372 
 373 
 374 /*
 375  * Returns the immediate caller class of the native method invoking
 376  * JVM_GetCallerClass.  The Method.invoke and other frames due to
 377  * reflection machinery are skipped.
 378  *
 379  * The caller is expected to be marked with
 380  * jdk.internal.reflect.CallerSensitive. The JVM will throw an
 381  * error if it is not marked properly.
 382  */
 383 JNIEXPORT jclass JNICALL
 384 JVM_GetCallerClass(JNIEnv *env);
 385 
 386 
 387 /*
 388  * Find primitive classes
 389  * utf: class name
 390  */
 391 JNIEXPORT jclass JNICALL
 392 JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
 393 
 394 
 395 /*
 396  * Find a class from a boot class loader. Returns NULL if class not found.
 397  */
 398 JNIEXPORT jclass JNICALL
 399 JVM_FindClassFromBootLoader(JNIEnv *env, const char *name);
 400 
 401 /*
 402  * Find a class from a given class loader.  Throws ClassNotFoundException.
 403  *  name:   name of class
 404  *  init:   whether initialization is done
 405  *  loader: class loader to look up the class. This may not be the same as the caller's
 406  *          class loader.
 407  *  caller: initiating class. The initiating class may be null when a security
 408  *          manager is not installed.
 409  */
 410 JNIEXPORT jclass JNICALL
 411 JVM_FindClassFromCaller(JNIEnv *env, const char *name, jboolean init,
 412                         jobject loader, jclass caller);
 413 
 414 /*
 415  * Find a class from a given class.
 416  */
 417 JNIEXPORT jclass JNICALL
 418 JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init,
 419                              jclass from);
 420 
 421 /* Find a loaded class cached by the VM */
 422 JNIEXPORT jclass JNICALL
 423 JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name);
 424 
 425 /* Define a class */
 426 JNIEXPORT jclass JNICALL
 427 JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
 428                 jsize len, jobject pd);
 429 
 430 /* Define a class with a source (added in JDK1.5) */
 431 JNIEXPORT jclass JNICALL
 432 JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader,
 433                           const jbyte *buf, jsize len, jobject pd,
 434                           const char *source);
 435 
 436 /*
 437  * Define a class with the specified lookup class.
 438  *  lookup:  Lookup class
 439  *  name:    the name of the class
 440  *  buf:     class bytes
 441  *  len:     length of class bytes
 442  *  pd:      protection domain
 443  *  init:    initialize the class
 444  *  flags:   properties of the class
 445  *  classData: private static pre-initialized field; may be null
 446  */
 447 JNIEXPORT jclass JNICALL
 448 JVM_LookupDefineClass(JNIEnv *env, jclass lookup, const char *name, const jbyte *buf,
 449                       jsize len, jobject pd, jboolean init, int flags, jobject classData);
 450 
 451 /*
 452  * Module support funcions
 453  */
 454 
 455 /*
 456  * Define a module with the specified packages and bind the module to the
 457  * given class loader.
 458  *  module:       module to define
 459  *  is_open:      specifies if module is open (currently ignored)
 460  *  version:      the module version
 461  *  location:     the module location
 462  *  packages:     array of packages in the module
 463  */
 464 JNIEXPORT void JNICALL
 465 JVM_DefineModule(JNIEnv *env, jobject module, jboolean is_open, jstring version,
 466                  jstring location, jobjectArray packages);
 467 
 468 /*
 469  * Set the boot loader's unnamed module.
 470  *  module: boot loader's unnamed module
 471  */
 472 JNIEXPORT void JNICALL
 473 JVM_SetBootLoaderUnnamedModule(JNIEnv *env, jobject module);
 474 
 475 /*
 476  * Do a qualified export of a package.
 477  *  from_module: module containing the package to export
 478  *  package:     name of the package to export
 479  *  to_module:   module to export the package to
 480  */
 481 JNIEXPORT void JNICALL
 482 JVM_AddModuleExports(JNIEnv *env, jobject from_module, jstring package, jobject to_module);
 483 
 484 /*
 485  * Do an export of a package to all unnamed modules.
 486  *  from_module: module containing the package to export
 487  *  package:     name of the package to export to all unnamed modules
 488  */
 489 JNIEXPORT void JNICALL
 490 JVM_AddModuleExportsToAllUnnamed(JNIEnv *env, jobject from_module, jstring package);
 491 
 492 /*
 493  * Do an unqualified export of a package.
 494  *  from_module: module containing the package to export
 495  *  package:     name of the package to export
 496  */
 497 JNIEXPORT void JNICALL
 498 JVM_AddModuleExportsToAll(JNIEnv *env, jobject from_module, jstring package);
 499 
 500 /*
 501  * Add a module to the list of modules that a given module can read.
 502  *  from_module:   module requesting read access
 503  *  source_module: module that from_module wants to read
 504  */
 505 JNIEXPORT void JNICALL
 506 JVM_AddReadsModule(JNIEnv *env, jobject from_module, jobject source_module);
 507 
 508 /*
 509  * Reflection support functions
 510  */
 511 
 512 JNIEXPORT jstring JNICALL
 513 JVM_InitClassName(JNIEnv *env, jclass cls);
 514 
 515 JNIEXPORT jobjectArray JNICALL
 516 JVM_GetClassInterfaces(JNIEnv *env, jclass cls);
 517 
 518 JNIEXPORT jboolean JNICALL
 519 JVM_IsInterface(JNIEnv *env, jclass cls);
 520 
 521 JNIEXPORT jobjectArray JNICALL
 522 JVM_GetClassSigners(JNIEnv *env, jclass cls);
 523 
 524 JNIEXPORT void JNICALL
 525 JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers);
 526 
 527 JNIEXPORT jobject JNICALL
 528 JVM_GetProtectionDomain(JNIEnv *env, jclass cls);
 529 
 530 JNIEXPORT jboolean JNICALL
 531 JVM_IsArrayClass(JNIEnv *env, jclass cls);
 532 
 533 JNIEXPORT jboolean JNICALL
 534 JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);
 535 
 536 JNIEXPORT jboolean JNICALL
 537 JVM_IsHiddenClass(JNIEnv *env, jclass cls);
 538 
 539 JNIEXPORT jint JNICALL
 540 JVM_GetClassModifiers(JNIEnv *env, jclass cls);
 541 
 542 JNIEXPORT jobjectArray JNICALL
 543 JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass);
 544 
 545 JNIEXPORT jclass JNICALL
 546 JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass);
 547 
 548 JNIEXPORT jstring JNICALL
 549 JVM_GetSimpleBinaryName(JNIEnv *env, jclass ofClass);
 550 
 551 /* Generics support (JDK 1.5) */
 552 JNIEXPORT jstring JNICALL
 553 JVM_GetClassSignature(JNIEnv *env, jclass cls);
 554 
 555 /* Annotations support (JDK 1.5) */
 556 JNIEXPORT jbyteArray JNICALL
 557 JVM_GetClassAnnotations(JNIEnv *env, jclass cls);
 558 
 559 /* Type use annotations support (JDK 1.8) */
 560 
 561 JNIEXPORT jbyteArray JNICALL
 562 JVM_GetClassTypeAnnotations(JNIEnv *env, jclass cls);
 563 
 564 JNIEXPORT jbyteArray JNICALL
 565 JVM_GetFieldTypeAnnotations(JNIEnv *env, jobject field);
 566 
 567 JNIEXPORT jbyteArray JNICALL
 568 JVM_GetMethodTypeAnnotations(JNIEnv *env, jobject method);
 569 
 570 /*
 571  * New (JDK 1.4) reflection implementation
 572  */
 573 
 574 JNIEXPORT jobjectArray JNICALL
 575 JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly);
 576 
 577 JNIEXPORT jobjectArray JNICALL
 578 JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly);
 579 
 580 JNIEXPORT jobjectArray JNICALL
 581 JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly);
 582 
 583 
 584 /* Differs from JVM_GetClassModifiers in treatment of inner classes.
 585    This returns the access flags for the class as specified in the
 586    class file rather than searching the InnerClasses attribute (if
 587    present) to find the source-level access flags. Only the values of
 588    the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be
 589    valid. */
 590 JNIEXPORT jint JNICALL
 591 JVM_GetClassAccessFlags(JNIEnv *env, jclass cls);
 592 
 593 /* Nestmates - since JDK 11 */
 594 
 595 JNIEXPORT jboolean JNICALL
 596 JVM_AreNestMates(JNIEnv *env, jclass current, jclass member);
 597 
 598 JNIEXPORT jclass JNICALL
 599 JVM_GetNestHost(JNIEnv *env, jclass current);
 600 
 601 JNIEXPORT jobjectArray JNICALL
 602 JVM_GetNestMembers(JNIEnv *env, jclass current);
 603 
 604 /* Records - since JDK 14 */
 605 
 606 JNIEXPORT jboolean JNICALL
 607 JVM_IsRecord(JNIEnv *env, jclass cls);
 608 
 609 JNIEXPORT jobjectArray JNICALL
 610 JVM_GetRecordComponents(JNIEnv *env, jclass ofClass);
 611 
 612 /* Sealed types - since JDK 15 */
 613 
 614 JNIEXPORT jobjectArray JNICALL
 615 JVM_GetPermittedSubclasses(JNIEnv *env, jclass current);
 616 
 617 /* The following two reflection routines are still needed due to startup time issues */
 618 /*
 619  * java.lang.reflect.Method
 620  */
 621 JNIEXPORT jobject JNICALL
 622 JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0);
 623 
 624 /*
 625  * java.lang.reflect.Constructor
 626  */
 627 JNIEXPORT jobject JNICALL
 628 JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0);
 629 
 630 /*
 631  * Constant pool access; currently used to implement reflective access to annotations (JDK 1.5)
 632  */
 633 
 634 JNIEXPORT jobject JNICALL
 635 JVM_GetClassConstantPool(JNIEnv *env, jclass cls);
 636 
 637 JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize
 638 (JNIEnv *env, jobject unused, jobject jcpool);
 639 
 640 JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt
 641 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 642 
 643 JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded
 644 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 645 
 646 JNIEXPORT jint JNICALL JVM_ConstantPoolGetClassRefIndexAt
 647 (JNIEnv *env, jobject obj, jobject unused, jint index);
 648 
 649 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt
 650 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 651 
 652 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded
 653 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 654 
 655 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt
 656 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 657 
 658 JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded
 659 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 660 
 661 JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt
 662 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 663 
 664 JNIEXPORT jint JNICALL JVM_ConstantPoolGetNameAndTypeRefIndexAt
 665 (JNIEnv *env, jobject obj, jobject unused, jint index);
 666 
 667 JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetNameAndTypeRefInfoAt
 668 (JNIEnv *env, jobject obj, jobject unused, jint index);
 669 
 670 JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt
 671 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 672 
 673 JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt
 674 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 675 
 676 JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt
 677 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 678 
 679 JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt
 680 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 681 
 682 JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt
 683 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 684 
 685 JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At
 686 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 687 
 688 JNIEXPORT jbyte JNICALL JVM_ConstantPoolGetTagAt
 689 (JNIEnv *env, jobject unused, jobject jcpool, jint index);
 690 
 691 /*
 692  * Parameter reflection
 693  */
 694 
 695 JNIEXPORT jobjectArray JNICALL
 696 JVM_GetMethodParameters(JNIEnv *env, jobject method);
 697 
 698 /*
 699  * java.security.*
 700  */
 701 
 702 JNIEXPORT jobject JNICALL
 703 JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);
 704 
 705 /*
 706  * Ensure that code doing a stackwalk and using javaVFrame::locals() to
 707  * get the value will see a materialized value and not a scalar-replaced
 708  * null value.
 709  */
 710 #define JVM_EnsureMaterializedForStackWalk(env, value) \
 711     do {} while(0) // Nothing to do.  The fact that the value escaped
 712                    // through a native method is enough.
 713 
 714 JNIEXPORT jobject JNICALL
 715 JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls);
 716 
 717 /*
 718  * Signal support, used to implement the shutdown sequence.  Every VM must
 719  * support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts
 720  * (^C) and the latter for external termination (kill, system shutdown, etc.).
 721  * Other platform-dependent signal values may also be supported.
 722  */
 723 
 724 JNIEXPORT void * JNICALL
 725 JVM_RegisterSignal(jint sig, void *handler);
 726 
 727 JNIEXPORT jboolean JNICALL
 728 JVM_RaiseSignal(jint sig);
 729 
 730 JNIEXPORT jint JNICALL
 731 JVM_FindSignal(const char *name);
 732 
 733 /*
 734  * Retrieve the assertion directives for the specified class.
 735  */
 736 JNIEXPORT jboolean JNICALL
 737 JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls);
 738 
 739 /*
 740  * Retrieve the assertion directives from the VM.
 741  */
 742 JNIEXPORT jobject JNICALL
 743 JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);
 744 
 745 /*
 746  * java.util.concurrent.atomic.AtomicLong
 747  */
 748 JNIEXPORT jboolean JNICALL
 749 JVM_SupportsCX8(void);
 750 
 751 /*
 752  * com.sun.dtrace.jsdt support
 753  */
 754 
 755 #define JVM_TRACING_DTRACE_VERSION 1
 756 
 757 /*
 758  * Structure to pass one probe description to JVM
 759  */
 760 typedef struct {
 761     jmethodID method;
 762     jstring   function;
 763     jstring   name;
 764     void*            reserved[4];     // for future use
 765 } JVM_DTraceProbe;
 766 
 767 /**
 768  * Encapsulates the stability ratings for a DTrace provider field
 769  */
 770 typedef struct {
 771     jint nameStability;
 772     jint dataStability;
 773     jint dependencyClass;
 774 } JVM_DTraceInterfaceAttributes;
 775 
 776 /*
 777  * Structure to pass one provider description to JVM
 778  */
 779 typedef struct {
 780     jstring                       name;
 781     JVM_DTraceProbe*              probes;
 782     jint                          probe_count;
 783     JVM_DTraceInterfaceAttributes providerAttributes;
 784     JVM_DTraceInterfaceAttributes moduleAttributes;
 785     JVM_DTraceInterfaceAttributes functionAttributes;
 786     JVM_DTraceInterfaceAttributes nameAttributes;
 787     JVM_DTraceInterfaceAttributes argsAttributes;
 788     void*                         reserved[4]; // for future use
 789 } JVM_DTraceProvider;
 790 
 791 /*
 792  * Get the version number the JVM was built with
 793  */
 794 JNIEXPORT jint JNICALL
 795 JVM_DTraceGetVersion(JNIEnv* env);
 796 
 797 /*
 798  * Register new probe with given signature, return global handle
 799  *
 800  * The version passed in is the version that the library code was
 801  * built with.
 802  */
 803 JNIEXPORT jlong JNICALL
 804 JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name,
 805   jint providers_count, JVM_DTraceProvider* providers);
 806 
 807 /*
 808  * Check JSDT probe
 809  */
 810 JNIEXPORT jboolean JNICALL
 811 JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method);
 812 
 813 /*
 814  * Destroy custom DOF
 815  */
 816 JNIEXPORT void JNICALL
 817 JVM_DTraceDispose(JNIEnv* env, jlong activation_handle);
 818 
 819 /*
 820  * Check to see if DTrace is supported by OS
 821  */
 822 JNIEXPORT jboolean JNICALL
 823 JVM_DTraceIsSupported(JNIEnv* env);
 824 
 825 /*************************************************************************
 826  PART 2: Support for the Verifier and Class File Format Checker
 827  ************************************************************************/
 828 /*
 829  * Return the class name in UTF format. The result is valid
 830  * until JVM_ReleaseUTf is called.
 831  *
 832  * The caller must treat the string as a constant and not modify it
 833  * in any way.
 834  */
 835 JNIEXPORT const char * JNICALL
 836 JVM_GetClassNameUTF(JNIEnv *env, jclass cb);
 837 
 838 /*
 839  * Returns the constant pool types in the buffer provided by "types."
 840  */
 841 JNIEXPORT void JNICALL
 842 JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);
 843 
 844 /*
 845  * Returns the number of Constant Pool entries.
 846  */
 847 JNIEXPORT jint JNICALL
 848 JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);
 849 
 850 /*
 851  * Returns the number of *declared* fields or methods.
 852  */
 853 JNIEXPORT jint JNICALL
 854 JVM_GetClassFieldsCount(JNIEnv *env, jclass cb);
 855 
 856 JNIEXPORT jint JNICALL
 857 JVM_GetClassMethodsCount(JNIEnv *env, jclass cb);
 858 
 859 /*
 860  * Returns the CP indexes of exceptions raised by a given method.
 861  * Places the result in the given buffer.
 862  *
 863  * The method is identified by method_index.
 864  */
 865 JNIEXPORT void JNICALL
 866 JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,
 867                                 unsigned short *exceptions);
 868 /*
 869  * Returns the number of exceptions raised by a given method.
 870  * The method is identified by method_index.
 871  */
 872 JNIEXPORT jint JNICALL
 873 JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);
 874 
 875 /*
 876  * Returns the byte code sequence of a given method.
 877  * Places the result in the given buffer.
 878  *
 879  * The method is identified by method_index.
 880  */
 881 JNIEXPORT void JNICALL
 882 JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,
 883                         unsigned char *code);
 884 
 885 /*
 886  * Returns the length of the byte code sequence of a given method.
 887  * The method is identified by method_index.
 888  */
 889 JNIEXPORT jint JNICALL
 890 JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);
 891 
 892 /*
 893  * A structure used to a capture exception table entry in a Java method.
 894  */
 895 typedef struct {
 896     jint start_pc;
 897     jint end_pc;
 898     jint handler_pc;
 899     jint catchType;
 900 } JVM_ExceptionTableEntryType;
 901 
 902 /*
 903  * Returns the exception table entry at entry_index of a given method.
 904  * Places the result in the given buffer.
 905  *
 906  * The method is identified by method_index.
 907  */
 908 JNIEXPORT void JNICALL
 909 JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index,
 910                                    jint entry_index,
 911                                    JVM_ExceptionTableEntryType *entry);
 912 
 913 /*
 914  * Returns the length of the exception table of a given method.
 915  * The method is identified by method_index.
 916  */
 917 JNIEXPORT jint JNICALL
 918 JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index);
 919 
 920 /*
 921  * Returns the modifiers of a given field.
 922  * The field is identified by field_index.
 923  */
 924 JNIEXPORT jint JNICALL
 925 JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index);
 926 
 927 /*
 928  * Returns the modifiers of a given method.
 929  * The method is identified by method_index.
 930  */
 931 JNIEXPORT jint JNICALL
 932 JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index);
 933 
 934 /*
 935  * Returns the number of local variables of a given method.
 936  * The method is identified by method_index.
 937  */
 938 JNIEXPORT jint JNICALL
 939 JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index);
 940 
 941 /*
 942  * Returns the number of arguments (including this pointer) of a given method.
 943  * The method is identified by method_index.
 944  */
 945 JNIEXPORT jint JNICALL
 946 JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index);
 947 
 948 /*
 949  * Returns the maximum amount of stack (in words) used by a given method.
 950  * The method is identified by method_index.
 951  */
 952 JNIEXPORT jint JNICALL
 953 JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index);
 954 
 955 /*
 956  * Is a given method a constructor.
 957  * The method is identified by method_index.
 958  */
 959 JNIEXPORT jboolean JNICALL
 960 JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index);
 961 
 962 /*
 963  * Is the given method generated by the VM.
 964  * The method is identified by method_index.
 965  */
 966 JNIEXPORT jboolean JNICALL
 967 JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cb, int index);
 968 
 969 /*
 970  * Returns the name of a given method in UTF format.
 971  * The result remains valid until JVM_ReleaseUTF is called.
 972  *
 973  * The caller must treat the string as a constant and not modify it
 974  * in any way.
 975  */
 976 JNIEXPORT const char * JNICALL
 977 JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index);
 978 
 979 /*
 980  * Returns the signature of a given method in UTF format.
 981  * The result remains valid until JVM_ReleaseUTF is called.
 982  *
 983  * The caller must treat the string as a constant and not modify it
 984  * in any way.
 985  */
 986 JNIEXPORT const char * JNICALL
 987 JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index);
 988 
 989 /*
 990  * Returns the name of the field referred to at a given constant pool
 991  * index.
 992  *
 993  * The result is in UTF format and remains valid until JVM_ReleaseUTF
 994  * is called.
 995  *
 996  * The caller must treat the string as a constant and not modify it
 997  * in any way.
 998  */
 999 JNIEXPORT const char * JNICALL
1000 JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index);
1001 
1002 /*
1003  * Returns the name of the method referred to at a given constant pool
1004  * index.
1005  *
1006  * The result is in UTF format and remains valid until JVM_ReleaseUTF
1007  * is called.
1008  *
1009  * The caller must treat the string as a constant and not modify it
1010  * in any way.
1011  */
1012 JNIEXPORT const char * JNICALL
1013 JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index);
1014 
1015 /*
1016  * Returns the signature of the method referred to at a given constant pool
1017  * index.
1018  *
1019  * The result is in UTF format and remains valid until JVM_ReleaseUTF
1020  * is called.
1021  *
1022  * The caller must treat the string as a constant and not modify it
1023  * in any way.
1024  */
1025 JNIEXPORT const char * JNICALL
1026 JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index);
1027 
1028 /*
1029  * Returns the signature of the field referred to at a given constant pool
1030  * index.
1031  *
1032  * The result is in UTF format and remains valid until JVM_ReleaseUTF
1033  * is called.
1034  *
1035  * The caller must treat the string as a constant and not modify it
1036  * in any way.
1037  */
1038 JNIEXPORT const char * JNICALL
1039 JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index);
1040 
1041 /*
1042  * Returns the class name referred to at a given constant pool index.
1043  *
1044  * The result is in UTF format and remains valid until JVM_ReleaseUTF
1045  * is called.
1046  *
1047  * The caller must treat the string as a constant and not modify it
1048  * in any way.
1049  */
1050 JNIEXPORT const char * JNICALL
1051 JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index);
1052 
1053 /*
1054  * Returns the class name referred to at a given constant pool index.
1055  *
1056  * The constant pool entry must refer to a CONSTANT_Fieldref.
1057  *
1058  * The result is in UTF format and remains valid until JVM_ReleaseUTF
1059  * is called.
1060  *
1061  * The caller must treat the string as a constant and not modify it
1062  * in any way.
1063  */
1064 JNIEXPORT const char * JNICALL
1065 JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index);
1066 
1067 /*
1068  * Returns the class name referred to at a given constant pool index.
1069  *
1070  * The constant pool entry must refer to CONSTANT_Methodref or
1071  * CONSTANT_InterfaceMethodref.
1072  *
1073  * The result is in UTF format and remains valid until JVM_ReleaseUTF
1074  * is called.
1075  *
1076  * The caller must treat the string as a constant and not modify it
1077  * in any way.
1078  */
1079 JNIEXPORT const char * JNICALL
1080 JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index);
1081 
1082 /*
1083  * Returns the modifiers of a field in calledClass. The field is
1084  * referred to in class cb at constant pool entry index.
1085  *
1086  * The caller must treat the string as a constant and not modify it
1087  * in any way.
1088  *
1089  * Returns -1 if the field does not exist in calledClass.
1090  */
1091 JNIEXPORT jint JNICALL
1092 JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
1093 
1094 /*
1095  * Returns the modifiers of a method in calledClass. The method is
1096  * referred to in class cb at constant pool entry index.
1097  *
1098  * Returns -1 if the method does not exist in calledClass.
1099  */
1100 JNIEXPORT jint JNICALL
1101 JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
1102 
1103 /*
1104  * Releases the UTF string obtained from the VM.
1105  */
1106 JNIEXPORT void JNICALL
1107 JVM_ReleaseUTF(const char *utf);
1108 
1109 /*
1110  * Compare if two classes are in the same package.
1111  */
1112 JNIEXPORT jboolean JNICALL
1113 JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);
1114 
1115 /* Get classfile constants */
1116 #include "classfile_constants.h"
1117 
1118 /*
1119  * Support for a VM-independent class format checker.
1120  */
1121 typedef struct {
1122     unsigned long code;    /* byte code */
1123     unsigned long excs;    /* exceptions */
1124     unsigned long etab;    /* catch table */
1125     unsigned long lnum;    /* line number */
1126     unsigned long lvar;    /* local vars */
1127 } method_size_info;
1128 
1129 typedef struct {
1130     unsigned int constants;    /* constant pool */
1131     unsigned int fields;
1132     unsigned int methods;
1133     unsigned int interfaces;
1134     unsigned int fields2;      /* number of static 2-word fields */
1135     unsigned int innerclasses; /* # of records in InnerClasses attr */
1136 
1137     method_size_info clinit;   /* memory used in clinit */
1138     method_size_info main;     /* used everywhere else */
1139 } class_size_info;
1140 
1141 #define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \
1142                                         JVM_ACC_FINAL | \
1143                                         JVM_ACC_SUPER | \
1144                                         JVM_ACC_INTERFACE | \
1145                                         JVM_ACC_ABSTRACT | \
1146                                         JVM_ACC_ANNOTATION | \
1147                                         JVM_ACC_ENUM | \
1148                                         JVM_ACC_SYNTHETIC)
1149 
1150 #define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \
1151                                         JVM_ACC_PRIVATE | \
1152                                         JVM_ACC_PROTECTED | \
1153                                         JVM_ACC_STATIC | \
1154                                         JVM_ACC_FINAL | \
1155                                         JVM_ACC_VOLATILE | \
1156                                         JVM_ACC_TRANSIENT | \
1157                                         JVM_ACC_ENUM | \
1158                                         JVM_ACC_SYNTHETIC)
1159 
1160 #define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \
1161                                          JVM_ACC_PRIVATE | \
1162                                          JVM_ACC_PROTECTED | \
1163                                          JVM_ACC_STATIC | \
1164                                          JVM_ACC_FINAL | \
1165                                          JVM_ACC_SYNCHRONIZED | \
1166                                          JVM_ACC_BRIDGE | \
1167                                          JVM_ACC_VARARGS | \
1168                                          JVM_ACC_NATIVE | \
1169                                          JVM_ACC_ABSTRACT | \
1170                                          JVM_ACC_STRICT | \
1171                                          JVM_ACC_SYNTHETIC)
1172 
1173 
1174 /*************************************************************************
1175  PART 3: I/O and Network Support
1176  ************************************************************************/
1177 
1178 /*
1179  * Convert a pathname into native format.  This function does syntactic
1180  * cleanup, such as removing redundant separator characters.  It modifies
1181  * the given pathname string in place.
1182  */
1183 JNIEXPORT char * JNICALL
1184 JVM_NativePath(char *);
1185 
1186 /*
1187  * The standard printing functions supported by the Java VM. (Should they
1188  * be renamed to JVM_* in the future?
1189  */
1190 
1191 /* jio_snprintf() and jio_vsnprintf() behave like snprintf(3) and vsnprintf(3),
1192  *  respectively, with the following differences:
1193  * - The string written to str is always zero-terminated, also in case of
1194  *   truncation (count is too small to hold the result string), unless count
1195  *   is 0. In case of truncation count-1 characters are written and '\0'
1196  *   appendend.
1197  * - If count is too small to hold the whole string, -1 is returned across
1198  *   all platforms. */
1199 
1200 JNIEXPORT int
1201 jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
1202 
1203 JNIEXPORT int
1204 jio_snprintf(char *str, size_t count, const char *fmt, ...);
1205 
1206 JNIEXPORT int
1207 jio_fprintf(FILE *, const char *fmt, ...);
1208 
1209 JNIEXPORT int
1210 jio_vfprintf(FILE *, const char *fmt, va_list args);
1211 
1212 
1213 JNIEXPORT void * JNICALL
1214 JVM_RawMonitorCreate(void);
1215 
1216 JNIEXPORT void JNICALL
1217 JVM_RawMonitorDestroy(void *mon);
1218 
1219 JNIEXPORT jint JNICALL
1220 JVM_RawMonitorEnter(void *mon);
1221 
1222 JNIEXPORT void JNICALL
1223 JVM_RawMonitorExit(void *mon);
1224 
1225 /*
1226  * java.lang.management support
1227  */
1228 JNIEXPORT void* JNICALL
1229 JVM_GetManagement(jint version);
1230 
1231 /*
1232  * com.sun.tools.attach.VirtualMachine support
1233  *
1234  * Initialize the agent properties with the properties maintained in the VM.
1235  */
1236 JNIEXPORT jobject JNICALL
1237 JVM_InitAgentProperties(JNIEnv *env, jobject agent_props);
1238 
1239 JNIEXPORT jstring JNICALL
1240 JVM_GetTemporaryDirectory(JNIEnv *env);
1241 
1242 /* Generics reflection support.
1243  *
1244  * Returns information about the given class's EnclosingMethod
1245  * attribute, if present, or null if the class had no enclosing
1246  * method.
1247  *
1248  * If non-null, the returned array contains three elements. Element 0
1249  * is the java.lang.Class of which the enclosing method is a member,
1250  * and elements 1 and 2 are the java.lang.Strings for the enclosing
1251  * method's name and descriptor, respectively.
1252  */
1253 JNIEXPORT jobjectArray JNICALL
1254 JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);
1255 
1256 /*
1257  * This structure is used by the launcher to get the default thread
1258  * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a
1259  * version of 1.1.  As it is not supported otherwise, it has been removed
1260  * from jni.h
1261  */
1262 typedef struct JDK1_1InitArgs {
1263     jint version;
1264 
1265     char **properties;
1266     jint checkSource;
1267     jint nativeStackSize;
1268     jint javaStackSize;
1269     jint minHeapSize;
1270     jint maxHeapSize;
1271     jint verifyMode;
1272     char *classpath;
1273 
1274     jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args);
1275     void (JNICALL *exit)(jint code);
1276     void (JNICALL *abort)(void);
1277 
1278     jint enableClassGC;
1279     jint enableVerboseGC;
1280     jint disableAsyncGC;
1281     jint verbose;
1282     jboolean debugging;
1283     jint debugPort;
1284 } JDK1_1InitArgs;
1285 
1286 
1287 #ifdef __cplusplus
1288 } /* extern "C" */
1289 
1290 #endif /* __cplusplus */
1291 
1292 #endif /* !_JAVASOFT_JVM_H_ */