/*
* Copyright 2008, 2009 Red Hat, Inc.
* 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.
*
*/
#include "ci/ciInstanceKlass.hpp"
#include "ci/ciMethod.hpp"
#include "ci/ciTypeFlow.hpp"
#include "code/debugInfoRec.hpp"
#include "code/dependencies.hpp"
#include "memory/allocation.hpp"
#include "shark/llvmHeaders.hpp"
#include "shark/sharkBuilder.hpp"
// Base classes used to track various values through the compilation.
// SharkCompileInvariants is used to track values which remain the
// same for the top-level method and any inlined methods it may have
// (ie for the whole compilation). SharkTargetInvariants is used to
// track values which differ between methods.
protected:
private:
// Top-level broker for HotSpot's Compiler Interface.
//
// Its main purpose is to allow the various CI classes to access
// oops in the VM without having to worry about safepointing. In
// addition to this it acts as a holder for various recorders and
// memory allocators.
//
// Accessing this directly is kind of ugly, so it's private. Add
// new accessors below if you need something from it.
private:
return _env;
}
// The SharkBuilder that is used to build LLVM IR.
protected:
return _builder;
}
// Pointer to this thread's JavaThread object. This is not
// available until a short way into SharkFunction creation
// so a setter is required. Assertions are used to enforce
// invariance.
protected:
return _thread;
}
}
// Objects that handle various aspects of the compilation.
protected:
return env()->debug_info();
}
return env()->dependencies();
}
return builder()->code_buffer();
}
// Commonly used classes
protected:
return env()->Object_klass();
}
return env()->Throwable_klass();
}
};
protected:
_max_monitors(count_monitors()) {}
_max_monitors(count_monitors()) {}
private:
int count_monitors();
private:
int _max_monitors;
// The method being compiled.
protected:
return _target;
}
// Typeflow analysis of the method being compiled.
protected:
return _flow;
}
// Properties of the method.
protected:
int max_locals() const {
return target()->max_locals();
}
int max_stack() const {
}
int max_monitors() const {
return _max_monitors;
}
int arg_size() const {
}
bool is_static() const {
}
bool is_synchronized() const {
return target()->is_synchronized();
}
};
#endif // SHARE_VM_SHARK_SHARKINVARIANTS_HPP