RFR: 8255883: Avoid duplicated GeneratedMethodAccessor when reflect method invoked from different threads [v8]

Hui Shi hshi at openjdk.java.net
Mon Nov 16 08:45:20 UTC 2020


> …AccessorImpl object
> 
> We met real problem when using protobuf with option optimized for code size, detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883
> 
> Optimize solution is adding a new boolean field to detect concurrent method accessor generation in same NativeMethodAccessorImpl object, only one thread is allowed to generate accessor, other threads still invoke in jni way until parent's delegator is updated from NativeMethodAccessorImpl  to generated accessor.
> 
> In common case, extra overhead is an atomic operation, compared with method accessor generate, this cost is trivial.

Hui Shi has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains one additional commit since the last revision:

  8255883: Avoid duplicated GeneratedMethodAccessor when reflect method invoked from different threads

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1070/files
  - new: https://git.openjdk.java.net/jdk/pull/1070/files/98278050..e7b6d88a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1070&range=07
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1070&range=06-07

  Stats: 110505 lines in 1385 files changed: 59994 ins; 39577 del; 10934 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1070.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1070/head:pull/1070

PR: https://git.openjdk.java.net/jdk/pull/1070


More information about the core-libs-dev mailing list