Skip to content

Releases: theseus-rs/ristretto

v0.26.0

21 Aug 22:12
71b4c68

Choose a tag to compare

Added

  • calculate clap styles at compile time instead of runtime
  • add startup tracing
  • add Java 25 support
  • add java/lang/invoke/MemberName.vmindex
  • optimize logging startup
  • implement invokedynamic call site cache
  • implement java/lang/Class.isRecord0()Z
  • add member handles
  • reduce memory allocations during primordial thread creation

Fixed

  • correct java.lang.Object.clone()
  • correct class name generation for anewarray instruction
  • never deep clone java.lang.Class objects
  • use private java.lang.Class constructor to create a Class object
  • update frame exception handling to create throwable using the current thread instead of the primordial thread
  • correct polymorphic calls to java.lang.invoke Holder inner classes
  • correct JVM initialization process to call java.lang.ref.Reference.<clinit>()

Other

  • update CallSiteCache to use a DashMap instead of RwLock
  • [breaking] switch to OsStr/OsString and classpath handling
  • correct lint errors
  • remove superfluous Class arc usage
  • reduce memory allocations and locks when registering primitives with the boot class loader
  • replace Reference std::sync::RwLock with parking_lot::RwLock
  • update Cargo.toml dependencies
  • define MemberNameFlags::REFERENCE_KIND_MASK using MemberNameFlags::REFERENCE_KIND_SHIFT
  • update start tracing sum logic
  • correct lint errors
  • update compatibility tests

v0.25.0

31 Jul 21:14
958f94d

Choose a tag to compare

Added

  • add parallel jit compiler
  • update GC threads to be configurable; default to 50% of cpu cores

Fixed

  • correct default interface method resolution
  • correct instanceof operations
  • address stack overflow in invokedynamic instruction
  • correct definition of the ristretto/internal/access/JavaLangRefAccess class

Other

  • replace Value TryInto with as_<type>
  • replace Value.to_<type> methods with TryInto
  • remove ConcurrentVec
  • update Cargo.toml dependencies
  • refactor Reference and Object to improve memory and lock utilization
  • replace Reference TryInto<type> with as_<type>
  • replace Object TryInto<type> with as_<type>
  • implement value, reference and object hash
  • refactor usages of Reference to Value
  • correct clippy lint warnings
  • remove debugging code
  • update to cranelift=0.122.0, criterion=0.7.0

v0.24.0

22 Jul 17:33
cb4a92a

Choose a tag to compare

Added

  • add background jit compiler
  • improve class loader reflection; initial class loader and module support
  • implement java/lang/reflect/Array
  • implement java/lang/String.intern()Ljava/lang/String;
  • add initial string pool

