Commit Graph

633 Commits

Author SHA1 Message Date
Alexey Andreev
c95af17eae classlib: fix javadoc warning 2024-02-19 20:18:03 +01:00
Alexey Andreev
c1b3deedff Support @Inherited annotation on annotations
Fix #883
2024-02-19 20:14:00 +01:00
Bernd Busse
be09e698ea classlib: remove hardcoded dependecy to TRoundingMode in NumberFormat 2024-02-17 21:05:55 +03:00
Bernd Busse
cf850157f0 classlib: fix javadoc warnings 2024-02-15 11:59:43 +03:00
Alexey Andreev
6ac598b927 js: add limit for top-level declarations
Rationale: turns out that V8 utilizes stack even to represent module-level functions.
This can cause SOE when there's too many classes and methods in source JVM
2024-02-01 09:41:50 +01:00
Bernd Busse
83e3306071 classlib: extend BigInteger implementation with xValueExact() and sqrt() 2024-01-24 21:56:12 +03:00
Bernd Busse
4e076a65ee classlib: add BigInteger constant TWO added in Java 9 2024-01-24 21:56:12 +03:00
Bernd Busse
9280992661 classlib: add minimal SecureRandom implementation
- Utilizes JavaScript's window.crypto.getRandomValues() when available,
  otherwise uses the general Math.random() as fallback.
- No support for providers
- No support for proper randomness sources on non-JS backends
2024-01-24 20:48:28 +03:00
Bernd Busse
1964235fef classlib: directly use Math.random() in Random
Math.random() already handles the implementation for the backends,
delegating to JavaScript's Math.random() or the C runtime
implementation.

