sharkBuilder.hpp revision 1612
1612N/A * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 1612N/A * Copyright 2008, 2009, 2010 Red Hat, Inc. 1612N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1612N/A * This code is free software; you can redistribute it and/or modify it 1612N/A * under the terms of the GNU General Public License version 2 only, as 1612N/A * published by the Free Software Foundation. 1612N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1612N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1612N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1612N/A * version 2 for more details (a copy is included in the LICENSE file that 1612N/A * You should have received a copy of the GNU General Public License version 1612N/A * 2 along with this work; if not, write to the Free Software Foundation, 1612N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1612N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1612N/A // The code buffer we are building into. 1612N/A // Helpers for accessing structures. 1612N/A // Helpers for accessing arrays. 1612N/A // Helpers for creating intrinsics and external functions. 1612N/A // Intrinsics and external functions, part 1: VM calls. 1612N/A // These are functions declared with JRT_ENTRY and JRT_EXIT, 1612N/A // macros which flip the thread from _thread_in_Java to 1612N/A // _thread_in_vm and back. VM calls always safepoint, and can 1612N/A // therefore throw exceptions. VM calls require of setup and 1612N/A // teardown, and must be called with SharkTopLevelBlock::call_vm. 1612N/A // Intrinsics and external functions, part 2: High-level non-VM calls. 1612N/A // These are called like normal functions. The stack is not set 1612N/A // up for walking so they must not safepoint or throw exceptions, 1612N/A // or call anything that might. 1612N/A // Intrinsics and external functions, part 3: semi-VM calls. 1612N/A // These are special cases that do VM call stuff but are invoked 1612N/A // as though they were normal calls. This is acceptable so long 1612N/A // as the method that calls them returns to its immediately that 1612N/A // the semi VM call returns. 1612N/A // Intrinsics and external functions, part 4: Native-Java transition. 1612N/A // This is a special case in that it is invoked during a thread 1612N/A // state transition. The stack must be set up for walking, and it 1612N/A // may throw exceptions, but the state is _thread_in_native_trans. 1612N/A // Intrinsics and external functions, part 5: Low-level non-VM calls. 1612N/A // These have the same caveats as the high-level non-VM calls 1612N/A // above. They are not accessed directly; rather, you should 1612N/A // access them via the various Create* methods below. 1612N/A // Public interface to low-level non-VM calls. 1612N/A // Flags for CreateMemoryBarrier. 1612N/A // Helpers for accessing the code buffer. 1612N/A // Helpers for creating basic blocks. 1612N/A // NB don't use unless SharkFunction::CreateBlock is unavailable. 1612N/A // XXX these are hacky and should be removed.