GNU header update.
[cacao.git] / src / native / vm / VMRuntime.c
index f75f320c99c70d9e359816096246a499921d355a..2e9c7083d4bc9e52d7808f0add0af4b54820298c 100644 (file)
@@ -1,9 +1,9 @@
-/* nat/Runtime.c - java/lang/Runtime
+/* native/vm/VMRuntime.c - java/lang/VMRuntime
 
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
-   M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
-   P. Tomsich, J. Wenninger
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   Institut f. Computersprachen - TU Wien
 
    This file is part of CACAO.
 
@@ -27,8 +27,9 @@
    Authors: Roman Obermaiser
 
    Changes: Joseph Wenninger
+            Christian Thalinger
 
-   $Id: VMRuntime.c 873 2004-01-11 20:59:29Z twisti $
+   $Id: VMRuntime.c 1735 2004-12-07 14:33:27Z twisti $
 
 */
 
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/utsname.h>
-#include "jni.h"
-#include "builtin.h"
-#include "loader.h"
-#include "native.h"
-#include "tables.h"
-#include "asmpart.h"
+
+#if !defined(STATIC_CLASSPATH)
+#include <dlfcn.h>
+#endif
+
+#include "config.h"
+#include "cacao/cacao.h"
 #include "mm/boehm.h"
