< prev index next >
src/share/vm/compiler/directivesParser.cpp
Print this page
rev 10354 : 8150646: Add support for blocking compiles though whitebox API
Reviewed-by: kvn, ppunegov, simonis, neliasso
Contributed-by: nils.eliasson@oracle.com, volker.simonis@gmail.com
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -53,19 +53,19 @@
tmp = pop_tmp();
}
assert(_tmp_depth == 0, "Consistency");
}
-bool DirectivesParser::parse_string(const char* text, outputStream* st) {
+int DirectivesParser::parse_string(const char* text, outputStream* st) {
DirectivesParser cd(text, st);
if (cd.valid()) {
return cd.install_directives();
} else {
cd.clean_tmp();
st->flush();
st->print_cr("Parsing of compiler directives failed");
- return false;
+ return 0;
}
}
bool DirectivesParser::has_file() {
return CompilerDirectivesFile != NULL;
@@ -101,15 +101,15 @@
}
}
return false;
}
-bool DirectivesParser::install_directives() {
+int DirectivesParser::install_directives() {
// Check limit
if (!DirectivesStack::check_capacity(_tmp_depth, _st)) {
clean_tmp();
- return false;
+ return 0;
}
// Pop from internal temporary stack and push to compileBroker.
CompilerDirectives* tmp = pop_tmp();
int i = 0;
@@ -118,18 +118,18 @@
DirectivesStack::push(tmp);
tmp = pop_tmp();
}
if (i == 0) {
_st->print_cr("No directives in file");
- return false;
+ return 0;
} else {
_st->print_cr("%i compiler directives added", i);
if (CompilerDirectivesPrint) {
// Print entire directives stack after new has been pushed.
DirectivesStack::print(_st);
}
- return true;
+ return i;
}
}
DirectivesParser::DirectivesParser(const char* text, outputStream* st)
: JSON(text, false, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL), _tmp_depth(0) {
< prev index next >