Mercurial > hg > truffle
comparison src/share/vm/prims/jniCheck.cpp @ 465:dc16daa0329d
6739363: Xcheck jni doesn't check native function arguments
Summary: Fix adds support for verifying arguments with -Xcheck:jni.
Reviewed-by: coleenp
author | poonam |
---|---|
date | Thu, 04 Dec 2008 17:29:56 -0800 |
parents | a61af66fc99e |
children | ad8c8ca4ab0f |
comparison
equal
deleted
inserted
replaced
414:348be627a148 | 465:dc16daa0329d |
---|---|
109 static const char * fatal_wrong_field = "Wrong field ID passed to JNI"; | 109 static const char * fatal_wrong_field = "Wrong field ID passed to JNI"; |
110 static const char * fatal_instance_field_not_found = "Instance field not found in JNI get/set field operations"; | 110 static const char * fatal_instance_field_not_found = "Instance field not found in JNI get/set field operations"; |
111 static const char * fatal_instance_field_mismatch = "Field type (instance) mismatch in JNI get/set field operations"; | 111 static const char * fatal_instance_field_mismatch = "Field type (instance) mismatch in JNI get/set field operations"; |
112 static const char * fatal_non_string = "JNI string operation received a non-string"; | 112 static const char * fatal_non_string = "JNI string operation received a non-string"; |
113 | 113 |
114 | |
115 | |
116 // Report a JNI failure caught by -Xcheck:jni. Perform a core dump. | |
117 // Note: two variations -- one to be called when in VM state (e.g. when | |
118 // within IN_VM macro), one to be called when in NATIVE state. | |
119 | |
120 // When in VM state: | |
121 static void ReportJNIFatalError(JavaThread* thr, const char *msg) { | |
122 tty->print_cr("FATAL ERROR in native method: %s", msg); | |
123 thr->print_stack(); | |
124 os::abort(true); | |
125 } | |
126 | 114 |
127 // When in VM state: | 115 // When in VM state: |
128 static void ReportJNIWarning(JavaThread* thr, const char *msg) { | 116 static void ReportJNIWarning(JavaThread* thr, const char *msg) { |
129 tty->print_cr("WARNING in native method: %s", msg); | 117 tty->print_cr("WARNING in native method: %s", msg); |
130 thr->print_stack(); | 118 thr->print_stack(); |