CACAO
java_lang_VMClassLoader.cpp
Go to the documentation of this file.
1 /* src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp
2 
3  Copyright (C) 1996-2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 
26 #include "config.h"
27 
28 #include <assert.h>
29 #include <stdint.h>
30 
31 #include "mm/memory.hpp"
32 
33 #include "native/jni.hpp"
34 #include "native/llni.hpp"
35 #include "native/native.hpp"
36 
37 #if defined(ENABLE_JNI_HEADERS)
38 # include "native/vm/include/java_lang_VMClassLoader.h"
39 #endif
40 
41 #include "toolbox/logging.hpp"
42 #include "toolbox/list.hpp"
43 #include "toolbox/buffer.hpp"
44 
45 #if defined(ENABLE_ASSERTION)
46 #include "vm/assertion.hpp"
47 #endif
48 
49 #include "vm/array.hpp"
50 #include "vm/jit/builtin.hpp"
51 #include "vm/class.hpp"
52 #include "vm/classcache.hpp"
53 #include "vm/exceptions.hpp"
54 #include "vm/globals.hpp"
55 #include "vm/initialize.hpp"
56 #include "vm/javaobjects.hpp"
57 #include "vm/linker.hpp"
58 #include "vm/loader.hpp"
59 #include "vm/options.hpp"
60 #include "vm/os.hpp"
61 #include "vm/package.hpp"
62 #include "vm/primitive.hpp"
63 #include "vm/statistics.hpp"
64 #include "vm/string.hpp"
65 #include "vm/vm.hpp"
66 #include "vm/zip.hpp"
67 
68 #include "vm/jit/asmpart.hpp"
69 
70 #if defined(ENABLE_JVMTI)
71 #include "native/jvmti/cacaodbg.h"
72 #endif
73 
74 
75 // Native functions are exported as C functions.
76 extern "C" {
77 
78 /*
79  * Class: java/lang/VMClassLoader
80  * Method: defineClass
81  * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;
82  */
83 JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_defineClass(JNIEnv *env, jclass clazz, jobject cl, jstring name, jbyteArray data, jint offset, jint len, jobject pd)
84 {
85  Utf8String utfname;
86  classinfo* c;
88  uint8_t* stream;
89 
90 #if defined(ENABLE_JVMTI)
91  jint new_class_data_len = 0;
92  unsigned char* new_class_data = NULL;
93 #endif
94 
95  /* check if data was passed */
96 
97  if (data == NULL) {
99  return NULL;
100  }
101 
102  /* check the indexes passed */
103 
104  ByteArray ba(data);
105 
106  if ((offset < 0) || (len < 0) || ((offset + len) > ba.get_length())) {
108  return NULL;
109  }
110 
111  /* add classloader to classloader hashtable */
112 
114 
115  if (name != NULL) {
116  /* convert '.' to '/' in java string */
117 
118  utfname = JavaString((java_handle_t*) name).to_utf8_dot_to_slash();
119  }
120  else {
121  utfname = NULL;
122  }
123 
124 #if defined(ENABLE_JVMTI)
125  /* XXX again this will not work because of the indirection cell for classloaders */
126  assert(0);
127  /* fire Class File Load Hook JVMTI event */
128 
129  if (jvmti)
130  jvmti_ClassFileLoadHook(utfname, len, (unsigned char *) data->data,
131  loader, (java_handle_t *) pd,
132  &new_class_data_len, &new_class_data);
133 #endif
134 
135  /* define the class */
136 
137 #if defined(ENABLE_JVMTI)
138  /* check if the JVMTI wants to modify the class */
139 
140  if (new_class_data == NULL)
141  c = class_define(utfname, loader, new_class_data_len, new_class_data, pd);
142  else
143 #endif
144  {
145  stream = ((uint8_t *) ba.get_raw_data_ptr()) + offset;
146  c = class_define(utfname, loader, len, stream, (java_handle_t *) pd);
147  }
148 
149  if (c == NULL)
150  return NULL;
151 
152  // REMOVEME
154 
155  // Set ProtectionDomain.
156  java_lang_Class jlc(h);
157  jlc.set_pd(pd);
158 
159  return (jclass) jlc.get_handle();
160 }
161 
162 
163 /*
164  * Class: java/lang/VMClassLoader
165  * Method: getPrimitiveClass
166  * Signature: (C)Ljava/lang/Class;
167  */
168 JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_getPrimitiveClass(JNIEnv *env, jclass clazz, jchar type)
169 {
170  classinfo *c;
171 
173 
174  if (c == NULL) {
176  return NULL;
177  }
178 
179  return (jclass) LLNI_classinfo_wrap(c);
180 }
181 
182 
183 /*
184  * Class: java/lang/VMClassLoader
185  * Method: resolveClass
186  * Signature: (Ljava/lang/Class;)V
187  */
188 JNIEXPORT void JNICALL Java_java_lang_VMClassLoader_resolveClass(JNIEnv *env, jclass clazz, jclass c)
189 {
190  classinfo *ci;
191 
192  ci = LLNI_classinfo_unwrap(c);
193 
194  if (!ci) {
196  return;
197  }
198 
199  /* link the class */
200 
201  if (!(ci->state & CLASS_LINKED))
202  (void) link_class(ci);
203 
204  return;
205 }
206 
207 
208 /*
209  * Class: java/lang/VMClassLoader
210  * Method: loadClass
211  * Signature: (Ljava/lang/String;Z)Ljava/lang/Class;
212  */
213 JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_loadClass(JNIEnv *env, jclass clazz, jstring name, jboolean resolve)
214 {
215  if (name == NULL) {
217  return NULL;
218  }
219 
220  /* create utf string in which '.' is replaced by '/' */
221 
223 
224  /* load class */
225 
227 
228  if (c == NULL)
229  return NULL;
230 
231  /* resolve class -- if requested */
232 
233 /* if (resolve) */
234  if (!link_class(c))
235  return NULL;
236 
237  return (jclass) LLNI_classinfo_wrap(c);
238 }
239 
240 
241 /*
242  * Class: java/lang/VMClassLoader
243  * Method: nativeGetResources
244  * Signature: (Ljava/lang/String;)Ljava/util/Vector;
245  */
247 {
248  java_handle_t *o; /* vector being created */
249  methodinfo *m; /* "add" method of vector */
250  java_handle_t *path; /* path to be added */
251  Utf8String utfname; /* utf to look for */
252  const char *namestart; /* start of name to use */
253  char *tmppath; /* temporary buffer */
254  int32_t namelen; /* length of name to use */
255  int32_t searchlen; /* length of name to search */
256  int32_t bufsize; /* size of buffer allocated */
257  int32_t pathlen; /* name of path to assemble */
258  struct stat buf; /* buffer for stat */
259  jboolean ret; /* return value of "add" */
260 
261  // Get current list of classpath entries.
262  SuckClasspath& suckclasspath = VM::get_current()->get_suckclasspath();
263 
264  /* get the resource name as utf string */
265 
266  utfname = JavaString((java_handle_t*) name).to_utf8();
267 
268  if (utfname == NULL)
269  return NULL;
270 
271  /* copy it to a char buffer */
272 
273  Buffer<> buffer;
274  buffer.write(utfname);
275 
276  namelen = utfname.size();
277  searchlen = namelen;
278  bufsize = namelen + strlen("0");
279  namestart = buffer.c_str();
280 
281  /* skip leading '/' */
282 
283  if (namestart[0] == '/') {
284  namestart++;
285  namelen--;
286  searchlen--;
287  }
288 
289  /* remove trailing `.class' */
290 
291  if (namelen >= 6 && strcmp(namestart + (namelen - 6), ".class") == 0) {
292  searchlen -= 6;
293  }
294 
295  /* create a new needle to look for, if necessary */
296 
297  if (searchlen != bufsize-1) {
298  utfname = Utf8String::from_utf8(namestart, searchlen);
299  if (utfname == NULL)
300  goto return_NULL;
301  }
302 
303  /* new Vector() */
304 
306 
307  if (o == NULL)
308  goto return_NULL;
309 
310  /* get Vector.add() method */
311 
313  utf8::add,
314  Utf8String::from_utf8("(Ljava/lang/Object;)Z"),
315  NULL,
316  true);
317 
318  if (m == NULL)
319  goto return_NULL;
320 
321  /* iterate over all classpath entries */
322 
323  for (SuckClasspath::iterator it = suckclasspath.begin(); it != suckclasspath.end(); it++) {
324  list_classpath_entry* lce = *it;
325 
326  /* clear path pointer */
327  path = NULL;
328 
329 #if defined(ENABLE_ZLIB)
330  if (lce->type == CLASSPATH_ARCHIVE && lce->zip->find(utfname)) {
331  pathlen = strlen("jar:file://") + lce->pathlen + strlen("!/") + namelen + strlen("0");
332 
333  tmppath = MNEW(char, pathlen);
334 
335  sprintf(tmppath, "jar:file://%s!/%s", lce->path, namestart);
336  path = JavaString::from_utf8(tmppath),
337 
338  MFREE(tmppath, char, pathlen);
339  } else {
340 #endif /* defined(ENABLE_ZLIB) */
341  pathlen = strlen("file://") + lce->pathlen + namelen + strlen("0");
342 
343  tmppath = MNEW(char, pathlen);
344 
345  sprintf(tmppath, "file://%s%s", lce->path, namestart);
346 
347  /* Does this file exist? */
348 
349  if (stat(tmppath + strlen("file://") - 1, &buf) == 0)
350  if (!S_ISDIR(buf.st_mode))
351  path = JavaString::from_utf8(tmppath);
352 
353  MFREE(tmppath, char, pathlen);
354 #if defined(ENABLE_ZLIB)
355  }
356 #endif
357 
358  /* if a resource was found, add it to the vector */
359 
360  if (path != NULL) {
361  ret = vm_call_method_int(m, o, path);
362 
363  if (exceptions_get_exception() != NULL)
364  goto return_NULL;
365 
366  if (ret == 0)
367  goto return_NULL;
368  }
369  }
370 
371  return (jobject) o;
372 
373 return_NULL:
374  return NULL;
375 }
376 
377 
378 /*
379  * Class: java/lang/VMClassLoader
380  * Method: getStystemAssertionStatus
381  * Signature: ()Z
382  */
384 {
385 #if defined(ENABLE_ASSERTION)
387 #else
388  return false;
389 #endif
390 }
391 
392 /*
393  * Class: java/lang/VMClassLoader
394  * Method: defaultAssertionStatus
395  * Signature: ()Z
396  */
398 {
399 #if defined(ENABLE_ASSERTION)
400  return assertion_user_enabled;
401 #else
402  return false;
403 #endif
404 }
405 
406 /*
407  * Class: java/lang/VMClassLoader
408  * Method: packageAssertionStatus
409  * Signature: (Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;
410  */
412 {
413  java_handle_t *hm;
414 #if defined(ENABLE_ASSERTION)
415  java_handle_t *js;
416  methodinfo *m;
417 #endif
418 
419  /* new HashMap() */
420 
422  if (hm == NULL) {
423  return NULL;
424  }
425 
426 #if defined(ENABLE_ASSERTION)
427  /* if nothing todo, return now */
428 
429  if (assertion_package_count == 0) {
430  return (jobject) hm;
431  }
432 
433  /* get HashMap.put method */
434 
436  utf8::put,
437  Utf8String::from_utf8("(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"),
438  NULL,
439  true);
440 
441  if (m == NULL) {
442  return NULL;
443  }
444 
445  for (List<assertion_name_t*>::iterator it = list_assertion_names->begin(); it != list_assertion_names->end(); it++) {
446  assertion_name_t* item = *it;
447 
448  if (item->package == false)
449  continue;
450 
451  if (strcmp(item->name, "") == 0) {
452  /* unnamed package wanted */
453  js = NULL;
454  }
455  else {
456  js = JavaString::from_utf8(item->name);
457  if (js == NULL) {
458  return NULL;
459  }
460  }
461 
462  if (item->enabled == true) {
463  vm_call_method(m, hm, js, jtrue);
464  }
465  else {
466  vm_call_method(m, hm, js, jfalse);
467  }
468  }
469 #endif
470 
471  return (jobject) hm;
472 }
473 
474 /*
475  * Class: java/lang/VMClassLoader
476  * Method: classAssertionStatus
477  * Signature: (Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;
478  */
480 {
481  java_handle_t *hm;
482 #if defined(ENABLE_ASSERTION)
483  java_handle_t *js;
484  methodinfo *m;
485 #endif
486 
487  /* new HashMap() */
488 
490  if (hm == NULL) {
491  return NULL;
492  }
493 
494 #if defined(ENABLE_ASSERTION)
495  /* if nothing todo, return now */
496 
497  if (assertion_class_count == 0) {
498  return (jobject) hm;
499  }
500 
501  /* get HashMap.put method */
502 
504  utf8::put,
505  Utf8String::from_utf8("(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"),
506  NULL,
507  true);
508 
509  if (m == NULL) {
510  return NULL;
511  }
512 
513  for (List<assertion_name_t*>::iterator it = list_assertion_names->begin(); it != list_assertion_names->end(); it++) {
514  assertion_name_t* item = *it;
515 
516  if (item->package == true)
517  continue;
518 
519  js = JavaString::from_utf8(item->name);
520  if (js == NULL) {
521  return NULL;
522  }
523 
524  if (item->enabled == true) {
525  vm_call_method(m, hm, js, jtrue);
526  }
527  else {
528  vm_call_method(m, hm, js, jfalse);
529  }
530  }
531 #endif
532 
533  return (jobject) hm;
534 }
535 
536 
537 /*
538  * Class: java/lang/VMClassLoader
539  * Method: findLoadedClass
540  * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;
541  */
543 {
544  /* XXX is it correct to add the classloader to the hashtable here? */
545 
547 
548  /* replace `.' by `/', this is required by the classcache */
549 
551 
552  /* lookup for defining classloader */
553 
555 
556  /* if not found, lookup for initiating classloader */
557 
558  if (c == NULL)
559  c = classcache_lookup(cl, u);
560 
561  return (jclass) LLNI_classinfo_wrap(c);
562 }
563 
564 /*
565  * Class: java/lang/VMClassLoader
566  * Method: getBootPackage
567  * Signature: (Ljava/lang/String;)Ljava/lang/Package;
568  */
570 {
571  Utf8String u(JavaString((java_handle_t *) name).to_utf8());
572  if (!Package::find(u))
573  return NULL;
574 
575  classinfo *c = LLNI_classinfo_unwrap(clazz);
577  c,
578  Utf8String::from_utf8("createBootPackage"),
579  Utf8String::from_utf8("(Ljava/lang/String;)Ljava/lang/Package;"),
580  NULL,
581  true);
582  assert(m);
583 
584  java_handle_t *hm = vm_call_method(m, name);
585  return (jobject) hm;
586 }
587 
588 /*
589  * Class: java/lang/VMClassLoader
590  * Method: getBootPackages
591  * Signature: ()[Ljava/lang/Package;
592  */
594 {
595  classinfo *c = LLNI_classinfo_unwrap(clazz);
597  c,
598  Utf8String::from_utf8("createBootPackage"),
599  Utf8String::from_utf8("(Ljava/lang/String;)Ljava/lang/Package;"),
600  NULL,
601  true);
602  assert(m);
603 
605  const std::set<Utf8String> &packages(Package::packages());
606  int num = packages.size();
607 
608  classinfo *pc = load_class_bootstrap(Utf8String::from_utf8("java/lang/Package"));
609  if (!pc)
610  return NULL;
611  ObjectArray result(num, pc);
612  std::set<Utf8String>::const_iterator it = packages.begin();
613  for (int i=0; it != packages.end(); ++it, i++) {
614  JavaString package_name = JavaString::from_utf8(*it);
615  java_handle_t *hs = package_name;
616  if (!hs)
617  return NULL;
618  java_handle_t *h = vm_call_method(m, package_name);
619  if (!h)
620  return NULL;
621  result.set_element(i, h);
622  }
623  return result.get_handle();
624 }
625 
626 } // extern "C"
627 
628 
629 /* native methods implemented by this file ************************************/
630 
631 static JNINativeMethod methods[] = {
632  { (char*) "defineClass", (char*) "(Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_defineClass },
633  { (char*) "getPrimitiveClass", (char*) "(C)Ljava/lang/Class;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_getPrimitiveClass },
634  { (char*) "resolveClass", (char*) "(Ljava/lang/Class;)V", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_resolveClass },
635  { (char*) "loadClass", (char*) "(Ljava/lang/String;Z)Ljava/lang/Class;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_loadClass },
636  { (char*) "nativeGetResources", (char*) "(Ljava/lang/String;)Ljava/util/Vector;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_nativeGetResources },
637  { (char*) "getSystemAssertionStatus", (char*) "()Z", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_getSystemAssertionStatus },
638  { (char*) "defaultAssertionStatus", (char*) "()Z", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_defaultAssertionStatus },
639  { (char*) "packageAssertionStatus0", (char*) "(Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_packageAssertionStatus0 },
640  { (char*) "classAssertionStatus0", (char*) "(Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/util/Map;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_classAssertionStatus0 },
641  { (char*) "findLoadedClass", (char*) "(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_findLoadedClass },
642  { (char*) "getBootPackage", (char*) "(Ljava/lang/String;)Ljava/lang/Package;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_getBootPackage },
643  { (char*) "getBootPackages", (char*) "()[Ljava/lang/Package;", (void*) (uintptr_t) &Java_java_lang_VMClassLoader_getBootPackages },
644 };
645 
646 
647 /* _Jv_java_lang_VMClassLoader_init ********************************************
648 
649  Register native functions.
650 
651 *******************************************************************************/
652 
654 {
655  Utf8String u = Utf8String::from_utf8("java/lang/VMClassLoader");
656 
659 }
660 
661 
662 /*
663  * These are local overrides for various environment variables in Emacs.
664  * Please do not remove this and leave it at the end of the file, where
665  * Emacs will automagically detect them.
666  * ---------------------------------------------------------------------
667  * Local variables:
668  * mode: c++
669  * indent-tabs-mode: t
670  * c-basic-offset: 4
671  * tab-width: 4
672  * End:
673  * vim:noexpandtab:sw=4:ts=4:
674  */
JNIEXPORT jboolean JNICALL Java_java_lang_VMClassLoader_defaultAssertionStatus(JNIEnv *env, jclass clazz)
methodinfo * class_resolveclassmethod(classinfo *c, Utf8String name, Utf8String desc, classinfo *referer, bool throwexception)
Definition: class.cpp:1211
virtual java_handle_t * get_handle() const
Table containing all native methods registered with the VM.
Definition: native.hpp:132
ZipFile * zip
Definition: suck.hpp:55
NativeMethods & get_nativemethods()
Definition: vm.hpp:128
classinfo * classcache_lookup(classloader_t *initloader, Utf8String classname)
Definition: classcache.cpp:564
void register_methods(Utf8String classname, const JNINativeMethod *methods, size_t count)
Register native methods with the VM.
Definition: native.cpp:242
Utf8String to_utf8() const
Definition: string.cpp:437
JNIEXPORT jobject JNICALL Java_java_lang_VMClassLoader_nativeGetResources(JNIEnv *env, jclass clazz, jstring name)
_Jv_JNIEnv JNIEnv
Definition: jni.hpp:112
void exceptions_throw_classnotfoundexception(Utf8String name)
Definition: exceptions.cpp:681
virtual java_handle_array_t * get_handle() const
Definition: array.hpp:103
#define NATIVE_METHODS_COUNT
Definition: native.hpp:45
static JavaString from_utf8(Utf8String)
Definition: string.cpp:184
bool jvmti
Definition: cacaodbg.h:114
int8_t * get_raw_data_ptr()
Definition: array.hpp:333
size_t size() const
Definition: utf8.hpp:161
s4 state
Definition: class.hpp:115
const char * c_str()
get contents of buffer as zero-terminated c-style-string This strings lifetime is tied to it&#39;s buffer...
Definition: buffer.hpp:489
Actual implementation of access class for Java Object arrays.
Definition: array.hpp:381
JNIEXPORT jobject JNICALL Java_java_lang_VMClassLoader_packageAssertionStatus0(JNIEnv *env, jclass clazz, jobject jtrue, jobject jfalse)
List< assertion_name_t * > * list_assertion_names
Definition: assertion.cpp:42
typedef void(JNICALL *jvmtiEventSingleStep)(jvmtiEnv *jvmti_env
void jvmti_ClassFileLoadHook(utf *name, int class_data_len, unsigned char *class_data, java_objectheader *loader, java_objectheader *protection_domain, jint *new_class_data_len, unsigned char **new_class_data)
Definition: cacaodbg.c:317
void set_pd(java_handle_t *value)
char * path
Definition: suck.hpp:52
JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_loadClass(JNIEnv *env, jclass clazz, jstring name, jboolean resolve)
classinfo * load_class_bootstrap(Utf8String name)
Definition: loader.cpp:1276
JNIEXPORT jboolean JNICALL Java_java_lang_VMClassLoader_getSystemAssertionStatus(JNIEnv *env, jclass clazz)
java_handle_t * vm_call_method(methodinfo *m, java_handle_t *o,...)
JNIEnv jclass jobject const char * name
Definition: jvmti.h:312
void set_element(int32_t index, T value)
Definition: array.hpp:255
int32_t vm_call_method_int(methodinfo *m, java_handle_t *o,...)
static std::set< Utf8String > & packages()
Definition: package.cpp:40
JNIEXPORT void JNICALL Java_java_lang_VMClassLoader_resolveClass(JNIEnv *env, jclass clazz, jclass c)
classloader_t * loader_hashtable_classloader_add(java_handle_t *cl)
Definition: loader.cpp:305
static Mutex lock
Definition: atomic.cpp:34
bool assertion_user_enabled
Definition: assertion.cpp:45
#define LLNI_classinfo_wrap(classinfo)
Definition: llni.hpp:110
int32_t get_length() const
Definition: array.hpp:189
List implementation.
Definition: lock.hpp:35
JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_defineClass(JNIEnv *env, jclass clazz, jobject cl, jstring name, jbyteArray data, jint offset, jint len, jobject pd)
This file contains the statistics framework.
JNIEXPORT jobject JNICALL Java_java_lang_VMClassLoader_classAssertionStatus0(JNIEnv *env, jclass clazz, jobject jtrue, jobject jfalse)
void exceptions_throw_nullpointerexception(void)
JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_findLoadedClass(JNIEnv *env, jclass clazz, jobject loader, jstring name)
static Utf8String find(Utf8String packagename)
Find a package in the list.
Definition: package.cpp:77
static Utf8String from_utf8(const char *, size_t)
Definition: utf8.cpp:335
int32_t assertion_class_count
Definition: assertion.cpp:43
MIIterator i
Classpath entries list.
Definition: suck.hpp:62
s4 type
Definition: suck.hpp:51
JNIEnv jclass jobject loader
Definition: jvmti.h:312
JNIEnv jclass jobject const char jobject jint const unsigned char jint unsigned char ** new_class_data
Definition: jvmti.h:312
EntryRef find(Utf8String filename)
Find file in zip archive.
Definition: zip.hpp:108
Definition: suck.hpp:49
static const std::set< Utf8String > & packages()
Definition: package.cpp:90
java_handle_t * native_new_and_init(classinfo *c)
Registers a new native agent by specified by it&#39;s library name and with an optional options string...
Definition: native.cpp:729
void exceptions_throw_arrayindexoutofboundsexception(void)
#define pc
Definition: md-asm.hpp:56
#define MNEW(type, num)
Definition: memory.hpp:96
s4 pathlen
Definition: suck.hpp:53
bool assertion_system_enabled
Definition: assertion.cpp:46
Buffer & write(char)
Definition: buffer.hpp:280
classinfo * link_class(classinfo *c)
Definition: linker.cpp:378
JNIEXPORT jobject JNICALL Java_java_lang_VMClassLoader_getBootPackage(JNIEnv *env, jclass clazz, jstring name)
SuckClasspath & get_suckclasspath()
Definition: vm.hpp:129
java_handle_t * exceptions_get_exception(void)
Definition: exceptions.cpp:76
JNIEXPORT jobject JNICALL Java_java_lang_VMClassLoader_getBootPackages(JNIEnv *env, jclass clazz)
#define LLNI_classinfo_unwrap(clazz)
Definition: llni.hpp:113
static classinfo * get_class_by_char(char ch)
Returns the primitive class of the given type.
Definition: primitive.cpp:266
JNIEnv jclass jobject const char jobject jint const unsigned char jint * new_class_data_len
Definition: jvmti.h:312
classinfo * class_java_util_HashMap
Definition: globals.cpp:86
GNU Classpath java/lang/Class.
classinfo * class_java_util_Vector
Definition: globals.cpp:85
classinfo * classcache_lookup_defined(classloader_t *defloader, Utf8String classname)
Definition: classcache.cpp:616
#define MFREE(ptr, type, num)
Definition: memory.hpp:97
int32_t assertion_package_count
Definition: assertion.cpp:44
classinfo * class_define(Utf8String name, classloader_t *cl, int32_t length, uint8_t *data, java_handle_t *pd)
Definition: class.cpp:243
static JNINativeMethod methods[]
JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_getPrimitiveClass(JNIEnv *env, jclass clazz, jchar type)
void _Jv_java_lang_VMClassLoader_init(void)
static VM * get_current()
Definition: vm.hpp:99
Utf8String to_utf8_dot_to_slash() const
Definition: string.cpp:450