aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/natString.cc
AgeCommit message (Collapse)AuthorFilesLines
2002-06-13natString.cc (init): Handle case where DONT_COPY is true and OFFSET!=0.Tom Tromey1-2/+1
* java/lang/natString.cc (init): Handle case where DONT_COPY is true and OFFSET!=0. * java/lang/String.java (String(char[],int,int,boolean): New constructor. * java/lang/Long.java: Imported new version from Classpath. * java/lang/Number.java: Likewise. * java/lang/Integer.java: Likewise. * java/lang/Long.java: Likewise. * java/lang/Float.java: Likewise. * java/lang/Boolean.java: Likewise. * java/lang/Double.java: Likewise. * java/lang/Void.java: Likewise. From-SVN: r54595
2002-05-07* java/lang/natString.cc (unintern): Fixed typo.Tom Tromey1-2/+2
From-SVN: r53265
2001-11-15natString.cc: correct argument order for _Jv_AllocPtrFreeObjHans Boehm1-1/+1
* java/lang/natString.cc: correct argument order for _Jv_AllocPtrFreeObj From-SVN: r47035
2001-07-30natIconv.cc (done): New methods.Tom Tromey1-0/+2
2001-07-30 Tom Tromey <tromey@redhat.com> Corey Minyard <minyard@acm.org> * gnu/gcj/convert/natIconv.cc (done): New methods. * gnu/gcj/convert/Output_iconv.java (done): New method. * gnu/gcj/convert/Input_iconv.java (done): New method. * gnu/gcj/convert/UnicodeToBytes.java (defaultEncodingClass): Removed. (getDefaultEncodingClass): Removed. (getDefaultEncoder): Use getEncoder. (done): New method. (defaultEncoding, CACHE_SIZE, encoderCache, currCachePos): New static fields. * gnu/gcj/convert/BytesToUnicode.java (defaultDecodingClass): Removed. (defaultEncoding, CACHE_SIZE, decoderCache, currCachePos): New static fields. (getDefaultDecodingClass): Removed. (getDefaultDecoder): Use getDecoder. (getDecoder): Look up decoder in cache. (done): New method. * java/lang/natString.cc (init): Call `done' on converter. (getBytes): Likewise. Co-Authored-By: Corey Minyard <minyard@acm.org> From-SVN: r44484
2001-05-24natString.cc (init): Throw ArrayIndexOutOfBoundsException.Tom Tromey1-8/+10
* java/lang/natString.cc (init): Throw ArrayIndexOutOfBoundsException. (getChars): Likewise. (getBytes): Likewise. (valueOf): Likewise. From-SVN: r42531
2001-05-24[multiple changes]Tom Tromey1-6/+14
2001-05-23 Tom Tromey <tromey@redhat.com> * posix-threads.cc (_Jv_self_cache): Renamed from self_cache. * gcj/Makefile.in: Rebuilt. * gcj/Makefile.am (gcj_HEADERS): Added libgcj-config.h. * gcj/javaprims.h: Include gcj/libgcj-config.h. * gcj/libgcj-config.h.in: New file. * libgcj.spec.in (*jc1): Added @HASH_SYNC_SPEC@. * configure: Rebuilt. * configure.in: Enable hash synchronization by default on some platforms. (HASH_SYNC_SPEC): New subst. (AC_CONFIG_HEADER): Added gcj/libgcj-config.h. Correctly use `test -z' instead of `test -n' in a couple places. (JV_HASH_SYNCHRONIZATION): Use AC_DEFINE; don't add to LIBGCJ_CXXFLAGS. * configure.host (enable_java_net_default): Initialize. (enable_hash_synchronization_default): New variable. 2001-05-23 Hans Boehm <Hans_Boehm@hp.com> * boehm.cc (_Jv_MarkObj): Don't mark sync_info when hash synchronization in use. (_Jv_MarkArray): Likewise. (_Jv_AllocBytes): Don't check return result. (handle_out_of_memory): New function. (_Jv_InitGC): Set GC_oom_fn. (trace_one_vtable): New global. (_Jv_AllocTraceOne): New function. * configure.in: Added --enable-hash-synchronization. * defineclass.cc, prims.cc, resolve.cc, java/lang/natString.cc, java/net/natInetAddress.cc: Remove _Jv_AllocBytesChecked. * nogc.cc (_Jv_AllocObj): Throw out-of-memory. (_Jv_AllocArray): Likewise. (_Jv_AllocBytes): Likewise. (_Jv_AllocPtrFreeObject): New function. (_Jv_AllocTraceOne): Likewise. * posix-threads.cc (_Jv_ThreadRegister): Handle slow pthread_self(). (self_cache): New global. (_Jv_ThreadSelf_out_of_line): New function. * prims.cc (_Jv_AllocBytesChecked): Removed. (_Jv_ThrowNoMemory): New function. (_Jv_AllocObject): Don't check for null return from allocator. (_Jv_NewObjectArray): Likewise. (_Jv_AllocPtrFreeObject): New function. (_Jv_NewPrimArray): Allocate pointer-free object if possible. * include/javaprims.h (_Jv_AllocPtrFreeObject): Declare. (_Jv_MonitorEnter, _Jv_MonitorExit): Don't return value. * include/boehm-gc.h (_Jv_AllocObj): Define. (_Jv_AllocPtrFreeObj): Define. * include/jvm.h (_Jv_AllocPtrFreeObj): Declare. (_Jv_ThrowNoMemory): Declare. (_Jv_AllocTraceOne): Declare. (_Jv_AllocBytesChecked): Removed. * include/posix-threads.h (_Jv_MutexInit, _Jv_MutexLock, _Jv_MutexUnlock): Handle LOCK_DEBUG. (_Jv_ThreadSelf): Handle case where system pthread_self() is slow. * java/lang/Class.h (Class): Declare _Jv_AllocPtrFreeObj as friend. * java/lang/Object.h (sync_info): Conditional upon presence of hash synchronization. * java/lang/natObject.cc: Much new code to handle thin locks and hash synchronization. * java/lang/natString.cc (_Jv_AllocString): Allocate pointer-free object if possible. From-SVN: r42519
2001-05-21javaprims.h (_Jv_FormatInt): New declaration.Per Bothner1-0/+46
* gcj/javaprims.h (_Jv_FormatInt): New declaration. * java/lang/natString.cc (_JvFormatInt): New primitive, with logic taken from old Integer.toString code. (Integer::valueOf): Use _Jv_FormatInt. * java/lang/Integer.java (toString): Just use call String.valueOf. * java/lang/Long.java (toString): Fix typo in comment. * java/lang/String.java (valueOf(int)): Make native. * java/lang/StringBuffer.java (append(int)): Make native. * java/lang/natStringBuffer.cc: New file, for append(jint). * Makefile.am (ant_source_files): Add java/lang/natStringBuffer.cc. From-SVN: r42419
2001-04-10natString.cc (_Jv_NewStringUtf8Const): Register finalizer.Per Bothner1-6/+12
* java/lang/natString.cc (_Jv_NewStringUtf8Const): Register finalizer. Recalculate hash, since Utf8Const's hash is only 16 bits. * java/lang/natString.cc (_Jv_StringFindSlot, rehash): Use high-order bits of hash to calculate step for chaining. * java/lang/natString.cc (intern, _Jv_NewStringUtf8Const): Rehash when 2/3 full, rather than 3/4 full. From-SVN: r41233
2001-04-01natString.cc (intern): If string's data does not point to this String, make ↵Per Bothner1-6/+9
a fresh String that does. * java/lang/natString.cc (intern): If string's data does not point to this String, make a fresh String that does. * java/lang/natString.cc (unintern): Replace by static function. * java/lang/String.java (unintern): Remove method. From-SVN: r40990
2001-03-25exception.cc (java_eh_info): Make value type jthrowable.Richard Henderson1-11/+11
* exception.cc (java_eh_info): Make value type jthrowable. (_Jv_type_matcher): Remove now unneeded cast. (_Jv_Throw): Make argument type jthrowable. Munge name for SJLJ_EXCEPTIONS here ... * gcj/cni.h: ... not here. (JvThrow): Remove. * gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations. * defineclass.cc, interpret.cc, jni.cc, posix-threads.cc, prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc, gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc, gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc, gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc, java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc, java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc, java/lang/natClass.cc, java/lang/natClassLoader.cc, java/lang/natDouble.cc, java/lang/natObject.cc, java/lang/natPosixProcess.cc, java/lang/natRuntime.cc, java/lang/natString.cc, java/lang/natSystem.cc, java/lang/natThread.cc, java/lang/reflect/natArray.cc, java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc, java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc, java/util/zip/natInflater.cc: Use throw, not JvThrow or _Jv_Throw. From-SVN: r40838
2001-03-18natString.cc (rehash): Don't bother with memset; _Jv_AllocBytes returns ↵Tom Tromey1-18/+58
zero'd memory. * java/lang/natString.cc (rehash): Don't bother with memset; _Jv_AllocBytes returns zero'd memory. Use _Jv_AllocBytesChecked. Use UNMASK_PTR. (UNMASK_PTR): New macro. (intern): Unmask pointer before returning it. Register finalizer for the string. (unintern): Handle case where (MASK_PTR): New macro. (PTR_MAKSED): Likewise. (_Jv_NewStringUtf8Const): Use UNMASK_PTR. From-SVN: r40593
2000-12-02natMath.cc: Declare fabsf() function.Bryce McKinlay1-1/+1
2000-12-02 Bryce McKinlay <bryce@albatross.co.nz> * java/lang/natMath.cc: Declare fabsf() function. * java/lang/mprec.h: Don't include math.h. * java/lang/dtoa.c: Include string.h. * java/lang/natString.cc (toLowerCase): Initialize ch to prevent compiler warning. From-SVN: r37938
2000-11-18natString.cc: Include Locale.h.Tom Tromey1-12/+83
* java/lang/natString.cc: Include Locale.h. (toUpperCase): Added `locale' argument. Handle locale sensitivity. (toLowerCase): Added `locale' argument. Handle locale sensitivity. (ESSET, CAPITAL_S, SMALL_I, CAPITAL_I_WITH_DOT, SMALL_DOTLESS_I, CAPITAL_I): New defines. * java/lang/String.java (CASE_INSENSITIVE_ORDER): Now public and final. Import Locale. (toUpperCase, toLowerCase): New methods. Variants which accept locale now native. * java/lang/ExceptionInInitializerError.java (printStackTrace): New methods. * java/util/PropertyPermission.java: Re-merged from Classpath. * java/text/RuleBasedCollator.java (getCollationElementIterator): New method. * java/text/StringCharacterIterator.java: Reindented. (setText): New method. From-SVN: r37539
2000-05-19Jumbo patch:Tom Tromey1-50/+50
* Imported beans and serialization * Updated IA-64 port * Miscellaneous bug fixes From-SVN: r34028
2000-04-12natString.cc (intern): Temporarily disable finalizer registration.Tom Tromey1-1/+1
* java/lang/natString.cc (intern): Temporarily disable finalizer registration. From-SVN: r33127
2000-04-12natString.cc (unintern): Added `obj' argument.Tom Tromey1-3/+6
* java/lang/natString.cc (unintern): Added `obj' argument. (intern): Register finalizer for string. * java/lang/String.java (unintern): Now static; added obj argument. From-SVN: r33124
2000-03-07All files: Updated copyright information.Tom Tromey1-1/+1
* All files: Updated copyright information. * COPYING: New file. * COPYING.LIB: Removed. * LIBGCJ_LICENSE: We now use GPL + special exception. From-SVN: r32387
2000-01-19* All files: Updated copyright to reflect Cygnus purchase.Tom Tromey1-1/+1
From-SVN: r31504
2000-01-09natString.cc (init): Test for overflow condition during out of bounds check.Anthony Green1-16/+23
2000-01-09 Anthony Green <green@cygnus.com> * java/lang/natString.cc (init): Test for overflow condition during out of bounds check. (getChars): Throw StringIndexOutOfBoundsException, not ArrayIndexOutOfBoundsException. (getBytes): Ditto. (regionMatches): Obey case option during string comparison. * configure.host (ligcj_interpreter): New variable. Enable interpreter by default on IA-32. * configure.in: Examine libgcj_interpreter. * configure: Rebuilt. From-SVN: r31300
1999-12-02natString.cc (equalsIgnoreCase): return false if anotherString is null.Bryce McKinlay1-1/+1
* java/lang/natString.cc (equalsIgnoreCase): return false if anotherString is null. * java/lang/Boolean.java (valueOf): return FALSE if argument is null. From-SVN: r30763
1999-09-10configure: Rebuilt.Tom Tromey1-1/+1
* configure: Rebuilt. * configure.in: Build include/Makefile. * Makefile.in: Rebuilt. * Makefile.am (SUBDIRS): Added gcj and include. (install-data-local): New target. (extra_headers): New macro. * include/Makefile.in: New file. * include/Makefile.am: New file. * interpret.cc: Don't include gcj/field.h or gcj/cni.h. * java/lang/reflect/natField.cc: Don't include gcj/field.h or gcj/cni.h. * boehm.cc: Don't include java-threads.h or gcj/field.h. * resolve.cc: Include config.h. * defineclass.cc: Include config.h. * include/java-interp.h: Don't include config.h. * include/jvm.h: Include java-threads.h, Object.h, java-gc.h, cni.h. * gcj/javaprims.h: Regenerated namespace decls. * classes.pl (scan): Don't put `;' after closing brace. * Makefile.in: Rebuilt. * Makefile.am (INCLUDES): Added -I for top_srcdir. * configure.in: Create gcj/Makefile. * gcj/Makefile.in: New file. * gcj/Makefile.am: New file. * java/lang/Object.h: Don't include any other headers. * gcj/array.h: Renamed from include/java-array.h. * gcj/field.h: Renamed from include/java-field.h. * gcj/method.h: Renamed from include/java-method.h. * gcj/cni.h, gcj/javaprims.h: Moved from include/. Updated all files to reflect new include structure. From-SVN: r29278
1999-07-26natString.cc (substring): optimize where substring is entire String.Bryce McKinlay1-0/+2
1999-07-22 Bryce McKinlay <bryce@albatross.co.nz> * java/lang/natString.cc (substring): optimize where substring is entire String. * java/io/File.java (getName): don't return separator with file name. * java/io/natFile.cc (attr): fix overflow. From-SVN: r28246
1999-04-21natString.cc (getBytes): Reverted earlier change and applied correct fix ↵Tom Tromey1-3/+5
from Per Bothner. * java/lang/natString.cc (getBytes): Reverted earlier change and applied correct fix from Per Bothner. From-SVN: r26579
1999-04-21natString.cc (getBytes): Correctly size result buffer.Tom Tromey1-2/+2
* java/lang/natString.cc (getBytes): Correctly size result buffer. From Bryce McKinlay <bryce@albatross.co.nz>. From-SVN: r26575
1999-04-16InputStreamReader.java (<init>): Set super.in correctly.Per Bothner1-23/+56
� * java/io/InputStreamReader.java (<init>): Set super.in correctly. * java/io/OutputStreamWriter.java (<init>): Set super.in correctly. (writeChars): Don't be quite so eager to flush. * java/io/PrintStream.java: Rewrite. Now more similar to OutputStreamWriter, using explicit UnicodeToBytes converter. Also, autoflush does not need to flush so often. * java/lang/natString.cc (getBytes): More efficient algorithm. (init(jbyteArray,jint,jint,jstring)): More efficient. From-SVN: r26508
1999-04-07natString.cc (init(jbyteArray,jint,jint,jstring)): Set count to 0 when ↵Warren Levy1-0/+4
InputStreamReader returns -1 for EOF. * java/lang/natString.cc (init(jbyteArray,jint,jint,jstring)): Set count to 0 when InputStreamReader returns -1 for EOF. From-SVN: r26273
1999-04-07Initial revisionTom Tromey1-0/+800
From-SVN: r26263