Skip to content
szegedi edited this page Jul 21, 2012 · 4 revisions

Changes in 0.3 compared to 0.2

Major new features

  • java.lang.Class objects have a synthetic property named "static" which exposes the static facet of the class; that is, a request for "dyn:getProp:static" on a Class will return it.
  • New "dyn:new" operation for creation of instances.
  • Static facet of the class exposes all public constructors (answer to "dyn:new"), static methods, static fields and static property getters/setters for the class. Classes of arrays also have a constructor that takes a single int as the length of the array. Full overload resolution and vararg handling applies to statics too.
  • New call site class, ChainedCallSite can remember several already linked methods and build guardWithTest() chains from them. Usually performs better than MonomorphicCallSite.
  • ConversionComparator interface for defining priorities between possible language-specific type conversions.
  • POJO linker recognizes method names with explicit type signatures in them, i.e. "dyn:callPropWithThis:println(String)" and uses them to explicitly select an overload with that exact signature.
  • DynamicLinker.getTypeConverter(sourceType, targetType) can be used to retrieve a type converter method handle outside of the linking context (if the language runtime needs to explicitly invoke them from some other code).
  • Swanky new website at http://szegedi.github.com/dynalink

Minor new features

  • DynamicLinkerFactory.setSyncOnRelink() method.
  • GuardedInvocation.compose() convenience methods.
  • GuardedInvocation.hasBeenInvalidated() method.
  • GuardedInvocation.asType(), .filterArguments() and .dropArguments() convenience methods that operate both on the invocation and the guard.
  • Guards.isNull() method.
  • LinkRequest.getReceiver() for returning the 0th argument of the link request. Saves whole lot of argument array cloning.
  • Lookup.findOwnStatic() method.
  • TypeUtilities.getPrimitiveTypeByName() and .getPrimitiveType() methods.
  • Array objects now expose a synthetic "length" property.

Improvements and fixes

  • Significantly improved overloaded method resolution compared to 0.2.
  • Use of foldArguments(exactInvoker()) for relinking invocation eliminates Dynalink stack frames from the relinking operations.
  • CallSiteDescriptor is now an interface; we provide a factory that canonicalizes instances and varies between optimal implementations for different needs.
  • POJO linker reuses most guard method handles; much less method handles are generated.
  • Language specific context arguments are now expected from the argument position 1. In 0.2, they were trailing arguments, but that caused problems with vararg invocation. Now they're after "this" (which is in position 0), and before any regular arguments.
Clone this wiki locally