Open fjeremic opened 7 years ago
Maybe this could be added as a feature for the perf-agent work over at https://github.com/amyhou/openj9-utils?
We've since switched to using OpenJDK's StringBuilder implementation, so this work becomes difficult on JDK11 onwards. However you're right if the JVMTI agent just inserts bytecode for instrumentation then yes that seems to be a much better path forward.
As suggested by @andrewcraik in https://github.com/eclipse/openj9/pull/133#issuecomment-332185691 and https://github.com/eclipse/openj9/pull/133#issuecomment-332515832 we should be able to implement a simple agent for the StringBuilderTransformer optimization and check it into our repository so that we can always collect statistics if need be.
The corresponding PR https://github.com/eclipse/openj9/pull/133 contains a rather large https://github.com/eclipse/openj9/pull/133#issuecomment-332006978 outlining the types of changes which are needed to StringBuilder class for the instrumentation to work.