hotspot/src/share/tools/launcher/java.h
author coleenp
Mon, 14 Jan 2013 11:01:39 -0500
changeset 15194 a35093d73168
parent 7410 f5b282e7a7a6
child 15228 e92acc84ade3
permissions -rw-r--r--
8006005: Fix constant pool index validation and alignment trap for method parameter reflection Summary: This patch addresses an alignment trap due to the storage format of method parameters data in constMethod. It also adds code to validate constant pool indexes for method parameters data. Reviewed-by: jrose, dholmes Contributed-by: eric.mccorkle@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7410
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     1
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     2
 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     4
 *
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     8
 *
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    13
 * accompanied this code).
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    14
 *
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    18
 *
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    21
 * questions.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    22
 *
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    23
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    24
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    25
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    26
#ifndef _JAVA_H_
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    27
#define _JAVA_H_
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    28
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    29
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    30
 * Get system specific defines.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    31
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    32
#include "jni.h"
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    33
#include "java_md.h"
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    34
#include "jli_util.h"
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    35
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    36
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    37
 * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    38
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    39
typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    40
typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    41
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    42
typedef struct {
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    43
    CreateJavaVM_t CreateJavaVM;
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    44
    GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs;
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    45
} InvocationFunctions;
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    46
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    47
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    48
 * Prototypes for launcher functions in the system specific java_md.c.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    49
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    50
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    51
jboolean
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    52
LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    53
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    54
void
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    55
GetXUsagePath(char *buf, jint bufsize);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    56
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    57
jboolean
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    58
GetApplicationHome(char *buf, jint bufsize);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    59
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    60
const char *
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    61
GetArch();
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    62
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    63
void CreateExecutionEnvironment(int *_argc,
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    64
                                       char ***_argv,
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    65
                                       char jrepath[],
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    66
                                       jint so_jrepath,
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    67
                                       char jvmpath[],
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    68
                                       jint so_jvmpath,
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    69
                                       char **original_argv);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    70
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    71
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    72
 * Report an error message to stderr or a window as appropriate.  The
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    73
 * flag always is set to JNI_TRUE if message is to be reported to both
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    74
 * strerr and windows and set to JNI_FALSE if the message should only
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    75
 * be sent to a window.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    76
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    77
void ReportErrorMessage(char * message, jboolean always);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    78
void ReportErrorMessage2(char * format, char * string, jboolean always);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    79
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    80
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    81
 * Report an exception which terminates the vm to stderr or a window
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    82
 * as appropriate.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    83
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    84
void ReportExceptionDescription(JNIEnv * env);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    85
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    86
jboolean RemovableMachineDependentOption(char * option);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    87
void PrintMachineDependentOptions();
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    88
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    89
const char *jlong_format_specifier();
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    90
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    91
 * Block current thread and continue execution in new thread
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    92
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    93
int ContinueInNewThread(int (JNICALL *continuation)(void *),
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    94
                        jlong stack_size, void * args);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    95
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    96
/* sun.java.launcher.* platform properties. */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    97
void SetJavaLauncherPlatformProps(void);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    98
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
    99
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   100
 * Functions defined in java.c and used in java_md.c.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   101
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   102
jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   103
char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   104
void AddOption(char *str, void *info);
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   105
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   106
/*
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   107
 * Make launcher spit debug output.
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   108
 */
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   109
extern jboolean _launcher_debug;
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   110
f5b282e7a7a6 6981484: Update development launcher
sla
parents:
diff changeset
   111
#endif /* _JAVA_H_ */