/*
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_C1_C1_COMPILATION_HPP
#define SHARE_VM_C1_C1_COMPILATION_HPP
#include "code/exceptionHandlerTable.hpp"
#include "memory/resourceArea.hpp"
class CompilationResourceObj;
class XHandlers;
class ExceptionInfo;
class DebugInformationRecorder;
class FrameMap;
class IR;
class IRScope;
class Instruction;
class LinearScan;
class OopMap;
class LIR_Emitter;
class LIR_Assembler;
class CodeEmitInfo;
class ciEnv;
class ciMethod;
class ValueStack;
class LIR_OprDesc;
class C1_MacroAssembler;
class CFGPrinter;
friend class CompilationResourceObj;
private:
// compilation specifics
int _next_id;
int _next_block_id;
int _osr_bci;
int _max_spills;
bool _has_exception_handlers;
bool _has_fpu_code;
bool _has_unsafe_access;
bool _would_profile;
const char* _bailout_msg;
// compilation helpers
void initialize();
void build_hir();
void emit_lir();
int emit_code_body();
int compile_java_method();
void install_code(int frame_size);
void compile_method();
void generate_exception_handler_table();
#ifndef PRODUCT
#endif // PRODUCT
public:
// creation
~Compilation();
}
// accessors
int max_vector_size() const { return 0; }
// Instruction ids
// BlockBegin ids
// setters
// Add a set of exception handlers covering the given PC offset
// Statistics gathering
// JSR 292
return previous;
}
#ifndef PRODUCT
void maybe_print_current_instruction();
#endif // PRODUCT
// error handling
static int desired_max_code_buffer_size() {
#ifndef PPC
return (int) NMethodSizeLimit; // default 256K or 512K
#else
// conditional branches on PPC are restricted to 16 bit signed
#endif
}
static int desired_max_constant_size() {
return desired_max_code_buffer_size() / 10;
}
// timers
static void print_timers();
#ifndef PRODUCT
// debugging support.
// produces a file named c1compileonly in the current directory with
// directives to compile only the current method and it's inlines.
// The file can be passed to the command line option -XX:Flags=<filename>
void compile_only_this_method();
void exclude_this_method();
#endif // PRODUCT
bool is_profiling() {
}
// Helpers for generation of profile information
bool profile_branches() {
}
bool profile_calls() {
}
bool profile_inlined_calls() {
return profile_calls() && C1ProfileInlinedCalls;
}
bool profile_checkcasts() {
}
};
// Macro definitions for unified bailout-support
// The methods bailout() and bailed_out() are present in all classes
// that might bailout, but forward all calls to Compilation
private:
public:
}
~InstructionMark() {
}
};
//----------------------------------------------------------------------
// Base class for objects allocated by the compiler in the compilation arena
public:
}
void operator delete(void* p) {} // nothing to do
};
//----------------------------------------------------------------------
// Class for aggregating exception handler information.
// Effectively extends XHandlers class with PC offset of
// potentially exception-throwing instruction.
// This class is used at the end of the compilation to build the
// ExceptionHandlerTable.
private:
public:
{ }
};
#endif // SHARE_VM_C1_C1_COMPILATION_HPP