This commit is contained in:
Jesper Wilhelmsson 2018-04-13 03:05:19 +02:00
commit 468c1c19bb
451 changed files with 11174 additions and 5810 deletions

View File

@ -453,6 +453,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
ALWAYS_DEFINES_JVM="-DNOMINMAX"
fi
###############################################################################

View File

@ -114,17 +114,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
fi
# Math library
if test "x$OPENJDK_TARGET_OS" != xsolaris; then
BASIC_JVM_LIBS="$LIBM"
else
# FIXME: This hard-coded path is not really proper.
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
BASIC_SOLARIS_LIBM_LIBS="/usr/lib/amd64/libm.so.1"
elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then
BASIC_SOLARIS_LIBM_LIBS="/usr/lib/sparcv9/libm.so.1"
fi
BASIC_JVM_LIBS="$BASIC_SOLARIS_LIBM_LIBS"
fi
BASIC_JVM_LIBS="$LIBM"
# Dynamic loading library
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then

View File

@ -60,6 +60,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=little
;;
ia64)
VAR_CPU=ia64
VAR_CPU_ARCH=ia64
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=little
;;
m68k)
VAR_CPU=m68k
VAR_CPU_ARCH=m68k

View File

@ -113,6 +113,11 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_sparc/solaris_sparc.il
endif
# Exclude warnings in devstudio 12.6
ifeq ($(CC_VERSION_NUMBER), 5.15)
DISABLED_WARNINGS_solstudio := SEC_ARR_OUTSIDE_BOUND_READ \
SEC_ARR_OUTSIDE_BOUND_WRITE
endif
endif
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
@ -154,6 +159,7 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_clang := tautological-compare, \
DISABLED_WARNINGS_solstudio := $(DISABLED_WARNINGS_solstudio), \
DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
1540-1088 1500-010, \
ASFLAGS := $(JVM_ASFLAGS), \

View File

@ -403,11 +403,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS), \
LIBS_linux := $(LIBM), \
LIBS_macosx := $(LIBM), \
LIBS_aix := $(LIBM),\
LIBS_unix := -lawt -ljvm -ljava $(LCMS_LIBS) $(LIBM), \
LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
))

View File

@ -65,8 +65,11 @@ else
exeinvoke.c exestack-gap.c
endif
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exesigtest := -ljvm
ifeq ($(OPENJDK_TARGET_OS), windows)
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c
endif
$(eval $(call SetupTestFilesCompilation, BUILD_HOTSPOT_JTREG_LIBRARIES, \

View File

@ -1,5 +1,5 @@
'\" t
.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
.\" This code is free software; you can redistribute it and/or modify it
@ -1178,65 +1178,6 @@ Verify all classes\&.
.PP
These options control the runtime behavior of the Java HotSpot VM\&.
.PP
\-XX:+CheckEndorsedAndExtDirs
.RS 4
Enables the option to prevent the
\fBjava\fR
command from running a Java application if it uses the endorsed\-standards override mechanism or the extension mechanism\&. This option checks if an application is using one of these mechanisms by checking the following:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBjava\&.ext\&.dirs\fR
or
\fBjava\&.endorsed\&.dirs\fR
system property is set\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBlib/endorsed\fR
directory exists and is not empty\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The
\fBlib/ext\fR
directory contains any JAR files other than those of the JDK\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The system\-wide platform\-specific extension directory contains any JAR files\&.
.RE
.RE
.PP
\-XX:+DisableAttachMechanism
.RS 4
Enables the option that disables the mechanism that lets tools attach to the JVM\&. By default, this option is disabled, meaning that the attach mechanism is enabled and you can use tools such as

View File

@ -995,8 +995,10 @@ definitions %{
source_hpp %{
#include "asm/macroAssembler.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "opto/addnode.hpp"
class CallStubImpl {

View File

@ -35,8 +35,9 @@
#include "compiler/disassembler.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_aarch64.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.hpp"
#include "opto/compile.hpp"
#include "opto/intrinsicnode.hpp"
#include "opto/node.hpp"
@ -46,7 +47,6 @@
#include "runtime/jniHandles.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/thread.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CardTable.hpp"
@ -173,7 +173,7 @@ int MacroAssembler::patch_oop(address insn_addr, address o) {
// instruction.
if (Instruction_aarch64::extract(insn, 31, 21) == 0b11010010101) {
// Move narrow OOP
narrowOop n = oopDesc::encode_heap_oop((oop)o);
narrowOop n = CompressedOops::encode((oop)o);
Instruction_aarch64::patch(insn_addr, 20, 5, n >> 16);
Instruction_aarch64::patch(insn_addr+4, 20, 5, n & 0xffff);
instructions = 2;
@ -3712,7 +3712,7 @@ void MacroAssembler::store_klass_gap(Register dst, Register src) {
}
}
// Algorithm must match oop.inline.hpp encode_heap_oop.
// Algorithm must match CompressedOops::encode.
void MacroAssembler::encode_heap_oop(Register d, Register s) {
#ifdef ASSERT
verify_heapbase("MacroAssembler::encode_heap_oop: heap base corrupted?");

View File

@ -27,7 +27,6 @@
#define CPU_AARCH64_VM_NATIVEINST_AARCH64_HPP
#include "asm/assembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -31,7 +31,7 @@
class G1BarrierSetAssembler: public ModRefBarrierSetAssembler {
protected:
void gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators,
Register addr, Register count, , int callee_saved_regs);
Register addr, Register count, int callee_saved_regs);
void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
Register addr, Register count, Register tmp);
};

View File

@ -32,7 +32,7 @@
class BarrierSetAssembler: public CHeapObj<mtGC> {
public:
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
Register addr, Register count, , int callee_saved_regs) {}
Register addr, Register count, int callee_saved_regs) {}
virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
Register addr, Register count, Register tmp) {}
};

View File

@ -44,6 +44,7 @@
void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
Register addr, Register count, Register tmp) {
BLOCK_COMMENT("CardTablePostBarrier");
BarrierSet* bs = Universe::heap()->barrier_set();
CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
CardTable* ct = ctbs->card_table();
assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");

View File

@ -31,7 +31,7 @@
class ModRefBarrierSetAssembler: public BarrierSetAssembler {
protected:
virtual void gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators,
Register addr, Register count, , int callee_saved_regs) {}
Register addr, Register count, int callee_saved_regs) {}
virtual void gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
Register addr, Register count, Register tmp) {}

View File

