1 /*
2 * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
914 _filename("filename","Name of the directives file", "STRING",true) {
915 _dcmdparser.add_dcmd_argument(&_filename);
916 }
917
918 void CompilerDirectivesAddDCmd::execute(DCmdSource source, TRAPS) {
919 DirectivesParser::parse_from_file(_filename.value(), output());
920 }
921
922 int CompilerDirectivesAddDCmd::num_arguments() {
923 ResourceMark rm;
924 CompilerDirectivesAddDCmd* dcmd = new CompilerDirectivesAddDCmd(NULL, false);
925 if (dcmd != NULL) {
926 DCmdMark mark(dcmd);
927 return dcmd->_dcmdparser.num_arguments();
928 } else {
929 return 0;
930 }
931 }
932
933 void CompilerDirectivesRemoveDCmd::execute(DCmdSource source, TRAPS) {
934 DirectivesStack::pop();
935 }
936
937 void CompilerDirectivesClearDCmd::execute(DCmdSource source, TRAPS) {
938 DirectivesStack::clear();
939 }
940 #if INCLUDE_SERVICES
941 ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
942 DCmdWithParser(output, heap),
943 _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
944 _print_subclasses("-s", "If a classname is specified, print its subclasses. "
945 "Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"),
946 _classname("classname", "Name of class whose hierarchy should be printed. "
947 "If not specified, all class hierarchies are printed.",
948 "STRING", false) {
949 _dcmdparser.add_dcmd_option(&_print_interfaces);
950 _dcmdparser.add_dcmd_option(&_print_subclasses);
951 _dcmdparser.add_dcmd_argument(&_classname);
952 }
953
954 void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
|
1 /*
2 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
914 _filename("filename","Name of the directives file", "STRING",true) {
915 _dcmdparser.add_dcmd_argument(&_filename);
916 }
917
918 void CompilerDirectivesAddDCmd::execute(DCmdSource source, TRAPS) {
919 DirectivesParser::parse_from_file(_filename.value(), output());
920 }
921
922 int CompilerDirectivesAddDCmd::num_arguments() {
923 ResourceMark rm;
924 CompilerDirectivesAddDCmd* dcmd = new CompilerDirectivesAddDCmd(NULL, false);
925 if (dcmd != NULL) {
926 DCmdMark mark(dcmd);
927 return dcmd->_dcmdparser.num_arguments();
928 } else {
929 return 0;
930 }
931 }
932
933 void CompilerDirectivesRemoveDCmd::execute(DCmdSource source, TRAPS) {
934 DirectivesStack::pop(1);
935 }
936
937 void CompilerDirectivesClearDCmd::execute(DCmdSource source, TRAPS) {
938 DirectivesStack::clear();
939 }
940 #if INCLUDE_SERVICES
941 ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
942 DCmdWithParser(output, heap),
943 _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
944 _print_subclasses("-s", "If a classname is specified, print its subclasses. "
945 "Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"),
946 _classname("classname", "Name of class whose hierarchy should be printed. "
947 "If not specified, all class hierarchies are printed.",
948 "STRING", false) {
949 _dcmdparser.add_dcmd_option(&_print_interfaces);
950 _dcmdparser.add_dcmd_option(&_print_subclasses);
951 _dcmdparser.add_dcmd_argument(&_classname);
952 }
953
954 void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
|