You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 5.3KB

10 years ago
10 years ago
10 years ago
5 years ago
6 years ago
5 years ago
10 years ago
10 years ago
10 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # DCEVM
  2. This project is a fork of original [DCEVM](http://ssw.jku.at/dcevm/) project.
  3. The purpose of the project is to maintain enhanced class redefinition functionality for OpenJDK HotSpot 7/8.
  4. ## Binaries
  5. You can download binaries [here](https://dcevm.github.io/).
  6. ## Dcevm for Java9, Java10 and Java10
  7. Dcevm8 is last version supported by this project. New versions are moved to separated projects extended from OpenJDK under HotswapProjects umbrella.
  8. * [Dcevm9](https://github.com/HotswapProjects/openjdk-jdk9)
  9. * [Dcevm10](https://github.com/HotswapProjects/openjdk-jdk10)
  10. * [Dcevm11](https://github.com/HotswapProjects/openjdk-jdk11)
  11. Dcevm patch is hosted in dedicated **dcevm** branch in each repository.
  12. ## Supported versions
  13. [hotspot/.hg/patches/](hotspot/.hg/patches/) contains patches for all supported versions. Each patch is named by concatenating prefix `full` or `light` with the OpenJDK HotSpot tag. `full` patches support full redefenition capabilities (including removal of superclasses, for example). `light` patches are easier to maintain, but they only support limited functionality (generally, additions to class hierarchies are fine, removals are not).
  14. HotSpot tag is the name of the tag in the corresponding HotSpot Mercurial repository ([Java 8](http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot)/[Java 7](http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot)).
  15. ## Building
  16. ### General Requirements
  17. You need the following software to build DCEVM:
  18. * Java 7 or later. If you intend to run tests, it should be one of the supported versions (see list of [patches/](patches/))
  19. * C++ compiler toolchain (gcc). There is no strict version requirement except that it should be supported by HotSpot build scripts.
  20. * Mercurial with [Mercurial Queues Extension](https://mercurial.selenic.com/wiki/MqExtension) enabled.
  21. #### Mac OS X specific requirements
  22. Currently the build is not compatible with Clang on Mac OS X, you need to install gcc 4.8 using the [Homebrew](http://brew.sh/):
  23. ```sh
  24. brew tap homebrew/versions
  25. brew install gcc48
  26. ```
  27. Then set the following environmental properties:
  28. ```sh
  29. export CC=/usr/local/bin/gcc-4.8
  30. export CFLAGS=-fobjc-exceptions
  31. export CXX=/usr/local/bin/g++-4.8
  32. export SA_LDFLAGS=-fobjc-exceptions
  33. ```
  34. ### Linux gcc8 specific prebuild steps
  35. ```sh
  36. export CFLAGS="${CFLAGS//-O2/-O3} ${CPPFLAGS} -Wno-error=deprecated-declarations -Wno-error=stringop-overflow= -Wno-error=return-type -Wno-error=cpp -fno-lifetime-dse -fno-delete-null-pointer-checks"
  37. export CXXFLAGS="${CXXFLAGS} ${CPPFLAGS}"
  38. ```
  39. ### Compiling DCEVM
  40. * Configure version you want in [gradle.properties](gradle.properties).
  41. * Run `./gradlew patch` to retrieve HotSpot sources and patch them.
  42. * Run `./gradlew compileFastdebug` to build `fastdebug` version or `./gradlew compileProduct` to build `product` version.
  43. * Compiled libraries are placed in `hotspot/build/fastdebug` or `hotspot/build/product`.
  44. ### Installing DCEVM
  45. * Replace `libjvm.so/jvm.dll/libjvm.dylib` in the target JRE.
  46. * Run `java -version`, it should include `Dynamic Code Evolution` string.
  47. Or you can install DCEVM using the gradle script:
  48. * Run `./gradlew installFastdebug -PtargetJre=$JAVA_HOME/jre` or `./gradlew installProduct -PtargetJre=$JAVA_HOME/jre`
  49. * DCEVM will be installed as "alternative" JVM. To use it, add `-XXaltjvm=dcevm`
  50. Alternatively, on Debian and Ubuntu systems DCEVM can be installed with the
  51. [`openjdk-7-jre-dcevm`](https://tracker.debian.org/pkg/openjdk-7-jre-dcevm)
  52. package and invoked by adding the `-dcevm` command line parameter:
  53. * Run `apt-get install openjdk-7-jre-dcevm`
  54. * Run `java -dcevm -version`, it should include `Dynamic Code Evolution` string.
  55. ### Testing DCEVM
  56. * Configure version you want in [gradle.properties](gradle.properties).
  57. * Set `JAVA_HOME` to point to JDK you want to test against (should be compatible with the version you set in [gradle.properties](gradle.properties)).
  58. * Run `./gradlew patch` to retrieve HotSpot sources and patch them.
  59. * Run `./gradlew test` to run tests.
  60. * Tests reports will be in `dcevm/build/reports/tests/index.html`
  61. To run tests from IDE, you need:
  62. * Run `./gradlew agent:build` to build redefinition agent code.
  63. * Add JVM argument to use redefinition agent (`-javaagent:agent/build/libs/agent.jar`).
  64. * Add JVM argument to DCEVM VM if installed side-by-side (`-XXaltjvm=dcevm`).
  65. ### Hotswap performance tweak (Experimental)
  66. DCEVM executes deoptimization (purge of code cache) after any class redefinition. It leads to decrease JVM's performance (after redefinition). This is especially problem on large scale projects with significant number of classes. Hotswap performance can be improved using an experimental option `-XX:HotswapDeoptClassPath=`. One or more packages can be specified in comma separated list as parameters. Packages must contain all classes that will be potentially modified (redefined). Classes outside of this list won't be included in the deoptimization. Usually it is sufficient to specify application main or root package. If `com.sun.proxy.Proxy` is used in the application or by application's framework, then this option should contain package `com.sun.proxy` as well. If `HotswapDeoptClassPath` option is not specified, then all classes will be deoptimized after redefinition. It is also recommended to clean all generated byte by reflection.
  67. Example:
  68. -XX:HotswapDeoptClassPath='com.myproject.,com.sun.proxy.$Proxy,sun.reflect.Generated'
  69. ### Known issues