@ -37,7 +37,7 @@
#define __ _masm->
Interpreter::SignatureHandlerGenerator::SignatureHandlerGenerator(
InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(
const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) {
_masm = new MacroAssembler(buffer);
_abi_offset = 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,6 @@
#define CPU_ARM_VM_NATIVEINST_ARM_HPP
#include "asm/macroAssembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -27,7 +27,6 @@
#include "asm/macroAssembler.hpp"
#include "code/codeCache.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"
#include "runtime/thread.hpp"

View File

@ -27,8 +27,9 @@
#include "code/codeCache.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_arm.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.hpp"
#include "runtime/handles.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
@ -105,7 +106,7 @@ static void raw_set_data(RawNativeInstruction* si, intptr_t x, oop* oop_addr, Me
uintptr_t nx = 0;
int val_size = 32;
if (oop_addr != NULL) {
narrowOop encoded_oop = oopDesc::encode_heap_oop(*oop_addr);
narrowOop encoded_oop = CompressedOops::encode(*oop_addr);
nx = encoded_oop;
} else if (metadata_addr != NULL) {
assert((*metadata_addr)->is_klass(), "expected Klass");
@ -240,4 +241,3 @@ NativeCall* nativeCall_before(address return_address) {
assert(NativeCall::is_call_before(return_address), "must be");
return nativeCall_at(call_for(return_address));
}

View File

@ -27,7 +27,6 @@
#include "asm/macroAssembler.hpp"
#include "code/codeCache.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -27,7 +27,8 @@
#include "assembler_arm.inline.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_arm.hpp"
#include "oops/oop.inline.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/oop.hpp"
#include "runtime/safepoint.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
@ -40,7 +41,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
uintptr_t d = ni->data();
guarantee((d >> 32) == 0, "not narrow oop");
narrowOop no = d;
oop o = oopDesc::decode_heap_oop(no);
oop o = CompressedOops::decode(no);
guarantee(cast_from_oop<intptr_t>(o) == (intptr_t)x, "instructions must match");
} else {
ni->set_data((intptr_t)x);

View File

@ -2877,7 +2877,7 @@ class StubGenerator: public StubCodeGenerator {
// 'to' is the beginning of the region
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->arraycopy_epilogue(this, decorators, true, to, count, tmp);
bs->arraycopy_epilogue(_masm, decorators, true, to, count, tmp);
if (status) {
__ mov(R0, 0); // OK
@ -2954,7 +2954,7 @@ class StubGenerator: public StubCodeGenerator {
}
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->arraycopy_prologue(this, decorators, true, to, count, callee_saved_regs);
bs->arraycopy_prologue(_masm, decorators, true, to, count, callee_saved_regs);
// save arguments for barrier generation (after the pre barrier)
__ mov(saved_count, count);
@ -3220,7 +3220,7 @@ class StubGenerator: public StubCodeGenerator {
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->arraycopy_prologue(this, decorators, true, to, count, callee_saved_regs);
bs->arraycopy_prologue(_masm, decorators, true, to, count, callee_saved_regs);
#ifndef AARCH64
const RegisterSet caller_saved_regs = RegisterSet(R4,R6) | RegisterSet(R8,R9) | altFP_7_11;
@ -3298,7 +3298,7 @@ class StubGenerator: public StubCodeGenerator {
__ sub(to, to, AsmOperand(copied, lsl, LogBytesPerHeapOop)); // initial to value
__ mov(R12, copied); // count arg scratched by post barrier
bs->arraycopy_epilogue(this, decorators, true, to, R12, R3);
bs->arraycopy_epilogue(_masm, decorators, true, to, R12, R3);
assert_different_registers(R3,R12,LR,copied,saved_count);
inc_counter_np(SharedRuntime::_checkcast_array_copy_ctr, R3, R12);

View File

@ -384,7 +384,7 @@
// Constructors
inline frame(intptr_t* sp);
frame(intptr_t* sp, address pc);
inline frame(intptr_t* sp, address pc);
inline frame(intptr_t* sp, address pc, intptr_t* unextended_sp);
private:

View File

@ -27,8 +27,10 @@
#include "asm/macroAssembler.inline.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_ppc.hpp"
#include "oops/oop.inline.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/oop.hpp"
#include "runtime/handles.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/ostream.hpp"
@ -194,7 +196,7 @@ intptr_t NativeMovConstReg::data() const {
CodeBlob* cb = CodeCache::find_blob_unsafe(addr);
if (MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) {
narrowOop no = (narrowOop)MacroAssembler::get_narrow_oop(addr, cb->content_begin());
return cast_from_oop<intptr_t>(oopDesc::decode_heap_oop(no));
return cast_from_oop<intptr_t>(CompressedOops::decode(no));
} else {
assert(MacroAssembler::is_load_const_from_method_toc_at(addr), "must be load_const_from_pool");
@ -415,4 +417,3 @@ void NativeCallTrampolineStub::set_destination(address new_destination) {
*(address*)(ctable + destination_toc_offset()) = new_destination;
}

View File

@ -27,7 +27,6 @@
#define CPU_PPC_VM_NATIVEINST_PPC_HPP
#include "asm/macroAssembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointMechanism.hpp"

View File

@ -27,8 +27,9 @@
#include "asm/assembler.inline.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_ppc.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.hpp"
#include "runtime/safepoint.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
@ -57,7 +58,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type,
"how to encode else?");
narrowOop no = (type() == relocInfo::oop_type) ?
oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x);
CompressedOops::encode((oop)x) : Klass::encode_klass((Klass*)x);
nativeMovConstReg_at(addr())->set_narrow_oop(no, code());
}
} else {

View File

@ -465,10 +465,10 @@
// Constructors
public:
frame(intptr_t* sp);
inline frame(intptr_t* sp);
// To be used, if sp was not extended to match callee's calling convention.
frame(intptr_t* sp, address pc);
frame(intptr_t* sp, address pc, intptr_t* unextended_sp);
inline frame(intptr_t* sp, address pc);
inline frame(intptr_t* sp, address pc, intptr_t* unextended_sp);
// Access frame via stack pointer.
inline intptr_t* sp_addr_at(int index) const { return &sp()[index]; }

View File

@ -33,6 +33,7 @@
#include "gc/shared/cardTableBarrierSet.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "opto/compile.hpp"
#include "opto/intrinsicnode.hpp"
@ -1286,7 +1287,7 @@ int MacroAssembler::patch_compare_immediate_32(address pos, int64_t np) {
int MacroAssembler::patch_load_narrow_oop(address pos, oop o) {
assert(UseCompressedOops, "Can only patch compressed oops");
narrowOop no = oopDesc::encode_heap_oop(o);
narrowOop no = CompressedOops::encode(o);
return patch_load_const_32to64(pos, no);
}
@ -1304,7 +1305,7 @@ int MacroAssembler::patch_load_narrow_klass(address pos, Klass* k) {
int MacroAssembler::patch_compare_immediate_narrow_oop(address pos, oop o) {
assert(UseCompressedOops, "Can only patch compressed oops");
narrowOop no = oopDesc::encode_heap_oop(o);
narrowOop no = CompressedOops::encode(o);
return patch_compare_immediate_32(pos, no);
}

View File

@ -29,7 +29,6 @@
#define CPU_S390_VM_NATIVEINST_S390_HPP
#include "asm/macroAssembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -41,17 +41,6 @@ REGISTER_DECLARATION(FloatRegister, Ftos_d , F0); // for doubles
REGISTER_DECLARATION(FloatRegister, Ftos_d1, F0); // for 1st part of double
REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double
#ifndef DONT_USE_REGISTER_DEFINES
#define Otos_i O0
#define Otos_l O0
#define Otos_l1 O0
#define Otos_l2 O1
#define Ftos_f F0
#define Ftos_d F0
#define Ftos_d1 F0
#define Ftos_d2 F1
#endif // DONT_USE_REGISTER_DEFINES
class InterpreterMacroAssembler: public MacroAssembler {
protected:
// Interpreter specific version of call_VM_base

View File

@ -998,8 +998,13 @@ AddressLiteral MacroAssembler::constant_metadata_address(Metadata* obj) {
AddressLiteral MacroAssembler::constant_oop_address(jobject obj) {
assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "not an oop");
#ifdef ASSERT
{
ThreadInVMfromUnknown tiv;
assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "not an oop");
}
#endif
int oop_index = oop_recorder()->find_index(obj);
return AddressLiteral(obj, oop_Relocation::spec(oop_index));
}
@ -3703,7 +3708,7 @@ void MacroAssembler::g1_write_barrier_post(Register store_addr, Register new_val
// Called from init_globals() after universe_init() and before interpreter_init()
void g1_barrier_stubs_init() {
CollectedHeap* heap = Universe::heap();
if (heap->kind() == CollectedHeap::G1CollectedHeap) {
if (heap->kind() == CollectedHeap::G1) {
// Only needed for G1
if (dirty_card_log_enqueue == 0) {
G1BarrierSet* bs =

View File

@ -199,41 +199,6 @@ REGISTER_DECLARATION(Register, ImethodDataPtr , I2); // Pointer to the current
REGISTER_DECLARATION(Register, Oexception , O0); // exception being thrown
REGISTER_DECLARATION(Register, Oissuing_pc , O1); // where the exception is coming from
// These must occur after the declarations above
#ifndef DONT_USE_REGISTER_DEFINES
#define Gthread AS_REGISTER(Register, Gthread)
#define Gmethod AS_REGISTER(Register, Gmethod)
#define Gmegamorphic_method AS_REGISTER(Register, Gmegamorphic_method)
#define Ginline_cache_reg AS_REGISTER(Register, Ginline_cache_reg)
#define Gargs AS_REGISTER(Register, Gargs)
#define Lthread_cache AS_REGISTER(Register, Lthread_cache)
#define Gframe_size AS_REGISTER(Register, Gframe_size)
#define Gtemp AS_REGISTER(Register, Gtemp)
#define Lesp AS_REGISTER(Register, Lesp)
#define Lbcp AS_REGISTER(Register, Lbcp)
#define Lmethod AS_REGISTER(Register, Lmethod)
#define Llocals AS_REGISTER(Register, Llocals)
#define Lmonitors AS_REGISTER(Register, Lmonitors)
#define Lbyte_code AS_REGISTER(Register, Lbyte_code)
#define Lscratch AS_REGISTER(Register, Lscratch)
#define Lscratch2 AS_REGISTER(Register, Lscratch2)
#define LcpoolCache AS_REGISTER(Register, LcpoolCache)
#define Lentry_args AS_REGISTER(Register, Lentry_args)
#define I5_savedSP AS_REGISTER(Register, I5_savedSP)
#define O5_savedSP AS_REGISTER(Register, O5_savedSP)
#define IdispatchAddress AS_REGISTER(Register, IdispatchAddress)
#define ImethodDataPtr AS_REGISTER(Register, ImethodDataPtr)
#define Oexception AS_REGISTER(Register, Oexception)
#define Oissuing_pc AS_REGISTER(Register, Oissuing_pc)
#endif
// Address is an abstraction used to represent a memory location.
//
// Note: A register location is represented via a Register, not

View File

@ -26,7 +26,6 @@
#define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
#include "asm/macroAssembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -22,9 +22,6 @@
*
*/
// make sure the defines don't screw up the declarations later on in this file
#define DONT_USE_REGISTER_DEFINES
// Note: precompiled headers can not be used in this file because of the above
// definition

View File

@ -154,62 +154,6 @@ CONSTANT_REGISTER_DECLARATION(Register, I7 , (RegisterImpl::ibase + 7));
CONSTANT_REGISTER_DECLARATION(Register, FP , (RegisterImpl::ibase + 6));
CONSTANT_REGISTER_DECLARATION(Register, SP , (RegisterImpl::obase + 6));
//
// Because sparc has so many registers, #define'ing values for the is
// beneficial in code size and the cost of some of the dangers of
// defines. We don't use them on Intel because win32 uses asm
// directives which use the same names for registers as Hotspot does,
// so #defines would screw up the inline assembly. If a particular
// file has a problem with these defines then it's possible to turn
// them off in that file by defining DONT_USE_REGISTER_DEFINES.
// register_definition_sparc.cpp does that so that it's able to
// provide real definitions of these registers for use in debuggers
// and such.
//
#ifndef DONT_USE_REGISTER_DEFINES
#define noreg ((Register)(noreg_RegisterEnumValue))
#define G0 ((Register)(G0_RegisterEnumValue))
#define G1 ((Register)(G1_RegisterEnumValue))
#define G2 ((Register)(G2_RegisterEnumValue))
#define G3 ((Register)(G3_RegisterEnumValue))
#define G4 ((Register)(G4_RegisterEnumValue))
#define G5 ((Register)(G5_RegisterEnumValue))
#define G6 ((Register)(G6_RegisterEnumValue))
#define G7 ((Register)(G7_RegisterEnumValue))
#define O0 ((Register)(O0_RegisterEnumValue))
#define O1 ((Register)(O1_RegisterEnumValue))
#define O2 ((Register)(O2_RegisterEnumValue))
#define O3 ((Register)(O3_RegisterEnumValue))
#define O4 ((Register)(O4_RegisterEnumValue))
#define O5 ((Register)(O5_RegisterEnumValue))
#define O6 ((Register)(O6_RegisterEnumValue))
#define O7 ((Register)(O7_RegisterEnumValue))
#define L0 ((Register)(L0_RegisterEnumValue))
#define L1 ((Register)(L1_RegisterEnumValue))
#define L2 ((Register)(L2_RegisterEnumValue))
#define L3 ((Register)(L3_RegisterEnumValue))
#define L4 ((Register)(L4_RegisterEnumValue))
#define L5 ((Register)(L5_RegisterEnumValue))
#define L6 ((Register)(L6_RegisterEnumValue))
#define L7 ((Register)(L7_RegisterEnumValue))
#define I0 ((Register)(I0_RegisterEnumValue))
#define I1 ((Register)(I1_RegisterEnumValue))
#define I2 ((Register)(I2_RegisterEnumValue))
#define I3 ((Register)(I3_RegisterEnumValue))
#define I4 ((Register)(I4_RegisterEnumValue))
#define I5 ((Register)(I5_RegisterEnumValue))
#define I6 ((Register)(I6_RegisterEnumValue))
#define I7 ((Register)(I7_RegisterEnumValue))
#define FP ((Register)(FP_RegisterEnumValue))
#define SP ((Register)(SP_RegisterEnumValue))
#endif // DONT_USE_REGISTER_DEFINES
// Use FloatRegister as shortcut
class FloatRegisterImpl;
typedef FloatRegisterImpl* FloatRegister;
@ -321,59 +265,6 @@ CONSTANT_REGISTER_DECLARATION(FloatRegister, F58 , (58));
CONSTANT_REGISTER_DECLARATION(FloatRegister, F60 , (60));
CONSTANT_REGISTER_DECLARATION(FloatRegister, F62 , (62));
#ifndef DONT_USE_REGISTER_DEFINES
#define fnoreg ((FloatRegister)(fnoreg_FloatRegisterEnumValue))
#define F0 ((FloatRegister)( F0_FloatRegisterEnumValue))
#define F1 ((FloatRegister)( F1_FloatRegisterEnumValue))
#define F2 ((FloatRegister)( F2_FloatRegisterEnumValue))
#define F3 ((FloatRegister)( F3_FloatRegisterEnumValue))
#define F4 ((FloatRegister)( F4_FloatRegisterEnumValue))
#define F5 ((FloatRegister)( F5_FloatRegisterEnumValue))
#define F6 ((FloatRegister)( F6_FloatRegisterEnumValue))
#define F7 ((FloatRegister)( F7_FloatRegisterEnumValue))
#define F8 ((FloatRegister)( F8_FloatRegisterEnumValue))
#define F9 ((FloatRegister)( F9_FloatRegisterEnumValue))
#define F10 ((FloatRegister)( F10_FloatRegisterEnumValue))
#define F11 ((FloatRegister)( F11_FloatRegisterEnumValue))
#define F12 ((FloatRegister)( F12_FloatRegisterEnumValue))
#define F13 ((FloatRegister)( F13_FloatRegisterEnumValue))
#define F14 ((FloatRegister)( F14_FloatRegisterEnumValue))
#define F15 ((FloatRegister)( F15_FloatRegisterEnumValue))
#define F16 ((FloatRegister)( F16_FloatRegisterEnumValue))
#define F17 ((FloatRegister)( F17_FloatRegisterEnumValue))
#define F18 ((FloatRegister)( F18_FloatRegisterEnumValue))
#define F19 ((FloatRegister)( F19_FloatRegisterEnumValue))
#define F20 ((FloatRegister)( F20_FloatRegisterEnumValue))
#define F21 ((FloatRegister)( F21_FloatRegisterEnumValue))
#define F22 ((FloatRegister)( F22_FloatRegisterEnumValue))
#define F23 ((FloatRegister)( F23_FloatRegisterEnumValue))
#define F24 ((FloatRegister)( F24_FloatRegisterEnumValue))
#define F25 ((FloatRegister)( F25_FloatRegisterEnumValue))
#define F26 ((FloatRegister)( F26_FloatRegisterEnumValue))
#define F27 ((FloatRegister)( F27_FloatRegisterEnumValue))
#define F28 ((FloatRegister)( F28_FloatRegisterEnumValue))
#define F29 ((FloatRegister)( F29_FloatRegisterEnumValue))
#define F30 ((FloatRegister)( F30_FloatRegisterEnumValue))
#define F31 ((FloatRegister)( F31_FloatRegisterEnumValue))
#define F32 ((FloatRegister)( F32_FloatRegisterEnumValue))
#define F34 ((FloatRegister)( F34_FloatRegisterEnumValue))
#define F36 ((FloatRegister)( F36_FloatRegisterEnumValue))
#define F38 ((FloatRegister)( F38_FloatRegisterEnumValue))
#define F40 ((FloatRegister)( F40_FloatRegisterEnumValue))
#define F42 ((FloatRegister)( F42_FloatRegisterEnumValue))
#define F44 ((FloatRegister)( F44_FloatRegisterEnumValue))
#define F46 ((FloatRegister)( F46_FloatRegisterEnumValue))
#define F48 ((FloatRegister)( F48_FloatRegisterEnumValue))
#define F50 ((FloatRegister)( F50_FloatRegisterEnumValue))
#define F52 ((FloatRegister)( F52_FloatRegisterEnumValue))
#define F54 ((FloatRegister)( F54_FloatRegisterEnumValue))
#define F56 ((FloatRegister)( F56_FloatRegisterEnumValue))
#define F58 ((FloatRegister)( F58_FloatRegisterEnumValue))
#define F60 ((FloatRegister)( F60_FloatRegisterEnumValue))
#define F62 ((FloatRegister)( F62_FloatRegisterEnumValue))
#endif // DONT_USE_REGISTER_DEFINES
// Maximum number of incoming arguments that can be passed in i registers.
const int SPARC_ARGS_IN_REGS_NUM = 6;

View File

@ -26,8 +26,9 @@
#include "asm/assembler.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_sparc.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.hpp"
#include "runtime/safepoint.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
@ -97,7 +98,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
if (format() != 0) {
assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "only narrow oops or klasses case");
jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x);
jint np = type() == relocInfo::oop_type ? CompressedOops::encode((oop)x) : Klass::encode_klass((Klass*)x);
inst &= ~Assembler::hi22(-1);
inst |= Assembler::hi22((intptr_t)np);
if (verify_only) {

View File

@ -4080,6 +4080,16 @@ void Assembler::pshuflw(XMMRegister dst, Address src, int mode) {
emit_operand(dst, src);
emit_int8(mode & 0xFF);
}
void Assembler::evshufi64x2(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8, int vector_len) {
assert(VM_Version::supports_evex(), "requires EVEX support");
assert(vector_len == Assembler::AVX_256bit || vector_len == Assembler::AVX_512bit, "");
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
attributes.set_is_evex_instruction();
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
emit_int8(0x43);
emit_int8((unsigned char)(0xC0 | encode));
emit_int8(imm8 & 0xFF);
}
void Assembler::psrldq(XMMRegister dst, int shift) {
// Shift left 128 bit value in dst XMMRegister by shift number of bytes.
@ -6201,6 +6211,27 @@ void Assembler::vpxor(XMMRegister dst, XMMRegister nds, Address src, int vector_
emit_operand(dst, src);
}
void Assembler::evpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
assert(VM_Version::supports_evex(), "requires EVEX support");
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
attributes.set_is_evex_instruction();
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
emit_int8((unsigned char)0xEF);
emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::evpxorq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) {
assert(VM_Version::supports_evex(), "requires EVEX support");
assert(dst != xnoreg, "sanity");
InstructionMark im(this);
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
attributes.set_is_evex_instruction();
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit);
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
emit_int8((unsigned char)0xEF);
emit_operand(dst, src);
}
// vinserti forms
@ -6786,6 +6817,16 @@ void Assembler::vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, in
emit_int8((unsigned char)mask);
}
void Assembler::evpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask, int vector_len) {
assert(VM_Version::supports_vpclmulqdq(), "Requires vector carryless multiplication support");
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true);
attributes.set_is_evex_instruction();
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes);
emit_int8(0x44);
emit_int8((unsigned char)(0xC0 | encode));
emit_int8((unsigned char)mask);
}
void Assembler::vzeroupper() {
if (VM_Version::supports_vzeroupper()) {
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false);

View File

@ -1663,6 +1663,9 @@ private:
void pshuflw(XMMRegister dst, XMMRegister src, int mode);
void pshuflw(XMMRegister dst, Address src, int mode);
// Shuffle packed values at 128 bit granularity
void evshufi64x2(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8, int vector_len);
// Shift Right by bytes Logical DoubleQuadword Immediate
void psrldq(XMMRegister dst, int shift);
// Shift Left by bytes Logical DoubleQuadword Immediate
@ -2046,6 +2049,9 @@ private:
void pxor(XMMRegister dst, XMMRegister src);
void vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len);
void vpxor(XMMRegister dst, XMMRegister nds, Address src, int vector_len);
void evpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len);
void evpxorq(XMMRegister dst, XMMRegister nds, Address src, int vector_len);
// vinserti forms
void vinserti128(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8);
@ -2108,7 +2114,7 @@ private:
// Carry-Less Multiplication Quadword
void pclmulqdq(XMMRegister dst, XMMRegister src, int mask);
void vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask);
void evpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask, int vector_len);
// AVX instruction which is used to clear upper 128 bits of YMM registers and
// to avoid transaction penalty between AVX and SSE states. There is no
// penalty if legacy SSE instructions are encoded using VEX prefix because

View File

@ -10119,6 +10119,16 @@ void MacroAssembler::update_byte_crc32(Register crc, Register val, Register tabl
xorl(crc, Address(table, val, Address::times_4, 0));
}
/**
* Fold four 128-bit data chunks
*/
void MacroAssembler::fold_128bit_crc32_avx512(XMMRegister xcrc, XMMRegister xK, XMMRegister xtmp, Register buf, int offset) {
evpclmulhdq(xtmp, xK, xcrc, Assembler::AVX_512bit); // [123:64]
evpclmulldq(xcrc, xK, xcrc, Assembler::AVX_512bit); // [63:0]
evpxorq(xcrc, xcrc, Address(buf, offset), Assembler::AVX_512bit /* vector_len */);
evpxorq(xcrc, xcrc, xtmp, Assembler::AVX_512bit /* vector_len */);
}
/**
* Fold 128-bit data chunk
*/
@ -10224,6 +10234,34 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, Regi
shrl(len, 4);
jcc(Assembler::zero, L_tail_restore);
// Fold total 512 bits of polynomial on each iteration
if (VM_Version::supports_vpclmulqdq()) {
Label Parallel_loop, L_No_Parallel;
cmpl(len, 8);
jccb(Assembler::less, L_No_Parallel);
movdqu(xmm0, ExternalAddress(StubRoutines::x86::crc_by128_masks_addr() + 32));
evmovdquq(xmm1, Address(buf, 0), Assembler::AVX_512bit);
movdl(xmm5, crc);
evpxorq(xmm1, xmm1, xmm5, Assembler::AVX_512bit);
addptr(buf, 64);
subl(len, 7);
evshufi64x2(xmm0, xmm0, xmm0, 0x00, Assembler::AVX_512bit); //propagate the mask from 128 bits to 512 bits
BIND(Parallel_loop);
fold_128bit_crc32_avx512(xmm1, xmm0, xmm5, buf, 0);
addptr(buf, 64);
subl(len, 4);
jcc(Assembler::greater, Parallel_loop);
vextracti64x2(xmm2, xmm1, 0x01);
vextracti64x2(xmm3, xmm1, 0x02);
vextracti64x2(xmm4, xmm1, 0x03);
jmp(L_fold_512b);
BIND(L_No_Parallel);
}
// Fold crc into first bytes of vector
movdqa(xmm1, Address(buf, 0));
movdl(rax, xmm1);

View File

@ -1498,6 +1498,14 @@ public:
// 0x11 - multiply upper 64 bits [64:127]
Assembler::vpclmulqdq(dst, nds, src, 0x11);
}
void evpclmulldq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
// 0x00 - multiply lower 64 bits [0:63]
Assembler::evpclmulqdq(dst, nds, src, 0x00, vector_len);
}
void evpclmulhdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) {
// 0x11 - multiply upper 64 bits [64:127]
Assembler::evpclmulqdq(dst, nds, src, 0x11, vector_len);
}
// Data
@ -1723,6 +1731,7 @@ public:
// Fold 8-bit data
void fold_8bit_crc32(Register crc, Register table, Register tmp);
void fold_8bit_crc32(XMMRegister crc, Register table, XMMRegister xtmp, Register tmp);
void fold_128bit_crc32_avx512(XMMRegister xcrc, XMMRegister xK, XMMRegister xtmp, Register buf, int offset);
// Compress char[] array to byte[].
void char_array_compress(Register src, Register dst, Register len,

View File

@ -26,7 +26,6 @@
#define CPU_X86_VM_NATIVEINST_X86_HPP
#include "asm/assembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointMechanism.hpp"

View File

@ -26,6 +26,7 @@
#include "asm/macroAssembler.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_x86.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/safepoint.hpp"
@ -51,9 +52,9 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
// both compressed oops and compressed classes look the same
if (Universe::heap()->is_in_reserved((oop)x)) {
if (verify_only) {
guarantee(*(uint32_t*) disp == oopDesc::encode_heap_oop((oop)x), "instructions must match");
guarantee(*(uint32_t*) disp == CompressedOops::encode((oop)x), "instructions must match");
} else {
*(int32_t*) disp = oopDesc::encode_heap_oop((oop)x);
*(int32_t*) disp = CompressedOops::encode((oop)x);
}
} else {
if (verify_only) {

View File

@ -27,6 +27,7 @@
#include "asm/macroAssembler.inline.hpp"
#include "code/debugInfoRec.hpp"
#include "code/icBuffer.hpp"
#include "code/nativeInst.hpp"
#include "code/vtableStubs.hpp"
#include "gc/shared/gcLocker.hpp"
#include "interpreter/interpreter.hpp"

View File

@ -41,6 +41,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/align.hpp"
#include "utilities/formatBuffer.hpp"
#include "vm_version_x86.hpp"
#include "vmreg_x86.inline.hpp"
#ifdef COMPILER1

View File

@ -665,6 +665,7 @@ void VM_Version::get_processor_features() {
_features &= ~CPU_AVX512BW;
_features &= ~CPU_AVX512VL;
_features &= ~CPU_AVX512_VPOPCNTDQ;
_features &= ~CPU_VPCLMULQDQ;
}
if (UseAVX < 2)

View File

@ -334,6 +334,7 @@ protected:
#define CPU_FMA ((uint64_t)UCONST64(0x800000000)) // FMA instructions
#define CPU_VZEROUPPER ((uint64_t)UCONST64(0x1000000000)) // Vzeroupper instruction
#define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount
#define CPU_VPCLMULQDQ ((uint64_t)UCONST64(0x4000000000)) //Vector carryless multiplication
enum Extended_Family {
// AMD
@ -542,6 +543,8 @@ protected:
result |= CPU_AVX512VL;
if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vpopcntdq != 0)
result |= CPU_AVX512_VPOPCNTDQ;
if (_cpuid_info.sef_cpuid7_ecx.bits.vpclmulqdq != 0)
result |= CPU_VPCLMULQDQ;
}
}
if(_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0)
@ -819,6 +822,7 @@ public:
static bool supports_fma() { return (_features & CPU_FMA) != 0 && supports_avx(); }
static bool supports_vzeroupper() { return (_features & CPU_VZEROUPPER) != 0; }
static bool supports_vpopcntdq() { return (_features & CPU_AVX512_VPOPCNTDQ) != 0; }
static bool supports_vpclmulqdq() { return (_features & CPU_VPCLMULQDQ) != 0; }
// Intel features
static bool is_intel_family_core() { return is_intel() &&

View File

@ -27,7 +27,6 @@
#define CPU_ZERO_VM_NATIVEINST_ZERO_HPP
#include "asm/assembler.hpp"
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -24,6 +24,7 @@
*/
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"
#include "services/attachListener.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"
#include "services/attachListener.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"

View File

@ -152,6 +152,13 @@ static jlong initial_time_count=0;
static int clock_tics_per_sec = 100;
// If the VM might have been created on the primordial thread, we need to resolve the
// primordial thread stack bounds and check if the current thread might be the
// primordial thread in places. If we know that the primordial thread is never used,
// such as when the VM was created by one of the standard java launchers, we can
// avoid this
static bool suppress_primordial_thread_resolution = false;
// For diagnostics to print a message once. see run_periodic_checks
static sigset_t check_signal_done;
static bool check_signals = true;
@ -917,6 +924,9 @@ void os::free_thread(OSThread* osthread) {
// Check if current thread is the primordial thread, similar to Solaris thr_main.
bool os::is_primordial_thread(void) {
if (suppress_primordial_thread_resolution) {
return false;
}
char dummy;
// If called before init complete, thread stack bottom will be null.
// Can be called if fatal error occurs before initialization.
@ -1644,10 +1654,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
//
// Dynamic loader will make all stacks executable after
// this function returns, and will not do that again.
#ifdef ASSERT
ThreadsListHandle tlh;
assert(tlh.length() == 0, "no Java threads should exist yet.");
#endif
assert(Threads::number_of_threads() == 0, "no Java threads should exist yet.");
} else {
warning("You have loaded library %s which might have disabled stack guard. "
"The VM will try to fix the stack guard now.\n"
@ -4936,7 +4943,11 @@ jint os::init_2(void) {
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
return JNI_ERR;
}
Linux::capture_initial_stack(JavaThread::stack_size_at_create());
suppress_primordial_thread_resolution = Arguments::created_by_java_launcher();
if (!suppress_primordial_thread_resolution) {
Linux::capture_initial_stack(JavaThread::stack_size_at_create());
}
#if defined(IA32)
workaround_expand_exec_shield_cs_limit();

View File

@ -23,6 +23,7 @@
*/
#include "jvm.h"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "utilities/globalDefinitions.hpp"
#include "runtime/frame.inline.hpp"
@ -30,6 +31,7 @@
#include "runtime/os.hpp"
#include "services/memTracker.hpp"
#include "utilities/align.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmError.hpp"

View File

@ -27,6 +27,7 @@
#include "runtime/arguments.hpp"
#include "runtime/os.hpp"
#include "runtime/thread.hpp"
#include "utilities/debug.hpp"
#include "utilities/vmError.hpp"
#include <sys/types.h>
@ -122,11 +123,20 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
pc = (address) info->si_addr;
}
// Needed to make it possible to call SafeFetch.. APIs in error handling.
if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
return;
}
// Needed because asserts may happen in error handling too.
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return;
}
#endif // CAN_SHOW_REGISTERS_ON_ASSERT
VMError::report_and_die(NULL, sig, pc, info, ucVoid);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"
#include "services/attachListener.hpp"

View File

@ -24,7 +24,7 @@
*/
#include "precompiled.hpp"
#include "runtime/frame.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/thread.hpp"
frame JavaThread::pd_last_frame() {

View File

@ -32,6 +32,7 @@
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "os_share_bsd.hpp"
#include "prims/jniFastGetField.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -50,6 +50,7 @@
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/timer.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
#ifdef BUILTIN_SIM
@ -306,6 +307,13 @@ JVM_handle_linux_signal(int sig,
}
}
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return 1;
}
#endif
JavaThread* thread = NULL;
VMThread* vmthread = NULL;
if (os::Linux::signal_handlers_are_installed) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -47,6 +47,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/timer.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
@ -311,6 +312,13 @@ extern "C" int JVM_handle_linux_signal(int sig, siginfo_t* info,
}
}
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return 1;
}
#endif
JavaThread* thread = NULL;
VMThread* vmthread = NULL;
if (os::Linux::signal_handlers_are_installed) {

View File

@ -51,6 +51,7 @@
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/timer.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
@ -266,6 +267,13 @@ JVM_handle_linux_signal(int sig,
}
}
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return 1;
}
#endif
JavaThread* thread = NULL;
VMThread* vmthread = NULL;
if (os::Linux::signal_handlers_are_installed) {

View File

@ -54,6 +54,7 @@
#include "runtime/thread.inline.hpp"
#include "runtime/timer.hpp"
#include "utilities/events.hpp"
#include "utilities/debug.hpp"
#include "utilities/vmError.hpp"
// put OS-includes here
@ -270,6 +271,13 @@ JVM_handle_linux_signal(int sig,
}
}
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return 1;
}
#endif
JavaThread* thread = NULL;
VMThread* vmthread = NULL;
if (os::Linux::signal_handlers_are_installed) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -49,6 +49,7 @@
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/timer.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
@ -513,6 +514,13 @@ JVM_handle_linux_signal(int sig,
}
}
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return 1;
}
#endif
JavaThread* thread = NULL;
VMThread* vmthread = NULL;
if (os::Linux::signal_handlers_are_installed) {

View File

@ -32,6 +32,7 @@
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "os_share_linux.hpp"
#include "prims/jniFastGetField.hpp"
@ -50,6 +51,7 @@
#include "runtime/timer.hpp"
#include "services/memTracker.hpp"
#include "utilities/align.hpp"
#include "utilities/debug.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
@ -303,6 +305,13 @@ JVM_handle_linux_signal(int sig,
}
}
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
handle_assert_poison_fault(ucVoid, info->si_addr);
return 1;
}
#endif
JavaThread* thread = NULL;
VMThread* vmthread = NULL;
if (os::Linux::signal_handlers_are_installed) {

View File

@ -32,6 +32,7 @@
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "os_share_solaris.hpp"
#include "prims/jniFastGetField.hpp"

View File

@ -29,8 +29,8 @@
#include "classfile/javaAssertions.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/shared/gcLocker.hpp"
#include "interpreter/abstractInterpreter.hpp"
#include "jvmci/compilerRuntime.hpp"
#include "jvmci/jvmciRuntime.hpp"

View File

@ -32,7 +32,6 @@
#include "compiler/compilerOracle.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gcLocker.hpp"
#include "jvmci/compilerRuntime.hpp"
#include "jvmci/jvmciRuntime.hpp"
#include "oops/method.inline.hpp"
@ -40,6 +39,7 @@
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/xmlstream.hpp"

View File

@ -25,10 +25,10 @@
#include "precompiled.hpp"
#include "asm/codeBuffer.hpp"
#include "compiler/disassembler.hpp"
#include "gc/shared/gcLocker.hpp"
#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/icache.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "utilities/align.hpp"
#include "utilities/copy.hpp"
#include "utilities/xmlstream.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,6 @@
#define SHARE_VM_C1_C1_FPUSTACKSIM_HPP
#include "c1/c1_FrameMap.hpp"
#include "memory/allocation.hpp"
#include "utilities/macros.hpp"
// Provides location for forward declaration of this class, which is

View File

@ -27,7 +27,6 @@
#include "c1/c1_IR.hpp"
#include "c1/c1_Instruction.hpp"
#include "memory/allocation.hpp"
class Optimizer {
private:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,8 +32,7 @@
#include "oops/oop.inline.hpp"
#include "utilities/align.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/copy.hpp"
#ifndef PRODUCT
#define TRACE_BCEA(level, code) \

View File

@ -57,6 +57,7 @@
#include "runtime/init.hpp"
#include "runtime/reflection.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/thread.inline.hpp"
#include "trace/tracing.hpp"
@ -540,7 +541,7 @@ ciKlass* ciEnv::get_klass_by_index_impl(const constantPoolHandle& cpool,
// Calculate accessibility the hard way.
if (!k->is_loaded()) {
is_accessible = false;
} else if (k->loader() != accessor->loader() &&
} else if (!oopDesc::equals(k->loader(), accessor->loader()) &&
get_klass_by_name_impl(accessor, cpool, k->name(), true) == NULL) {
// Loaded only remotely. Not linked yet.
is_accessible = false;
@ -591,7 +592,7 @@ ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
index = cpool->object_to_cp_index(cache_index);
oop obj = cpool->resolved_references()->obj_at(cache_index);
if (obj != NULL) {
if (obj == Universe::the_null_sentinel()) {
if (oopDesc::equals(obj, Universe::the_null_sentinel())) {
return ciConstant(T_OBJECT, get_object(NULL));
}
BasicType bt = T_OBJECT;

View File

@ -27,7 +27,6 @@
#include "jvm.h"
#include "ci/ciClassList.hpp"
#include "memory/allocation.hpp"
#include "utilities/accessFlags.hpp"
#include "utilities/ostream.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,6 @@
#include "ci/ciBaseObject.hpp"
#include "ci/ciClassList.hpp"
#include "memory/allocation.hpp"
#include "runtime/handles.hpp"
#include "runtime/jniHandles.hpp"

View File

@ -27,7 +27,6 @@
#include "ci/ciBaseObject.hpp"
#include "ci/ciClassList.hpp"
#include "memory/allocation.hpp"
#include "runtime/handles.hpp"
#include "runtime/jniHandles.hpp"

View File

@ -249,7 +249,7 @@ ciObject* ciObjectFactory::get(oop key) {
// into the cache.
Handle keyHandle(Thread::current(), key);
ciObject* new_object = create_new_object(keyHandle());
assert(keyHandle() == new_object->get_oop(), "must be properly recorded");
assert(oopDesc::equals(keyHandle(), new_object->get_oop()), "must be properly recorded");
init_ident_of(new_object);
assert(Universe::heap()->is_in_reserved(new_object->get_oop()), "must be");
@ -450,8 +450,8 @@ ciKlass* ciObjectFactory::get_unloaded_klass(ciKlass* accessing_klass,
for (int i=0; i<_unloaded_klasses->length(); i++) {
ciKlass* entry = _unloaded_klasses->at(i);
if (entry->name()->equals(name) &&
entry->loader() == loader &&
entry->protection_domain() == domain) {
oopDesc::equals(entry->loader(), loader) &&
oopDesc::equals(entry->protection_domain(), domain)) {
// We've found a match.
return entry;
}

View File

@ -37,7 +37,6 @@
#include "classfile/verificationType.hpp"
#include "classfile/verifier.hpp"
#include "classfile/vmSymbols.hpp"
#include "gc/shared/gcLocker.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.hpp"
@ -62,6 +61,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/perfData.hpp"
#include "runtime/reflection.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/signature.hpp"
#include "runtime/timer.hpp"
#include "services/classLoadingService.hpp"
@ -69,6 +69,7 @@
#include "trace/traceMacros.hpp"
#include "utilities/align.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/copy.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
@ -5423,6 +5424,8 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
// has to be changed accordingly.
ik->set_initial_method_idnum(ik->methods()->length());
ik->set_this_class_index(_this_class_index);
if (is_anonymous()) {
// _this_class_index is a CONSTANT_Class entry that refers to this
// anonymous class itself. If this class needs to refer to its own methods or

View File

@ -64,7 +64,7 @@
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/os.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/timer.hpp"
#include "runtime/vm_version.hpp"
@ -148,8 +148,6 @@ ClassPathEntry* ClassLoader::_last_append_entry = NULL;
#if INCLUDE_CDS
ClassPathEntry* ClassLoader::_app_classpath_entries = NULL;
ClassPathEntry* ClassLoader::_last_app_classpath_entry = NULL;
GrowableArray<char*>* ClassLoader::_boot_modules_array = NULL;
GrowableArray<char*>* ClassLoader::_platform_modules_array = NULL;
SharedPathsMiscInfo* ClassLoader::_shared_paths_misc_info = NULL;
#endif

View File

@ -233,12 +233,6 @@ class ClassLoader: AllStatic {
// Last entry in linked list of appended ClassPathEntry instances
static ClassPathEntry* _last_append_entry;
// Array of module names associated with the boot class loader
CDS_ONLY(static GrowableArray<char*>* _boot_modules_array;)
// Array of module names associated with the platform class loader
CDS_ONLY(static GrowableArray<char*>* _platform_modules_array;)
// Info used by CDS
CDS_ONLY(static SharedPathsMiscInfo * _shared_paths_misc_info;)

View File

@ -56,7 +56,6 @@
#include "classfile/packageEntry.hpp"
#include "classfile/systemDictionary.hpp"
#include "code/codeCache.hpp"
#include "gc/shared/gcLocker.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.inline.hpp"
@ -74,6 +73,7 @@
#include "runtime/mutex.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/synchronizer.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/macros.hpp"
@ -201,7 +201,7 @@ class VerifyContainsOopClosure : public OopClosure {
VerifyContainsOopClosure(oop target) : _target(target), _found(false) {}
void do_oop(oop* p) {
if (p != NULL && *p == _target) {
if (p != NULL && oopDesc::equals(RawAccess<>::oop_load(p), _target)) {
_found = true;
}
}
@ -380,7 +380,7 @@ void ClassLoaderData::record_dependency(const Klass* k) {
// Just return if this dependency is to a class with the same or a parent
// class_loader.
if (from == to || java_lang_ClassLoader::isAncestor(from, to)) {
if (oopDesc::equals(from, to) || java_lang_ClassLoader::isAncestor(from, to)) {
return; // this class loader is in the parent list, no need to add it.
}
}
@ -1223,17 +1223,6 @@ GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() {
return array;
}
bool ClassLoaderDataGraph::unload_list_contains(const void* x) {
assert(SafepointSynchronize::is_at_safepoint(), "only safe to call at safepoint");
for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
// Needs fixing, see JDK-8199007.
if (cld->metaspace_or_null() != NULL && Metaspace::contains(x)) {
return true;
}
}
return false;
}
#ifndef PRODUCT
bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) {
for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {

View File

@ -155,8 +155,6 @@ class ClassLoaderDataGraph : public AllStatic {
static void print() { print_on(tty); }
static void verify();
static bool unload_list_contains(const void* x);
// instance and array class counters
static inline size_t num_instance_classes();
static inline size_t num_array_classes();

View File

@ -29,6 +29,7 @@
#include "logging/logMessage.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/metaspaceShared.hpp"
#include "oops/compressedOops.inline.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/numberSeq.hpp"
#include <sys/stat.h>
@ -182,7 +183,7 @@ void CompactSymbolTableWriter::add(unsigned int hash, Symbol *symbol) {
}
void CompactStringTableWriter::add(unsigned int hash, oop string) {
CompactHashtableWriter::add(hash, oopDesc::encode_heap_oop(string));
CompactHashtableWriter::add(hash, CompressedOops::encode(string));
}
void CompactSymbolTableWriter::dump(CompactHashtable<Symbol*, char> *cht) {

View File

@ -26,8 +26,10 @@
#define SHARE_VM_CLASSFILE_COMPACTHASHTABLE_INLINE_HPP
#include "classfile/compactHashtable.hpp"
#include "classfile/javaClasses.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/oop.hpp"
template <class T, class N>
inline Symbol* CompactHashtable<T, N>::decode_entry(CompactHashtable<Symbol*, char>* const t,
@ -45,7 +47,7 @@ template <class T, class N>
inline oop CompactHashtable<T, N>::decode_entry(CompactHashtable<oop, char>* const t,
u4 offset, const char* name, int len) {
narrowOop obj = (narrowOop)offset;
oop string = oopDesc::decode_heap_oop(obj);
oop string = CompressedOops::decode(obj);
if (java_lang_String::equals(string, (jchar*)name, len)) {
return string;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -884,6 +884,10 @@ static void switchover_constant_pool(BytecodeConstantPool* bpool,
if (new_methods->length() > 0) {
ConstantPool* cp = bpool->create_constant_pool(CHECK);
if (cp != klass->constants()) {
// Copy resolved anonymous class into new constant pool.
if (klass->is_anonymous()) {
cp->klass_at_put(klass->this_class_index(), klass);
}
klass->class_loader_data()->add_to_deallocate_list(klass->constants());
klass->set_constants(cp);
cp->set_pool_holder(klass);

View File

@ -29,7 +29,6 @@
#include "classfile/protectionDomainCache.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/systemDictionaryShared.hpp"
#include "gc/shared/gcLocker.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/iterator.hpp"
@ -38,6 +37,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "utilities/hashtable.inline.hpp"
// Optimization: if any dictionary needs resizing, we set this flag,
@ -161,13 +161,13 @@ bool Dictionary::resize_if_needed() {
bool DictionaryEntry::contains_protection_domain(oop protection_domain) const {
#ifdef ASSERT
if (protection_domain == instance_klass()->protection_domain()) {
if (oopDesc::equals(protection_domain, instance_klass()->protection_domain())) {
// Ensure this doesn't show up in the pd_set (invariant)
bool in_pd_set = false;
for (ProtectionDomainEntry* current = pd_set_acquire();
current != NULL;
current = current->next()) {
if (current->object_no_keepalive() == protection_domain) {
if (oopDesc::equals(current->object_no_keepalive(), protection_domain)) {
in_pd_set = true;
break;
}
@ -179,7 +179,7 @@ bool DictionaryEntry::contains_protection_domain(oop protection_domain) const {
}
#endif /* ASSERT */
if (protection_domain == instance_klass()->protection_domain()) {
if (oopDesc::equals(protection_domain, instance_klass()->protection_domain())) {
// Succeeds trivially
return true;
}
@ -187,7 +187,7 @@ bool DictionaryEntry::contains_protection_domain(oop protection_domain) const {
for (ProtectionDomainEntry* current = pd_set_acquire();
current != NULL;
current = current->next()) {
if (current->object_no_keepalive() == protection_domain) return true;
if (oopDesc::equals(current->object_no_keepalive(), protection_domain)) return true;
}
return false;
}

View File

@ -33,6 +33,7 @@
#include "code/dependencyContext.hpp"
#include "code/pcDesc.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/linkResolver.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/oopFactory.hpp"
@ -57,6 +58,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/vframe.inline.hpp"
#include "utilities/align.hpp"
@ -870,7 +872,7 @@ void java_lang_Class::set_mirror_module_field(Klass* k, Handle mirror, Handle mo
} else {
assert(Universe::is_module_initialized() ||
(ModuleEntryTable::javabase_defined() &&
(module() == ModuleEntryTable::javabase_moduleEntry()->module())),
(oopDesc::equals(module(), ModuleEntryTable::javabase_moduleEntry()->module()))),
"Incorrect java.lang.Module specification while creating mirror");
set_module(mirror(), module());
}
@ -947,7 +949,7 @@ void java_lang_Class::create_mirror(Klass* k, Handle class_loader,
}
// set the classLoader field in the java_lang_Class instance
assert(class_loader() == k->class_loader(), "should be same");
assert(oopDesc::equals(class_loader(), k->class_loader()), "should be same");
set_class_loader(mirror(), class_loader());
// Setup indirection from klass->mirror
@ -1461,9 +1463,9 @@ BasicType java_lang_Class::primitive_type(oop java_class) {
// Note: create_basic_type_mirror above initializes ak to a non-null value.
type = ArrayKlass::cast(ak)->element_type();
} else {
assert(java_class == Universe::void_mirror(), "only valid non-array primitive");
assert(oopDesc::equals(java_class, Universe::void_mirror()), "only valid non-array primitive");
}
assert(Universe::java_mirror(type) == java_class, "must be consistent");
assert(oopDesc::equals(Universe::java_mirror(type), java_class), "must be consistent");
return type;
}
@ -3504,7 +3506,7 @@ void java_lang_boxing_object::print(BasicType type, jvalue* value, outputStream*
// Support for java_lang_ref_Reference
bool java_lang_ref_Reference::is_referent_field(oop obj, ptrdiff_t offset) {
assert(!oopDesc::is_null(obj), "sanity");
assert(obj != NULL, "sanity");
if (offset != java_lang_ref_Reference::referent_offset) {
return false;
}
@ -3836,14 +3838,14 @@ Symbol* java_lang_invoke_MethodType::as_signature(oop mt, bool intern_if_not_fou
}
bool java_lang_invoke_MethodType::equals(oop mt1, oop mt2) {
if (mt1 == mt2)
if (oopDesc::equals(mt1, mt2))
return true;
if (rtype(mt1) != rtype(mt2))
if (!oopDesc::equals(rtype(mt1), rtype(mt2)))
return false;
if (ptype_count(mt1) != ptype_count(mt2))
return false;
for (int i = ptype_count(mt1) - 1; i >= 0; i--) {
if (ptype(mt1, i) != ptype(mt2, i))
if (!oopDesc::equals(ptype(mt1, i), ptype(mt2, i)))
return false;
}
return true;
@ -4041,7 +4043,7 @@ bool java_lang_ClassLoader::isAncestor(oop loader, oop cl) {
// This loop taken verbatim from ClassLoader.java:
do {
acl = parent(acl);
if (cl == acl) {
if (oopDesc::equals(cl, acl)) {
return true;
}
assert(++loop_count > 0, "loop_count overflow");
@ -4071,7 +4073,7 @@ bool java_lang_ClassLoader::is_trusted_loader(oop loader) {
oop cl = SystemDictionary::java_system_loader();
while(cl != NULL) {
if (cl == loader) return true;
if (oopDesc::equals(cl, loader)) return true;
cl = parent(cl);
}
return false;
@ -4131,7 +4133,7 @@ int java_lang_System::err_offset_in_bytes() { return static_err_offset; }
bool java_lang_System::has_security_manager() {
InstanceKlass* ik = SystemDictionary::System_klass();
oop base = ik->static_field_base_raw();
return !oopDesc::is_null(base->obj_field(static_security_offset));
return base->obj_field(static_security_offset) != NULL;
}
int java_lang_Class::_klass_offset;

View File

@ -132,7 +132,7 @@ ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(Handle protection_do
ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, Handle protection_domain) {
for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) {
if (e->object_no_keepalive() == protection_domain()) {
if (oopDesc::equals(e->object_no_keepalive(), protection_domain())) {
return e;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,6 +32,7 @@
#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/arguments.hpp"
#include "runtime/os.inline.hpp"
#include "utilities/ostream.hpp"
SharedPathsMiscInfo::SharedPathsMiscInfo() {

View File

@ -29,7 +29,6 @@
#include "classfile/stringTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/gcLocker.inline.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/filemap.hpp"
@ -41,6 +40,7 @@
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "services/diagnosticCommand.hpp"
#include "utilities/hashtable.inline.hpp"
#include "utilities/macros.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,6 @@
#ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
#define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
#include "memory/allocation.hpp"
#include "utilities/hashtable.hpp"
template <class T, class N> class CompactHashtable;

View File

@ -29,7 +29,7 @@
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/gcLocker.inline.hpp"
#include "gc/shared/gcLocker.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/filemap.hpp"
#include "memory/metaspaceClosure.hpp"
@ -37,6 +37,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "services/diagnosticCommand.hpp"
#include "utilities/hashtable.inline.hpp"

View File

@ -43,7 +43,6 @@
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "compiler/compileBroker.hpp"
#include "gc/shared/gcLocker.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "interpreter/bytecodeStream.hpp"
#include "interpreter/interpreter.hpp"
@ -53,6 +52,7 @@
#include "memory/metaspaceClosure.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/access.inline.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/instanceRefKlass.hpp"
#include "oops/klass.inline.hpp"
@ -75,6 +75,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/signature.hpp"
#include "services/classLoadingService.hpp"
#include "services/diagnosticCommand.hpp"
@ -181,7 +182,7 @@ bool SystemDictionary::is_system_class_loader(oop class_loader) {
return false;
}
return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() ||
class_loader == _java_system_loader);
oopDesc::equals(class_loader, _java_system_loader));
}
// Returns true if the passed class loader is the platform class loader.
@ -390,7 +391,7 @@ Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
((quicksuperk = childk->super()) != NULL) &&
((quicksuperk->name() == class_name) &&
(quicksuperk->class_loader() == class_loader()))) {
(oopDesc::equals(quicksuperk->class_loader(), class_loader())))) {
return quicksuperk;
} else {
PlaceholderEntry* probe = placeholders()->get_entry(p_index, p_hash, child_name, loader_data);
@ -524,7 +525,7 @@ void SystemDictionary::double_lock_wait(Handle lockObject, TRAPS) {
bool calledholdinglock
= ObjectSynchronizer::current_thread_holds_lock((JavaThread*)THREAD, lockObject);
assert(calledholdinglock,"must hold lock for notify");
assert((!(lockObject() == _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait");
assert((!oopDesc::equals(lockObject(), _system_loader_lock_obj) && !is_parallelCapable(lockObject)), "unexpected double_lock_wait");
ObjectSynchronizer::notifyall(lockObject, THREAD);
intptr_t recursions = ObjectSynchronizer::complete_exit(lockObject, THREAD);
SystemDictionary_lock->wait();
@ -842,7 +843,7 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
// If everything was OK (no exceptions, no null return value), and
// class_loader is NOT the defining loader, do a little more bookkeeping.
if (!HAS_PENDING_EXCEPTION && k != NULL &&
k->class_loader() != class_loader()) {
!oopDesc::equals(k->class_loader(), class_loader())) {
check_constraints(d_hash, k, class_loader, false, THREAD);
@ -988,7 +989,7 @@ InstanceKlass* SystemDictionary::parse_stream(Symbol* class_name,
if (host_klass != NULL) {
// Create a new CLD for anonymous class, that uses the same class loader
// as the host_klass
guarantee(host_klass->class_loader() == class_loader(), "should be the same");
guarantee(oopDesc::equals(host_klass->class_loader(), class_loader()), "should be the same");
loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader);
} else {
loader_data = ClassLoaderData::class_loader_data(class_loader());
@ -1746,7 +1747,7 @@ void SystemDictionary::check_loader_lock_contention(Handle loader_lock, TRAPS) {
== ObjectSynchronizer::owner_other) {
// contention will likely happen, so increment the corresponding
// contention counter.
if (loader_lock() == _system_loader_lock_obj) {
if (oopDesc::equals(loader_lock(), _system_loader_lock_obj)) {
ClassLoader::sync_systemLoaderLockContentionRate()->inc();
} else {
ClassLoader::sync_nonSystemLoaderLockContentionRate()->inc();
@ -1829,7 +1830,7 @@ private:
BoolObjectClosure* _is_alive;
template <class T> void do_oop_work(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
oop obj = RawAccess<>::oop_load(p);
guarantee(_is_alive->do_object_b(obj), "Oop in protection domain cache table must be live");
}
@ -2228,7 +2229,7 @@ void SystemDictionary::update_dictionary(unsigned int d_hash,
// cleared if revocation occurs too often for this type
// NOTE that we must only do this when the class is initally
// defined, not each time it is referenced from a new class loader
if (k->class_loader() == class_loader()) {
if (oopDesc::equals(k->class_loader(), class_loader())) {
k->set_prototype_header(markOopDesc::biased_locking_prototype());
}
}
@ -2420,7 +2421,7 @@ Symbol* SystemDictionary::check_signature_loaders(Symbol* signature,
Handle loader1, Handle loader2,
bool is_method, TRAPS) {
// Nothing to do if loaders are the same.
if (loader1() == loader2()) {
if (oopDesc::equals(loader1(), loader2())) {
return NULL;
}
@ -2699,7 +2700,7 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
mirror = ss.as_java_mirror(class_loader, protection_domain,
SignatureStream::NCDFError, CHECK_(empty));
}
assert(!oopDesc::is_null(mirror), "%s", ss.as_symbol(THREAD)->as_C_string());
assert(mirror != NULL, "%s", ss.as_symbol(THREAD)->as_C_string());
if (ss.at_return_type())
rt = Handle(THREAD, mirror);
else
@ -2793,7 +2794,7 @@ Handle SystemDictionary::link_method_handle_constant(Klass* caller,
// which MemberName resolution doesn't handle. There's special logic on JDK side to handle them
// (see MethodHandles.linkMethodHandleConstant() and MethodHandles.findVirtualForMH()).
} else {
MethodHandles::resolve_MemberName(mname, caller, CHECK_(empty));
MethodHandles::resolve_MemberName(mname, caller, /*speculative_resolve*/false, CHECK_(empty));
}
// After method/field resolution succeeded, it's safe to resolve MH signature as well.

View File

@ -27,6 +27,7 @@
#include "classfile/systemDictionaryShared.hpp"
#include "classfile/verificationType.hpp"
#include "classfile/verifier.hpp"
#include "logging/log.hpp"
#include "runtime/handles.inline.hpp"
VerificationType VerificationType::from_tag(u1 tag) {

View File

@ -26,7 +26,6 @@
#define SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
#include "classfile/systemDictionary.hpp"
#include "memory/allocation.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.hpp"
#include "oops/symbol.hpp"

View File

@ -49,6 +49,7 @@
#include "runtime/jniHandles.inline.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/thread.hpp"
#include "services/threadService.hpp"
#include "utilities/align.hpp"

View File

@ -26,7 +26,6 @@
#define SHARE_VM_CLASSFILE_VERIFIER_HPP
#include "classfile/verificationType.hpp"
#include "gc/shared/gcLocker.hpp"
#include "oops/klass.hpp"
#include "oops/method.hpp"
#include "runtime/handles.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -294,6 +294,28 @@ AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
return blob;
}
VtableBlob::VtableBlob(const char* name, int size) :
BufferBlob(name, size) {
}
VtableBlob* VtableBlob::create(const char* name, int buffer_size) {
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
VtableBlob* blob = NULL;
unsigned int size = sizeof(VtableBlob);
// align the size to CodeEntryAlignment
size = align_code_offset(size);
size += align_up(buffer_size, oopSize);
assert(name != NULL, "must provide a name");
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
blob = new (size) VtableBlob(name, size);
}
// Track memory usage statistic after releasing CodeCache_lock
MemoryService::track_code_cache_memory_usage();
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of MethodHandlesAdapterBlob

View File

@ -58,6 +58,7 @@ struct CodeBlobType {
// RuntimeBlob : Non-compiled method code; generated glue code
// BufferBlob : Used for non-relocatable code such as interpreter, stubroutines, etc.
// AdapterBlob : Used to hold C2I/I2C adapters
// VtableBlob : Used for holding vtable chunks
// MethodHandlesAdapterBlob : Used to hold MethodHandles adapters
// RuntimeStub : Call to VM runtime methods
// SingletonBlob : Super-class for all blobs that exist in only one instance
@ -132,6 +133,7 @@ public:
virtual bool is_exception_stub() const { return false; }
virtual bool is_safepoint_stub() const { return false; }
virtual bool is_adapter_blob() const { return false; }
virtual bool is_vtable_blob() const { return false; }
virtual bool is_method_handles_adapter_blob() const { return false; }
virtual bool is_aot() const { return false; }
virtual bool is_compiled() const { return false; }
@ -380,6 +382,7 @@ class WhiteBox;
class BufferBlob: public RuntimeBlob {
friend class VMStructs;
friend class AdapterBlob;
friend class VtableBlob;
friend class MethodHandlesAdapterBlob;
friend class WhiteBox;
@ -425,6 +428,18 @@ public:
virtual bool is_adapter_blob() const { return true; }
};
//---------------------------------------------------------------------------------------------------
class VtableBlob: public BufferBlob {
private:
VtableBlob(const char*, int);
public:
// Creation
static VtableBlob* create(const char* name, int buffer_size);
// Typing
virtual bool is_vtable_blob() const { return true; }
};
//----------------------------------------------------------------------------------------------------
// MethodHandlesAdapterBlob: used to hold MethodHandles adapters

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,13 +26,15 @@
#include "aot/aotLoader.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
#include "code/codeHeapState.hpp"
#include "code/compiledIC.hpp"
#include "code/dependencies.hpp"
#include "code/icBuffer.hpp"
#include "code/nmethod.hpp"
#include "code/pcDesc.hpp"
#include "compiler/compileBroker.hpp"
#include "gc/shared/gcLocker.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/iterator.hpp"
#include "memory/resourceArea.hpp"
@ -47,6 +49,7 @@
#include "runtime/icache.hpp"
#include "runtime/java.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "runtime/sweeper.hpp"
#include "services/memoryService.hpp"
#include "trace/tracing.hpp"
@ -1363,8 +1366,17 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
print_summary(&s);
}
ttyLocker ttyl;
tty->print("%s", s.as_string());
{
ttyLocker ttyl;
tty->print("%s", s.as_string());
}
if (heap->full_count() == 0) {
LogTarget(Debug, codecache) lt;
if (lt.is_enabled()) {
CompileBroker::print_heapinfo(tty, "all", "4096"); // details, may be a lot!
}
}
}
heap->report_full();
@ -1639,3 +1651,54 @@ void CodeCache::log_state(outputStream* st) {
blob_count(), nmethod_count(), adapter_count(),
unallocated_capacity());
}
//---< BEGIN >--- CodeHeap State Analytics.
void CodeCache::aggregate(outputStream *out, const char* granularity) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::aggregate(out, (*heap), granularity);
}
}
void CodeCache::discard(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::discard(out, (*heap));
}
}
void CodeCache::print_usedSpace(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::print_usedSpace(out, (*heap));
}
}
void CodeCache::print_freeSpace(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::print_freeSpace(out, (*heap));
}
}
void CodeCache::print_count(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::print_count(out, (*heap));
}
}
void CodeCache::print_space(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::print_space(out, (*heap));
}
}
void CodeCache::print_age(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::print_age(out, (*heap));
}
}
void CodeCache::print_names(outputStream *out) {
FOR_ALL_ALLOCABLE_HEAPS(heap) {
CodeHeapState::print_names(out, (*heap));
}
}
//---< END >--- CodeHeap State Analytics.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -296,6 +296,17 @@ class CodeCache : AllStatic {
CodeHeap* heap = get_code_heap(code_blob_type);
return (heap != NULL) ? heap->full_count() : 0;
}
// CodeHeap State Analytics.
// interface methods for CodeHeap printing, called by CompileBroker
static void aggregate(outputStream *out, const char* granularity);
static void discard(outputStream *out);
static void print_usedSpace(outputStream *out);
static void print_freeSpace(outputStream *out);
static void print_count(outputStream *out);
static void print_space(outputStream *out);
static void print_age(outputStream *out);
static void print_names(outputStream *out);
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,229 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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_CODE_CODEHEAPSTATE_HPP
#define SHARE_CODE_CODEHEAPSTATE_HPP
#include "memory/heap.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
class CodeHeapState : public CHeapObj<mtCode> {
public:
enum compType {
noComp = 0, // must be! due to initialization by memset to zero
c1,
c2,
jvmci,
lastComp
};
enum blobType {
noType = 0, // must be! due to initialization by memset to zero
// The nMethod_* values correspond 1:1 to the CompiledMethod enum values.
nMethod_inuse, // executable. This is the "normal" state for a nmethod.
nMethod_notused, // assumed inactive, marked not entrant. Could be revived if necessary.
nMethod_notentrant, // no new activations allowed, marked for deoptimization. Old activations may still exist.
// Will transition to "zombie" after all activations are gone.
nMethod_zombie, // No more activations exist, ready for purge (remove from code cache).
nMethod_unloaded, // No activations exist, should not be called. Transient state on the way to "zombie".
nMethod_alive = nMethod_notentrant, // Combined state: nmethod may have activations, thus can't be purged.
nMethod_dead = nMethod_zombie, // Combined state: nmethod does not have any activations.
runtimeStub = nMethod_unloaded + 1,
ricochetStub,
deoptimizationStub,
uncommonTrapStub,
exceptionStub,
safepointStub,
adapterBlob,
mh_adapterBlob,
bufferBlob,
lastType
};
private:
static void prepare_StatArray(outputStream* out, size_t nElem, size_t granularity, const char* heapName);
static void prepare_FreeArray(outputStream* out, unsigned int nElem, const char* heapName);
static void prepare_TopSizeArray(outputStream* out, unsigned int nElem, const char* heapName);
static void prepare_SizeDistArray(outputStream* out, unsigned int nElem, const char* heapName);
static void discard_StatArray(outputStream* out);
static void discard_FreeArray(outputStream* out);
static void discard_TopSizeArray(outputStream* out);
static void discard_SizeDistArray(outputStream* out);
static void update_SizeDistArray(outputStream* out, unsigned int len);
static const char* get_heapName(CodeHeap* heap);
static unsigned int findHeapIndex(outputStream* out, const char* heapName);
static void get_HeapStatGlobals(outputStream* out, const char* heapName);
static void set_HeapStatGlobals(outputStream* out, const char* heapName);
static void printBox(outputStream* out, const char border, const char* text1, const char* text2);
static void print_blobType_legend(outputStream* out);
static void print_space_legend(outputStream* out);
static void print_age_legend(outputStream* out);
static void print_blobType_single(outputStream *ast, u2 /* blobType */ type);
static void print_count_single(outputStream *ast, unsigned short count);
static void print_space_single(outputStream *ast, unsigned short space);
static void print_age_single(outputStream *ast, unsigned int age);
static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl);
static blobType get_cbType(CodeBlob* cb);
public:
static void discard(outputStream* out, CodeHeap* heap);
static void aggregate(outputStream* out, CodeHeap* heap, const char* granularity);
static void print_usedSpace(outputStream* out, CodeHeap* heap);
static void print_freeSpace(outputStream* out, CodeHeap* heap);
static void print_count(outputStream* out, CodeHeap* heap);
static void print_space(outputStream* out, CodeHeap* heap);
static void print_age(outputStream* out, CodeHeap* heap);
static void print_names(outputStream* out, CodeHeap* heap);
};
//----------------
// StatElement
//----------------
// Each analysis granule is represented by an instance of
// this StatElement struct. It collects and aggregates all
// information describing the allocated contents of the granule.
// Free (unallocated) contents is not considered (see FreeBlk for that).
// All StatElements of a heap segment are stored in the related StatArray.
// Current size: 40 bytes + 8 bytes class header.
class StatElement : public CHeapObj<mtCode> {
public:
// A note on ages: The compilation_id easily overflows unsigned short in large systems
unsigned int t1_age; // oldest compilation_id of tier1 nMethods.
unsigned int t2_age; // oldest compilation_id of tier2 nMethods.
unsigned int tx_age; // oldest compilation_id of inactive/not entrant nMethods.
unsigned short t1_space; // in units of _segment_size to "prevent" overflow
unsigned short t2_space; // in units of _segment_size to "prevent" overflow
unsigned short tx_space; // in units of _segment_size to "prevent" overflow
unsigned short dead_space; // in units of _segment_size to "prevent" overflow
unsigned short stub_space; // in units of _segment_size to "prevent" overflow
unsigned short t1_count;
unsigned short t2_count;
unsigned short tx_count;
unsigned short dead_count;
unsigned short stub_count;
CompLevel level; // optimization level (see globalDefinitions.hpp)
//---< replaced the correct enum typing with u2 to save space.
u2 compiler; // compiler which generated this blob. Type is CodeHeapState::compType
u2 type; // used only if granularity == segment_size. Type is CodeHeapState::blobType
};
//-----------
// FreeBlk
//-----------
// Each free block in the code heap is represented by an instance
// of this FreeBlk struct. It collects all information we need to
// know about each free block.
// All FreeBlks of a heap segment are stored in the related FreeArray.
struct FreeBlk : public CHeapObj<mtCode> {
HeapBlock* start; // address of free block
unsigned int len; // length of free block
unsigned int gap; // gap to next free block
unsigned int index; // sequential number of free block
unsigned short n_gapBlocks; // # used blocks in gap
bool stubs_in_gap; // The occupied space between this and the next free block contains (unmovable) stubs or blobs.
};
//--------------
// TopSizeBlk
//--------------
// The n largest blocks in the code heap are represented in an instance
// of this TopSizeBlk struct. It collects all information we need to
// know about those largest blocks.
// All TopSizeBlks of a heap segment are stored in the related TopSizeArray.
struct TopSizeBlk : public CHeapObj<mtCode> {
HeapBlock* start; // address of block
unsigned int len; // length of block, in _segment_size units. Will never overflow int.
unsigned int index; // ordering index, 0 is largest block
// contains array index of next smaller block
// -1 indicates end of list
CompLevel level; // optimization level (see globalDefinitions.hpp)
u2 compiler; // compiler which generated this blob
u2 type; // blob type
};
//---------------------------
// SizeDistributionElement
//---------------------------
// During CodeHeap analysis, each allocated code block is associated with a
// SizeDistributionElement according to its size. Later on, the array of
// SizeDistributionElements is used to print a size distribution bar graph.
// All SizeDistributionElements of a heap segment are stored in the related SizeDistributionArray.
struct SizeDistributionElement : public CHeapObj<mtCode> {
// Range is [rangeStart..rangeEnd).
unsigned int rangeStart; // start of length range, in _segment_size units.
unsigned int rangeEnd; // end of length range, in _segment_size units.
unsigned int lenSum; // length of block, in _segment_size units. Will never overflow int.
unsigned int count; // number of blocks assigned to this range.
};
//----------------
// CodeHeapStat
//----------------
// Because we have to deal with multiple CodeHeaps, we need to
// collect "global" information in a segment-specific way as well.
// Thats what the CodeHeapStat and CodeHeapStatArray are used for.
// Before a heap segment is processed, the contents of the CodeHeapStat
// element is copied to the global variables (get_HeapStatGlobals).
// When processing is done, the possibly modified global variables are
// copied back (set_HeapStatGlobals) to the CodeHeapStat element.
struct CodeHeapStat {
StatElement* StatArray;
struct FreeBlk* FreeArray;
struct TopSizeBlk* TopSizeArray;
struct SizeDistributionElement* SizeDistributionArray;
const char* heapName;
size_t segment_size;
// StatElement data
size_t alloc_granules;
size_t granule_size;
bool segment_granules;
unsigned int nBlocks_t1;
unsigned int nBlocks_t2;
unsigned int nBlocks_alive;
unsigned int nBlocks_dead;
unsigned int nBlocks_unloaded;
unsigned int nBlocks_stub;
// FreeBlk data
unsigned int alloc_freeBlocks;
// UsedBlk data
unsigned int alloc_topSizeBlocks;
unsigned int used_topSizeBlocks;
// method hotness data. Temperature range is [-reset_val..+reset_val]
int avgTemp;
int maxTemp;
int minTemp;
};
#endif // SHARE_CODE_CODEHEAPSTATE_HPP

View File

@ -235,7 +235,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
assert(k->verify_itable_index(itable_index), "sanity check");
#endif //ASSERT
CompiledICHolder* holder = new CompiledICHolder(call_info->resolved_method()->method_holder(),
call_info->resolved_klass());
call_info->resolved_klass(), false);
holder->claim();
InlineCacheBuffer::create_transition_stub(this, holder, entry);
} else {
@ -273,7 +273,7 @@ bool CompiledIC::is_megamorphic() const {
assert(!is_optimized(), "an optimized call cannot be megamorphic");
// Cannot rely on cached_value. It is either an interface or a method.
return VtableStubs::is_entry_point(ic_destination());
return VtableStubs::entry_point(ic_destination()) != NULL;
}
bool CompiledIC::is_call_to_compiled() const {
@ -525,9 +525,11 @@ bool CompiledIC::is_icholder_entry(address entry) {
return true;
}
// itable stubs also use CompiledICHolder
if (VtableStubs::is_entry_point(entry) && VtableStubs::stub_containing(entry)->is_itable_stub()) {
return true;
if (cb != NULL && cb->is_vtable_blob()) {
VtableStub* s = VtableStubs::entry_point(entry);
return (s != NULL) && s->is_itable_stub();
}
return false;
}

Some files were not shown because too many files have changed in this diff Show More