HotswapProjects / openjdk-jdk9

OpenJDK jdk9 mirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DCEVM & HotswapJDK

In contrast to standard Java, where the hotswap is limited to in-body code changes, the DCEVM + HotswapAgent allow following code changes:

  • Add/remove/modify class fields.
  • Add/remove/modify methods.
  • Add/remove/modify annotations
  • Add/remove/modify classes including anonymous classes.
  • Add/remove static member of classes.
  • Add/remove enum values

The only unsupported change is hierarchy change (change superclass).

DCEVM changed files (overview)

TODO - add more detail.

makefiles -> JVM_GetVmMemoryPressure

src/vm/classfile

share/vm/ci -> int find(Metadata* key, GrowableArray<ciMetadata*>* objects); bool is_found_at(int index, Metadata* key, GrowableArray<ciMetadata*>* objects); void insert(int index, ciMetadata* obj, GrowableArray<ciMetadata*>* objects); replaced by: static int metadata_compare(Metadata* const& key, ciMetadata* const& elt);

src/vm/classfile

classFileParser -> new variable _pick_newest introduced

classLoaderData -> do_unloading - fix unloaded for DCEVM

dictionary ->

  • update_klass() -> update class entry in the Dictionary
  • rollback_redefinition() -> rever all class entries to old_version() in the Dictionary
  • do_unloading() -> do not unload redefined class - fix for DCEVM may be needed

javaClasses ->

  • new interface to java.lang.invoke.DirectMethodHandle$StaticAccessor and java.lang.invoke.DirectMethodHandle$Accessor

loadConstraints -> update_after_redefinition - switch to newest classes

systemDictionary ->

  • check that only newest class is used
  • new method remove_from_hierarchy() introduced

verifier -> use newest class

vmSymbols -> java.lang.invoke.DirectMethodHandle$StaticAccessor and java.lang.invoke.DirectMethodHandle$Accessor

src/vm/gc

cms - not supported for DCEVM g1 - not supported for DCEVM serial - **** DCEVM *****

shared - **** DCEVM *****

  • rescue()
  • must_rescue()

Universe ->

  • _is_redefining_gc_run
  • root_oops_do() - iterate over all objects

src/vm/oops

cache - clear_entries, disable field modification checks instanceKlass - update_jmethod_id, implements_interface_any_version, ... klass ->

  • new redefinition flags - _old_version, _new_version, _redefinition_flags, _is_redefining,
  • update_information - store mapping betwen old fields and new fields - use to recalculate objects method - oldMethod, newMethod, ..
  • remove_from_sibling_list - fix list of subclasses after superclass change

src/vm/prims

jvmtiEnhancedRedefineClasses - **** DCEVM ***** jvmtiEnv -> switch to enhanced version jvmtiGetLoadedClasses -> iterate only on newest classes jvmtiImpl -> method breakpoints in old method version methodHandles -> reinit - FIXME

src/vm/runtime

arguments -> force usage of Serial GC globals -> new flag AllowEnhancedClassRedefinition reflection -> use new class version

About

OpenJDK jdk9 mirror

License:GNU General Public License v2.0


Languages

Language:Java 78.3%Language:C++ 12.1%Language:C 5.0%Language:JavaScript 1.2%Language:Roff 1.0%Language:Shell 1.0%Language:HTML 0.5%Language:Objective-C 0.3%Language:XSLT 0.2%Language:M4 0.1%Language:Python 0.1%Language:Assembly 0.0%Language:Makefile 0.0%Language:DTrace 0.0%Language:CSS 0.0%Language:Awk 0.0%Language:Perl 0.0%Language:Batchfile 0.0%Language:Red 0.0%Language:SourcePawn 0.0%