From 1bc39a9bde3aae23c62166be8b641e79e5843d58 Mon Sep 17 00:00:00 2001 From: bryce Date: Thu, 17 Nov 2005 20:25:57 +0000 Subject: Implement -Xss. * include/jvm.h (gcj::stack_size): Declare. (_Jv_StackSize): Declare. * posix-threads.cc (_Jv_InitThreads): Validate gcj::stack_size. (_Jv_ThreadStart): Set stack size if specified. * prims.cc (gcj::stack_size): Define. (parse_memory_size): Renamed from parse_heap_size. (_Jv_SetStackSize): Parse stack size argument and set gcj::stack_size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107132 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/prims.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'libjava/prims.cc') diff --git a/libjava/prims.cc b/libjava/prims.cc index ba5c9efd260..490d2b1c127 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -959,6 +959,9 @@ namespace gcj // When true, enable the bytecode verifier and BC-ABI type verification. bool verifyClasses = true; + + // Thread stack size specified by the -Xss runtime argument. + size_t stack_size = 0; } // We accept all non-standard options accepted by Sun's java command, @@ -1045,7 +1048,7 @@ parse_x_arg (char* option_string) } else if (! strncmp (option_string, "ss", 2)) { - // FIXME: set thread stack size + _Jv_SetStackSize (option_string + 2); } else if (! strcmp (option_string, "X:+UseAltSigs")) { @@ -1407,7 +1410,7 @@ JvRunMain (jclass klass, int argc, const char **argv) // Parse a string and return a heap size. static size_t -parse_heap_size (const char *spec) +parse_memory_size (const char *spec) { char *end; unsigned long val = strtoul (spec, &end, 10); @@ -1423,7 +1426,7 @@ parse_heap_size (const char *spec) void _Jv_SetInitialHeapSize (const char *arg) { - size_t size = parse_heap_size (arg); + size_t size = parse_memory_size (arg); _Jv_GCSetInitialHeapSize (size); } @@ -1432,11 +1435,16 @@ _Jv_SetInitialHeapSize (const char *arg) void _Jv_SetMaximumHeapSize (const char *arg) { - size_t size = parse_heap_size (arg); + size_t size = parse_memory_size (arg); _Jv_GCSetMaximumHeapSize (size); } - +void +_Jv_SetStackSize (const char *arg) +{ + size_t size = parse_memory_size (arg); + gcj::stack_size = size; +} void * _Jv_Malloc (jsize size) -- cgit v1.2.3