Currently, if any option exists in CompileCommand, DirectiveSet::compilecommand_compatibility_init will clone a DirectiveSet for each method. it's expensive but rarely hit.
http://hg.openjdk.java.net/jdk/jdk/file/5775a1b1ff5a/src/hotspot/share/compiler/compilerDirectives.cpp#l288
We should wrap set with a smart pointer and use Copy-on-Write strategy. The directiveSet will be cloned only when the content is about to modify.
http://hg.openjdk.java.net/jdk/jdk/file/5775a1b1ff5a/src/hotspot/share/compiler/compilerDirectives.cpp#l288
We should wrap set with a smart pointer and use Copy-on-Write strategy. The directiveSet will be cloned only when the content is about to modify.