Commit Graph

367 Commits

Author SHA1 Message Date
Alexey Andreev
f0d97a72ab Wasm backend: add intrinsics for some Float and Double methods 2018-05-16 20:15:13 +03:00
Alexey Andreev
f23128bb13 Wasm backend: fix many tests 2018-05-12 23:43:53 +03:00
Alexey Andreev
b087610c2c Wasm backend: make JUnit tests work 2018-05-08 23:31:51 +03:00
Alexey Andreev
f532801f38 C backend: implement support for ResourceArray and ResourceMap 2018-05-07 19:30:00 +03:00
Alexey Andreev
37efbd742b C backend: more bugfixes
* Fix cloning Object[] in 64-bit systems
* Fix generation of x instanceof Interface
* Fix a % b when a and b are float or double
* Fix generation of unreachable virtual calls
2018-05-05 23:35:17 +03:00
Michele Comignano
c11b868c0b Add IdentityHashMap, improve distribution of identityHashCode
Add IdentityHashMap, improve distribution of identityHashCode
2018-05-05 22:05:22 +03:00
Alexey Andreev
4530167061 C backend: implement support for simple cases of resources 2018-05-01 00:54:11 +03:00
Alexey Andreev
ee2f389027 C backend: make more tests pass 2018-04-28 18:49:26 +03:00
Alexey Andreev
18eb3ee058 C backend: make more tests pass 2018-04-27 00:47:38 +03:00
Alexey Andreev
8f0320e217 Fix bugs in C backend to make more tests pass 2018-04-21 00:55:43 +03:00
Alexey Andreev
4990dbe8e4 Add support for C backend in TeaVMTestRunner 2018-04-20 22:58:09 +03:00
Alexey Andreev
e77997c93f Implement null check in C backend
Although initial purpose of this comment was null check,
it took much time to complete it and it caused many unrelated changes.
Besides just implementing null check in quite naive fashion
(I could not use the trick with memory protection, since I have to
maintain shadow stack, and support WebAssembly), I had to optimize
things. I relied on my existing nullness analysis to eliminate
as much null checks as possible. However, the whole nullness analysis
was wrong. After some thoughts I came up with solution very
close to range analysis, which required me to introduce extension
to IR sometimes called e-SSA form with so called sigma nodes.
Also, I found some bugs in few different places (by the time write this
message I could only remember escape analysis/scalar replacement and
after-inlining devirtualization) and fixed them.
2018-04-17 00:05:46 +03:00
Alexey Andreev
05d0220dcd C backend: initial commit 2018-03-20 23:18:52 +03:00
Alexey Andreev
52a23fcadd Support '.<digits>' floating literals in Double.parseDouble
See #327
2018-02-16 23:17:17 +03:00
Alexey Andreev
0485930c1f Add AtomicInteger 2018-02-16 23:08:29 +03:00
Alexey Andreev
51d87091cc Fix TimeUnit.convert implementation
See #329
2018-02-16 22:40:56 +03:00
Alexey Andreev
96b2d4e7d6 Support o and x format specifiers in String.format 2018-01-28 19:19:45 +03:00
Alexey Andreev
4ebaf476fe Fix to[Hex/Octal/Binary]String for unsigned values 2018-01-28 18:38:00 +03:00
Alexey Andreev
ff7232ac3e Improvements in reflection:
1. During dependency analysis, propagate class literals from
   Class.forName return node
