src/share/vm/compiler/abstractCompiler.hpp
Print this page
*** 25,50 ****
#ifndef SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
#define SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
#include "ci/compilerInterface.hpp"
- typedef void (*initializer)(void);
-
class AbstractCompiler : public CHeapObj<mtCompiler> {
- private:
- bool _is_initialized; // Mark whether compiler object is initialized
-
protected:
// Used for tracking global state of compiler runtime initialization
! enum { uninitialized, initializing, initialized };
! // This method will call the initialization method "f" once (per compiler class/subclass)
! // and do so without holding any locks
! void initialize_runtimes(initializer f, volatile int* state);
public:
! AbstractCompiler() : _is_initialized(false) {}
// Name of this compiler
virtual const char* name() = 0;
// Missing feature tests
--- 25,46 ----
#ifndef SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
#define SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP
#include "ci/compilerInterface.hpp"
class AbstractCompiler : public CHeapObj<mtCompiler> {
protected:
+ volatile int _compiler_state;
// Used for tracking global state of compiler runtime initialization
! enum { uninitialized, initializing, initialized, failed };
! // This method returns true for the first compiler thread that reaches that methos.
! // This thread will initialize the compiler object.
! bool should_perform_init();
public:
! AbstractCompiler() : _compiler_state(uninitialized) {}
// Name of this compiler
virtual const char* name() = 0;
// Missing feature tests
*** 72,92 ****
bool is_shark() { return true; }
#endif // SHARK
#endif // TIERED
// Customization
! virtual bool needs_stubs () = 0;
!
! void mark_initialized() { _is_initialized = true; }
! bool is_initialized() { return _is_initialized; }
!
! virtual void initialize() = 0;
!
// Compilation entry point for methods
! virtual void compile_method(ciEnv* env,
! ciMethod* target,
! int entry_bci) {
ShouldNotReachHere();
}
// Print compilation timers and statistics
--- 68,84 ----
bool is_shark() { return true; }
#endif // SHARK
#endif // TIERED
// Customization
! virtual void initialize () = 0;
! bool is_initialized () { return _compiler_state == initialized; }
! // Get/set state of compiler objects
! bool is_state_failed () { return _compiler_state == failed; }
! void set_state (int state);
// Compilation entry point for methods
! virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
ShouldNotReachHere();
}
// Print compilation timers and statistics