--- old/src/share/vm/services/diagnosticCommand.cpp 2015-09-25 16:23:25.314913795 +0200 +++ new/src/share/vm/services/diagnosticCommand.cpp 2015-09-25 16:23:25.170913800 +0200 @@ -25,6 +25,8 @@ #include "precompiled.hpp" #include "classfile/classLoaderStats.hpp" #include "classfile/compactHashtable.hpp" +#include "compiler/compileBroker.hpp" +#include "compiler/directivesParser.hpp" #include "gc/shared/vmGCOperations.hpp" #include "oops/oop.inline.hpp" #include "runtime/globals.hpp" @@ -79,6 +81,11 @@ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + // Enhanced JMX Agent Support // These commands won't be exported via the DiagnosticCommandMBean until an // appropriate permission is created for them @@ -834,6 +841,41 @@ VMThread::execute(&printCodeCacheOp); } +void CompilerDirectivesPrintDCmd::execute(DCmdSource source, TRAPS) { + DirectivesStack::print(output()); +} + +CompilerDirectivesAddDCmd::CompilerDirectivesAddDCmd(outputStream* output, bool heap) : + DCmdWithParser(output, heap), + _filename("filename","Name of the directives file", "STRING",true) { + _dcmdparser.add_dcmd_argument(&_filename); +} + + +void CompilerDirectivesAddDCmd::execute(DCmdSource source, TRAPS) { + if (!DirectivesParser::parse_from_file(_filename.value())) { + output()->print_cr("Could not load compiler directives file."); + } +} + +int CompilerDirectivesAddDCmd::num_arguments() { + ResourceMark rm; + CompilerDirectivesAddDCmd* dcmd = new CompilerDirectivesAddDCmd(NULL, false); + if (dcmd != NULL) { + DCmdMark mark(dcmd); + return dcmd->_dcmdparser.num_arguments(); + } else { + return 0; + } +} + +void CompilerDirectivesRemoveDCmd::execute(DCmdSource source, TRAPS) { + DirectivesStack::pop(); +} + +void CompilerDirectivesClearDCmd::execute(DCmdSource source, TRAPS) { + DirectivesStack::clear(); +} #if INCLUDE_SERVICES ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap),