Changeset 1391 for branches/GNU/src/gcc/libjava/prims.cc
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (21 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 dir.info 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/libjava/prims.cc
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r1390 r1391 54 54 #include <java/lang/OutOfMemoryError.h> 55 55 #include <java/lang/System.h> 56 #include <java/lang/VMThrowable.h> 56 57 #include <java/lang/reflect/Modifier.h> 57 58 #include <java/io/PrintStream.h> … … 86 87 #endif 87 88 88 // The name of this executable.89 static char *_Jv_execName;90 91 89 // Stash the argv pointer to benefit native libraries that need it. 92 90 const char **_Jv_argv; 93 91 int _Jv_argc; 92 93 // Argument support. 94 int 95 _Jv_GetNbArgs (void) 96 { 97 // _Jv_argc is 0 if not explicitly initialized. 98 return _Jv_argc; 99 } 100 101 const char * 102 _Jv_GetSafeArg (int index) 103 { 104 if (index >=0 && index < _Jv_GetNbArgs ()) 105 return _Jv_argv[index]; 106 else 107 return ""; 108 } 109 110 void 111 _Jv_SetArgs (int argc, const char **argv) 112 { 113 _Jv_argc = argc; 114 _Jv_argv = argv; 115 } 94 116 95 117 #ifdef ENABLE_JVMPI … … 102 124 103 125 126 /* Unblock a signal. Unless we do this, the signal may only be sent 127 once. */ 128 static void 129 unblock_signal (int signum) 130 { 131 #ifdef _POSIX_VERSION 132 sigset_t sigs; 133 134 sigemptyset (&sigs); 135 sigaddset (&sigs, signum); 136 sigprocmask (SIG_UNBLOCK, &sigs, NULL); 137 #endif 138 } 139 104 140 extern "C" void _Jv_ThrowSignal (jthrowable) __attribute ((noreturn)); 105 141 … … 119 155 SIGNAL_HANDLER (catch_segv) 120 156 { 157 unblock_signal (SIGSEGV); 121 158 MAKE_THROW_FRAME (nullp); 122 159 _Jv_ThrowSignal (nullp); … … 129 166 SIGNAL_HANDLER (catch_fpe) 130 167 { 168 unblock_signal (SIGFPE); 131 169 #ifdef HANDLE_DIVIDE_OVERFLOW 132 170 HANDLE_DIVIDE_OVERFLOW; … … 400 438 // Unfortunately, we still have to the dynamic test, since there may 401 439 // be cni calls to this routine. 402 // No re that on IA64 get_finalizer() returns the starting address of the440 // Note that on IA64 get_finalizer() returns the starting address of the 403 441 // function, not a function pointer. Thus this still works. 404 442 if (klass->vtable->get_finalizer () … … 461 499 size += count * sizeof (jobject); 462 500 463 // FIXME: second argument should be "current loader"464 jclass klass = _Jv_GetArrayClass (elementClass, 0);501 jclass klass = _Jv_GetArrayClass (elementClass, 502 elementClass->getClassLoaderInternal()); 465 503 466 504 obj = (jobjectArray) _Jv_AllocArray (size, klass); … … 661 699 _Jv_Utf8Const *name = _Jv_makeUtf8Const (&sig[1], i - 1); 662 700 return _Jv_FindClass (name, loader); 663 664 701 } 665 702 case '[': … … 712 749 // The primary thread. 713 750 static java::lang::Thread *main_thread; 714 715 char *716 _Jv_ThisExecutable (void)717 {718 return _Jv_execName;719 }720 721 void722 _Jv_ThisExecutable (const char *name)723 {724 if (name)725 {726 _Jv_execName = (char *) _Jv_Malloc (strlen (name) + 1);727 strcpy (_Jv_execName, name);728 }729 }730 751 731 752 #ifndef DISABLE_GETENV_PROPERTIES … … 916 937 917 938 // Turn stack trace generation off while creating exception objects. 918 _Jv_InitClass (&java::lang:: Throwable::class$);919 java::lang:: Throwable::trace_enabled = 0;939 _Jv_InitClass (&java::lang::VMThrowable::class$); 940 java::lang::VMThrowable::trace_enabled = 0; 920 941 921 942 INIT_SEGV; … … 926 947 (JvNewStringLatin1 ("/ by zero")); 927 948 #endif 928 949 929 950 no_memory = new java::lang::OutOfMemoryError; 930 931 java::lang:: Throwable::trace_enabled = 1;932 951 952 java::lang::VMThrowable::trace_enabled = 1; 953 933 954 #ifdef USE_LTDL 934 955 LTDL_SET_PRELOADED_SYMBOLS (); … … 961 982 bool is_jar) 962 983 { 963 _Jv_argv = argv; 964 _Jv_argc = argc; 984 _Jv_SetArgs (argc, argv); 965 985 966 986 java::lang::Runtime *runtime = NULL; 967 968 969 #ifdef DISABLE_MAIN_ARGS970 _Jv_ThisExecutable ("[Embedded App]");971 #else972 #ifdef HAVE_PROC_SELF_EXE973 char exec_name[20];974 sprintf (exec_name, "/proc/%d/exe", getpid ());975 _Jv_ThisExecutable (exec_name);976 #else977 _Jv_ThisExecutable (argv[0]);978 #endif /* HAVE_PROC_SELF_EXE */979 #endif /* DISABLE_MAIN_ARGS */980 987 981 988 try -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.