/*
* Copyright 2008, 2009, 2010 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.
*
*/
#ifndef SHARE_VM_SHARK_SHARKBUILDER_HPP
#define SHARE_VM_SHARK_SHARKBUILDER_HPP
#include "ci/ciType.hpp"
#include "memory/barrierSet.hpp"
#include "memory/cardTableModRefBS.hpp"
#include "shark/llvmHeaders.hpp"
#include "shark/llvmValue.hpp"
#include "shark/sharkCodeBuffer.hpp"
#include "shark/sharkEntry.hpp"
#include "shark/sharkType.hpp"
#include "shark/sharkValue.hpp"
friend class SharkCompileInvariants;
public:
// The code buffer we are building into.
private:
protected:
return _code_buffer;
}
// Helpers for accessing structures.
public:
const char *name = "");
const char *name = "");
// Helpers for accessing arrays.
public:
int element_bytes,
const char* name = "");
const char* name = "");
const char* name = "");
// Helpers for creating intrinsics and external functions.
private:
const char* ret);
const char* params,
const char* ret);
const char* params,
const char* ret);
// Intrinsics and external functions, part 1: VM calls.
// These are functions declared with JRT_ENTRY and JRT_EXIT,
// macros which flip the thread from _thread_in_Java to
// _thread_in_vm and back. VM calls always safepoint, and can
// therefore throw exceptions. VM calls require of setup and
// teardown, and must be called with SharkTopLevelBlock::call_vm.
public:
// Intrinsics and external functions, part 2: High-level non-VM calls.
// These are called like normal functions. The stack is not set
// up for walking so they must not safepoint or throw exceptions,
// or call anything that might.
public:
// Intrinsics and external functions, part 3: semi-VM calls.
// These are special cases that do VM call stuff but are invoked
// as though they were normal calls. This is acceptable so long
// as the method that calls them returns to its immediately that
// the semi VM call returns.
public:
// Intrinsics and external functions, part 4: Native-Java transition.
// This is a special case in that it is invoked during a thread
// state transition. The stack must be set up for walking, and it
// may throw exceptions, but the state is _thread_in_native_trans.
public:
// Intrinsics and external functions, part 5: Low-level non-VM calls.
// These have the same caveats as the high-level non-VM calls
// above. They are not accessed directly; rather, you should
// access them via the various Create* methods below.
private:
// Public interface to low-level non-VM calls.
public:
// Flags for CreateMemoryBarrier.
public:
enum BarrierFlags {
};
// HotSpot memory barriers
public:
// Helpers for accessing the code buffer.
public:
}
const char* name = "");
// Helpers for creating basic blocks.
// NB don't use unless SharkFunction::CreateBlock is unavailable.
// XXX these are hacky and should be removed.
public:
const char* name="") const;
};
#endif // SHARE_VM_SHARK_SHARKBUILDER_HPP