2. Use original class source to generate reflection metadata
3. Link classes when they appear in signature of reflectable methods
4. Turn Class.forName(string_literal) into class literal.
2018-01-27 00:21:50 +03:00
Alexey Andreev
5ec05b9446 Fix lock on overflow/underflow in ArrayBlockingQueue 2018-01-23 22:08:44 +03:00
Alexey Andreev
28e17af500 Implement ArrayBlockingQueue 2018-01-22 23:32:10 +03:00
Alexey Andreev
ec3724b2bc Perform HTTP request as late as possible 2018-01-14 22:51:02 +03:00
Alexey Andreev
ac236f1ff8 When HTTP response invalid, return -1 as a responseCode 2018-01-09 22:15:37 +03:00
Alexey Andreev
a9beef3a15 Fix behaviour of HttpUrlConnection responseCode/responseMessage 2018-01-07 18:45:00 +03:00
Alexey Andreev
477f491b25 Fix HttpUrlConnection responseCode/responseMessage properties 2018-01-07 14:20:08 +03:00
Alexey Andreev
c46bfbc93c Fix bugs in URL implementation 2018-01-03 19:47:00 +03:00
Alexey Andreev
422cb0462a Add java.net.URL implementation 2018-01-01 14:53:44 +03:00
Alexey Andreev
7a03bf795f Add some Java classes that aren't used by TeaVM, but are necessary for javac 2017-12-03 20:05:50 +03:00
Alexey Andreev
7b989a4c1c Fix bug in EnumSet.of 2017-12-03 17:46:35 +03:00
Alexey Andreev
8256302c03 Fix ClassLoader.getResourceAsStream 2017-12-03 13:08:08 +03:00
Alexey Andreev
f14990eaeb Fix bug in base64 encoder 2017-11-26 20:18:39 +03:00
Alexey Andreev
a39e6eb47e Get rid of Base64 class in TeaVM compiler 2017-11-26 19:56:23 +03:00
Alexey Andreev
8fbf62ebac Fix infinite lock when overriding Thread.run and then joining it 2017-11-26 17:32:09 +03:00
Alexey Andreev
cc04c3446d Add support for several JDK classes and functions 2017-11-26 17:10:56 +03:00
Alexey Andreev
cc0f7583b0 Minor performance improvement 2017-11-26 14:53:56 +03:00
Alexey Andreev
c246bb6e1e Fix code that represents doubles as text in bootstrap mode 2017-11-26 13:14:02 +03:00
Alexey Andreev
ff19dc15c9 Further bootstrapping 2017-11-26 13:14:02 +03:00
Alexey Andreev
42be95959b Minor fixes for bootstrapping TeaVM 2017-11-26 13:14:02 +03:00
Alexey Andreev
cb355a85f5 Add BufferedOutputStream implementation 2017-11-26 13:14:02 +03:00
Alexey Andreev
5fa48c089a Add several unimplemented collection methods 2017-11-26 13:14:00 +03:00
Alexey Andreev
608e62ae3b Add support of stream API 2017-11-26 13:13:33 +03:00
Alexey Andreev
2fb6ca7001 Fix bug in LambdaMetafactory 2017-11-26 13:05:34 +03:00
Alexey Andreev
fc4425d7f4 Add missing method to Properties 2017-11-26 13:05:34 +03:00
Alexey Andreev
980a2d9e97 Add Optional implementation 2017-11-19 14:36:19 +03:00
Alexey Andreev
44e6feef0c Add support for functions that return true or false depending on whether they run from TeaVM 2017-11-16 18:30:04 +03:00
Alexey Andreev
2f73272ed7 Fix compiler crash when service enumerated in META-INF/service does not exist 2017-11-16 16:16:10 +03:00
Alexey Andreev
07f946e710 Add some useful JDK classes 2017-11-16 15:47:10 +03:00
Alexey Andreev
e96df3ef7e Add java.util.jar.* classes 2017-11-16 15:11:58 +03:00
Alexey Andreev
aa48a097d2 Fix bug in File.createTempFile 2017-11-16 15:11:58 +03:00
Alexey Andreev
0e5b1a97c1 Add PipedInputStream and PipedOutputStream 2017-11-16 15:11:58 +03:00
Alexey Andreev
82b96da215 Add StreamTokenizer 2017-11-16 15:11:58 +03:00
Alexey Andreev
7f152c0137 Add FileReader and FileWriter 2017-11-16 15:11:58 +03:00
Alexey Andreev
30da395304 Add BufferedWriter 2017-11-16 13:43:31 +03:00
Alexey Andreev
c9485ccbdc Add tests for FileInputStream and FileOutputStream 2017-11-16 00:19:00 +03:00
Alexey Andreev
a96b5912c7 Uncomment previously failing File tests and fix bugs in File implementation 2017-11-16 00:19:00 +03:00
Alexey Andreev
23c25c5d6e Add tests for java.io.File. Improve its implementation to pass tests 2017-11-15 00:13:07 +03:00
Alexey Andreev
c048b2ac6c Implement java.io.RandomAccessFile 2017-11-14 00:08:49 +03:00
Alexey Andreev
9ca09093a6 Improve virtual FS API 2017-11-13 23:22:54 +03:00
Alexey Andreev
99812d1bfa Call <clinit> from native System.currentTimeMillis 2017-11-13 00:37:20 +03:00
Alexey Andreev
e1c7acd8a1 Fix ResourceBundle.getBundle in case of .properties resource 2017-11-10 15:49:09 +03:00
Alexey Andreev
e2225941f8 Add java.lang.InternalError 2017-11-10 01:02:36 +03:00
Alexey Andreev
76590d759c Add preliminary support of file I/O 2017-11-10 01:02:21 +03:00
Alexey Andreev
86d151d953 Add support for more java.util.zip 2017-11-10 00:47:48 +03:00
Alexey Andreev
2a07e67423 Cache CLDRReader data between builds 2017-11-05 14:51:24 +03:00
Alexey Andreev
840b9dfe8b Fix message format tests 2017-11-03 21:59:21 +03:00
Alexey Andreev
90cc2c4677 Add implementation of java.text.MessageFormat 2017-11-03 00:32:16 +03:00
Alexey Andreev
6145afcbf8 Fix compact() operation on NIO buffers 2017-11-02 23:30:03 +03:00
Alexey Andreev
389b55be91 Implement AtomicBoolean and String.toLowerCase/toUpperCase(Locale) 2017-11-02 20:26:02 +03:00
Alexey Andreev
6d5b4a67e5 Implement String.format 2017-10-30 00:06:25 +03:00
Alexey Andreev
5109691a8d Implement java.util.Formatter for subset of available specifiers 2017-10-30 00:03:30 +03:00
Alexey Andreev
ffbfd7df79 Add minor stuff to classlib 2017-10-26 20:17:09 +03:00
Alexey Andreev
74be67038d Implement ResourceBundle 2017-10-26 20:11:24 +03:00
Alexey Andreev
a22eb43bde Fix Enum.getDeclaringClass 2017-10-26 16:16:27 +03:00
Alexey Andreev
f61567dfde Implement StringWriter and PrintWriter 2017-10-26 15:51:01 +03:00
Alexey Andreev
6848984a10 Provide independent implementation for ArrayList.add(E).
To improve performance. Also, see #310
2017-10-24 23:06:43 +03:00
Jaroslav Tulach
ba5342f860 Basic implementation of two basic JavaBeans classes 2017-10-24 22:56:22 +03:00
Jaroslav Tulach
8c7905e9cc Adjusting TeaVM to forthcoming release of Apache HTML/Java API version 1.5 2017-10-24 22:56:22 +03:00
Alexey Andreev
daf0f03634 Fix Boolean.getBoolean(String). Fix various minor issues with system properties
See #306
2017-10-13 16:06:10 +03:00
Alexey Andreev
0b985b95d1 Implementing java.util.EnumMap 2017-10-12 15:13:55 +03:00
adamjryan
8d2e468f44 TArrayDeque fix for .remove(Object) (#302)
* TArrayDeque fix for .remove(Object)

ArrayDeque removes items by shifting the existing items to overwrite
the removed item. It did not update the head/tail pointers once the
operation was complete leaving a null item at the head/tail of the
collection. This change updates the pointers so that the null element is
excluded and the correct size is returned.
2017-10-10 22:39:06 +03:00
Alexey Andreev
26824f1399 Add some properties-related methods to System class 2017-10-10 12:56:51 +03:00
Alexey Andreev
c057c7b78f Fix compilation 2017-10-08 21:50:41 +03:00
Alexey Andreev
dfaeb46c5e Implementing EnumSet 2017-10-08 21:40:45 +03:00
Alexey Andreev
669594fc9c JS: add reflection support for methods 2017-07-17 22:21:17 +03:00
Alexey Andreev
12dded73f6 JS: add support for Class.getModifiers 2017-07-17 22:21:17 +03:00
Alexey Andreev
4171d468d4 JS: add reflection support for constructors 2017-07-17 22:21:17 +03:00
Alexey Andreev
c4c5635f88 Add reflection support for constructors 2017-07-17 22:21:16 +03:00
Alexey Andreev
31f9ca57ce Add reflection support for fields 2017-07-17 22:21:16 +03:00
Alexey Andreev
248d62ff12 Reformat classlib according to checkstyle rules 2017-07-01 14:08:29 +03:00
Alexey Andreev
cdec4560ba Remove dumb comments containing only @author annotation 2017-07-01 13:13:52 +03:00
Alexey Andreev
b477a7dcad Fix capacity calculation in ArrayList and StringBuilder.
See #289 and #290
2017-06-25 13:37:15 +03:00
Alexey Andreev
d982f89ab6 Add missing folder to CLDR archive. Fix tests WRT changes in CLDR. 2017-06-25 13:36:35 +03:00
Alexey Andreev
daa5384e97 Upgrade versions of dependencies. Upgrade tzdata, CLDR and UnicodeData 2017-06-18 22:33:27 +03:00
Alexey Andreev
40b29cdfa1 Add support for altMetafactory 2017-06-18 21:22:44 +03:00
Alexey Andreev
27bb8fe9ed Rename object's $id field to $id$
To avoid clash with user-defined fields
2017-06-07 12:46:43 +03:00
Alexey Andreev
87f7ee4b72 Remove unnecessary @author comment from classes 2017-06-01 16:14:25 +03:00
Alexey Andreev
2e8e3a65bd Add IO bufferization 2017-06-01 16:14:24 +03:00
Alexey Andreev
c0ed3d54d7 Fix base64 support
(cherry picked from commit 5da32e3a6583493a36c87bc02c8177a7740faaf7)

# Conflicts:
#	tests/src/test/java/org/teavm/classlib/java/lang/TestResourcesSupplier.java
2017-05-29 23:26:34 +03:00
Alexey Andreev
b1b98097ee Improve ResourceSupplier API
(cherry picked from commit 539a12227f79abdb4ce22aac2dbc647f1c09f083)

# Conflicts:
#	classlib/src/main/java/org/teavm/classlib/java/lang/ClassLoaderNativeGenerator.java
#	tests/src/test/java/org/teavm/classlib/java/lang/TestResourcesSupplier.java
2017-05-29 23:22:59 +03:00
Alexey Andreev
25b298b1d0 JS: fix ClassLoader.getResourceBundle for non-existent resources 2017-05-29 23:19:07 +03:00
Alexey Andreev
b8b3aa7a53 WASM: fix name section 2017-05-15 00:39:20 +03:00
Alexey Andreev
2d5f6a81c2 Improve peformance of Long.hashCode 2017-05-07 22:18:10 +03:00
Alexey Andreev
48d14570b2 Make Long/Float/Double/Integer compare/hashCode methods cross-platform 2017-05-07 22:06:44 +03:00
Alexey Andreev
e884bb35c9 Fix System.setErr/setOut methods 2017-05-07 21:32:35 +03:00
Alexey Andreev
653caa00b3 Fixes for html4j/ko4j
1. Replace Class.forName(cls.getName) with class initializer
2. Reduce set of compiled annotations to classes that actually
   get called getAnnotations()
2017-04-18 00:08:09 +03:00
Alexey Andreev
f347de44a9 WASM: fix metadata intrinsics 2017-04-17 00:09:14 +03:00
sertic
78a3aa29ec Added more WASM imports to Classlib for Double and Random class 2017-04-12 20:57:33 +03:00
Alexey Andreev
3ad16e80c7 WASM: add support for Enum.valueOf and Class.isEnum 2017-04-10 22:27:24 +03:00
Alexey Andreev
8330eae4ae WASM: support stack traces 2017-04-06 23:06:30 +03:00
Alexey Andreev
4847731328 Fix SOE when calling Throwable.getCause()
Fix https://github.com/konsoletyper/teavm/issues/249
2017-03-27 22:27:59 +03:00
Alexey Andreev
929e77bf69 Postpone execution code after wait method, since it's executed in a native callback which can't be async. When the code contains async calls, compiler produces error. 2017-02-25 19:52:05 +03:00
Davin McCall
5ff5b22529 Add implementation of Random.nextGaussian(). 2017-02-13 21:59:51 +00:00
Alexey Andreev
5c936878a7 Update JSO apis 2017-01-23 23:27:57 +03:00
Alexey Andreev
ae5e1e4962 Store instructions as double-linked list instead of ArrayList 2016-12-20 00:03:14 +03:00
Alexey Andreev
10bb4ef3da Fix range checking in AbstractList.subList. Add RandomAccess to object returned by Arrays.asList 2016-12-03 11:05:33 +03:00
Alexey Andreev
8c3f071f88 Fix updating size in LinkedList.remove (fix #226). 2016-11-04 13:28:34 +03:00
Alexey Andreev
499ce8c029 WASM: add some GC interop methods 2016-10-06 16:21:09 +03:00
Alexey Andreev
cc0c68e809 WASM: porting jbox2d benchmark to WebAssembly 2016-09-29 20:05:32 +03:00
Alexey Andreev
b67d243ad4 WASM: add transformation that converts exception handling to explicit guard checks 2016-09-22 16:27:28 +03:00
Alexey Andreev
0a00551af1 WASM: add support of Character.toLowerCase/toUpperCase. Add _ prefix to names in c output 2016-09-17 12:37:49 +03:00
Alexey Andreev
6c5a691fc9 Fixing minor bugs 2016-09-17 10:42:46 +03:00
Alexey Andreev
ed7e8ff7f4 javascript: refactor renderer 2016-09-17 09:21:26 +03:00
Alexey Andreev
bb2f23b19b Fix bugs in runtime. Add support for System.out 2016-09-17 09:19:34 +03:00
Alexey Andreev
67098a60ef Fix bugs in GC and runtime 2016-09-17 09:19:34 +03:00
Alexey Andreev
5caa400eb7 Mark several low-level methods as NoGC 2016-09-17 09:19:34 +03:00
Alexey Andreev
bb4040af23 Fix bugs 2016-09-17 09:19:31 +03:00
Alexey Andreev
1ae683ead3 System.arrayCopy works 2016-09-17 09:19:31 +03:00
Alexey Andreev
ca3258417b Implementing System.arraycopy 2016-09-17 09:19:31 +03:00
Alexey Andreev
1c1b0c69fa Propagating variable name via compiler's pipeline 2016-09-17 09:11:59 +03:00
Alexey Andreev
6483f518cf Remove unused classes 2016-09-17 09:00:48 +03:00
Alexey Andreev
9fb97fd53f Refactoring 2016-09-17 09:00:40 +03:00
Alexey Andreev
3dd76c9355 Fix bugs in WASM target 2016-09-17 08:59:03 +03:00
Alexey Andreev
06a96911a1 Further improvements in WASM target 2016-09-17 08:59:03 +03:00
Alexey Andreev
5479d24a21 Implementing reflection in WASM 2016-09-17 08:59:02 +03:00
Alexey Andreev
3f02cad9e7 Further development of WASM backend 2016-09-17 08:59:02 +03:00
Alexey Andreev
a1fe87ff70 Move several annotations 2016-09-17 08:59:01 +03:00
Alexey Andreev
47997cde87 Rename target package to backend to avoid gitignore 2016-09-17 08:59:00 +03:00
Alexey Andreev
52ace0c252 Refactor TeaVM to support pluggable targets like JavaScript, WebAssembly, LLVM, etc (with only JavaScript target for now) 2016-09-17 08:55:44 +03:00
Alexey Andreev
c5548dfa59 Merge pull request #218 from skapral/missing-runtime
Added missing classes/methods from Java SE Runtime
2016-08-27 10:22:16 +03:00
Sergey Kapralov
d1ade89ed4 TMap new methods are covered with tests 2016-08-25 17:12:03 +03:00
Sergey Kapralov
6b950e618e Applied minor remarks. 2016-08-25 11:30:53 +03:00
Sergey Kapralov
ec2a52900e TMap.compute fixed and tested 2016-08-25 11:13:08 +03:00
Sergey Kapralov
dc4a937262 Added missing map methods 2016-08-23 10:41:25 +03:00
Sergey Kapralov
035c616b5e added TStaskOverflowError 2016-08-23 10:41:18 +03:00
Sebastian Bauer
9a1c6fe5b9 Fix ms to ns conversion. 2016-08-19 20:35:34 +02:00
Alexey Andreev
50ac08fce4 Merge branch 'master' of https://github.com/konsoletyper/teavm 2016-08-18 21:34:56 +03:00
Alexey Andreev
559f7f7e42 Fix ByteArrayInputStream.read. Fix https://github.com/konsoletyper/teavm/issues/213 2016-08-18 21:34:18 +03:00
Sebastian Bauer
b03ba67a88 Use max() instead of min() when enlarging the array.
Adding n elements subsequently has now an O(n) running time while it was
O(n^2) before.
2016-08-18 20:09:48 +02:00
Alexey Andreev
02f414b61a Speed up allocation of objects and arrays 2016-05-12 22:25:31 +03:00
Alexey Andreev
88a1a39301 Add PrintStream methods 2016-05-11 21:16:01 +03:00
Alexey Andreev
5576275998 Improving JUnit test runner 2016-02-26 23:48:04 +03:00
Alexey Andreev
1bb36b98b2 Merge pull request #185 from shannah/master
Fixed NPE in LinkedList.remove(e)
2016-02-21 22:27:24 +03:00
Steve Hannah
9a52a277b9 Added Timer.scheduleTaskAtFixedRate() method 2016-02-17 11:46:10 -08:00
Alexey Andreev
5dad013cc7 Migration to IDEA 2016-02-07 14:28:51 +03:00
Steve Hannah
eb2e08da3f Fixed NPE in LinkedList.remove(e) 2016-02-05 15:03:53 -08:00
Alexey Andreev
d718177fe0 Improve resource loading contributed by Jaroslav:
* Implement base64 decoder instead of atob, which is not supported 
  by IE9
* Avoid direct usage of window identifier to prevent global namespace
  from spoiling
* Make customizable approach to supply list of resources to write
  into JavaScript
2015-12-26 13:26:34 +03:00
Alexey Andreev
de7f0910e9 Merge branch 'jtulach_resources' into release-0.4.x 2015-12-25 22:52:27 +03:00
Jaroslav Tulach
de117b61ed Converts the resource from base64 encoding before returning it 2015-12-24 07:59:41 +01:00
Jaroslav Tulach
ecfdcd34c3 Class.getResourceAsStream can find the generated resource 2015-12-24 07:53:36 +01:00
Jaroslav Tulach
4aec89967b Simple test to show expected behavior of resources 2015-12-24 06:47:43 +01:00
Alexey Andreev
b12404ee7e Fix emit API. Fix several JS wrappers. 2015-10-25 19:22:48 +03:00
Alexey Andreev
8702f7ee33 Repair incremental builder 2015-10-21 20:51:43 +03:00
Alexey Andreev
2640234391 Rename achieved -> reached. Fix - operator generation in minified mode 2015-10-21 12:08:30 +03:00
Alexey Andreev
a96ee8a647 Fix bug in synchronous monitor unlocking 2015-10-19 17:42:35 +03:00
Alexey Andreev
4082c6389a Fix LinkedList.push and .element methods 2015-10-08 19:59:38 +03:00
Alexey Andreev
a4e41fc6be Add hacks for scala classlib. Add DOM method for convenience. Improve
Scala example
2015-10-04 14:29:34 +03:00
Alexey Andreev
3341df3668 Change directory structure 2015-10-04 11:49:20 +03:00