-#include "toolbox/loging.h"
-#include "toolbox/memory.h"
-#include "java_io_File.h"
-#include "java_lang_String.h"
-#include "java_lang_Process.h"
-#include "java_util_Properties.h"    /* needed for java_lang_Runtime.h */
-#include "java_lang_Runtime.h"
-
-
-#define JOWENN_DEBUG
-
-
-#define MAXPROPS 100
-static int activeprops = 19;  
-   
-static char *proplist[MAXPROPS][2] = {
-       { "java.class.path", NULL },
-       { "java.home", NULL },
-       { "user.home", NULL },  
-       { "user.name", NULL },
-       { "user.dir",  NULL },
-                                
-       { "os.arch", NULL },
-       { "os.name", NULL },
-       { "os.version", NULL },
-                                         
-       { "java.class.version", "45.3" },
-       { "java.version", PACKAGE":"VERSION },
-       { "java.vendor", "CACAO Team" },
-       { "java.vendor.url", "http://www.complang.tuwien.ac.at/java/cacao/" },
-       { "java.vm.name", "CACAO"}, 
-       { "java.tmpdir", "/tmp/"},
-       { "java.io.tmpdir", "/tmp/"},
-
-       { "path.separator", ":" },
-       { "file.separator", "/" },
-       { "line.separator", "\n" },
-       { "java.protocol.handler.pkgs", "gnu.java.net.protocol"}
+#include "mm/memory.h"
+#include "native/jni.h"
+#include "native/native.h"
+#include "native/include/java_io_File.h"
+#include "native/include/java_lang_String.h"
+#include "native/include/java_lang_Process.h"
+#include "native/include/java_util_Properties.h"     /* java_lang_VMRuntime.h */
+#include "native/include/java_lang_VMRuntime.h"
+#include "toolbox/logging.h"
+#include "vm/builtin.h"
+#include "vm/exceptions.h"
+#include "vm/loader.h"
+#include "vm/tables.h"
+#include "vm/jit/asmpart.h"
+
+
+/* this should work on BSD */
+/*
+#if defined(__DARWIN__)
+#include <sys/sysctl.h>
+#endif
+*/
+
+#undef JOWENN_DEBUG
+
+/* should we run all finalizers on exit? */
+static bool finalizeOnExit = false;
+
+/* temporary property structure */
+
+typedef struct property property;
+
+struct property {
+       char     *key;
+       char     *value;
+       property *next;
 };
 
+static property *properties = NULL;
+
+
+/* create_property *************************************************************
+
+   Create a property entry for a command line property definition.
+
+*******************************************************************************/
+
+void create_property(char *key, char *value)
+{
+       property *p;
+
+       p = NEW(property);
+       p->key = key;
+       p->value = value;
+       p->next = properties;
+       properties = p;
+}
+
+
+/* insert_property *************************************************************
+
+   Used for inserting a property into the system's properties table. Method m
+   (usually put) and the properties table must be given.
+
+*******************************************************************************/
+
+static void insert_property(methodinfo *m, java_util_Properties *p, char *key,
+                                                       char *value)
+{
+       asm_calljavafunction(m,
+                                                p,
+                                                javastring_new_char(key),
+                                                javastring_new_char(value),
+                                                NULL);
+}
+
 
 /*
- * Class:     java_lang_Runtime
+ * Class:     java_lang_VMRuntime
  * Method:    execInternal
  * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/io/File;)Ljava/lang/Process;
  */
-JNIEXPORT java_lang_Process* JNICALL Java_java_lang_Runtime_execInternal(JNIEnv *env, java_lang_Runtime *this, java_objectarray *cmd, java_objectarray *shellenv, java_io_File *workingdir)
+JNIEXPORT java_lang_Process* JNICALL Java_java_lang_VMRuntime_execInternal(JNIEnv *env, jclass clazz, java_objectarray *cmd, java_objectarray *shellenv, java_io_File *workingdir)
 {
        log_text("Java_java_lang_Runtime_execInternal called");
 
@@ -99,12 +137,15 @@ JNIEXPORT java_lang_Process* JNICALL Java_java_lang_Runtime_execInternal(JNIEnv
 
 
 /*
- * Class:     java/lang/Runtime
+ * Class:     java/lang/VMRuntime
  * Method:    exitInternal
  * Signature: (I)V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_exitInternal(JNIEnv *env, java_lang_Runtime *this, s4 par1)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_exit(JNIEnv *env, jclass clazz, s4 par1)
 {
+       if (finalizeOnExit)
+               gc_finalize_all();
+
        cacao_shutdown(par1);
 }
 
@@ -114,11 +155,9 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_exitInternal(JNIEnv *env, java_lan
  * Method:    freeMemory
  * Signature: ()J
  */
-JNIEXPORT s8 JNICALL Java_java_lang_Runtime_freeMemory(JNIEnv *env, java_lang_Runtime *this)
+JNIEXPORT s8 JNICALL Java_java_lang_VMRuntime_freeMemory(JNIEnv *env, jclass clazz)
 {
-       log_text ("java_lang_Runtime_freeMemory called");
-
-       return builtin_i2l(0);
+       return gc_get_free_bytes();
 }
 
 
@@ -127,7 +166,7 @@ JNIEXPORT s8 JNICALL Java_java_lang_Runtime_freeMemory(JNIEnv *env, java_lang_Ru
  * Method:    gc
  * Signature: ()V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_gc(JNIEnv *env, java_lang_Runtime *this)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_gc(JNIEnv *env, jclass clazz)
 {
        gc_call();
 }
@@ -138,9 +177,9 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_gc(JNIEnv *env, java_lang_Runtime
  * Method:    runFinalization
  * Signature: ()V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_runFinalization(JNIEnv *env, java_lang_Runtime *this)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalization(JNIEnv *env, jclass clazz)
 {
-       /* empty */
+       gc_invoke_finalizers();
 }
 
 
@@ -149,9 +188,30 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_runFinalization(JNIEnv *env, java_
  * Method:    runFinalizersOnExit
  * Signature: (Z)V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_runFinalizersOnExitInternal(JNIEnv *env, jclass clazz, s4 par1)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalizersOnExit(JNIEnv *env, jclass clazz, s4 value)
+{
+#ifdef __GNUC__
+#warning threading
+#endif
+       finalizeOnExit = value;
+}
+
+
+/*
+ * Class:     java/lang/Runtime
+ * Method:    runFinalizationsForExit
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalizationForExit(JNIEnv *env, jclass clazz)
 {
-       log_text("Java_java_lang_Runtime_runFinalizersOnExit0 called");
+/*     if (finalizeOnExit) { */
+/*             gc_call(); */
+       /* gc_finalize_all(); */
+/*     } */
+/*     log_text("Java_java_lang_VMRuntime_runFinalizationForExit called"); */
+       /*gc_finalize_all();*/
+       /*gc_invoke_finalizers();*/
+       /*gc_call();*/
 }
 
 
@@ -160,11 +220,9 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_runFinalizersOnExitInternal(JNIEnv
  * Method:    totalMemory
  * Signature: ()J
  */
-JNIEXPORT s8 JNICALL Java_java_lang_Runtime_totalMemory(JNIEnv *env, java_lang_Runtime *this)
+JNIEXPORT s8 JNICALL Java_java_lang_VMRuntime_totalMemory(JNIEnv *env, jclass clazz)
 {
-       log_text ("java_lang_Runtime_totalMemory called");
-
-       return builtin_i2l(0);
+       return gc_get_heap_size();
 }
 
 
@@ -173,9 +231,9 @@ JNIEXPORT s8 JNICALL Java_java_lang_Runtime_totalMemory(JNIEnv *env, java_lang_R
  * Method:    traceInstructions
  * Signature: (Z)V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_traceInstructions(JNIEnv *env, java_lang_Runtime *this, s4 par1)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_traceInstructions(JNIEnv *env, jclass clazz, s4 par1)
 {
-       log_text("Java_java_lang_Runtime_traceInstructions called");
+       /* not supported */
 }
 
 
@@ -184,9 +242,9 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_traceInstructions(JNIEnv *env, jav
  * Method:    traceMethodCalls
  * Signature: (Z)V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_traceMethodCalls(JNIEnv *env, java_lang_Runtime *this, s4 par1)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_traceMethodCalls(JNIEnv *env, jclass clazz, s4 par1)
 {
-       log_text("Java_java_lang_Runtime_traceMethodCalls called");
+       /* not supported */
 }
 
 
@@ -195,11 +253,44 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_traceMethodCalls(JNIEnv *env, java
  * Method:    availableProcessors
  * Signature: ()I
  */
-JNIEXPORT s4 JNICALL Java_java_lang_Runtime_availableProcessors(JNIEnv *env, java_lang_Runtime *this)
+JNIEXPORT s4 JNICALL Java_java_lang_VMRuntime_availableProcessors(JNIEnv *env, jclass clazz)
 {
-       log_text("Java_java_lang_Runtime_availableProcessors called, returning hardcoded 1");
+#if defined(_SC_NPROC_ONLN)
+       return (s4) sysconf(_SC_NPROC_ONLN);
+
+#elif defined(_SC_NPROCESSORS_ONLN)
+       return (s4) sysconf(_SC_NPROCESSORS_ONLN);
+
+#elif defined(__DARWIN__)
+       /* this should work in BSD */
+       /*
+       int ncpu, mib[2], rc;
+       size_t len;
+
+       mib[0] = CTL_HW;
+       mib[1] = HW_NCPU;
+       len = sizeof(ncpu);
+       rc = sysctl(mib, 2, &ncpu, &len, NULL, 0);
+
+       return (s4) ncpu;
+       */
+
+       host_basic_info_data_t hinfo;
+       mach_msg_type_number_t hinfo_count = HOST_BASIC_INFO_COUNT;
+       kern_return_t rc;
+
+       rc = host_info(mach_host_self(), HOST_BASIC_INFO,
+                                  (host_info_t) &hinfo, &hinfo_count);
+       if (rc != KERN_SUCCESS) {
+               return -1;
+       }
 
+    return (s4) hinfo.avail_cpus;
+
+#else
        return 1;
+#endif
 }
 
 
@@ -208,13 +299,20 @@ JNIEXPORT s4 JNICALL Java_java_lang_Runtime_availableProcessors(JNIEnv *env, jav
  * Method:    nativeLoad
  * Signature: (Ljava/lang/String;)I
  */
-JNIEXPORT s4 JNICALL Java_java_lang_Runtime_nativeLoad(JNIEnv *env, java_lang_Runtime *this, java_lang_String *par1)
+JNIEXPORT s4 JNICALL Java_java_lang_VMRuntime_nativeLoad(JNIEnv *env, jclass clazz, java_lang_String *par1)
 {
-#ifdef JOWENN_DEBUG    
+       int retVal=0;
+
+#ifdef JOWENN_DEBUG
        char *buffer;
        int buffer_len;
+#endif
        utf *data;
-       
+
+#ifdef JOWENN_DEBUG
+       log_text("Java_java_lang_VMRuntime_nativeLoad");
+#endif
+
        data = javastring_toutf(par1, 0);
        
        if (!data) {
@@ -222,107 +320,202 @@ JNIEXPORT s4 JNICALL Java_java_lang_Runtime_nativeLoad(JNIEnv *env, java_lang_Ru
                return 1;
        }
        
+#if JOWENN_DEBUG       
        buffer_len = utf_strlen(data) + 40;
 
-               
        buffer = MNEW(char, buffer_len);
-
-       strcpy(buffer, "Java_java_lang_Runtime_nativeLoad:");
+       strcpy(buffer, "Java_java_lang_VMRuntime_nativeLoad:");
        utf_sprint(buffer + strlen((char *) data), data);
        log_text(buffer);       
-
+        
+  
        MFREE(buffer, char, buffer_len);
 #endif
-       log_text("Java_java_lang_Runtime_nativeLoad");
 
-       return 1;
+#ifndef STATIC_CLASSPATH
+       /*here it could be interesting to store the references in a list eg for nicely cleaning up or for certain platforms*/
+        if (dlopen(data->text,RTLD_NOW | RTLD_GLOBAL)) {
+               /*log_text("LIBLOADED");*/
+                retVal=1;
+        }
+#else
+       retVal=1;
+#endif
+
+       return retVal;
 }
 
 
 /*
- * Class:     java_lang_Runtime
+ * Class:     java/lang/VMRuntime
  * Method:    nativeGetLibname
  * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  */
-JNIEXPORT java_lang_String* JNICALL Java_java_lang_Runtime_nativeGetLibname(JNIEnv *env, jclass clazz, java_lang_String *par1, java_lang_String *par2)
+JNIEXPORT java_lang_String* JNICALL Java_java_lang_VMRuntime_nativeGetLibname(JNIEnv *env, jclass clazz, java_lang_String *pathname, java_lang_String *libname)
 {
-#ifdef JOWENN_DEBUG    
        char *buffer;
        int buffer_len;
-       utf *data;
-       
-       data = javastring_toutf(par2, 0);
+       utf *u;
+       java_lang_String *s;
+
+       if (!libname) {
+               *exceptionptr = new_nullpointerexception();
+               return NULL;
+       }
+
+       u = javastring_toutf(libname, 0);
        
-       if (!data) {
+       if (!u) {
                log_text("nativeGetLibName: Error: empty string");
                return 0;;
        }
        
-       buffer_len = utf_strlen(data) + 40;
-       
+       buffer_len = utf_strlen(u) + 6 /*lib .so */ +1 /*0*/;
        buffer = MNEW(char, buffer_len);
 
-       strcpy(buffer, "Java_java_lang_Runtime_nativeGetLibname:");
-       utf_sprint(buffer + strlen((char *) data), data);
-       log_text(buffer);       
+       sprintf(buffer, "lib");
+       utf_sprint(buffer + 3, u);
+       strcat(buffer, ".so");
 
-       MFREE(buffer, char, buffer_len);
+#ifdef JOWENN_DEBUG
+       log_text("nativeGetLibName:");
+       log_text(buffer);
 #endif
-       log_text("Java_java_lang_Runtime_nativeGetLibname");
+       
+       s = javastring_new_char(buffer);        
+
+       MFREE(buffer, char, buffer_len);
 
-       return 0;
+       return s;
 }
 
 
 /*
- * Class:     java_lang_Runtime
+ * Class:     java_lang_VMRuntime
  * Method:    insertSystemProperties
  * Signature: (Ljava/util/Properties;)V
  */
-JNIEXPORT void JNICALL Java_java_lang_Runtime_insertSystemProperties(JNIEnv *env, jclass clazz, java_util_Properties *p)
+JNIEXPORT void JNICALL Java_java_lang_VMRuntime_insertSystemProperties(JNIEnv *env, jclass clazz, java_util_Properties *p)
 {
 
 #define BUFFERSIZE 200
-       u4 i;
        methodinfo *m;
-       char buffer[BUFFERSIZE];
+       char cwd[BUFFERSIZE];
+       char *java_home;
+       char *user;
+       char *home;
        struct utsname utsnamebuf;
+#if !defined(STATIC_CLASSPATH)
+       char *libpath;
+       s4    libpathlen;
+#endif
 
-       proplist[0][1] = classpath;
-       proplist[1][1] = getenv("JAVA_HOME");
-       proplist[2][1] = getenv("HOME");
-       proplist[3][1] = getenv("USER");
-       proplist[4][1] = getcwd(buffer, BUFFERSIZE);
+       if (!p) {
+               *exceptionptr = new_nullpointerexception();
+               return;
+       }
 
        /* get properties from system */
-       uname(&utsnamebuf);
-       proplist[5][1] = utsnamebuf.machine;
-       proplist[6][1] = utsnamebuf.sysname;
-       proplist[7][1] = utsnamebuf.release;
 
-       if (!p)
-               panic("Java_java_lang_Runtime_insertSystemProperties called with NULL-Argument");
+       (void) getcwd(cwd, BUFFERSIZE);
+       java_home = getenv("JAVA_HOME");
+       user = getenv("USER");
+       home = getenv("HOME");
+       uname(&utsnamebuf);
 
        /* search for method to add properties */
-       m = class_resolvemethod(p->header.vftbl->class,
-                                                       utf_new_char("put"),
-                                                       utf_new_char("(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;")
-                                                       );
+
+       m = class_resolveclassmethod(p->header.vftbl->class,
+                                                                utf_new_char("put"),
+                                                                utf_new_char("(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"),
+                                                                clazz,
+                                                                true);
 
        if (!m)
-               panic("Can not find method 'put' for class Properties");
+               return;
+
+       insert_property(m, p, "java.version", VERSION);
+       insert_property(m, p, "java.vendor", "CACAO Team");
+       insert_property(m, p, "java.vendor.url", "http://www.complang.tuwien.ac.at/java/cacao/");
+       insert_property(m, p, "java.home", java_home ? java_home : "null");
+       insert_property(m, p, "java.vm.specification.version", "1.0");
+       insert_property(m, p, "java.vm.specification.vendor", "Sun Microsystems Inc.");
+       insert_property(m, p, "java.vm.specification.name", "Java Virtual Machine Specification");
+       insert_property(m, p, "java.vm.version", VERSION);
+       insert_property(m, p, "java.vm.vendor", "CACAO Team");
+       insert_property(m, p, "java.vm.name", "CACAO");
+       insert_property(m, p, "java.specification.version", "1.4");
+       insert_property(m, p, "java.specification.vendor", "Sun Microsystems Inc.");
+       insert_property(m, p, "java.specification.name", "Java Platform API Specification");
+       insert_property(m, p, "java.class.version", "48.0");
+       insert_property(m, p, "java.class.path", classpath);
+
+#if defined(STATIC_CLASSPATH)
+       insert_property(m, p, "java.library.path" , ".");
+#else
+       libpathlen = strlen(INSTALL_PREFIX) + strlen(CACAO_LIBRARY_PATH) + 1;
+
+       if (getenv("CACAO_LIB_OVERRIDE"))
+               libpathlen += strlen(getenv("CACAO_LIB_OVERRIDE")) + 1;
+
+       if (getenv("LD_LIBRARY_PATH"))
+               libpathlen += strlen(getenv("LD_LIBRARY_PATH")) + 1;
+
+       libpath = MNEW(char, libpathlen);
+
+       if (getenv("CACAO_LIB_OVERRIDE")) {
+               strcat(libpath, getenv("CACAO_LIB_OVERRIDE"));
+               strcat(libpath, ":");
+       }
 
-       /* add the properties */
-       for (i = 0; i < activeprops; i++) {
+       strcat(libpath, INSTALL_PREFIX);
+       strcat(libpath, CACAO_LIBRARY_PATH);
 
-               if (proplist[i][1] == NULL) proplist[i][1] = "";
+       if (getenv("LD_LIBRARY_PATH")) {
+               strcat(libpath, ":");
+               strcat(libpath, getenv("LD_LIBRARY_PATH"));
+       }
+       insert_property(m, p, "java.library.path", libpath);
+
+       MFREE(libpath, char, libpathlen);
+#endif
+
+       insert_property(m, p, "java.io.tmpdir", "/tmp");
+       insert_property(m, p, "java.compiler", "cacao.jit");
+       insert_property(m, p, "java.ext.dirs", "");
+       insert_property(m, p, "os.name", utsnamebuf.sysname);
+       insert_property(m, p, "os.arch", utsnamebuf.machine);
+       insert_property(m, p, "os.version", utsnamebuf.release);
+       insert_property(m, p, "file.separator", "/");
+       /* insert_property(m, p, "file.encoding", "null"); -- this must be set properly */
+       insert_property(m, p, "path.separator", ":");
+       insert_property(m, p, "line.separator", "\n");
+       insert_property(m, p, "user.name", user ? user : "null");
+       insert_property(m, p, "user.home", home ? home : "null");
+       insert_property(m, p, "user.dir", cwd ? cwd : "null");
+
+#if 0
+       /* how do we get them? */
+       { "user.language", "en" },
+       { "user.region", "US" },
+       { "user.country", "US" },
+       { "user.timezone", "Europe/Vienna" },
+
+       /* XXX do we need this one? */
+       { "java.protocol.handler.pkgs", "gnu.java.net.protocol"}
+#endif
+       insert_property(m, p, "java.protocol.handler.pkgs", "gnu.java.net.protocol");
 
-               asm_calljavafunction(m,
-                                                        p,
-                                                        javastring_new_char(proplist[i][0]),
-                                                        javastring_new_char(proplist[i][1]),
-                                                        NULL
-                                                        );
+       /* insert properties defined on commandline */
+
+       while (properties) {
+               property *tp;
+
+               insert_property(m, p, properties->key, properties->value);
+
+               tp = properties;
+               properties = properties->next;
+               FREE(tp, property);
        }
 
        return;
@@ -330,15 +523,13 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_insertSystemProperties(JNIEnv *env
 
 
 /*
- * Class:     java_lang_Runtime
+ * Class:     java_lang_VMRuntime
  * Method:    maxMemory
  * Signature: ()J
  */
-JNIEXPORT s8 JNICALL Java_java_lang_Runtime_maxMemory(JNIEnv *env, java_lang_Runtime *this)
+JNIEXPORT s8 JNICALL Java_java_lang_VMRuntime_maxMemory(JNIEnv *env, jclass clazz)
 {
-       log_text("Java_java_lang_Runtime_maxMemory");
-
-       return 0;
+       return gc_get_max_heap_size();
 }