Commit Graph

539 Commits

Author SHA1 Message Date
Joel Dice
b908f575d5 fix several blocking SocketChannel bugs
In java-nio.cpp, we can't use GetPrimitiveArrayCritical when reading
from or writing to blocking sockets since it may block the rest of the
VM indefinitely.

In SelectableChannel.java, we can't use a null test on
SelectableChannel.key to determine whether the channel is open since
it might never be registered with a Selector.  According to the Sun
documentation, a SelectableChannel is open as soon as it's created, so
that's what we now implement.
2010-06-04 15:37:22 -06:00
Matt Klich
83c51f4801 Fix signed vs. unsigned comparison for 32bit build with mingw64 2010-05-13 16:59:08 -06:00
mjensen
a6998238d5 Additional of several interfaces which can be used in serialization 2010-05-10 10:17:06 -06:00
JET
c666ab58e3 Improved (should now be complete) Unicode support (UTF-8 for *nix and UTF-16 for Windows). 2010-04-20 10:03:07 -06:00
JET
b6936fb597 optimized InputStreamReader.read() 2010-04-14 09:43:56 -06:00
JET
b2f5e71d22 ARM and UTF-8 work 2010-04-14 09:26:50 -06:00
Joel Dice
a650f1affa provide more useful message when throwing exception from Field.set 2010-03-07 12:03:17 -07:00
Joel Dice
fdf9c5087b register socket with exceptfds when calling select on Windows
This allows us to get connection errors like WSAECONNREFUSED in
non-blocking mode.
2010-02-19 16:41:27 -07:00
Joel Dice
5d781a0584 declare Long.MAX_VALUE and Long.MIN_VALUE as longs, not Longs 2010-02-02 09:33:10 -07:00
Joel Dice
2c4e229e6e convert forward slashes to back slashes in Windows paths 2010-01-11 08:31:01 -07:00
Joel Dice
b1a1391093 skip "." and ".." in File.list{Files} to match Sun 2010-01-09 19:18:39 -07:00
Joel Dice
585dba004b ignore redundant calls to File{In|Out}putStream.close
Previously, we threw an IOException, which did not match Sun's behavior.
2010-01-09 18:22:16 -07:00
Joel Dice
9a056da2f7 increase default buffer size in BufferedInputStream
The previous value of 32 bytes did not perform well.  This increases it to 4096 bytes, which matches BufferedOutputStream.
2010-01-09 18:20:15 -07:00
Joel Dice
664cb3cd39 don't try to parse annotation tables more than once; use defining classloader when loading array classes during linking 2009-12-24 17:58:48 -07:00
Joel Dice
f588a62ae3 fix Classpath 0.98 compatibility issues 2009-12-22 21:34:04 -07:00
Joel Dice
30db38ebd6 replace calls to ExceptionOccurred with calls to ExceptionCheck
The latter is cheaper (avoids a state transition and possible memory
allocation) when we just want to know if an exception is thrown
without needing a handle to that exception.
2009-12-16 19:25:03 -07:00
Joel Dice
70da0df46b add Class.getExceptionTypes method 2009-12-15 10:04:51 -07:00
Joel Dice
875a1a45a3 pass valid pReturnValue parameter to _wgetenv_s 2009-12-12 17:55:00 -07:00
Joel Dice
f0c14fa1f1 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-12-06 13:35:07 -07:00
Joel Dice
bec3766180 fix misuse of term "recursive" in Continations JavaDoc 2009-12-06 13:34:31 -07:00
Joel Dice
ccbb4796f2 fix typo in JavaDoc comment 2009-12-05 22:49:23 -07:00
Joel Dice
0c85fc7527 throw OutOfMemoryError if malloc returns null pointer 2009-12-05 15:51:12 -07:00
Joel Dice
112e2a71d5 update copyright years 2009-12-05 15:50:23 -07:00
jent
99a1c12682 Files to add Deflater and DeflaterOutputStream to java.util.zip for
avian
2009-12-04 12:01:31 -07:00
Joel Dice
6118792ffd update copyright years 2009-12-02 19:08:29 -07:00
jent
f39469e71c Changes for better memory managment 2009-12-01 09:54:36 -07:00
Joel Dice
6475beda83 don't null out array in HashMap when size drops to zero
As in ArrayList, we want to avoid thrashing in cases where the map is frequently emptied and refilled.
2009-11-19 12:55:53 -07:00
Joel Dice
adcac443e4 don't null out array in ArrayList when size goes to zero
This avoids thrashing in the case of a list which is frequently
emptied and refilled with a small number of elements.
2009-11-19 11:43:11 -07:00
Joel Dice
3862128a3a tolerate EINTR in ServerSocketChannel.accept implementation
On POSIX systems, Avian sends a special signal to a thread to
implement Thread.getStackTrace() when called from a different thread.
If the target thread is blocked on a call to accept when this happens,
it will return -1, with errno set to EINTR.  Instead of treating this
as an error, we now just loop and call accept again.
2009-11-16 17:23:09 -07:00
Joel Dice
ef00ff80ef avoid EAGAIN or EWOULDBLOCK errors due to SocketSelector.wakup being called many times between calls to select 2009-10-30 08:55:55 -06:00
Joel Dice
efdfb796d9 implement SocketChannel.isConnected 2009-10-29 16:19:33 -06:00
Joel Dice
3c893b2ee3 Merge commit 'origin/master' into wip 2009-10-27 10:36:19 -06:00
Joel Dice
1fd00dd55d revert all __attribute__ ((externally_visible)) changes because it's not clear yet how to detect whether it's supported 2009-10-27 10:35:26 -06:00
Joel Dice
8bf3487ff1 Merge commit 'origin/master' into wip 2009-10-27 09:35:13 -06:00
Joel Dice
51fcf1ef74 ammend recent commit to avoid using __attribute__ ((externally_visible)) when it is not available 2009-10-27 09:34:46 -06:00
Joel Dice
2efff818ea Merge commit 'origin/master' into wip 2009-10-27 09:17:54 -06:00
Joel Dice
b15ff58542 provide a useful error message when throwing IOExceptions from Java_java_nio_channels_SocketChannel_natFinishConnect 2009-10-27 09:17:08 -06:00
Joel Dice
4570b86da0 add __attribute__ ((externally_visible)) to EXPORT macros to facilitate whole-program optimization using GCC 4.5 2009-10-27 09:16:08 -06:00
Joel Dice
a68742200b return empty stack trace for thread which isn't running 2009-10-26 11:44:29 -06:00
Joel Dice
5967246b37 Merge commit 'origin/master' into wip 2009-10-20 14:15:35 -06:00
Joel Dice
53588b94f3 compare lengths first in String.equals[IgnoreCase] for efficiency 2009-10-19 10:36:48 -06:00
Joel Dice
984f3106fd fix powerpc build 2009-10-19 10:31:34 -06:00
Joel Dice
7b0378c180 support darwin/x86_64 2009-10-14 10:01:37 -06:00
Joel Dice
1b893c7a19 check for EINPROGRESS in Java_java_nio_channels_SocketChannel_natFinishConnect 2009-10-12 09:28:04 -06:00
Joel Dice
59ba4aecf2 implement non-blocking socket connections 2009-10-08 16:26:20 -06:00
Mike Keesey
77fb0083a4 updated nio native code to properly check for PIPE closure on POSIX OSes 2009-10-05 09:23:53 -06:00
Joel Dice
447741d6ec implement java.io.File.renameTo 2009-09-28 17:45:47 -06:00
Joel Dice
fb40b046fd fix regression in SocketSelector when selecting ServerSocketChannels 2009-09-28 16:54:49 -06:00
Joel Dice
1faf93c163 fix typo in Proxy.makeInvokeCode 2009-09-19 16:27:28 -06:00
Joel Dice
953cb69e5e move proxy and annotation code from C++ to Java
This allows code shrinkers to remove it if it's not used by the application.
2009-09-19 16:21:15 -06:00
Joel Dice
1a2eb3836c Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-09-18 18:01:57 -06:00
Joel Dice
7aa906d97b support runtime-visible annotations and java.lang.reflect.Proxy 2009-09-18 18:01:54 -06:00
Joel Dice
6fa25f992c Properties.setProperty should return an Object 2009-09-18 17:51:05 -06:00
Joel Dice
3446ed0fce fix MSVC build regression in java-io.cpp 2009-09-05 15:35:00 -06:00
Joel Dice
e47c149fb1 fix misuse of FindFirstFile 2009-09-03 17:57:32 -06:00
Joel Dice
0a96f4c552 ensure WeakHashMap.MyCell objects are registered with the ReferenceQueue 2009-09-01 17:22:31 -06:00
Joel Dice
987330fed5 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-28 16:18:36 -06:00
Joel Dice
cd41751912 ensure primitive names are zero-terminated in Class.getName 2009-08-28 16:17:23 -06:00
Joel Dice
73dc058c14 implement StackTraceElement.getFileName properly 2009-08-27 16:28:44 -06:00
Joel Dice
1a0eef7e2d add support for building with MSVC on Windows 2009-08-26 18:26:44 -06:00
Joel Dice
d4e2e05b31 add AccessControlException 2009-08-24 16:40:25 -06:00
Joel Dice
77ae259e41 throw ClassCastException if asked to compare Enums of different types 2009-08-21 16:06:12 -06:00
Joel Dice
c14bb5768e throw FileNotFoundException from doOpen when appropriate 2009-08-21 09:23:03 -06:00
Joel Dice
4c14a9ab66 implement enough of java.util.regex to ensure String methods work for trivial regular expressions 2009-08-20 11:14:05 -06:00
Joel Dice
71f1efc4cb add a couple of StringBuffer.append overloads 2009-08-20 08:59:22 -06:00
Joel Dice
c4b5ecec90 implement Runtime.addShutdownHook and Thread.setDaemon; avoid segfaults due to an application calling e.g. CallStaticBooleanMethod when it really meant CallStaticVoidMethod 2009-08-19 14:27:03 -06:00
Joel Dice
c4edabdc02 implement ClassLoader.resolveClass and ensure class is linked in e.g. Class.getMethods; minor bugfixes 2009-08-18 14:26:28 -06:00
Joel Dice
6d54b6cec8 add classes which I meant to add in earlier commits 2009-08-14 08:51:10 -06:00
Joel Dice
9553d56977 add AccessibleObject.setAccessible(AccessibleObject[],boolean) 2009-08-13 09:03:44 -06:00
Joel Dice
f96fa82607 add methods to Throwable 2009-08-13 09:03:04 -06:00
Joel Dice
017116d060 add ThreadGroup(String) constructor 2009-08-13 09:02:32 -06:00
Joel Dice
0d7a2fa2bc add methods to StringBuilder and fix logic error in getChars 2009-08-13 09:02:00 -06:00
Joel Dice
ae02212dd9 add a few methods to String; support ISO-8859-1 charset 2009-08-13 09:00:07 -06:00
Joel Dice
864a28f2ce throw IllegalArgumentException from Enum.valueOf if name does not match any value 2009-08-13 08:57:58 -06:00
Joel Dice
fb37f48237 add various methods to Class and fix getComponentType for primitive arrays 2009-08-13 08:57:06 -06:00
Joel Dice
58e3c3013a pass start and end indexes to String.getChars in Writer.write, not start and length 2009-08-13 08:55:35 -06:00
Joel Dice
0544ab381f fix Class.isArray for case this == Class.class 2009-08-12 19:40:52 -06:00
Joel Dice
dd82b58dad add String.lastIndexOf(String,int); defer to Pattern.split in String.split 2009-08-12 19:39:29 -06:00
Joel Dice
df1aee5981 replace slashes with dots in class name passed to Class.forName in Method.getParameterTypes 2009-08-11 09:25:05 -06:00
Joel Dice
d868815737 put thread into runnable state in Thread.start 2009-08-10 17:36:11 -06:00
Joel Dice
001000364d add classloader parameter to functions which may directly or indirectly load classes; include methods inherited from interfaces (but not explicitly declared) in method tables and virtual tables of abstract classes 2009-08-10 07:56:16 -06:00
Joel Dice
58c3a37277 specify classloader when calling Class.forCanonicalName in Field and Method; tolerate null argument array in Method.invoke 2009-08-10 07:48:44 -06:00
Joel Dice
5c72746d2c inherit thread group from current thread 2009-08-10 07:46:59 -06:00
Joel Dice
97ea23e3bb optionally specify classloader to Class.forCanonicalName 2009-08-10 07:46:05 -06:00
Joel Dice
1a2deff97d Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-09 14:43:53 -06:00
jet
1ffe46a545 added ARM interpreted mode supported 2009-08-06 11:52:36 -06:00
Joel Dice
6d27274aea update Class.PrimitiveFlag value to reflect change in machine.h; make Class.getName work for primitive types 2009-08-05 15:57:51 +00:00
Joel Dice
2de750768b add java.lang.reflect.Modifier.isInterface 2009-08-05 14:14:45 +00:00
Joel Dice
7050448ec5 implement Class.{get|set}Signers 2009-08-04 18:31:14 -06:00
Joel Dice
e18ab49f4d always pass null instance to native version of Method.invoke when invoking static methods 2009-08-04 18:30:16 -06:00
Joel Dice
626c514373 add listFiles and isFile methods to java.io.File 2009-08-04 17:59:07 -06:00
Joel Dice
590238bbfc add indexOf and lastIndexOf methods to java.util.List 2009-08-04 17:58:31 -06:00
Joel Dice
0a7f94abfe add java.util.Collection.toArray() 2009-08-04 17:36:25 -06:00
Joel Dice
7911989055 add AbstractList and AbstractSequentialList classes to java.util and listIterator methods to java.util.List 2009-08-04 17:24:29 -06:00
Joel Dice
93597a4d1d implement ArrayList.listIterator() 2009-08-04 11:34:46 -06:00
Joel Dice
08dd7d0a5a Merge branch 'gnu' 2009-08-03 09:01:16 -06:00
Joel Dice
80d4385cb8 implement blocking mode for SocketChannel and ServerSocketChannel 2009-08-03 08:58:56 -06:00
Joel Dice
54ceb80116 implement stub versions of java.security classes 2009-08-03 08:56:19 -06:00
Joel Dice
8c18f27e89 avoid NPE in String.equalsIgnoreCase 2009-07-28 17:00:11 -06:00
jent
c2e9b3ed76 Commit to implement property os.arch for use in bug 8574
I had thought about using other means, ie using sysctl or utsname for
osx/linux....but this solution is more universal between OS's as well as
provided by the compiler, not via system operations
2009-07-28 10:16:27 -06:00