From: gary Date: Fri, 28 Jul 2006 07:40:17 +0000 (+0000) Subject: 2006-07-28 Gary Benson X-Git-Tag: upstream/4.9.2~53586 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11c79049f3a6379362badd782a71666b520b8518;p=platform%2Fupstream%2Flinaro-gcc.git 2006-07-28 Gary Benson * prims.cc (_Jv_CreateJavaVM): Move setting runtimeInitialized from the start to the end of the function. Remove references to VMThrowable.trace_enabled. * java/lang/natVMThrowable.cc (fillInStackTrace): Use runtimeInitialized rather than trace_enabled to decide whether to inhibit stack trace generation. * java/lang/VMThrowable.java (trace_enabled): Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115791 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 9b4990d..66e11e2 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2006-07-28 Gary Benson + + * prims.cc (_Jv_CreateJavaVM): Move setting runtimeInitialized + from the start to the end of the function. Remove references + to VMThrowable.trace_enabled. + * java/lang/natVMThrowable.cc (fillInStackTrace): Use + runtimeInitialized rather than trace_enabled to decide + whether to inhibit stack trace generation. + * java/lang/VMThrowable.java (trace_enabled): Removed. + 2006-07-23 Mohan Embar * include/win32-threads.h (_Jv_Thread_t): Explicitly diff --git a/libjava/java/lang/VMThrowable.java b/libjava/java/lang/VMThrowable.java index c5e5861..9dde28d 100644 --- a/libjava/java/lang/VMThrowable.java +++ b/libjava/java/lang/VMThrowable.java @@ -1,5 +1,6 @@ /* java.lang.VMThrowable -- VM support methods for Throwable. - Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2002, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -76,9 +77,6 @@ final class VMThrowable */ native StackTraceElement[] getStackTrace(Throwable t); - // Setting this flag to false prevents fillInStackTrace() from running. - static boolean trace_enabled = true; - // Native stack data. private RawDataManaged data; } diff --git a/libjava/java/lang/natVMThrowable.cc b/libjava/java/lang/natVMThrowable.cc index 6db1a1f..b198f90 100644 --- a/libjava/java/lang/natVMThrowable.cc +++ b/libjava/java/lang/natVMThrowable.cc @@ -1,6 +1,6 @@ // natVMThrowable.cc - Native part of VMThrowable class. -/* Copyright (C) 2003 Free Software Foundation +/* Copyright (C) 2003, 2006 Free Software Foundation This file is part of libgcj. @@ -27,7 +27,7 @@ java::lang::VMThrowable::fillInStackTrace (java::lang::Throwable *) using namespace java::lang; // Don't trace stack during initialization of the runtime. - if (! trace_enabled) + if (! gcj::runtimeInitialized) return NULL; _Jv_StackTrace *trace = _Jv_StackTrace::GetStackTrace (); diff --git a/libjava/prims.cc b/libjava/prims.cc index a066866..c216c7f 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -56,7 +56,6 @@ details. */ #include #include #include -#include #include #include #include @@ -1404,8 +1403,6 @@ _Jv_CreateJavaVM (JvVMInitArgs* vm_args) if (runtimeInitialized) return -1; - runtimeInitialized = true; - jint result = parse_init_args (vm_args); if (result < 0) return -1; @@ -1447,10 +1444,6 @@ _Jv_CreateJavaVM (JvVMInitArgs* vm_args) _Jv_InitPrimClass (&_Jv_doubleClass, "double", 'D', 8); _Jv_InitPrimClass (&_Jv_voidClass, "void", 'V', 0); - // Turn stack trace generation off while creating exception objects. - _Jv_InitClass (&java::lang::VMThrowable::class$); - java::lang::VMThrowable::trace_enabled = 0; - // We have to initialize this fairly early, to avoid circular class // initialization. In particular we want to start the // initialization of ClassLoader before we start the initialization @@ -1465,8 +1458,6 @@ _Jv_CreateJavaVM (JvVMInitArgs* vm_args) no_memory = new java::lang::OutOfMemoryError; - java::lang::VMThrowable::trace_enabled = 1; - #ifdef USE_LTDL LTDL_SET_PRELOADED_SYMBOLS (); #endif @@ -1489,6 +1480,8 @@ _Jv_CreateJavaVM (JvVMInitArgs* vm_args) { } + runtimeInitialized = true; + return 0; }