Fixed

  • update cli to allow -cp argument for classpath
  • do not deep clone java.lang.Class objects
  • unbox primitives for constructor reflection
  • correct class loading hierarchy logic
  • correct java/lang/Class.getRawAnnotations()[B and java/lang/Class.getRawTypeAnnotations()[B to return zero length in byte array when there are no annotations
  • correct private method invocation
  • reduce gc memory utilization
  • add Unsafe support for getting/setting Class static fields
  • update java/lang/invoke/MethodHandleNatives.staticFieldOffset(Ljava/lang/invoke/MemberName;)J to get the correct class name
  • update java/lang/Class.forName0 to throw ClassNotFoundException for primitive types
  • correct multinewarray instruction
  • correct jdk.internal.misc.Unsafe put methods
  • correct inherited static method invocation
  • correct java/lang/System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

Other

  • introduce -X cli arguments and move --int to -Xint
  • stub java/lang/invoke/DelegatingMethodHandle$Holder.reinvoke_L([Ljava/lang/Object;)Ljava/lang/Object;
  • stub java/lang/invoke/DelegatingMethodHandle$Holder.delegate([Ljava/lang/Object;)Ljava/lang/Object;
  • stub java/lang/invoke/Invokers$Holder.invoker([Ljava/lang/Object;)Ljava/lang/Object;
  • stub java/lang/invoke/DirectMethodHandle$Holder.getReference([Ljava/lang/Object;)Ljava/lang/Object;
  • consolidate array class creation
  • upgrade default java version to 21.0.8.9.1
  • move primitive and array class creation into class loader
  • remove use of custom garbage collector box
  • update jit and main readme
  • add timing to compatibility tests
  • add method and string integration tests

v0.23.0

13 Jul 22:42
22e2369

Choose a tag to compare

Added

  • add garbage collector
  • implement jdk/internal/loader/BootLoader.getSystemPackageLocation(Ljava/lang/String;)Ljava/lang/String; and jdk/internal/loader/BootLoader.getSystemPackageNames()[Ljava/lang/String;
  • add parallel garbage collection
  • add jit lookupswitch
  • add jit tableswitch

Fixed

  • improve unsafe support for byte offsets

Other

  • update Cargo.toml dependencies
  • remove unnecessary test classes
  • improve compatibility test messages

v0.22.0

08 Jul 00:19
3368aae

Choose a tag to compare

Added

  • add Eq trait to class file attributes
  • implement java/lang/invoke/MethodHandle.invoke([Ljava/lang/Object;)Ljava/lang/Object;, java/lang/invoke/MethodHandle.invokeBasic([Ljava/lang/Object;)Ljava/lang/Object;, java/lang/invoke/MethodHandle.invokeExact([Ljava/lang/Object;)Ljava/lang/Object;
  • implement jdk/internal/misc/Unsafe.park(ZJ)V and jdk/internal/misc/Unsafe.unpark(Ljava/lang/Object;)V
  • implement java/lang/ref/Reference.getAndClearReferencePendingList()Ljava/lang/ref/Reference;
  • implement java/lang/ref/Reference.hasReferencePendingList()Z and java/lang/ref/Reference.waitForReferencePendingList()V
  • implement java/lang/Thread.start0()V
  • implement jdk/internal/vm/ContinuationSupport.isSupported0()Z
  • implement java/lang/Thread.setPriority0(I)V
  • implement java.lang.Thread resume, suspend and stop methods to return UnsupportedOperationException
  • implement java/lang/Thread.clearInterruptEvent()V, java/lang/Thread.interrupt0()V, java/lang/Thread.isInterrupted(Z)Z
  • implement java/lang/Thread.getThreads()[Ljava/lang/Thread;
  • implement java/lang/Thread.ensureMaterializedForStackWalk(Ljava/lang/Object;)V
  • implement jdk/internal/reflect/Reflection.areNestMates(Ljava/lang/Class;Ljava/lang/Class;)Z
  • implement jdk/internal/misc/Unsafe.staticFieldBase0(Ljava/lang/reflect/Field;)Ljava/lang/Object;, jdk/internal/misc/Unsafe.staticFieldOffset0(Ljava/lang/reflect/Field;)J, sun/misc/Unsafe.staticFieldBase(Ljava/lang/reflect/Field;)Ljava/lang/Object;, sun/misc/Unsafe.staticFieldOffset(Ljava/lang/reflect/Field;)J
  • implement jdk/internal/misc/Unsafe.pageSize()I and sun/misc/Unsafe.pageSize()I

Fixed

  • correct java/lang/Object.hashCode()I
  • correct if_icmpeq and if_icmpne instructions
  • correct field shadowing logic
  • correct and optimize class polymorphic method lookups
  • correct java/lang/invoke/MethodHandleNatives resolve access check logic
  • correct field resolution logic in java/lang/invoke/MethodHandleNatives.resolve()
  • correct integer/long div/rem instructions when dividing by zero
  • correct double/float div/rem instructions when dividing by zero
  • correct jdk/internal/misc/Unsafe.get(...) methods to handle partial byte buffers
  • correct array index out of bounds behavior
  • add class, method type and method handle support to invokedynamic static bootstrap argument resolution
  • correct class retrieval for java/lang/invoke/MethodHandleNatives.objectFieldOffset(Ljava/lang/invoke/MemberName;)J
  • define empty configuration for jdk/internal/module/ModuleBootstrap.boot()Ljava/lang/ModuleLayer;
  • use thread execute for internal vm calls
  • lookup classes using existing thread context instead of vm

Other

  • update Cargo.toml dependencies
  • [breaking] optimize Instruction enum by introducing TableSwitch and LookupSwitch structs
  • reduced direct usages of Reference
  • remove fields from object instances
  • [breaking] refactor class and object fields
  • add eq trait to value and reference
  • [breaking] refactor VM invoke interfaces to combine method name and method descriptor argument into a single method signature argument
  • update compatibility tests to run in parallel
  • update to Rust 1.88.0
  • update JavaObject.to_object(&VM) -> JavaObject.to_object(&Thread)
  • refactored file handle management and created thread handles

v0.21.0

20 Jun 22:15
93d1c7b

Choose a tag to compare

Added

  • add java.io.ObjectInputStream and java.io.ObjectOutputStream intrinsics
  • add intrinsic support for basic file io
  • add java/lang/ref/PhantomReference intrinsics
  • add OS specific file intrinsics
  • implemented java.io.ObjectStreamClass.hasStaticInitializer(Ljava/lang/Class;)Z

Fixed

  • correct mutf-8 class file string encoding/decoding as well as add utf-16 Java 9+ string support
  • add invokedynamic bootstrap method descriptor verification

Other

  • [breaking] change VM parameter types from Vec to &[T] for zero-allocation and improved ergonomics
  • optimize Reference enum memory
  • [breaking] update ConstantPool try_get_utf8, try_get_class, try_get_string, try_get_module, and try_get_package to return &str instead of &String. Updated Class to use the same class name reference from constant pool instead of copying the string into the struct.
  • create compile time intrinsic method registry
  • add classfile attributes documentation
  • update rust doc formatting
  • add constants for java versions
  • optimize file reads by removing iterative type conversion from u8->i8. Optimized Reference Vec signed<->unsigned type conversions.
  • add java.lang.invoke.DirectMethodHandle$Holder trampoline methods on class definition
  • remove unnecessary version file parsing on startup when the full java version is specified
  • remove unnecessary call to obtain current directory on initialization
  • update to phf=0.12.1
  • remove lint warning on windows
  • remove unnecessary java version from intrinsics registry
  • correct clippy lints

v0.20.0

06 Jun 23:06
a7d7f8f

Choose a tag to compare

Added

  • add jit support for ret and ret_w

Fixed

  • [breaking] update MaxLocals to correctly handle static/virtual methods and category 2 (long/double) types
  • update Version.supports() to take a reference to self
  • correct stack overflow error in java/lang/invoke/MethodHandleNatives.resolve(Ljava/lang/invoke/MemberName;Ljava/lang/Class;)Ljava/lang/invoke/MemberName;
  • corrected jit bug where float was being treated as a double in ldc and ldc_w instructions

Other

  • update Cargo.toml dependencies
  • improve attribute code coverage
  • improve classfile documentation
  • stub support for polymorphic intrinsic methods
  • add jit ldc, ldc_w, and ldc2_w error tests
  • improve jit ret_w code coverage
  • stub java.lang.invoke.DirectMethodHandle$Holder
  • rename native_methods module to intrinsic_methods

v0.19.2

31 May 19:02
2923077

Choose a tag to compare

Fixed

  • java/lang/Class.getDeclaredMethods0(Z)[Ljava/lang/reflect/Method; set void return types to void class instead of null
  • correct invokedynamic get_method_type to handle descriptors without parameters
  • correct jit jsr and jsr_w instructions

Other

  • add jit pop2 category2 test
  • add jit stack tests
  • add jit test coverage for dcmpg, dcmpl, fcmpg, fcmpl, lcmp
  • update Cargo.toml dependencies

v0.19.1

24 May 01:05
85379b6

Choose a tag to compare

Added

  • add java.lang.invoke.MethodHandleNatives objectFieldOffset(..), staticFieldBase(..) and staticFieldOffset(..)
  • add java.lang.invoke.MethodHandleNatives setCallSiteTargetNormal(..) and setCallSiteTargetVolatile(..)

Fixed

  • update jit dcmpg, dcmpl, fcmpg, fcmpl to correctly handle NaN
  • correct java.lang.invoke.MethodHandleNatives.resolve(..) field support
  • correct jit dreturn and freturn

Other

  • add jit double math tests
  • add jit long math tests
  • add jit float math tests
  • add jit integer math tests
  • add jit debug, monitor, and nop tests
  • add jit convert instruction tests
  • add jit bipush and sipush instruction tests
  • add jit primitive load and store instruction tests
  • update to cranelift=0.120.0
  • update cfg doc formatting
  • add jit test coverage
  • update Cargo.lock dependencies
  • update Cargo.toml dependencies
  • update default java version to 21.0.7.6.1
  • update to cranelift=0.120.0
  • stub invokedynamic caller method handle lookup
  • stub invokedynamic static bootstrap arguments
  • expand invokedynamic stub by obtaining MethodType parameter for bootstrap method
  • stub invokedynamic bootstrap method lookup

v0.19.0

18 May 04:41
a9cb678

Choose a tag to compare

Added

  • implement basic jit branch instructions
  • enable creation of jit control flow graph blocks
  • generate jit control flow graph using cranelift blocks
  • optimize operand stack layout
  • optimize jit Instruction::Return
  • optimize operand stack to prevent allocation when not used; e.g. Object.<init>()
  • implement jit operand stack

Fixed

  • add jit cfg exception blocks
  • add jit block support for ifnull and ifnonnull
  • add jit control flow logic for if_acmpeq and if_acmpne
  • correct lcmp, dcmpl, dcmpg, fcmpl, fcmpg to pass stack values through block params
  • correct jit dcmpl, dcmpg, fcmpl, fcmpg to emit float instructions instead of int.
  • correct jit invoke* instruction parameter processing
  • correct jit field, invoke and stack simulation errors

Other

  • minor jit readme update
  • simplify jit stack implementations
  • update to Rust 1.87.0
  • improve jit instruction simulation test coverage
  • refactor to use block params for OperandStack
  • update jit operand stack to use cranelift stack slot
  • only enable jit verifier when debug assertions are enabled
  • update to clap=4.5.38, os_info=3.11.0, sysinfo=0.35.1, tempfile=3.20.0