src/share/vm/compiler/directivesParser.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/compiler/directivesParser.cpp
src/share/vm/compiler/directivesParser.cpp
Print this page
rev 10435 : 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 ****
/*
! * Copyright (c) 2015, 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.
--- 1,7 ----
/*
! * 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,71 ****
tmp = pop_tmp();
}
assert(_tmp_depth == 0, "Consistency");
}
! bool 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;
}
}
bool DirectivesParser::has_file() {
return CompilerDirectivesFile != NULL;
--- 53,71 ----
tmp = pop_tmp();
}
assert(_tmp_depth == 0, "Consistency");
}
! 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 -1;
}
}
bool DirectivesParser::has_file() {
return CompilerDirectivesFile != NULL;
*** 95,115 ****
char* buffer = NEW_RESOURCE_ARRAY(char, st.st_size+1);
size_t num_read = os::read(file_handle, (char*) buffer, st.st_size);
buffer[num_read] = '\0';
// close file
os::close(file_handle);
! return parse_string(buffer, stream);
}
}
return false;
}
! bool DirectivesParser::install_directives() {
// Check limit
if (!DirectivesStack::check_capacity(_tmp_depth, _st)) {
clean_tmp();
! return false;
}
// Pop from internal temporary stack and push to compileBroker.
CompilerDirectives* tmp = pop_tmp();
int i = 0;
--- 95,115 ----
char* buffer = NEW_RESOURCE_ARRAY(char, st.st_size+1);
size_t num_read = os::read(file_handle, (char*) buffer, st.st_size);
buffer[num_read] = '\0';
// close file
os::close(file_handle);
! return parse_string(buffer, stream) != -1;
}
}
return false;
}
! int DirectivesParser::install_directives() {
// Check limit
if (!DirectivesStack::check_capacity(_tmp_depth, _st)) {
clean_tmp();
! return 0;
}
// Pop from internal temporary stack and push to compileBroker.
CompilerDirectives* tmp = pop_tmp();
int i = 0;
*** 118,135 ****
DirectivesStack::push(tmp);
tmp = pop_tmp();
}
if (i == 0) {
_st->print_cr("No directives in file");
! return false;
} 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;
}
}
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) {
--- 118,135 ----
DirectivesStack::push(tmp);
tmp = pop_tmp();
}
if (i == 0) {
_st->print_cr("No directives in file");
! 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 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) {
src/share/vm/compiler/directivesParser.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File