RFR[XS] 8249809 avoid calling DirectiveSet::clone(this) in compilecommand_compatibility_init
Liu, Xin
xxinliu at amazon.com
Sun Jul 26 23:46:38 UTC 2020
hi, Reviewers,
Could you review this simple patch?
bug: https://bugs.openjdk.java.net/browse/JDK-8249809
webrev: https://cr.openjdk.java.net/~xliu/8249809/00/webrev/
When the users specify a method-level compiler directive, the DirectiveSet is cloned for every single compiling method. It's expensive but rarely hit. Actually, Only user-specified methods must clone the DirectiveSet. I introduce a smart pointer DirectiveSetPtr. operator->() returns a pointer to a constant DirectiveSet, which is read-only. It doesn't clone the _origin until c2 need to update its members. transfer() yield the ownership of the pointer.
Test:
manually tests with different CompileComand options.
hotspot:tier1 and gtest:all.
thanks,
--lx
More information about the hotspot-compiler-dev
mailing list