/*
* 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 "precompiled.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
#include "code/relocInfo.hpp"
#include "compiler/disassembler.hpp"
#include "interpreter/bytecode.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframe.hpp"
#include "services/memoryService.hpp"
#ifdef TARGET_ARCH_x86
# include "nativeInst_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "nativeInst_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "nativeInst_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "nativeInst_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "nativeInst_ppc.hpp"
#endif
#ifdef COMPILER1
#include "c1/c1_Runtime1.hpp"
#endif
// align the size to CodeEntryAlignment
return
- (int)CodeHeap::header_size();
}
// This must be consistent with the CodeBlob constructor's layout actions.
// align the size to CodeEntryAlignment
return size;
}
// Creates a simple CodeBlob. Sets up the size of the different regions.
CodeBlob::CodeBlob(const char* name, int header_size, int size, int frame_complete, int locs_size) {
// Note: If UseRelocIndex is enabled, there needs to be (at least) one
// extra word for the relocation information, containing the reloc
// index table length. Unfortunately, the reloc index table imple-
// mentation is not easily understandable and thus it is not clear
// what exactly the format is supposed to be. For now, we just turn
// off the use of this table (gri 7/6/2000).
_data_offset = size;
_frame_size = 0;
}
// Creates a CodeBlob from a CodeBuffer. Sets up the size of the different regions,
// and copy code and relocation info.
const char* name,
CodeBuffer* cb,
int header_size,
int size,
int frame_complete,
int frame_size,
) {
cb->copy_code_and_locs_to(this);
#ifdef COMPILER1
// probably wrong for tiered
#endif // COMPILER1
}
// Danger Will Robinson! This method allocates a big
// chunk of memory, its your job to free it.
if (p != NULL) {
// We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps
} else {
}
}
// Do not hold the CodeCache lock during name formatting.
if (PrintStubCode) {
}
}
}
// Track memory usage statistic after releasing CodeCache_lock
}
if (_oop_maps) {
}
}
}
//----------------------------------------------------------------------------------------------------
// Implementation of BufferBlob
{}
// align the size to CodeEntryAlignment
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
{}
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
return p;
}
{
}
// Track memory usage statistic after releasing CodeCache_lock
}
//----------------------------------------------------------------------------------------------------
// Implementation of AdapterBlob
}
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of MethodHandlesAdapterBlob
// align the size to CodeEntryAlignment
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of RuntimeStub
const char* name,
CodeBuffer* cb,
int size,
int frame_complete,
int frame_size,
)
{
}
CodeBuffer* cb,
int frame_complete,
int frame_size,
bool caller_must_gc_arguments)
{
{
stub = new (size) RuntimeStub(stub_name, cb, size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments);
}
return stub;
}
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
// operator new shared by all singletons:
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
//----------------------------------------------------------------------------------------------------
// Implementation of DeoptimizationBlob
CodeBuffer* cb,
int size,
int unpack_offset,
int frame_size
)
{
#ifdef COMPILER1
#endif
}
CodeBuffer* cb,
int unpack_offset,
int frame_size)
{
{
size,
}
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of UncommonTrapBlob
#ifdef COMPILER2
CodeBuffer* cb,
int size,
int frame_size
)
{}
CodeBuffer* cb,
int frame_size)
{
{
}
return blob;
}
#endif // COMPILER2
//----------------------------------------------------------------------------------------------------
// Implementation of ExceptionBlob
#ifdef COMPILER2
CodeBuffer* cb,
int size,
int frame_size
)
{}
CodeBuffer* cb,
int frame_size)
{
{
}
return blob;
}
#endif // COMPILER2
//----------------------------------------------------------------------------------------------------
// Implementation of SafepointBlob
CodeBuffer* cb,
int size,
int frame_size
)
{}
CodeBuffer* cb,
int frame_size)
{
{
}
return blob;
}
//----------------------------------------------------------------------------------------------------
// Verification and printing
}
}
}
// unimplemented
}
}
}
// unimplemented
}
}
}
// unimplemented
}
}
}
}