Fixes duplicate symbols when using the WASM backend.
2024-01-24 20:48:28 +03:00
Bernd Busse
6de4560282 classlib: implement Cloneable for TreeSet 2024-01-24 20:46:26 +03:00
Bernd Busse
6a398c9b8d classlib: properly duplicate inner map when cloning TreeMap 2024-01-24 20:46:26 +03:00
Bernd Busse
2318caad7b
classlib: add static nullOutputStream() to OutputStream (#878) 2024-01-24 20:44:59 +03:00
Alexey Andreev
facf3c496f classlib: get rid of call to Math.log 2023-12-07 19:55:47 +01:00
J. Fronny
953c475b46
classlib: implement float support for String.format (#873) 2023-12-07 19:16:38 +01:00
Alexey Andreev
bb837bd020 classlib: replace usage of Math.log10 with custom implementation of int log10 algorithm
This fixes BigDecimal support on WASI, which does not support log10 at the moment
2023-12-07 19:14:55 +01:00
J. Fronny
9093ad2f8a
classlib: implement String.chars() (#872) 2023-12-05 13:26:39 +01:00
Alexey Andreev
a1355bb2f7 classlib: refactor LinkedHashMap
I found regression somewhere in LinkedHashMap, when certain operations cause cycle in entry list. Since updated logic was totally unclear to me, I rewrote it from scratch. Also, reverted mechanism to remove entries NOT by keys and used it where necessary to improve performance.
2023-11-23 21:19:28 +01:00
Alexey Andreev
3282ae3b59 Refactor mechanism that resolves methods and fields parsed from bytecode and reports errors about missing items 2023-11-20 19:50:20 +01:00
Alexey Andreev
810012872c Add couple native declarations to JSO APIs. Update sample 2023-11-19 20:25:29 +01:00
Alexey Andreev
7108dfbac7 classlib: fix Math exact operations in C and WebAssembly backends 2023-11-19 20:12:58 +01:00
Alexey Andreev
318d4bff93 Fix boxing/unboxing arguments and return values in method references 2023-11-19 20:12:58 +01:00
Jonathan Coates
4fc43a5597
classlib: fix toLowerCase/toUpperCase on Locale.ROOT (#862) 2023-11-19 21:45:32 +03:00
Alexey Andreev
6e46ae8eec classlib: get rid of Math polyfill in java.time implementation 2023-11-19 18:32:36 +01:00
Ivan Hetman
cd14ece14c
classlib: add Math methods for no-overflow addition/multiplication (#859)
Co-authored-by: Jörg Hohwiller <hohwille@users.sourceforge.net>
2023-11-19 20:14:23 +03:00
Jonathan Coates
8fa1a86728
classlib: add further nio stubs (#863)
- Add {FileAlreadyExists,NoSuchFile,NotADirectory}Exception.
 - Add OpenOption interface and StandardOpenOption enum.
2023-11-19 20:11:20 +03:00
Ivan Hetman
5336fc9b3c
classlib: implement String.to__Case with locale parameter in JS BE (#766) 2023-11-14 16:57:09 +01:00
Jonathan Coates
9469e4c0b4
Widen byte/short to ints in ObjectMethods (#853) 2023-11-08 10:28:13 +01:00
Jonathan Coates
2256b293ab
classlib: fix missing .shift() in ReferenceQueue.poll (#852) 2023-11-08 09:07:31 +01:00
Ivan Hetman
bd80c2dfce
classlib: fix parse and other issues in Long and Integer 2023-11-07 20:02:58 +01:00
Alexey Andreev
9c6f23d280 classlib: optimize console output in JS backend 2023-11-07 20:00:33 +01:00
Alexey Andreev
21137c57a3 JS: merge let statements to get better minification; rewrite some Array methods to generate less dependencies on runtime 2023-11-06 19:18:18 +01:00
Alexey Andreev
6738d6f1f8 JS: add remembering source writer, refactor PreparedMethod and Renderer to use it, get rid of $rt_globals 2023-11-02 19:03:10 +01:00
Alexey Andreev
23ad999bbd JS: get rid of IOException in SourceWriter and related classes 2023-10-31 20:09:55 +01:00
Alexey Andreev
32ee8943c1 JS: rewrite more natives with templates, get rid of runtime aliases in minification mode 2023-10-31 19:29:32 +01:00
Ivan Hetman
2756fe4384
classlib: more argument validation in Collections methods (#839) 2023-10-31 09:46:43 +01:00
Ivan Hetman
5b5c26cf99
classlib: minor improvements (#843)
* String.substring performance
* More argument validation in String methods
* Object.checkFromIndexSize corner case for large indexes
* ByteBuffer.wrap argument validation
2023-10-31 09:45:23 +01:00
Alexey Andreev
a1cc817504 JS: rewrite more native generators with templates, fix issues in template engine 2023-10-29 20:17:18 +01:00
Alexey Andreev
7c4aa522d3 Add missing file 2023-10-29 17:17:38 +01:00
Alexey Andreev
eb0f4fb090 Improve JS templating so that it could be used in native generators 2023-10-29 17:16:55 +01:00
Ivan Hetman
b006cbb206
classlib: various fixes in Character class (#831)
* fix bug in `codePointBefore`
* validate arguments in some methods
* support negative `codePointOffset` in `offsetByCodePoints`
* add tests
2023-10-27 17:25:32 +02:00
Ivan Hetman
fc49094d96
classlib: fix support of positive/negative zeros in Float/Double.toHexString (#830) 2023-10-27 16:52:33 +02:00
Alexey Andreev
c5768e07bc classlib: fix issue in InputStreamReader 2023-10-26 11:50:27 +02:00
Ivan Hetman
3ac0078e2a
classlib: add cache to Byte and Short valueOf; fix Byte.parseByte (#832) 2023-10-26 09:09:08 +03:00
Ivan Hetman
4b6c4bd3d3
classlib: fix issues in EnumSet and EnumMap (#834) 2023-10-26 09:04:26 +03:00
Alexey Andreev
7acc81ce4d JS: remove lazy creation of primitive classes 2023-10-21 20:07:49 +02:00
Alexey Andreev
02b3c92912 JS: use native string to represent internals of java.lang.String 2023-10-21 19:30:16 +02:00
Alexey Andreev
a59236cc7a Update unicode data 2023-10-17 19:32:28 +02:00
Alexey Andreev
368f8a5c23 Update tzdata 2023-10-17 19:32:21 +02:00
Alexey Andreev
fe0ced064b Update CLDR 2023-10-17 19:27:34 +02:00
Ivan Hetman
9242aeb750
classlib: Arrays corner cases fixes (#825) 2023-10-16 20:40:50 +03:00
Alexey Andreev
cd9db17d73 JS: improve performance float<->int reinterpretation conversion, improve performance of Double.equals. 2023-10-16 17:27:12 +02:00
Ivan Hetman
658ef711ab
classlib: additional stream collectors (#822) 2023-10-16 14:09:56 +02:00
Ivan Hetman
65681e74d8
classlib: small PriorityQueue fixes (#823) 2023-10-16 13:59:35 +02:00
Ivan Hetman
1900852cd8
classlib: fix for positioned addAll in sequential lists (#824) 2023-10-16 13:41:15 +02:00
Alexey Andreev
5bc398415d classlib: implement Atomic*FieldUpdater classes
Fix #750
2023-10-15 19:51:44 +02:00
Ivan Hetman
4e9d89b669
classlib: improve range checks for BitSet (#820) 2023-10-13 22:04:00 +03:00
Ivan Hetman
82cd9d9cdf
classlib: fix various issues in TreeMap (#813) 2023-10-13 22:01:40 +03:00
Ivan Hetman
6faecc91d2
classlib: more overrides for TreeMap keySet (#818) 2023-10-13 20:57:32 +03:00
Ludovic Dubost
4a81615749 class: fix LinkedList.offer method adding item incorrectly at the beginning
Fix #772
2023-10-13 19:52:47 +02:00
Ivan Hetman
0b2d1428fb
classlib: minor exceptions fix for lists (#819) 2023-10-13 20:45:02 +03:00
Ivan Hetman
bcc2c0ff35
classlib: implement last part of JEP-431 (#810)
TreeMap, TreeSet
2023-10-09 22:26:42 +03:00
Alexey Andreev
05454380d9 classlib: fix issue in TreeMap iterator remove method 2023-10-09 20:35:54 +02:00
Ivan Hetman
d47fea0b55
classlib: implement third part of JEP-431 (#771)
SequencedSet -> LinkedHashSet, SequencedMap -> LinkedHashMap
2023-10-08 18:05:11 +03:00
Ivan Hetman
2d91f539c7
classlib: fix corner case for Character.forDigit (#769) 2023-10-08 12:48:59 +03:00
Ivan Hetman
a493d003e5
classlib: add methods/fields from JDK 21 to Math (#784) 2023-10-08 12:45:27 +03:00
Jörg Hohwiller
7e761ca7e9
classlib: add TResourceBundle.containsKey (#779)
Fix #573
2023-10-08 12:41:55 +03:00
Alexey Andreev
3d65d38375 Massive refactoring around Wasm support
1. Get rid of old exception handling IR transformer in favor of generation of EH code inside BE
2. Get rid of no-setjmp/longjmp support in C BE
3. Fix various bugs in WebAssembly BE
4. Suppress remaining failing tests for Wasm
5. Enable running Wasm tests by default
2023-10-08 10:36:03 +02:00
Ivan Hetman
fe1a169d9b
classlib: fix delete and replace for AbstractStringBuilder (#783) 2023-10-05 13:27:15 +02:00
Alexey Andreev
2c00df288f wasm: fix ServiceLoader 2023-10-02 14:05:25 +02:00
Alexey Andreev
fc3d92f58d classlib: improve performance of String.toLower/toUpper 2023-09-30 07:17:22 +02:00
Alexey Andreev
a3eb5f635f Fix wrong previous commit 2023-09-29 20:57:45 +02:00
Alexey Andreev
58e68db2c4 classlib: properly determine enum class in SwitchBootstrapSubstitutor 2023-09-29 18:09:01 +02:00
Alexey Andreev
d4113a6744 classlib: improve Math min/max implementations in C and Wasm
Follow-up to ihromant's "fix Math min/max functions in JS"
2023-09-28 17:02:18 +02:00
ihromant
56ff3fbdd8 classlib: fix Math min/max functions 2023-09-28 17:02:18 +02:00
Ivan Hetman
5dec78b590
classlib: support SwitchBootstraps (#764)
Java 21 supports switch pattern matching (as well as few earlier Java version as an experimental feature). Javac produces code with INVOKEDYNAMIC that relies on bootstrap methods from `java.lang.runtime.SwitchBootstraps`. This commit is intended to support for new Java language feature
2023-09-28 15:04:07 +02:00
Ivan Hetman
0ef08a01e7
classlib: inheritDeque from SequencedCollection, fix ArrayDeque (#765)
Second part of JEP-431
2023-09-28 14:35:41 +02:00
Alexey Andreev
ada85b4c07 Bump checkstyle version to support Java 21 syntax 2023-09-28 13:51:08 +02:00
Alexey Andreev
7fd3166f9b wasm: support Date.toString 2023-09-27 14:30:20 +02:00
Alexey Andreev
5a0c418389 wasm: fix duplicate random function 2023-09-25 21:23:46 +02:00
Ivan Hetman
603d7f1f88
classlib: distinguish between +0 and -0 in double stringifier, improve copySign implementation 2023-09-25 15:56:43 +02:00
Colorize
05f50afa8d
classlib: add ExecutionException (#637) 2023-09-25 15:50:19 +02:00
ihromant
c858542605 classlib: implement general reversed ListIterator 2023-09-25 15:28:26 +02:00
Alexey Andreev
e383b94e1b classlib: fix implementations of SequencedCollection methods in ArrayList 2023-09-25 15:23:18 +02:00
Ivan Hetman
55426b25cf
classlib: add SequencedCollection interface, inherited List from it (#759)
(initial part of JEP-431)
2023-09-25 14:50:00 +02:00
Ivan Hetman
a669cd4957
classlib: add MatchException needed for exhaustive switch (#757) 2023-09-24 19:24:47 +03:00
Jonathan Coates
e02f91b0fd
classlib: add Java 9's Arrays.equals and Arrays.mismatch (#755) 2023-09-23 13:01:26 +03:00
Ivan Hetman
7589eb23fc
classlib: remove deprecated constructors of primitive wrappers (#754) 2023-09-21 16:05:18 +02:00
Ivan Hetman
887528531f
classlib: fix for hashcode implementation in various classes, add other minor fixes/improvements (#752) 2023-09-21 15:30:41 +02:00
Ivan Hetman
e13746a650
classlib: fix reverse bytes methods in primitive wrappers (#753) 2023-09-21 13:58:03 +02:00
Alexey Andreev
ba7dcd13b5 Update gradle scripts for latest gradle version
1. Use lazy property assignment
2. Remove usages of deprecated buildDir property
2023-09-21 09:52:29 +02:00
Alexey Andreev
2ae9c593d2 classlib: satisfy checkstyle after applying latest PR 2023-09-21 09:51:34 +02:00
Jonathan Coates
6efade1b49
classlib: Add nio's channel interfaces (#751)
- Add the basic java.nio.channels.Channel interfaces.
 - Add several nio exception types.
 - Add UncheckedIOException
2023-09-21 09:20:24 +02:00
Ivan Hetman
8277671376
classlib: make difference between raw and normal floating points to int conversion 2023-09-20 23:51:55 +03:00
Alexey Andreev
3b6b31ff8f Implement more precise comparison logic 2023-09-20 21:30:56 +02:00
Ivan Hetman
154bf7abd9
classlib: more fixes to Math.nextUp/nextDown (#746) 2023-09-19 13:21:32 +02:00
Alexey Andreev
617ce67871 classlib: follow-up for math fixes 2023-09-19 11:34:51 +02:00
Alexey Andreev
c245eb08cd Fix checkstyle rule violation 2023-09-19 11:34:50 +02:00
Ivan Hetman
93d1a5e492
classlib: float/double equals fixes (#741) 2023-09-19 11:34:29 +02:00
Ivan Hetman
0997a65596
classlib: math fixes (#742) 2023-09-19 09:52:10 +02:00
Ivan Hetman
4a081db1c3
classlib: update RandomGenerator implementation (#743) 2023-09-19 09:39:57 +02:00