c2compiler.cpp revision 196
/*
* Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_c2compiler.cpp.incl"
// register information defined by ADLC
extern const char register_save_policy[];
extern const int register_save_type[];
const char* C2Compiler::retry_no_subsuming_loads() {
return "retry without subsuming loads";
}
const char* C2Compiler::retry_no_escape_analysis() {
return "retry without escape analysis";
}
void C2Compiler::initialize_runtime() {
// Check assumptions used while running ADLC
for (int i = 0; i < ConcreteRegisterImpl::number_of_registers ; i++ ) {
}
if (r->is_valid()) {
}
}
// Check that runtime and architecture description agree on callee-saved-floats
bool callee_saved_floats = false;
// Is there a callee-saved float or double?
callee_saved_floats = true;
}
}
}
void C2Compiler::initialize() {
// This method can only be called once per C2Compiler object
// The first compiler thread that gets here will initialize the
// small amount of global state (and runtime stubs) that c2 needs.
// There is a race possible once at startup and then we're fine
// Note that this is being called from a compiler thread not the
// main startup thread.
if (_runtimes != initialized) {
}
// Mark this compiler object as ready to roll
}
int entry_bci) {
if (!is_initialized()) {
initialize();
}
bool subsume_loads = true;
bool do_escape_analysis = DoEscapeAnalysis;
// Attempt to compile while subsuming loads into machine instructions.
// Check result and retry if appropriate.
if (C.failure_reason() != NULL) {
if (C.failure_reason_is(retry_no_subsuming_loads())) {
subsume_loads = false;
continue; // retry
}
if (C.failure_reason_is(retry_no_escape_analysis())) {
do_escape_analysis = false;
continue; // retry
}
// Pass any other failure reason up to the ciEnv.
// Note that serious, irreversible failures are already logged
// on the ciEnv via env->record_method_not_compilable().
}
// No retry; just break the loop.
break;
}
}
void C2Compiler::print_timers() {
// do nothing
}