In order to move the ServiceThread initialization earlier, we need to check whether the CompiledMethodLoad and CompiledMethodUnload and DynamicCodeGenerated events can be posted yet. The JDK 8 JVMTI spec, says it's during LIVE phase but it's been changed to START and LIVE phases, so the code needs to be fixed.
Before the ServiceThread initialization was moved, the events would never be posted in the START phase, but now they can be.
The tests also need to be fixed:
test/hotspot/jtreg/vmTestbase/nsk/jvmti/CompiledMethodLoad/compmethload001/compmethload001.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/CompiledMethodUnload/compmethunload001/compmethunload001.cpp