Merge
This commit is contained in:
commit
31cbf182e1
@ -348,3 +348,4 @@ c4d72a1620835b5d657b7b6792c2879367d0154f jdk-9+101
|
|||||||
47d6462e514b2097663305a57d9c844c15d5b609 jdk-9+103
|
47d6462e514b2097663305a57d9c844c15d5b609 jdk-9+103
|
||||||
9a38f8b4ba220708db198d08d82fd2144a64777d jdk-9+104
|
9a38f8b4ba220708db198d08d82fd2144a64777d jdk-9+104
|
||||||
be58b02c11f90b88c67e4d0e2cb5e4cf2d9b3c57 jdk-9+105
|
be58b02c11f90b88c67e4d0e2cb5e4cf2d9b3c57 jdk-9+105
|
||||||
|
54575d8783b3a39a2d710c28cda675d44261f9d9 jdk-9+106
|
||||||
|
@ -508,3 +508,4 @@ d5239fc1b69749ae50793c61b899fcdacf3df857 jdk-9+102
|
|||||||
c5f55130b1b69510d9a6f4a3105b58e21cd7ffe1 jdk-9+103
|
c5f55130b1b69510d9a6f4a3105b58e21cd7ffe1 jdk-9+103
|
||||||
534c50395957c6025fb6627e93b35756f8d48a08 jdk-9+104
|
534c50395957c6025fb6627e93b35756f8d48a08 jdk-9+104
|
||||||
266fa9bb5297bf02cb2a7b038b10a109817d2b48 jdk-9+105
|
266fa9bb5297bf02cb2a7b038b10a109817d2b48 jdk-9+105
|
||||||
|
7232de4c17c37f60aecec4f3191090bd3d41d334 jdk-9+106
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
suite = {
|
suite = {
|
||||||
"mxversion" : "5.6.11",
|
"mxversion" : "5.6.16",
|
||||||
"name" : "jvmci",
|
"name" : "jvmci",
|
||||||
"url" : "http://openjdk.java.net/projects/graal",
|
"url" : "http://openjdk.java.net/projects/graal",
|
||||||
"developer" : {
|
"developer" : {
|
||||||
|
@ -256,7 +256,7 @@ endif
|
|||||||
|
|
||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
ifneq ($(COMPILER_WARNINGS_FATAL),false)
|
ifneq ($(COMPILER_WARNINGS_FATAL),false)
|
||||||
WARNINGS_ARE_ERRORS = -Werror
|
WARNINGS_ARE_ERRORS ?= -Werror
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_CLANG), true)
|
ifeq ($(USE_CLANG), true)
|
||||||
|
@ -203,7 +203,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
WARNINGS_ARE_ERRORS = -Werror
|
WARNINGS_ARE_ERRORS ?= -Werror
|
||||||
|
|
||||||
ifeq ($(USE_CLANG), true)
|
ifeq ($(USE_CLANG), true)
|
||||||
# However we need to clean the code up before we can unrestrictedly enable this option with Clang
|
# However we need to clean the code up before we can unrestrictedly enable this option with Clang
|
||||||
|
@ -66,17 +66,21 @@ CXXFLAGS = $(SYSDEFS) $(INCLUDES)
|
|||||||
CXXFLAGS += -DASSERT
|
CXXFLAGS += -DASSERT
|
||||||
|
|
||||||
ifndef USE_GCC
|
ifndef USE_GCC
|
||||||
# We need libCstd.so for adlc
|
# We need libCstd.so for adlc
|
||||||
CFLAGS += -library=Cstd -g
|
CFLAGS += -library=Cstd -g
|
||||||
LFLAGS += -library=Cstd -g
|
LFLAGS += -library=Cstd -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
||||||
|
CFLAGS_WARN = +w
|
||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
|
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
|
||||||
CFLAGS_WARN = +w -errwarn
|
WARNINGS_ARE_ERRORS ?= -xwe
|
||||||
endif
|
endif
|
||||||
# When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly
|
|
||||||
|
CFLAGS_WARN += $(WARNINGS_ARE_ERRORS)
|
||||||
|
|
||||||
|
# When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly
|
||||||
# instantiated template functions trigger this warning when +w is active.
|
# instantiated template functions trigger this warning when +w is active.
|
||||||
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 513), 1)
|
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 513), 1)
|
||||||
CFLAGS_WARN += -erroff=notemsource
|
CFLAGS_WARN += -erroff=notemsource
|
||||||
|
@ -117,7 +117,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
WARNINGS_ARE_ERRORS = -Werror
|
WARNINGS_ARE_ERRORS ?= -Werror
|
||||||
|
|
||||||
# Enable these warnings. See 'info gcc' about details on these options
|
# Enable these warnings. See 'info gcc' about details on these options
|
||||||
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2
|
WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2
|
||||||
|
@ -145,7 +145,8 @@ endif
|
|||||||
CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
|
CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
|
||||||
|
|
||||||
# Compiler warnings are treated as errors
|
# Compiler warnings are treated as errors
|
||||||
CFLAGS_WARN = -xwe
|
WARNINGS_ARE_ERRORS ?= -xwe
|
||||||
|
CFLAGS_WARN = $(WARNINGS_ARE_ERRORS)
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
# Begin current (>=5.9) Forte compiler options #
|
# Begin current (>=5.9) Forte compiler options #
|
||||||
|
@ -14928,7 +14928,22 @@ instruct string_equals(iRegP_R1 str1, iRegP_R3 str2, iRegI_R4 cnt,
|
|||||||
ins_pipe(pipe_class_memory);
|
ins_pipe(pipe_class_memory);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct array_equals(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
|
instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
|
||||||
|
iRegP_R10 tmp, rFlagsReg cr)
|
||||||
|
%{
|
||||||
|
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
|
||||||
|
match(Set result (AryEq ary1 ary2));
|
||||||
|
effect(KILL tmp, USE_KILL ary1, USE_KILL ary2, KILL cr);
|
||||||
|
|
||||||
|
format %{ "Array Equals $ary1,ary2 -> $result // KILL $tmp" %}
|
||||||
|
ins_encode %{
|
||||||
|
__ byte_arrays_equals($ary1$$Register, $ary2$$Register,
|
||||||
|
$result$$Register, $tmp$$Register);
|
||||||
|
%}
|
||||||
|
ins_pipe(pipe_class_memory);
|
||||||
|
%}
|
||||||
|
|
||||||
|
instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
|
||||||
iRegP_R10 tmp, rFlagsReg cr)
|
iRegP_R10 tmp, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
|
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
|
||||||
|
@ -40,11 +40,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im
|
|||||||
define_pd_global(bool, TrapBasedNullChecks, false);
|
define_pd_global(bool, TrapBasedNullChecks, false);
|
||||||
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast
|
define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast
|
||||||
|
|
||||||
#if defined(COMPILER2) || INCLUDE_JVMCI
|
|
||||||
define_pd_global(intx, CodeEntryAlignment, 64);
|
define_pd_global(intx, CodeEntryAlignment, 64);
|
||||||
#else
|
|
||||||
define_pd_global(intx, CodeEntryAlignment, 16);
|
|
||||||
#endif // COMPILER2
|
|
||||||
define_pd_global(intx, OptoLoopAlignment, 16);
|
define_pd_global(intx, OptoLoopAlignment, 16);
|
||||||
define_pd_global(intx, InlineFrequencyCount, 100);
|
define_pd_global(intx, InlineFrequencyCount, 100);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -127,7 +127,10 @@ int MacroAssembler::pd_patch_instruction_size(address branch, address target) {
|
|||||||
Instruction_aarch64::extract(insn2, 4, 0)) {
|
Instruction_aarch64::extract(insn2, 4, 0)) {
|
||||||
// movk #imm16<<32
|
// movk #imm16<<32
|
||||||
Instruction_aarch64::patch(branch + 4, 20, 5, (uint64_t)target >> 32);
|
Instruction_aarch64::patch(branch + 4, 20, 5, (uint64_t)target >> 32);
|
||||||
offset &= (1<<20)-1;
|
long dest = ((long)target & 0xffffffffL) | ((long)branch & 0xffff00000000L);
|
||||||
|
long pc_page = (long)branch >> 12;
|
||||||
|
long adr_page = (long)dest >> 12;
|
||||||
|
offset = adr_page - pc_page;
|
||||||
instructions = 2;
|
instructions = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -898,23 +901,18 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
|||||||
"caller must use same register for non-constant itable index as for method");
|
"caller must use same register for non-constant itable index as for method");
|
||||||
|
|
||||||
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
|
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
|
||||||
int vtable_base = InstanceKlass::vtable_start_offset() * wordSize;
|
int vtable_base = in_bytes(Klass::vtable_start_offset());
|
||||||
int itentry_off = itableMethodEntry::method_offset_in_bytes();
|
int itentry_off = itableMethodEntry::method_offset_in_bytes();
|
||||||
int scan_step = itableOffsetEntry::size() * wordSize;
|
int scan_step = itableOffsetEntry::size() * wordSize;
|
||||||
int vte_size = vtableEntry::size() * wordSize;
|
int vte_size = vtableEntry::size_in_bytes();
|
||||||
assert(vte_size == wordSize, "else adjust times_vte_scale");
|
assert(vte_size == wordSize, "else adjust times_vte_scale");
|
||||||
|
|
||||||
ldrw(scan_temp, Address(recv_klass, InstanceKlass::vtable_length_offset() * wordSize));
|
ldrw(scan_temp, Address(recv_klass, Klass::vtable_length_offset()));
|
||||||
|
|
||||||
// %%% Could store the aligned, prescaled offset in the klassoop.
|
// %%% Could store the aligned, prescaled offset in the klassoop.
|
||||||
// lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base));
|
// lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base));
|
||||||
lea(scan_temp, Address(recv_klass, scan_temp, Address::lsl(3)));
|
lea(scan_temp, Address(recv_klass, scan_temp, Address::lsl(3)));
|
||||||
add(scan_temp, scan_temp, vtable_base);
|
add(scan_temp, scan_temp, vtable_base);
|
||||||
if (HeapWordsPerLong > 1) {
|
|
||||||
// Round up to align_object_offset boundary
|
|
||||||
// see code for instanceKlass::start_of_itable!
|
|
||||||
round_to(scan_temp, BytesPerLong);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
|
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
|
||||||
assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
|
assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
|
||||||
@ -963,7 +961,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
|||||||
void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
||||||
RegisterOrConstant vtable_index,
|
RegisterOrConstant vtable_index,
|
||||||
Register method_result) {
|
Register method_result) {
|
||||||
const int base = InstanceKlass::vtable_start_offset() * wordSize;
|
const int base = in_bytes(Klass::vtable_start_offset());
|
||||||
assert(vtableEntry::size() * wordSize == 8,
|
assert(vtableEntry::size() * wordSize == 8,
|
||||||
"adjust the scaling in the code below");
|
"adjust the scaling in the code below");
|
||||||
int vtable_offset_in_bytes = base + vtableEntry::method_offset_in_bytes();
|
int vtable_offset_in_bytes = base + vtableEntry::method_offset_in_bytes();
|
||||||
@ -3998,11 +3996,12 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byt
|
|||||||
if (offset_high >= -(1<<20) && offset_low < (1<<20)) {
|
if (offset_high >= -(1<<20) && offset_low < (1<<20)) {
|
||||||
_adrp(reg1, dest.target());
|
_adrp(reg1, dest.target());
|
||||||
} else {
|
} else {
|
||||||
unsigned long pc_page = (unsigned long)pc() >> 12;
|
unsigned long target = (unsigned long)dest.target();
|
||||||
long offset = dest_page - pc_page;
|
unsigned long adrp_target
|
||||||
offset = (offset & ((1<<20)-1)) << 12;
|
= (target & 0xffffffffUL) | ((unsigned long)pc() & 0xffff00000000UL);
|
||||||
_adrp(reg1, pc()+offset);
|
|
||||||
movk(reg1, (unsigned long)dest.target() >> 32, 32);
|
_adrp(reg1, (address)adrp_target);
|
||||||
|
movk(reg1, target >> 32, 32);
|
||||||
}
|
}
|
||||||
byte_offset = (unsigned long)dest.target() & 0xfff;
|
byte_offset = (unsigned long)dest.target() & 0xfff;
|
||||||
}
|
}
|
||||||
@ -4557,6 +4556,82 @@ void MacroAssembler::string_equals(Register str1, Register str2,
|
|||||||
BLOCK_COMMENT("} string_equals");
|
BLOCK_COMMENT("} string_equals");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MacroAssembler::byte_arrays_equals(Register ary1, Register ary2,
|
||||||
|
Register result, Register tmp1)
|
||||||
|
{
|
||||||
|
Register cnt1 = rscratch1;
|
||||||
|
Register cnt2 = rscratch2;
|
||||||
|
Register tmp2 = rscratch2;
|
||||||
|
|
||||||
|
Label SAME, DIFFER, NEXT, TAIL07, TAIL03, TAIL01;
|
||||||
|
|
||||||
|
int length_offset = arrayOopDesc::length_offset_in_bytes();
|
||||||
|
int base_offset = arrayOopDesc::base_offset_in_bytes(T_BYTE);
|
||||||
|
|
||||||
|
BLOCK_COMMENT("byte_arrays_equals {");
|
||||||
|
|
||||||
|
// different until proven equal
|
||||||
|
mov(result, false);
|
||||||
|
|
||||||
|
// same array?
|
||||||
|
cmp(ary1, ary2);
|
||||||
|
br(Assembler::EQ, SAME);
|
||||||
|
|
||||||
|
// ne if either null
|
||||||
|
cbz(ary1, DIFFER);
|
||||||
|
cbz(ary2, DIFFER);
|
||||||
|
|
||||||
|
// lengths ne?
|
||||||
|
ldrw(cnt1, Address(ary1, length_offset));
|
||||||
|
ldrw(cnt2, Address(ary2, length_offset));
|
||||||
|
cmp(cnt1, cnt2);
|
||||||
|
br(Assembler::NE, DIFFER);
|
||||||
|
|
||||||
|
lea(ary1, Address(ary1, base_offset));
|
||||||
|
lea(ary2, Address(ary2, base_offset));
|
||||||
|
|
||||||
|
subs(cnt1, cnt1, 8);
|
||||||
|
br(LT, TAIL07);
|
||||||
|
|
||||||
|
BIND(NEXT);
|
||||||
|
ldr(tmp1, Address(post(ary1, 8)));
|
||||||
|
ldr(tmp2, Address(post(ary2, 8)));
|
||||||
|
subs(cnt1, cnt1, 8);
|
||||||
|
eor(tmp1, tmp1, tmp2);
|
||||||
|
cbnz(tmp1, DIFFER);
|
||||||
|
br(GE, NEXT);
|
||||||
|
|
||||||
|
BIND(TAIL07); // 0-7 bytes left, cnt1 = #bytes left - 4
|
||||||
|
tst(cnt1, 0b100);
|
||||||
|
br(EQ, TAIL03);
|
||||||
|
ldrw(tmp1, Address(post(ary1, 4)));
|
||||||
|
ldrw(tmp2, Address(post(ary2, 4)));
|
||||||
|
cmp(tmp1, tmp2);
|
||||||
|
br(NE, DIFFER);
|
||||||
|
|
||||||
|
BIND(TAIL03); // 0-3 bytes left, cnt1 = #bytes left - 4
|
||||||
|
tst(cnt1, 0b10);
|
||||||
|
br(EQ, TAIL01);
|
||||||
|
ldrh(tmp1, Address(post(ary1, 2)));
|
||||||
|
ldrh(tmp2, Address(post(ary2, 2)));
|
||||||
|
cmp(tmp1, tmp2);
|
||||||
|
br(NE, DIFFER);
|
||||||
|
BIND(TAIL01); // 0-1 byte left
|
||||||
|
tst(cnt1, 0b01);
|
||||||
|
br(EQ, SAME);
|
||||||
|
ldrb(tmp1, ary1);
|
||||||
|
ldrb(tmp2, ary2);
|
||||||
|
cmp(tmp1, tmp2);
|
||||||
|
br(NE, DIFFER);
|
||||||
|
|
||||||
|
BIND(SAME);
|
||||||
|
mov(result, true);
|
||||||
|
BIND(DIFFER); // result already set
|
||||||
|
|
||||||
|
BLOCK_COMMENT("} byte_arrays_equals");
|
||||||
|
}
|
||||||
|
|
||||||
// Compare char[] arrays aligned to 4 bytes
|
// Compare char[] arrays aligned to 4 bytes
|
||||||
void MacroAssembler::char_arrays_equals(Register ary1, Register ary2,
|
void MacroAssembler::char_arrays_equals(Register ary1, Register ary2,
|
||||||
Register result, Register tmp1)
|
Register result, Register tmp1)
|
||||||
|
@ -1191,6 +1191,8 @@ public:
|
|||||||
Register tmp1);
|
Register tmp1);
|
||||||
void char_arrays_equals(Register ary1, Register ary2,
|
void char_arrays_equals(Register ary1, Register ary2,
|
||||||
Register result, Register tmp1);
|
Register result, Register tmp1);
|
||||||
|
void byte_arrays_equals(Register ary1, Register ary2,
|
||||||
|
Register result, Register tmp1);
|
||||||
void encode_iso_array(Register src, Register dst,
|
void encode_iso_array(Register src, Register dst,
|
||||||
Register len, Register result,
|
Register len, Register result,
|
||||||
FloatRegister Vtmp1, FloatRegister Vtmp2,
|
FloatRegister Vtmp1, FloatRegister Vtmp2,
|
||||||
|
@ -786,12 +786,19 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
int offset;
|
int offset;
|
||||||
const Register t0 = r3, t1 = r4, t2 = r5, t3 = r6,
|
const Register t0 = r3, t1 = r4, t2 = r5, t3 = r6,
|
||||||
t4 = r7, t5 = r10, t6 = r11, t7 = r12;
|
t4 = r7, t5 = r10, t6 = r11, t7 = r12;
|
||||||
|
const Register stride = r13;
|
||||||
|
|
||||||
assert_different_registers(rscratch1, t0, t1, t2, t3, t4, t5, t6, t7);
|
assert_different_registers(rscratch1, t0, t1, t2, t3, t4, t5, t6, t7);
|
||||||
assert_different_registers(s, d, count, rscratch1);
|
assert_different_registers(s, d, count, rscratch1);
|
||||||
|
|
||||||
Label again, large, small;
|
Label again, large, small;
|
||||||
__ align(6);
|
const char *stub_name;
|
||||||
|
if (direction == copy_forwards)
|
||||||
|
stub_name = "foward_copy_longs";
|
||||||
|
else
|
||||||
|
stub_name = "backward_copy_longs";
|
||||||
|
StubCodeMark mark(this, "StubRoutines", stub_name);
|
||||||
|
__ align(CodeEntryAlignment);
|
||||||
__ bind(start);
|
__ bind(start);
|
||||||
__ cmp(count, 8);
|
__ cmp(count, 8);
|
||||||
__ br(Assembler::LO, small);
|
__ br(Assembler::LO, small);
|
||||||
@ -836,7 +843,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
|
|
||||||
__ ret(lr);
|
__ ret(lr);
|
||||||
|
|
||||||
__ align(6);
|
__ align(CodeEntryAlignment);
|
||||||
__ bind(large);
|
__ bind(large);
|
||||||
|
|
||||||
// Fill 8 registers
|
// Fill 8 registers
|
||||||
@ -845,10 +852,18 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
__ ldp(t4, t5, Address(s, 6 * unit));
|
__ ldp(t4, t5, Address(s, 6 * unit));
|
||||||
__ ldp(t6, t7, Address(__ pre(s, 8 * unit)));
|
__ ldp(t6, t7, Address(__ pre(s, 8 * unit)));
|
||||||
|
|
||||||
|
int prefetch = PrefetchCopyIntervalInBytes;
|
||||||
|
bool use_stride = false;
|
||||||
|
if (direction == copy_backwards) {
|
||||||
|
use_stride = prefetch > 256;
|
||||||
|
prefetch = -prefetch;
|
||||||
|
if (use_stride) __ mov(stride, prefetch);
|
||||||
|
}
|
||||||
|
|
||||||
__ bind(again);
|
__ bind(again);
|
||||||
|
|
||||||
if (direction == copy_forwards && PrefetchCopyIntervalInBytes > 0)
|
if (PrefetchCopyIntervalInBytes > 0)
|
||||||
__ prfm(Address(s, PrefetchCopyIntervalInBytes), PLDL1KEEP);
|
__ prfm(use_stride ? Address(s, stride) : Address(s, prefetch), PLDL1KEEP);
|
||||||
|
|
||||||
__ stp(t0, t1, Address(d, 2 * unit));
|
__ stp(t0, t1, Address(d, 2 * unit));
|
||||||
__ ldp(t0, t1, Address(s, 2 * unit));
|
__ ldp(t0, t1, Address(s, 2 * unit));
|
||||||
@ -1151,8 +1166,11 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
// caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
|
// caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
|
||||||
BLOCK_COMMENT("Entry:");
|
BLOCK_COMMENT("Entry:");
|
||||||
}
|
}
|
||||||
__ cmp(d, s);
|
|
||||||
__ br(Assembler::LS, nooverlap_target);
|
// use fwd copy when (d-s) above_equal (count*size)
|
||||||
|
__ sub(rscratch1, d, s);
|
||||||
|
__ cmp(rscratch1, count, Assembler::LSL, exact_log2(size));
|
||||||
|
__ br(Assembler::HS, nooverlap_target);
|
||||||
|
|
||||||
if (is_oop) {
|
if (is_oop) {
|
||||||
__ push(RegSet::of(d, count), sp);
|
__ push(RegSet::of(d, count), sp);
|
||||||
|
@ -120,7 +120,14 @@ void VM_Version::get_processor_features() {
|
|||||||
FLAG_SET_DEFAULT(AllocatePrefetchStepSize, 64);
|
FLAG_SET_DEFAULT(AllocatePrefetchStepSize, 64);
|
||||||
FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 256);
|
FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 256);
|
||||||
FLAG_SET_DEFAULT(PrefetchFieldsAhead, 256);
|
FLAG_SET_DEFAULT(PrefetchFieldsAhead, 256);
|
||||||
FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 256);
|
if (FLAG_IS_DEFAULT(PrefetchCopyIntervalInBytes))
|
||||||
|
FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 256);
|
||||||
|
if ((PrefetchCopyIntervalInBytes & 7) || (PrefetchCopyIntervalInBytes >= 32768)) {
|
||||||
|
warning("PrefetchCopyIntervalInBytes must be a multiple of 8 and < 32768");
|
||||||
|
PrefetchCopyIntervalInBytes &= ~7;
|
||||||
|
if (PrefetchCopyIntervalInBytes >= 32768)
|
||||||
|
PrefetchCopyIntervalInBytes = 32760;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned long auxv = getauxval(AT_HWCAP);
|
unsigned long auxv = getauxval(AT_HWCAP);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -73,7 +73,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
|||||||
if (DebugVtables) {
|
if (DebugVtables) {
|
||||||
Label L;
|
Label L;
|
||||||
// check offset vs vtable length
|
// check offset vs vtable length
|
||||||
__ ldrw(rscratch1, Address(r19, InstanceKlass::vtable_length_offset() * wordSize));
|
__ ldrw(rscratch1, Address(r19, Klass::vtable_length_offset()));
|
||||||
__ cmpw(rscratch1, vtable_index * vtableEntry::size());
|
__ cmpw(rscratch1, vtable_index * vtableEntry::size());
|
||||||
__ br(Assembler::GT, L);
|
__ br(Assembler::GT, L);
|
||||||
__ enter();
|
__ enter();
|
||||||
|
@ -1583,13 +1583,13 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
|||||||
"caller must use same register for non-constant itable index as for method");
|
"caller must use same register for non-constant itable index as for method");
|
||||||
|
|
||||||
// Compute start of first itableOffsetEntry (which is at the end of the vtable).
|
// Compute start of first itableOffsetEntry (which is at the end of the vtable).
|
||||||
int vtable_base = InstanceKlass::vtable_start_offset() * wordSize;
|
int vtable_base = in_bytes(Klass::vtable_start_offset());
|
||||||
int itentry_off = itableMethodEntry::method_offset_in_bytes();
|
int itentry_off = itableMethodEntry::method_offset_in_bytes();
|
||||||
int logMEsize = exact_log2(itableMethodEntry::size() * wordSize);
|
int logMEsize = exact_log2(itableMethodEntry::size() * wordSize);
|
||||||
int scan_step = itableOffsetEntry::size() * wordSize;
|
int scan_step = itableOffsetEntry::size() * wordSize;
|
||||||
int log_vte_size= exact_log2(vtableEntry::size() * wordSize);
|
int log_vte_size= exact_log2(vtableEntry::size_in_bytes());
|
||||||
|
|
||||||
lwz(scan_temp, InstanceKlass::vtable_length_offset() * wordSize, recv_klass);
|
lwz(scan_temp, in_bytes(Klass::vtable_length_offset()), recv_klass);
|
||||||
// %%% We should store the aligned, prescaled offset in the klassoop.
|
// %%% We should store the aligned, prescaled offset in the klassoop.
|
||||||
// Then the next several instructions would fold away.
|
// Then the next several instructions would fold away.
|
||||||
|
|
||||||
@ -1657,7 +1657,7 @@ void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
|||||||
|
|
||||||
assert_different_registers(recv_klass, method_result, vtable_index.register_or_noreg());
|
assert_different_registers(recv_klass, method_result, vtable_index.register_or_noreg());
|
||||||
|
|
||||||
const int base = InstanceKlass::vtable_start_offset() * wordSize;
|
const int base = in_bytes(Klass::vtable_start_offset());
|
||||||
assert(vtableEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
|
assert(vtableEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
|
||||||
|
|
||||||
if (vtable_index.is_register()) {
|
if (vtable_index.is_register()) {
|
||||||
|
@ -3568,8 +3568,8 @@ encode %{
|
|||||||
|
|
||||||
__ load_klass(R11_scratch1, R3);
|
__ load_klass(R11_scratch1, R3);
|
||||||
|
|
||||||
int entry_offset = InstanceKlass::vtable_start_offset() + _vtable_index * vtableEntry::size();
|
int entry_offset = in_bytes(Klass::vtable_start_offset()) + _vtable_index * vtableEntry::size_in_bytes();
|
||||||
int v_off = entry_offset * wordSize + vtableEntry::method_offset_in_bytes();
|
int v_off = entry_offset + vtableEntry::method_offset_in_bytes();
|
||||||
__ li(R19_method, v_off);
|
__ li(R19_method, v_off);
|
||||||
__ ldx(R19_method/*method oop*/, R19_method/*method offset*/, R11_scratch1/*class*/);
|
__ ldx(R19_method/*method oop*/, R19_method/*method offset*/, R11_scratch1/*class*/);
|
||||||
// NOTE: for vtable dispatches, the vtable entry will never be
|
// NOTE: for vtable dispatches, the vtable entry will never be
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2013, 2015 SAP SE. All rights reserved.
|
* Copyright (c) 2013, 2015 SAP SE. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -3282,9 +3282,9 @@ void TemplateTable::generate_vtable_call(Register Rrecv_klass, Register Rindex,
|
|||||||
const Register Rtarget_method = Rindex;
|
const Register Rtarget_method = Rindex;
|
||||||
|
|
||||||
// Get target method & entry point.
|
// Get target method & entry point.
|
||||||
const int base = InstanceKlass::vtable_start_offset() * wordSize;
|
const int base = in_bytes(Klass::vtable_start_offset());
|
||||||
// Calc vtable addr scale the vtable index by 8.
|
// Calc vtable addr scale the vtable index by 8.
|
||||||
__ sldi(Rindex, Rindex, exact_log2(vtableEntry::size() * wordSize));
|
__ sldi(Rindex, Rindex, exact_log2(vtableEntry::size_in_bytes()));
|
||||||
// Load target.
|
// Load target.
|
||||||
__ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes());
|
__ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes());
|
||||||
__ ldx(Rtarget_method, Rindex, Rrecv_klass);
|
__ ldx(Rtarget_method, Rindex, Rrecv_klass);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -80,14 +80,14 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
|||||||
__ load_klass(rcvr_klass, R3);
|
__ load_klass(rcvr_klass, R3);
|
||||||
|
|
||||||
// Set method (in case of interpreted method), and destination address.
|
// Set method (in case of interpreted method), and destination address.
|
||||||
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
|
int entry_offset = in_bytes(Klass::vtable_start_offset()) + vtable_index*vtableEntry::size_in_bytes();
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (DebugVtables) {
|
if (DebugVtables) {
|
||||||
Label L;
|
Label L;
|
||||||
// Check offset vs vtable length.
|
// Check offset vs vtable length.
|
||||||
const Register vtable_len = R12_scratch2;
|
const Register vtable_len = R12_scratch2;
|
||||||
__ lwz(vtable_len, InstanceKlass::vtable_length_offset()*wordSize, rcvr_klass);
|
__ lwz(vtable_len, in_bytes(Klass::vtable_length_offset()), rcvr_klass);
|
||||||
__ cmpwi(CCR0, vtable_len, vtable_index*vtableEntry::size());
|
__ cmpwi(CCR0, vtable_len, vtable_index*vtableEntry::size());
|
||||||
__ bge(CCR0, L);
|
__ bge(CCR0, L);
|
||||||
__ li(R12_scratch2, vtable_index);
|
__ li(R12_scratch2, vtable_index);
|
||||||
@ -96,7 +96,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
|
int v_off = entry_offset + vtableEntry::method_offset_in_bytes();
|
||||||
|
|
||||||
__ ld(R19_method, v_off, rcvr_klass);
|
__ ld(R19_method, v_off, rcvr_klass);
|
||||||
|
|
||||||
@ -163,13 +163,13 @@ VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
|
|||||||
__ load_klass(rcvr_klass, R3_ARG1);
|
__ load_klass(rcvr_klass, R3_ARG1);
|
||||||
|
|
||||||
BLOCK_COMMENT("Load start of itable entries into itable_entry.");
|
BLOCK_COMMENT("Load start of itable entries into itable_entry.");
|
||||||
__ lwz(vtable_len, InstanceKlass::vtable_length_offset() * wordSize, rcvr_klass);
|
__ lwz(vtable_len, in_bytes(Klass::vtable_length_offset()), rcvr_klass);
|
||||||
__ slwi(vtable_len, vtable_len, exact_log2(vtableEntry::size() * wordSize));
|
__ slwi(vtable_len, vtable_len, exact_log2(vtableEntry::size_in_bytes()));
|
||||||
__ add(itable_entry_addr, vtable_len, rcvr_klass);
|
__ add(itable_entry_addr, vtable_len, rcvr_klass);
|
||||||
|
|
||||||
// Loop over all itable entries until desired interfaceOop(Rinterface) found.
|
// Loop over all itable entries until desired interfaceOop(Rinterface) found.
|
||||||
BLOCK_COMMENT("Increment itable_entry_addr in loop.");
|
BLOCK_COMMENT("Increment itable_entry_addr in loop.");
|
||||||
const int vtable_base_offset = InstanceKlass::vtable_start_offset() * wordSize;
|
const int vtable_base_offset = in_bytes(Klass::vtable_start_offset());
|
||||||
__ addi(itable_entry_addr, itable_entry_addr, vtable_base_offset + itableOffsetEntry::interface_offset_in_bytes());
|
__ addi(itable_entry_addr, itable_entry_addr, vtable_base_offset + itableOffsetEntry::interface_offset_in_bytes());
|
||||||
|
|
||||||
const int itable_offset_search_inc = itableOffsetEntry::size() * wordSize;
|
const int itable_offset_search_inc = itableOffsetEntry::size() * wordSize;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -180,6 +180,9 @@ static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
|
|||||||
|
|
||||||
typedef void (*_zero_Fn)(HeapWord* to, size_t count);
|
typedef void (*_zero_Fn)(HeapWord* to, size_t count);
|
||||||
|
|
||||||
|
// Only used for heap objects, so align_object_offset.
|
||||||
|
// All other platforms pd_fill_to_aligned_words simply calls pd_fill_to_words, don't
|
||||||
|
// know why this one is different.
|
||||||
static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
|
static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
|
||||||
assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation");
|
assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation");
|
||||||
|
|
||||||
|
@ -2188,30 +2188,18 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
|
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
|
||||||
int vtable_base = InstanceKlass::vtable_start_offset() * wordSize;
|
int vtable_base = in_bytes(Klass::vtable_start_offset());
|
||||||
int scan_step = itableOffsetEntry::size() * wordSize;
|
int scan_step = itableOffsetEntry::size() * wordSize;
|
||||||
int vte_size = vtableEntry::size() * wordSize;
|
int vte_size = vtableEntry::size_in_bytes();
|
||||||
|
|
||||||
lduw(recv_klass, InstanceKlass::vtable_length_offset() * wordSize, scan_temp);
|
lduw(recv_klass, in_bytes(Klass::vtable_length_offset()), scan_temp);
|
||||||
// %%% We should store the aligned, prescaled offset in the klassoop.
|
// %%% We should store the aligned, prescaled offset in the klassoop.
|
||||||
// Then the next several instructions would fold away.
|
// Then the next several instructions would fold away.
|
||||||
|
|
||||||
int round_to_unit = ((HeapWordsPerLong > 1) ? BytesPerLong : 0);
|
|
||||||
int itb_offset = vtable_base;
|
int itb_offset = vtable_base;
|
||||||
if (round_to_unit != 0) {
|
int itb_scale = exact_log2(vtableEntry::size_in_bytes());
|
||||||
// hoist first instruction of round_to(scan_temp, BytesPerLong):
|
|
||||||
itb_offset += round_to_unit - wordSize;
|
|
||||||
}
|
|
||||||
int itb_scale = exact_log2(vtableEntry::size() * wordSize);
|
|
||||||
sll(scan_temp, itb_scale, scan_temp);
|
sll(scan_temp, itb_scale, scan_temp);
|
||||||
add(scan_temp, itb_offset, scan_temp);
|
add(scan_temp, itb_offset, scan_temp);
|
||||||
if (round_to_unit != 0) {
|
|
||||||
// Round up to align_object_offset boundary
|
|
||||||
// see code for InstanceKlass::start_of_itable!
|
|
||||||
// Was: round_to(scan_temp, BytesPerLong);
|
|
||||||
// Hoisted: add(scan_temp, BytesPerLong-1, scan_temp);
|
|
||||||
and3(scan_temp, -round_to_unit, scan_temp);
|
|
||||||
}
|
|
||||||
add(recv_klass, scan_temp, scan_temp);
|
add(recv_klass, scan_temp, scan_temp);
|
||||||
|
|
||||||
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
|
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
|
||||||
@ -2280,16 +2268,16 @@ void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
|||||||
Register method_result) {
|
Register method_result) {
|
||||||
assert_different_registers(recv_klass, method_result, vtable_index.register_or_noreg());
|
assert_different_registers(recv_klass, method_result, vtable_index.register_or_noreg());
|
||||||
Register sethi_temp = method_result;
|
Register sethi_temp = method_result;
|
||||||
const int base = (InstanceKlass::vtable_start_offset() * wordSize +
|
const int base = in_bytes(Klass::vtable_start_offset()) +
|
||||||
// method pointer offset within the vtable entry:
|
// method pointer offset within the vtable entry:
|
||||||
vtableEntry::method_offset_in_bytes());
|
vtableEntry::method_offset_in_bytes();
|
||||||
RegisterOrConstant vtable_offset = vtable_index;
|
RegisterOrConstant vtable_offset = vtable_index;
|
||||||
// Each of the following three lines potentially generates an instruction.
|
// Each of the following three lines potentially generates an instruction.
|
||||||
// But the total number of address formation instructions will always be
|
// But the total number of address formation instructions will always be
|
||||||
// at most two, and will often be zero. In any case, it will be optimal.
|
// at most two, and will often be zero. In any case, it will be optimal.
|
||||||
// If vtable_index is a register, we will have (sll_ptr N,x; inc_ptr B,x; ld_ptr k,x).
|
// If vtable_index is a register, we will have (sll_ptr N,x; inc_ptr B,x; ld_ptr k,x).
|
||||||
// If vtable_index is a constant, we will have at most (set B+X<<N,t; ld_ptr k,t).
|
// If vtable_index is a constant, we will have at most (set B+X<<N,t; ld_ptr k,t).
|
||||||
vtable_offset = regcon_sll_ptr(vtable_index, exact_log2(vtableEntry::size() * wordSize), vtable_offset);
|
vtable_offset = regcon_sll_ptr(vtable_index, exact_log2(vtableEntry::size_in_bytes()), vtable_offset);
|
||||||
vtable_offset = regcon_inc_ptr(vtable_offset, base, vtable_offset, sethi_temp);
|
vtable_offset = regcon_inc_ptr(vtable_offset, base, vtable_offset, sethi_temp);
|
||||||
Address vtable_entry_addr(recv_klass, ensure_simm13_or_reg(vtable_offset, sethi_temp));
|
Address vtable_entry_addr(recv_klass, ensure_simm13_or_reg(vtable_offset, sethi_temp));
|
||||||
ld_ptr(vtable_entry_addr, method_result);
|
ld_ptr(vtable_entry_addr, method_result);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
|
// Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
//
|
//
|
||||||
// This code is free software; you can redistribute it and/or modify it
|
// This code is free software; you can redistribute it and/or modify it
|
||||||
@ -601,8 +601,8 @@ int MachCallDynamicJavaNode::ret_addr_offset() {
|
|||||||
NativeCall::instruction_size); // sethi; setlo; call; delay slot
|
NativeCall::instruction_size); // sethi; setlo; call; delay slot
|
||||||
} else {
|
} else {
|
||||||
assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
|
assert(!UseInlineCaches, "expect vtable calls only if not using ICs");
|
||||||
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
|
int entry_offset = in_bytes(Klass::vtable_start_offset()) + vtable_index*vtableEntry::size_in_bytes();
|
||||||
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
|
int v_off = entry_offset + vtableEntry::method_offset_in_bytes();
|
||||||
int klass_load_size;
|
int klass_load_size;
|
||||||
if (UseCompressedClassPointers) {
|
if (UseCompressedClassPointers) {
|
||||||
assert(Universe::heap() != NULL, "java heap should be initialized");
|
assert(Universe::heap() != NULL, "java heap should be initialized");
|
||||||
@ -2658,8 +2658,8 @@ encode %{
|
|||||||
} else {
|
} else {
|
||||||
klass_load_size = 1*BytesPerInstWord;
|
klass_load_size = 1*BytesPerInstWord;
|
||||||
}
|
}
|
||||||
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
|
int entry_offset = in_bytes(Klass::vtable_start_offset()) + vtable_index*vtableEntry::size_in_bytes();
|
||||||
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
|
int v_off = entry_offset + vtableEntry::method_offset_in_bytes();
|
||||||
if (Assembler::is_simm13(v_off)) {
|
if (Assembler::is_simm13(v_off)) {
|
||||||
__ ld_ptr(G3, v_off, G5_method);
|
__ ld_ptr(G3, v_off, G5_method);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3153,14 +3153,11 @@ void TemplateTable::invokeinterface(int byte_no) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
// compute start of first itableOffsetEntry (which is at end of vtable)
|
// compute start of first itableOffsetEntry (which is at end of vtable)
|
||||||
const int base = InstanceKlass::vtable_start_offset() * wordSize;
|
const int base = in_bytes(Klass::vtable_start_offset());
|
||||||
Label search;
|
Label search;
|
||||||
Register Rtemp = O1_flags;
|
Register Rtemp = O1_flags;
|
||||||
|
|
||||||
__ ld(O2_Klass, InstanceKlass::vtable_length_offset() * wordSize, Rtemp);
|
__ ld(O2_Klass, in_bytes(Klass::vtable_length_offset()), Rtemp);
|
||||||
if (align_object_offset(1) > 1) {
|
|
||||||
__ round_to(Rtemp, align_object_offset(1));
|
|
||||||
}
|
|
||||||
__ sll(Rtemp, LogBytesPerWord, Rtemp); // Rscratch *= 4;
|
__ sll(Rtemp, LogBytesPerWord, Rtemp); // Rscratch *= 4;
|
||||||
if (Assembler::is_simm13(base)) {
|
if (Assembler::is_simm13(base)) {
|
||||||
__ add(Rtemp, base, Rtemp);
|
__ add(Rtemp, base, Rtemp);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -78,7 +78,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
|||||||
if (DebugVtables) {
|
if (DebugVtables) {
|
||||||
Label L;
|
Label L;
|
||||||
// check offset vs vtable length
|
// check offset vs vtable length
|
||||||
__ ld(G3_scratch, InstanceKlass::vtable_length_offset()*wordSize, G5);
|
__ ld(G3_scratch, in_bytes(Klass::vtable_length_offset()), G5);
|
||||||
__ cmp_and_br_short(G5, vtable_index*vtableEntry::size(), Assembler::greaterUnsigned, Assembler::pt, L);
|
__ cmp_and_br_short(G5, vtable_index*vtableEntry::size(), Assembler::greaterUnsigned, Assembler::pt, L);
|
||||||
__ set(vtable_index, O2);
|
__ set(vtable_index, O2);
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2);
|
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -5867,22 +5867,17 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
|||||||
"caller must use same register for non-constant itable index as for method");
|
"caller must use same register for non-constant itable index as for method");
|
||||||
|
|
||||||
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
|
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
|
||||||
int vtable_base = InstanceKlass::vtable_start_offset() * wordSize;
|
int vtable_base = in_bytes(Klass::vtable_start_offset());
|
||||||
int itentry_off = itableMethodEntry::method_offset_in_bytes();
|
int itentry_off = itableMethodEntry::method_offset_in_bytes();
|
||||||
int scan_step = itableOffsetEntry::size() * wordSize;
|
int scan_step = itableOffsetEntry::size() * wordSize;
|
||||||
int vte_size = vtableEntry::size() * wordSize;
|
int vte_size = vtableEntry::size_in_bytes();
|
||||||
Address::ScaleFactor times_vte_scale = Address::times_ptr;
|
Address::ScaleFactor times_vte_scale = Address::times_ptr;
|
||||||
assert(vte_size == wordSize, "else adjust times_vte_scale");
|
assert(vte_size == wordSize, "else adjust times_vte_scale");
|
||||||
|
|
||||||
movl(scan_temp, Address(recv_klass, InstanceKlass::vtable_length_offset() * wordSize));
|
movl(scan_temp, Address(recv_klass, Klass::vtable_length_offset()));
|
||||||
|
|
||||||
// %%% Could store the aligned, prescaled offset in the klassoop.
|
// %%% Could store the aligned, prescaled offset in the klassoop.
|
||||||
lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base));
|
lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base));
|
||||||
if (HeapWordsPerLong > 1) {
|
|
||||||
// Round up to align_object_offset boundary
|
|
||||||
// see code for InstanceKlass::start_of_itable!
|
|
||||||
round_to(scan_temp, BytesPerLong);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
|
// Adjust recv_klass by scaled itable_index, so we can free itable_index.
|
||||||
assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
|
assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
|
||||||
@ -5930,7 +5925,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
|||||||
void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
||||||
RegisterOrConstant vtable_index,
|
RegisterOrConstant vtable_index,
|
||||||
Register method_result) {
|
Register method_result) {
|
||||||
const int base = InstanceKlass::vtable_start_offset() * wordSize;
|
const int base = in_bytes(Klass::vtable_start_offset());
|
||||||
assert(vtableEntry::size() * wordSize == wordSize, "else adjust the scaling in the code below");
|
assert(vtableEntry::size() * wordSize == wordSize, "else adjust the scaling in the code below");
|
||||||
Address vtable_entry_addr(recv_klass,
|
Address vtable_entry_addr(recv_klass,
|
||||||
vtable_index, Address::times_ptr,
|
vtable_index, Address::times_ptr,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -85,7 +85,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
|||||||
if (DebugVtables) {
|
if (DebugVtables) {
|
||||||
Label L;
|
Label L;
|
||||||
// check offset vs vtable length
|
// check offset vs vtable length
|
||||||
__ cmpl(Address(rax, InstanceKlass::vtable_length_offset()*wordSize), vtable_index*vtableEntry::size());
|
__ cmpl(Address(rax, Klass::vtable_length_offset()), vtable_index*vtableEntry::size());
|
||||||
__ jcc(Assembler::greater, L);
|
__ jcc(Assembler::greater, L);
|
||||||
__ movl(rbx, vtable_index);
|
__ movl(rbx, vtable_index);
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), rcx, rbx);
|
__ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), rcx, rbx);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -77,7 +77,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
|||||||
if (DebugVtables) {
|
if (DebugVtables) {
|
||||||
Label L;
|
Label L;
|
||||||
// check offset vs vtable length
|
// check offset vs vtable length
|
||||||
__ cmpl(Address(rax, InstanceKlass::vtable_length_offset() * wordSize),
|
__ cmpl(Address(rax, Klass::vtable_length_offset()),
|
||||||
vtable_index * vtableEntry::size());
|
vtable_index * vtableEntry::size());
|
||||||
__ jcc(Assembler::greater, L);
|
__ jcc(Assembler::greater, L);
|
||||||
__ movl(rbx, vtable_index);
|
__ movl(rbx, vtable_index);
|
||||||
|
@ -141,16 +141,20 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
agent = new HotSpotAgent();
|
// Create frame first, to catch any GUI creation issues
|
||||||
workerThread = new WorkerThread();
|
// before we initialize agent
|
||||||
attachMenuItems = new java.util.ArrayList();
|
|
||||||
detachMenuItems = new java.util.ArrayList();
|
|
||||||
|
|
||||||
frame = new JFrame("HSDB - HotSpot Debugger");
|
frame = new JFrame("HSDB - HotSpot Debugger");
|
||||||
frame.setSize(800, 600);
|
frame.setSize(800, 600);
|
||||||
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
frame.addWindowListener(new CloseUI());
|
frame.addWindowListener(new CloseUI());
|
||||||
|
|
||||||
|
agent = new HotSpotAgent();
|
||||||
|
workerThread = new WorkerThread();
|
||||||
|
attachMenuItems = new java.util.ArrayList();
|
||||||
|
detachMenuItems = new java.util.ArrayList();
|
||||||
|
|
||||||
|
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -48,7 +48,6 @@ public class ArrayKlass extends Klass {
|
|||||||
dimension = new CIntField(type.getCIntegerField("_dimension"), 0);
|
dimension = new CIntField(type.getCIntegerField("_dimension"), 0);
|
||||||
higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
|
higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
|
||||||
lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
|
lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
|
||||||
vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
|
|
||||||
javaLangCloneableName = null;
|
javaLangCloneableName = null;
|
||||||
javaLangObjectName = null;
|
javaLangObjectName = null;
|
||||||
javaIoSerializableName = null;
|
javaIoSerializableName = null;
|
||||||
@ -61,7 +60,6 @@ public class ArrayKlass extends Klass {
|
|||||||
private static CIntField dimension;
|
private static CIntField dimension;
|
||||||
private static MetadataField higherDimension;
|
private static MetadataField higherDimension;
|
||||||
private static MetadataField lowerDimension;
|
private static MetadataField lowerDimension;
|
||||||
private static CIntField vtableLen;
|
|
||||||
|
|
||||||
public Klass getJavaSuper() {
|
public Klass getJavaSuper() {
|
||||||
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
|
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
|
||||||
@ -71,7 +69,6 @@ public class ArrayKlass extends Klass {
|
|||||||
public long getDimension() { return dimension.getValue(this); }
|
public long getDimension() { return dimension.getValue(this); }
|
||||||
public Klass getHigherDimension() { return (Klass) higherDimension.getValue(this); }
|
public Klass getHigherDimension() { return (Klass) higherDimension.getValue(this); }
|
||||||
public Klass getLowerDimension() { return (Klass) lowerDimension.getValue(this); }
|
public Klass getLowerDimension() { return (Klass) lowerDimension.getValue(this); }
|
||||||
public long getVtableLen() { return vtableLen.getValue(this); }
|
|
||||||
|
|
||||||
// constant class names - javaLangCloneable, javaIoSerializable, javaLangObject
|
// constant class names - javaLangCloneable, javaIoSerializable, javaLangObject
|
||||||
// Initialized lazily to avoid initialization ordering dependencies between ArrayKlass and SymbolTable
|
// Initialized lazily to avoid initialization ordering dependencies between ArrayKlass and SymbolTable
|
||||||
@ -140,6 +137,5 @@ public class ArrayKlass extends Klass {
|
|||||||
visitor.doCInt(dimension, true);
|
visitor.doCInt(dimension, true);
|
||||||
visitor.doMetadata(higherDimension, true);
|
visitor.doMetadata(higherDimension, true);
|
||||||
visitor.doMetadata(lowerDimension, true);
|
visitor.doMetadata(lowerDimension, true);
|
||||||
visitor.doCInt(vtableLen, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -696,7 +696,7 @@ public class ConstantPool extends Metadata implements ClassConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getSize() {
|
public long getSize() {
|
||||||
return Oop.alignObjectSize(headerSize + getLength());
|
return alignSize(headerSize + getLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -70,7 +70,7 @@ public class ConstantPoolCache extends Metadata {
|
|||||||
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
|
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
|
||||||
|
|
||||||
public long getSize() {
|
public long getSize() {
|
||||||
return Oop.alignObjectSize(baseOffset + getLength() * elementSize);
|
return alignSize(baseOffset + getLength() * elementSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConstantPoolCacheEntry getEntryAt(int i) {
|
public ConstantPoolCacheEntry getEntryAt(int i) {
|
||||||
@ -79,8 +79,7 @@ public class ConstantPoolCache extends Metadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getIntAt(int entry, int fld) {
|
public int getIntAt(int entry, int fld) {
|
||||||
//alignObjectSize ?
|
long offset = baseOffset + entry * elementSize + fld * intSize;
|
||||||
long offset = baseOffset + /*alignObjectSize*/entry * elementSize + fld * intSize;
|
|
||||||
return (int) getAddress().getCIntegerAt(offset, intSize, true );
|
return (int) getAddress().getCIntegerAt(offset, intSize, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -84,13 +84,12 @@ public class InstanceKlass extends Klass {
|
|||||||
nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0);
|
nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0);
|
||||||
isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0);
|
isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0);
|
||||||
initState = new CIntField(type.getCIntegerField("_init_state"), 0);
|
initState = new CIntField(type.getCIntegerField("_init_state"), 0);
|
||||||
vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
|
|
||||||
itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0);
|
itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0);
|
||||||
breakpoints = type.getAddressField("_breakpoints");
|
breakpoints = type.getAddressField("_breakpoints");
|
||||||
genericSignatureIndex = new CIntField(type.getCIntegerField("_generic_signature_index"), 0);
|
genericSignatureIndex = new CIntField(type.getCIntegerField("_generic_signature_index"), 0);
|
||||||
majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0);
|
majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0);
|
||||||
minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0);
|
minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0);
|
||||||
headerSize = Oop.alignObjectOffset(type.getSize());
|
headerSize = type.getSize();
|
||||||
|
|
||||||
// read field offset constants
|
// read field offset constants
|
||||||
ACCESS_FLAGS_OFFSET = db.lookupIntConstant("FieldInfo::access_flags_offset").intValue();
|
ACCESS_FLAGS_OFFSET = db.lookupIntConstant("FieldInfo::access_flags_offset").intValue();
|
||||||
@ -143,7 +142,6 @@ public class InstanceKlass extends Klass {
|
|||||||
private static CIntField nonstaticOopMapSize;
|
private static CIntField nonstaticOopMapSize;
|
||||||
private static CIntField isMarkedDependent;
|
private static CIntField isMarkedDependent;
|
||||||
private static CIntField initState;
|
private static CIntField initState;
|
||||||
private static CIntField vtableLen;
|
|
||||||
private static CIntField itableLen;
|
private static CIntField itableLen;
|
||||||
private static AddressField breakpoints;
|
private static AddressField breakpoints;
|
||||||
private static CIntField genericSignatureIndex;
|
private static CIntField genericSignatureIndex;
|
||||||
@ -242,8 +240,7 @@ public class InstanceKlass extends Klass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getSize() {
|
public long getSize() {
|
||||||
return Oop.alignObjectSize(getHeaderSize() + Oop.alignObjectOffset(getVtableLen()) +
|
return alignSize(getHeaderSize() + getVtableLen() + getItableLen() + getNonstaticOopMapSize());
|
||||||
Oop.alignObjectOffset(getItableLen()) + Oop.alignObjectOffset(getNonstaticOopMapSize()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long getHeaderSize() { return headerSize; }
|
public static long getHeaderSize() { return headerSize; }
|
||||||
@ -352,7 +349,6 @@ public class InstanceKlass extends Klass {
|
|||||||
public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
|
public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
|
||||||
public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); }
|
public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); }
|
||||||
public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
|
public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
|
||||||
public long getVtableLen() { return vtableLen.getValue(this); }
|
|
||||||
public long getItableLen() { return itableLen.getValue(this); }
|
public long getItableLen() { return itableLen.getValue(this); }
|
||||||
public long majorVersion() { return majorVersion.getValue(this); }
|
public long majorVersion() { return majorVersion.getValue(this); }
|
||||||
public long minorVersion() { return minorVersion.getValue(this); }
|
public long minorVersion() { return minorVersion.getValue(this); }
|
||||||
@ -548,7 +544,6 @@ public class InstanceKlass extends Klass {
|
|||||||
visitor.doCInt(nonstaticOopMapSize, true);
|
visitor.doCInt(nonstaticOopMapSize, true);
|
||||||
visitor.doCInt(isMarkedDependent, true);
|
visitor.doCInt(isMarkedDependent, true);
|
||||||
visitor.doCInt(initState, true);
|
visitor.doCInt(initState, true);
|
||||||
visitor.doCInt(vtableLen, true);
|
|
||||||
visitor.doCInt(itableLen, true);
|
visitor.doCInt(itableLen, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -61,6 +61,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
}
|
}
|
||||||
subklass = new MetadataField(type.getAddressField("_subklass"), 0);
|
subklass = new MetadataField(type.getAddressField("_subklass"), 0);
|
||||||
nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
|
nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
|
||||||
|
vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
|
||||||
|
|
||||||
LH_INSTANCE_SLOW_PATH_BIT = db.lookupIntConstant("Klass::_lh_instance_slow_path_bit").intValue();
|
LH_INSTANCE_SLOW_PATH_BIT = db.lookupIntConstant("Klass::_lh_instance_slow_path_bit").intValue();
|
||||||
LH_LOG2_ELEMENT_SIZE_SHIFT = db.lookupIntConstant("Klass::_lh_log2_element_size_shift").intValue();
|
LH_LOG2_ELEMENT_SIZE_SHIFT = db.lookupIntConstant("Klass::_lh_log2_element_size_shift").intValue();
|
||||||
@ -71,6 +72,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
LH_ARRAY_TAG_OBJ_VALUE = db.lookupIntConstant("Klass::_lh_array_tag_obj_value").intValue();
|
LH_ARRAY_TAG_OBJ_VALUE = db.lookupIntConstant("Klass::_lh_array_tag_obj_value").intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Klass(Address addr) {
|
public Klass(Address addr) {
|
||||||
super(addr);
|
super(addr);
|
||||||
}
|
}
|
||||||
@ -91,6 +93,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
private static MetadataField subklass;
|
private static MetadataField subklass;
|
||||||
private static MetadataField nextSibling;
|
private static MetadataField nextSibling;
|
||||||
private static sun.jvm.hotspot.types.Field traceIDField;
|
private static sun.jvm.hotspot.types.Field traceIDField;
|
||||||
|
private static CIntField vtableLen;
|
||||||
|
|
||||||
private Address getValue(AddressField field) {
|
private Address getValue(AddressField field) {
|
||||||
return addr.getAddressAt(field.getOffset());
|
return addr.getAddressAt(field.getOffset());
|
||||||
@ -111,6 +114,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
|
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
|
||||||
public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
|
public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
|
||||||
public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
|
public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
|
||||||
|
public long getVtableLen() { return vtableLen.getValue(this); }
|
||||||
|
|
||||||
public long traceID() {
|
public long traceID() {
|
||||||
if (traceIDField == null) return 0;
|
if (traceIDField == null) return 0;
|
||||||
@ -179,6 +183,7 @@ public class Klass extends Metadata implements ClassConstants {
|
|||||||
visitor.doCInt(accessFlags, true);
|
visitor.doCInt(accessFlags, true);
|
||||||
visitor.doMetadata(subklass, true);
|
visitor.doMetadata(subklass, true);
|
||||||
visitor.doMetadata(nextSibling, true);
|
visitor.doMetadata(nextSibling, true);
|
||||||
|
visitor.doCInt(vtableLen, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getObjectSize() {
|
public long getObjectSize() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -44,6 +44,11 @@ abstract public class Metadata extends VMObject {
|
|||||||
super(addr);
|
super(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long alignSize(long size) {
|
||||||
|
// natural word size.
|
||||||
|
return VM.getVM().alignUp(size, VM.getVM().getBytesPerWord());
|
||||||
|
}
|
||||||
|
|
||||||
private static VirtualBaseConstructor<Metadata> metadataConstructor;
|
private static VirtualBaseConstructor<Metadata> metadataConstructor;
|
||||||
|
|
||||||
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
|
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -252,7 +252,7 @@ public class MethodData extends Metadata implements MethodDataInterface<Klass,Me
|
|||||||
}
|
}
|
||||||
|
|
||||||
int size() {
|
int size() {
|
||||||
return (int)Oop.alignObjectSize(VM.getVM().alignUp(sizeInBytes(), VM.getVM().getBytesPerWord())/VM.getVM().getBytesPerWord());
|
return (int)alignSize(VM.getVM().alignUp(sizeInBytes(), VM.getVM().getBytesPerWord())/VM.getVM().getBytesPerWord());
|
||||||
}
|
}
|
||||||
|
|
||||||
ParametersTypeData<Klass,Method> parametersTypeData() {
|
ParametersTypeData<Klass,Method> parametersTypeData() {
|
||||||
|
@ -35,7 +35,11 @@ public class WorkerThread {
|
|||||||
public WorkerThread() {
|
public WorkerThread() {
|
||||||
mqb = new MessageQueueBackend();
|
mqb = new MessageQueueBackend();
|
||||||
mq = mqb.getFirstQueue();
|
mq = mqb.getFirstQueue();
|
||||||
new Thread(new MainLoop()).start();
|
|
||||||
|
// Enable to terminate this worker during runnning by daemonize.
|
||||||
|
Thread mqthread = new Thread(new MainLoop());
|
||||||
|
mqthread.setDaemon(true);
|
||||||
|
mqthread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Runs the given Runnable in the thread represented by this
|
/** Runs the given Runnable in the thread represented by this
|
||||||
|
@ -76,14 +76,14 @@ public class AArch64 extends Architecture {
|
|||||||
public static final Register zr = r31;
|
public static final Register zr = r31;
|
||||||
public static final Register sp = r31;
|
public static final Register sp = r31;
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
public static final Register[] cpuRegisters = {
|
public static final Register[] cpuRegisters = {
|
||||||
// @formatter:off
|
|
||||||
r0, r1, r2, r3, r4, r5, r6, r7,
|
r0, r1, r2, r3, r4, r5, r6, r7,
|
||||||
r8, r9, r10, r11, r12, r13, r14, r15,
|
r8, r9, r10, r11, r12, r13, r14, r15,
|
||||||
r16, r17, r18, r19, r20, r21, r22, r23,
|
r16, r17, r18, r19, r20, r21, r22, r23,
|
||||||
r24, r25, r26, r27, r28, r29, r30, r31
|
r24, r25, r26, r27, r28, r29, r30, r31
|
||||||
// @formatter:on
|
|
||||||
};
|
};
|
||||||
|
// @formatter:on
|
||||||
|
|
||||||
public static final RegisterCategory SIMD = new RegisterCategory("SIMD");
|
public static final RegisterCategory SIMD = new RegisterCategory("SIMD");
|
||||||
|
|
||||||
@ -121,17 +121,17 @@ public class AArch64 extends Architecture {
|
|||||||
public static final Register v30 = new Register(62, 30, "v30", SIMD);
|
public static final Register v30 = new Register(62, 30, "v30", SIMD);
|
||||||
public static final Register v31 = new Register(63, 31, "v31", SIMD);
|
public static final Register v31 = new Register(63, 31, "v31", SIMD);
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
public static final Register[] simdRegisters = {
|
public static final Register[] simdRegisters = {
|
||||||
// @formatter:off
|
|
||||||
v0, v1, v2, v3, v4, v5, v6, v7,
|
v0, v1, v2, v3, v4, v5, v6, v7,
|
||||||
v8, v9, v10, v11, v12, v13, v14, v15,
|
v8, v9, v10, v11, v12, v13, v14, v15,
|
||||||
v16, v17, v18, v19, v20, v21, v22, v23,
|
v16, v17, v18, v19, v20, v21, v22, v23,
|
||||||
v24, v25, v26, v27, v28, v29, v30, v31
|
v24, v25, v26, v27, v28, v29, v30, v31
|
||||||
// @formatter:on
|
|
||||||
};
|
};
|
||||||
|
// @formatter:on
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
public static final Register[] allRegisters = {
|
public static final Register[] allRegisters = {
|
||||||
// @formatter:off
|
|
||||||
r0, r1, r2, r3, r4, r5, r6, r7,
|
r0, r1, r2, r3, r4, r5, r6, r7,
|
||||||
r8, r9, r10, r11, r12, r13, r14, r15,
|
r8, r9, r10, r11, r12, r13, r14, r15,
|
||||||
r16, r17, r18, r19, r20, r21, r22, r23,
|
r16, r17, r18, r19, r20, r21, r22, r23,
|
||||||
@ -141,14 +141,14 @@ public class AArch64 extends Architecture {
|
|||||||
v8, v9, v10, v11, v12, v13, v14, v15,
|
v8, v9, v10, v11, v12, v13, v14, v15,
|
||||||
v16, v17, v18, v19, v20, v21, v22, v23,
|
v16, v17, v18, v19, v20, v21, v22, v23,
|
||||||
v24, v25, v26, v27, v28, v29, v30, v31
|
v24, v25, v26, v27, v28, v29, v30, v31
|
||||||
// @formatter:on
|
|
||||||
};
|
};
|
||||||
|
// @formatter:on
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic set of CPU features mirroring what is returned from the cpuid instruction. See:
|
* Basic set of CPU features mirroring what is returned from the cpuid instruction. See:
|
||||||
* {@code VM_Version::cpuFeatureFlags}.
|
* {@code VM_Version::cpuFeatureFlags}.
|
||||||
*/
|
*/
|
||||||
public static enum CPUFeature {
|
public enum CPUFeature {
|
||||||
FP,
|
FP,
|
||||||
ASIMD,
|
ASIMD,
|
||||||
EVTSTRM,
|
EVTSTRM,
|
||||||
@ -166,7 +166,7 @@ public class AArch64 extends Architecture {
|
|||||||
/**
|
/**
|
||||||
* Set of flags to control code emission.
|
* Set of flags to control code emission.
|
||||||
*/
|
*/
|
||||||
public static enum Flag {
|
public enum Flag {
|
||||||
UseBarriersForVolatile,
|
UseBarriersForVolatile,
|
||||||
UseCRC32,
|
UseCRC32,
|
||||||
UseNeon
|
UseNeon
|
||||||
|
@ -58,13 +58,13 @@ public enum AArch64Kind implements PlatformKind {
|
|||||||
private final AArch64Kind scalar;
|
private final AArch64Kind scalar;
|
||||||
private final EnumKey<AArch64Kind> key = new EnumKey<>(this);
|
private final EnumKey<AArch64Kind> key = new EnumKey<>(this);
|
||||||
|
|
||||||
private AArch64Kind(int size) {
|
AArch64Kind(int size) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.scalar = this;
|
this.scalar = this;
|
||||||
this.vectorLength = 1;
|
this.vectorLength = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AArch64Kind(int size, AArch64Kind scalar) {
|
AArch64Kind(int size, AArch64Kind scalar) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.scalar = scalar;
|
this.scalar = scalar;
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ public class AMD64 extends Architecture {
|
|||||||
* Basic set of CPU features mirroring what is returned from the cpuid instruction. See:
|
* Basic set of CPU features mirroring what is returned from the cpuid instruction. See:
|
||||||
* {@code VM_Version::cpuFeatureFlags}.
|
* {@code VM_Version::cpuFeatureFlags}.
|
||||||
*/
|
*/
|
||||||
public static enum CPUFeature {
|
public enum CPUFeature {
|
||||||
CX8,
|
CX8,
|
||||||
CMOV,
|
CMOV,
|
||||||
FXSR,
|
FXSR,
|
||||||
@ -210,7 +210,7 @@ public class AMD64 extends Architecture {
|
|||||||
/**
|
/**
|
||||||
* Set of flags to control code emission.
|
* Set of flags to control code emission.
|
||||||
*/
|
*/
|
||||||
public static enum Flag {
|
public enum Flag {
|
||||||
UseCountLeadingZerosInstruction,
|
UseCountLeadingZerosInstruction,
|
||||||
UseCountTrailingZerosInstruction
|
UseCountTrailingZerosInstruction
|
||||||
}
|
}
|
||||||
|
@ -74,13 +74,13 @@ public enum AMD64Kind implements PlatformKind {
|
|||||||
private final AMD64Kind scalar;
|
private final AMD64Kind scalar;
|
||||||
private final EnumKey<AMD64Kind> key = new EnumKey<>(this);
|
private final EnumKey<AMD64Kind> key = new EnumKey<>(this);
|
||||||
|
|
||||||
private AMD64Kind(int size) {
|
AMD64Kind(int size) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.scalar = this;
|
this.scalar = this;
|
||||||
this.vectorLength = 1;
|
this.vectorLength = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AMD64Kind(int size, AMD64Kind scalar) {
|
AMD64Kind(int size, AMD64Kind scalar) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.scalar = scalar;
|
this.scalar = scalar;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
package jdk.vm.ci.code;
|
package jdk.vm.ci.code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing a exception with a stack trace of the currently processed position in the
|
* Class representing an exception with a stack trace of the currently processed position in the
|
||||||
* compiled Java program instead of the stack trace of the compiler. The exception of the compiler
|
* compiled Java program instead of the stack trace of the compiler. The exception of the compiler
|
||||||
* is saved as the cause of this exception.
|
* is saved as the cause of this exception.
|
||||||
*/
|
*/
|
||||||
@ -36,7 +36,7 @@ public abstract class SourceStackTrace extends BailoutException {
|
|||||||
private static final long serialVersionUID = 6279381376051787907L;
|
private static final long serialVersionUID = 6279381376051787907L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final synchronized Throwable fillInStackTrace() {
|
public synchronized Throwable fillInStackTrace() {
|
||||||
assert elements != null;
|
assert elements != null;
|
||||||
setStackTrace(elements);
|
setStackTrace(elements);
|
||||||
return this;
|
return this;
|
||||||
|
@ -49,7 +49,7 @@ public enum HotSpotCallingConventionType implements CallingConvention.Type {
|
|||||||
|
|
||||||
public static final Type[] VALUES = values();
|
public static final Type[] VALUES = values();
|
||||||
|
|
||||||
private HotSpotCallingConventionType(boolean out) {
|
HotSpotCallingConventionType(boolean out) {
|
||||||
this.out = out;
|
this.out = out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ package jdk.vm.ci.hotspot;
|
|||||||
|
|
||||||
import jdk.vm.ci.code.BytecodeFrame;
|
import jdk.vm.ci.code.BytecodeFrame;
|
||||||
import jdk.vm.ci.code.CompiledCode;
|
import jdk.vm.ci.code.CompiledCode;
|
||||||
|
import jdk.vm.ci.code.StackSlot;
|
||||||
import jdk.vm.ci.code.site.DataPatch;
|
import jdk.vm.ci.code.site.DataPatch;
|
||||||
import jdk.vm.ci.code.site.Infopoint;
|
import jdk.vm.ci.code.site.Infopoint;
|
||||||
import jdk.vm.ci.code.site.Site;
|
import jdk.vm.ci.code.site.Site;
|
||||||
@ -99,9 +100,9 @@ public class HotSpotCompiledCode implements CompiledCode {
|
|||||||
protected final int totalFrameSize;
|
protected final int totalFrameSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offset in bytes for the custom stack area (relative to sp).
|
* The deopt rescue slot. Must be non-null if there is a safepoint in the method.
|
||||||
*/
|
*/
|
||||||
protected final int customStackAreaOffset;
|
protected final StackSlot deoptRescueSlot;
|
||||||
|
|
||||||
public static class Comment {
|
public static class Comment {
|
||||||
|
|
||||||
@ -115,7 +116,7 @@ public class HotSpotCompiledCode implements CompiledCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HotSpotCompiledCode(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection,
|
public HotSpotCompiledCode(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection,
|
||||||
int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, int customStackAreaOffset) {
|
int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, StackSlot deoptRescueSlot) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.targetCode = targetCode;
|
this.targetCode = targetCode;
|
||||||
this.targetCodeSize = targetCodeSize;
|
this.targetCodeSize = targetCodeSize;
|
||||||
@ -129,7 +130,7 @@ public class HotSpotCompiledCode implements CompiledCode {
|
|||||||
this.dataSectionPatches = dataSectionPatches;
|
this.dataSectionPatches = dataSectionPatches;
|
||||||
this.isImmutablePIC = isImmutablePIC;
|
this.isImmutablePIC = isImmutablePIC;
|
||||||
this.totalFrameSize = totalFrameSize;
|
this.totalFrameSize = totalFrameSize;
|
||||||
this.customStackAreaOffset = customStackAreaOffset;
|
this.deoptRescueSlot = deoptRescueSlot;
|
||||||
|
|
||||||
assert validateFrames();
|
assert validateFrames();
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package jdk.vm.ci.hotspot;
|
package jdk.vm.ci.hotspot;
|
||||||
|
|
||||||
|
import jdk.vm.ci.code.StackSlot;
|
||||||
import jdk.vm.ci.code.site.DataPatch;
|
import jdk.vm.ci.code.site.DataPatch;
|
||||||
import jdk.vm.ci.code.site.Site;
|
import jdk.vm.ci.code.site.Site;
|
||||||
import jdk.vm.ci.inittimer.SuppressFBWarnings;
|
import jdk.vm.ci.inittimer.SuppressFBWarnings;
|
||||||
@ -55,9 +56,9 @@ public final class HotSpotCompiledNmethod extends HotSpotCompiledCode {
|
|||||||
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "set by the VM") private String installationFailureMessage;
|
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "set by the VM") private String installationFailureMessage;
|
||||||
|
|
||||||
public HotSpotCompiledNmethod(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection,
|
public HotSpotCompiledNmethod(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection,
|
||||||
int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, int customStackAreaOffset, HotSpotResolvedJavaMethod method, int entryBCI,
|
int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, StackSlot deoptRescueSlot, HotSpotResolvedJavaMethod method, int entryBCI,
|
||||||
int id, long jvmciEnv, boolean hasUnsafeAccess) {
|
int id, long jvmciEnv, boolean hasUnsafeAccess) {
|
||||||
super(name, targetCode, targetCodeSize, sites, assumptions, methods, comments, dataSection, dataSectionAlignment, dataSectionPatches, isImmutablePIC, totalFrameSize, customStackAreaOffset);
|
super(name, targetCode, targetCodeSize, sites, assumptions, methods, comments, dataSection, dataSectionAlignment, dataSectionPatches, isImmutablePIC, totalFrameSize, deoptRescueSlot);
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.entryBCI = entryBCI;
|
this.entryBCI = entryBCI;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -126,7 +126,7 @@ final class HotSpotConstantPool implements ConstantPool, HotSpotProxified, Metas
|
|||||||
private static final int InternalMin = config().jvmConstantInternalMin;
|
private static final int InternalMin = config().jvmConstantInternalMin;
|
||||||
private static final int InternalMax = config().jvmConstantInternalMax;
|
private static final int InternalMax = config().jvmConstantInternalMax;
|
||||||
|
|
||||||
private JVM_CONSTANT(int tag) {
|
JVM_CONSTANT(int tag) {
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ final class HotSpotConstantPool implements ConstantPool, HotSpotProxified, Metas
|
|||||||
int lastCpi = Integer.MIN_VALUE;
|
int lastCpi = Integer.MIN_VALUE;
|
||||||
JavaType javaType;
|
JavaType javaType;
|
||||||
|
|
||||||
public LookupTypeCacheElement(int lastCpi, JavaType javaType) {
|
LookupTypeCacheElement(int lastCpi, JavaType javaType) {
|
||||||
super();
|
super();
|
||||||
this.lastCpi = lastCpi;
|
this.lastCpi = lastCpi;
|
||||||
this.javaType = javaType;
|
this.javaType = javaType;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -22,7 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
package jdk.vm.ci.hotspot;
|
package jdk.vm.ci.hotspot;
|
||||||
|
|
||||||
public class HotSpotForeignCallTarget {
|
import jdk.vm.ci.meta.InvokeTarget;
|
||||||
|
|
||||||
|
public class HotSpotForeignCallTarget implements InvokeTarget {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The entry point address of this call's target.
|
* The entry point address of this call's target.
|
||||||
|
@ -43,6 +43,7 @@ import jdk.vm.ci.code.CompiledCode;
|
|||||||
import jdk.vm.ci.code.InstalledCode;
|
import jdk.vm.ci.code.InstalledCode;
|
||||||
import jdk.vm.ci.common.JVMCIError;
|
import jdk.vm.ci.common.JVMCIError;
|
||||||
import jdk.vm.ci.inittimer.InitTimer;
|
import jdk.vm.ci.inittimer.InitTimer;
|
||||||
|
import jdk.vm.ci.inittimer.SuppressFBWarnings;
|
||||||
import jdk.vm.ci.meta.JVMCIMetaAccessContext;
|
import jdk.vm.ci.meta.JVMCIMetaAccessContext;
|
||||||
import jdk.vm.ci.meta.JavaKind;
|
import jdk.vm.ci.meta.JavaKind;
|
||||||
import jdk.vm.ci.meta.JavaType;
|
import jdk.vm.ci.meta.JavaType;
|
||||||
@ -115,7 +116,7 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H
|
|||||||
private boolean isDefault;
|
private boolean isDefault;
|
||||||
private final String help;
|
private final String help;
|
||||||
|
|
||||||
private Option(Class<?> type, Object defaultValue, String help) {
|
Option(Class<?> type, Object defaultValue, String help) {
|
||||||
assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name();
|
assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name();
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.value = UNINITIALIZED;
|
this.value = UNINITIALIZED;
|
||||||
@ -123,6 +124,7 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H
|
|||||||
this.help = help;
|
this.help = help;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "sentinel must be String since it's a static final in an enum")
|
||||||
private Object getValue() {
|
private Object getValue() {
|
||||||
if (value == UNINITIALIZED) {
|
if (value == UNINITIALIZED) {
|
||||||
String propertyValue = VM.getSavedProperty(JVMCI_OPTION_PROPERTY_PREFIX + name());
|
String propertyValue = VM.getSavedProperty(JVMCI_OPTION_PROPERTY_PREFIX + name());
|
||||||
|
@ -38,7 +38,7 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider, Ho
|
|||||||
|
|
||||||
protected final HotSpotJVMCIRuntimeProvider runtime;
|
protected final HotSpotJVMCIRuntimeProvider runtime;
|
||||||
|
|
||||||
public HotSpotMemoryAccessProviderImpl(HotSpotJVMCIRuntimeProvider runtime) {
|
HotSpotMemoryAccessProviderImpl(HotSpotJVMCIRuntimeProvider runtime) {
|
||||||
this.runtime = runtime;
|
this.runtime = runtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ public final class HotSpotMethodData {
|
|||||||
private static final int COUNTER_DATA_SIZE = cellIndexToOffset(1);
|
private static final int COUNTER_DATA_SIZE = cellIndexToOffset(1);
|
||||||
private static final int COUNTER_DATA_COUNT_OFFSET = cellIndexToOffset(config.methodDataCountOffset);
|
private static final int COUNTER_DATA_COUNT_OFFSET = cellIndexToOffset(config.methodDataCountOffset);
|
||||||
|
|
||||||
public CounterData() {
|
CounterData() {
|
||||||
super(Tag.CounterData, COUNTER_DATA_SIZE);
|
super(Tag.CounterData, COUNTER_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ public final class HotSpotMethodData {
|
|||||||
protected static final int TAKEN_COUNT_OFFSET = cellIndexToOffset(config.jumpDataTakenOffset);
|
protected static final int TAKEN_COUNT_OFFSET = cellIndexToOffset(config.jumpDataTakenOffset);
|
||||||
protected static final int TAKEN_DISPLACEMENT_OFFSET = cellIndexToOffset(config.jumpDataDisplacementOffset);
|
protected static final int TAKEN_DISPLACEMENT_OFFSET = cellIndexToOffset(config.jumpDataDisplacementOffset);
|
||||||
|
|
||||||
public JumpData() {
|
JumpData() {
|
||||||
super(Tag.JumpData, JUMP_DATA_SIZE);
|
super(Tag.JumpData, JUMP_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ public final class HotSpotMethodData {
|
|||||||
final long[] counts;
|
final long[] counts;
|
||||||
final long totalCount;
|
final long totalCount;
|
||||||
|
|
||||||
public RawItemProfile(int entries, T[] items, long[] counts, long totalCount) {
|
RawItemProfile(int entries, T[] items, long[] counts, long totalCount) {
|
||||||
this.entries = entries;
|
this.entries = entries;
|
||||||
this.items = items;
|
this.items = items;
|
||||||
this.counts = counts;
|
this.counts = counts;
|
||||||
@ -587,7 +587,7 @@ public final class HotSpotMethodData {
|
|||||||
|
|
||||||
private static final int TYPE_CHECK_DATA_SIZE = cellIndexToOffset(2) + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
|
private static final int TYPE_CHECK_DATA_SIZE = cellIndexToOffset(2) + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
|
||||||
|
|
||||||
public ReceiverTypeData() {
|
ReceiverTypeData() {
|
||||||
super(Tag.ReceiverTypeData, TYPE_CHECK_DATA_SIZE);
|
super(Tag.ReceiverTypeData, TYPE_CHECK_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,7 +612,7 @@ public final class HotSpotMethodData {
|
|||||||
private static final int VIRTUAL_CALL_DATA_FIRST_METHOD_OFFSET = TYPE_DATA_FIRST_TYPE_OFFSET + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
|
private static final int VIRTUAL_CALL_DATA_FIRST_METHOD_OFFSET = TYPE_DATA_FIRST_TYPE_OFFSET + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
|
||||||
private static final int VIRTUAL_CALL_DATA_FIRST_METHOD_COUNT_OFFSET = TYPE_DATA_FIRST_TYPE_COUNT_OFFSET + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
|
private static final int VIRTUAL_CALL_DATA_FIRST_METHOD_COUNT_OFFSET = TYPE_DATA_FIRST_TYPE_COUNT_OFFSET + TYPE_DATA_ROW_SIZE * config.typeProfileWidth;
|
||||||
|
|
||||||
public VirtualCallData() {
|
VirtualCallData() {
|
||||||
super(Tag.VirtualCallData, VIRTUAL_CALL_DATA_SIZE);
|
super(Tag.VirtualCallData, VIRTUAL_CALL_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -714,7 +714,7 @@ public final class HotSpotMethodData {
|
|||||||
|
|
||||||
private static class VirtualCallTypeData extends VirtualCallData {
|
private static class VirtualCallTypeData extends VirtualCallData {
|
||||||
|
|
||||||
public VirtualCallTypeData() {
|
VirtualCallTypeData() {
|
||||||
super(Tag.VirtualCallTypeData, 0);
|
super(Tag.VirtualCallTypeData, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,7 +730,7 @@ public final class HotSpotMethodData {
|
|||||||
private static final int RET_DATA_ROW_SIZE = cellsToBytes(3);
|
private static final int RET_DATA_ROW_SIZE = cellsToBytes(3);
|
||||||
private static final int RET_DATA_SIZE = cellIndexToOffset(1) + RET_DATA_ROW_SIZE * config.bciProfileWidth;
|
private static final int RET_DATA_SIZE = cellIndexToOffset(1) + RET_DATA_ROW_SIZE * config.bciProfileWidth;
|
||||||
|
|
||||||
public RetData() {
|
RetData() {
|
||||||
super(Tag.RetData, RET_DATA_SIZE);
|
super(Tag.RetData, RET_DATA_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -740,7 +740,7 @@ public final class HotSpotMethodData {
|
|||||||
private static final int BRANCH_DATA_SIZE = cellIndexToOffset(3);
|
private static final int BRANCH_DATA_SIZE = cellIndexToOffset(3);
|
||||||
private static final int NOT_TAKEN_COUNT_OFFSET = cellIndexToOffset(config.branchDataNotTakenOffset);
|
private static final int NOT_TAKEN_COUNT_OFFSET = cellIndexToOffset(config.branchDataNotTakenOffset);
|
||||||
|
|
||||||
public BranchData() {
|
BranchData() {
|
||||||
super(Tag.BranchData, BRANCH_DATA_SIZE);
|
super(Tag.BranchData, BRANCH_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -773,7 +773,7 @@ public final class HotSpotMethodData {
|
|||||||
private static final int ARRAY_DATA_LENGTH_OFFSET = cellIndexToOffset(config.arrayDataArrayLenOffset);
|
private static final int ARRAY_DATA_LENGTH_OFFSET = cellIndexToOffset(config.arrayDataArrayLenOffset);
|
||||||
protected static final int ARRAY_DATA_START_OFFSET = cellIndexToOffset(config.arrayDataArrayStartOffset);
|
protected static final int ARRAY_DATA_START_OFFSET = cellIndexToOffset(config.arrayDataArrayStartOffset);
|
||||||
|
|
||||||
public ArrayData(Tag tag, int staticSize) {
|
ArrayData(Tag tag, int staticSize) {
|
||||||
super(tag, staticSize);
|
super(tag, staticSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -800,7 +800,7 @@ public final class HotSpotMethodData {
|
|||||||
private static final int MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(0);
|
private static final int MULTI_BRANCH_DATA_FIRST_COUNT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(0);
|
||||||
private static final int MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(1);
|
private static final int MULTI_BRANCH_DATA_FIRST_DISPLACEMENT_OFFSET = ARRAY_DATA_START_OFFSET + cellsToBytes(1);
|
||||||
|
|
||||||
public MultiBranchData() {
|
MultiBranchData() {
|
||||||
super(Tag.MultiBranchData, MULTI_BRANCH_DATA_SIZE);
|
super(Tag.MultiBranchData, MULTI_BRANCH_DATA_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -882,13 +882,13 @@ public final class HotSpotMethodData {
|
|||||||
|
|
||||||
private static final int ARG_INFO_DATA_SIZE = cellIndexToOffset(1);
|
private static final int ARG_INFO_DATA_SIZE = cellIndexToOffset(1);
|
||||||
|
|
||||||
public ArgInfoData() {
|
ArgInfoData() {
|
||||||
super(Tag.ArgInfoData, ARG_INFO_DATA_SIZE);
|
super(Tag.ArgInfoData, ARG_INFO_DATA_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class UnknownProfileData extends AbstractMethodData {
|
private static class UnknownProfileData extends AbstractMethodData {
|
||||||
public UnknownProfileData(Tag tag) {
|
UnknownProfileData(Tag tag) {
|
||||||
super(tag, 0);
|
super(tag, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public interface HotSpotMethodDataAccessor {
|
|||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
private Tag(int value) {
|
Tag(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ final class HotSpotMethodUnresolved extends HotSpotMethod {
|
|||||||
private final Signature signature;
|
private final Signature signature;
|
||||||
protected JavaType holder;
|
protected JavaType holder;
|
||||||
|
|
||||||
public HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) {
|
HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) {
|
||||||
super(name);
|
super(name);
|
||||||
this.holder = holder;
|
this.holder = holder;
|
||||||
this.signature = signature;
|
this.signature = signature;
|
||||||
|
@ -56,7 +56,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP
|
|||||||
public static class FieldLocationIdentity extends LocationIdentity {
|
public static class FieldLocationIdentity extends LocationIdentity {
|
||||||
HotSpotResolvedJavaField inner;
|
HotSpotResolvedJavaField inner;
|
||||||
|
|
||||||
public FieldLocationIdentity(HotSpotResolvedJavaFieldImpl inner) {
|
FieldLocationIdentity(HotSpotResolvedJavaFieldImpl inner) {
|
||||||
this.inner = inner;
|
this.inner = inner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -597,7 +597,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
|
|||||||
}
|
}
|
||||||
HotSpotVMConfig config = config();
|
HotSpotVMConfig config = config();
|
||||||
final int vtableIndex = getVtableIndex((HotSpotResolvedObjectTypeImpl) resolved);
|
final int vtableIndex = getVtableIndex((HotSpotResolvedObjectTypeImpl) resolved);
|
||||||
return config.instanceKlassVtableStartOffset() + vtableIndex * config.vtableEntrySize + config.vtableEntryMethodOffset;
|
return config.klassVtableStartOffset + vtableIndex * config.vtableEntrySize + config.vtableEntryMethodOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -33,7 +33,6 @@ import java.lang.reflect.Array;
|
|||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -49,7 +48,6 @@ import jdk.vm.ci.meta.Constant;
|
|||||||
import jdk.vm.ci.meta.JavaConstant;
|
import jdk.vm.ci.meta.JavaConstant;
|
||||||
import jdk.vm.ci.meta.JavaKind;
|
import jdk.vm.ci.meta.JavaKind;
|
||||||
import jdk.vm.ci.meta.JavaType;
|
import jdk.vm.ci.meta.JavaType;
|
||||||
import jdk.vm.ci.meta.MetaUtil;
|
|
||||||
import jdk.vm.ci.meta.ModifiersProvider;
|
import jdk.vm.ci.meta.ModifiersProvider;
|
||||||
import jdk.vm.ci.meta.ResolvedJavaField;
|
import jdk.vm.ci.meta.ResolvedJavaField;
|
||||||
import jdk.vm.ci.meta.ResolvedJavaMethod;
|
import jdk.vm.ci.meta.ResolvedJavaMethod;
|
||||||
@ -472,8 +470,8 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
|
|||||||
/* Everything has the core vtable of java.lang.Object */
|
/* Everything has the core vtable of java.lang.Object */
|
||||||
return config.baseVtableLength();
|
return config.baseVtableLength();
|
||||||
}
|
}
|
||||||
int result = UNSAFE.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize);
|
int result = UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize);
|
||||||
assert result >= config.baseVtableLength() : UNSAFE.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) + " " + config.vtableEntrySize;
|
assert result >= config.baseVtableLength() : UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) + " " + config.vtableEntrySize;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,7 +553,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
|
|||||||
*
|
*
|
||||||
* @param index index to the fields array
|
* @param index index to the fields array
|
||||||
*/
|
*/
|
||||||
public FieldInfo(int index) {
|
FieldInfo(int index) {
|
||||||
HotSpotVMConfig config = config();
|
HotSpotVMConfig config = config();
|
||||||
// Get Klass::_fields
|
// Get Klass::_fields
|
||||||
final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
|
final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
|
||||||
@ -838,12 +836,6 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public URL getClassFilePath() {
|
|
||||||
Class<?> cls = mirror();
|
|
||||||
return cls.getResource(MetaUtil.getSimpleName(cls, true).replace('.', '$') + ".class");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLocal() {
|
public boolean isLocal() {
|
||||||
return mirror().isLocalClass();
|
return mirror().isLocalClass();
|
||||||
|
@ -27,7 +27,6 @@ import static java.util.Objects.requireNonNull;
|
|||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import jdk.vm.ci.common.JVMCIError;
|
import jdk.vm.ci.common.JVMCIError;
|
||||||
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
|
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
|
||||||
@ -239,11 +238,6 @@ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType
|
|||||||
return kind.toJavaClass();
|
return kind.toJavaClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public URL getClassFilePath() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLocal() {
|
public boolean isLocal() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -360,7 +360,7 @@ public class HotSpotVMConfig {
|
|||||||
|
|
||||||
private final long address;
|
private final long address;
|
||||||
|
|
||||||
public VMFields(long address) {
|
VMFields(long address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ public class HotSpotVMConfig {
|
|||||||
|
|
||||||
private final long address;
|
private final long address;
|
||||||
|
|
||||||
public VMTypes(long address) {
|
VMTypes(long address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +580,7 @@ public class HotSpotVMConfig {
|
|||||||
|
|
||||||
private final long address;
|
private final long address;
|
||||||
|
|
||||||
public VMIntConstants(long address) {
|
VMIntConstants(long address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -639,7 +639,7 @@ public class HotSpotVMConfig {
|
|||||||
|
|
||||||
private final long address;
|
private final long address;
|
||||||
|
|
||||||
public VMLongConstants(long address) {
|
VMLongConstants(long address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -698,7 +698,7 @@ public class HotSpotVMConfig {
|
|||||||
|
|
||||||
private final long address;
|
private final long address;
|
||||||
|
|
||||||
public VMAddresses(long address) {
|
VMAddresses(long address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ public class HotSpotVMConfig {
|
|||||||
private final long nameOffset;
|
private final long nameOffset;
|
||||||
private final long addrOffset;
|
private final long addrOffset;
|
||||||
|
|
||||||
public Flags(HashMap<String, VMFields.Field> vmStructs, HashMap<String, VMTypes.Type> vmTypes) {
|
Flags(HashMap<String, VMFields.Field> vmStructs, HashMap<String, VMTypes.Type> vmTypes) {
|
||||||
address = vmStructs.get("Flag::flags").getValue();
|
address = vmStructs.get("Flag::flags").getValue();
|
||||||
entrySize = vmTypes.get("Flag").getSize();
|
entrySize = vmTypes.get("Flag").getSize();
|
||||||
typeOffset = vmStructs.get("Flag::_type").getOffset();
|
typeOffset = vmStructs.get("Flag::_type").getOffset();
|
||||||
@ -1031,19 +1031,12 @@ public class HotSpotVMConfig {
|
|||||||
@HotSpotVMField(name = "InstanceKlass::_init_state", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassInitStateOffset;
|
@HotSpotVMField(name = "InstanceKlass::_init_state", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassInitStateOffset;
|
||||||
@HotSpotVMField(name = "InstanceKlass::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassConstantsOffset;
|
@HotSpotVMField(name = "InstanceKlass::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassConstantsOffset;
|
||||||
@HotSpotVMField(name = "InstanceKlass::_fields", type = "Array<u2>*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassFieldsOffset;
|
@HotSpotVMField(name = "InstanceKlass::_fields", type = "Array<u2>*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassFieldsOffset;
|
||||||
@HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_start_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableStartOffset;
|
@HotSpotVMField(name = "CompilerToVM::Data::Klass_vtable_start_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassVtableStartOffset;
|
||||||
@HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_length_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableLengthOffset;
|
@HotSpotVMField(name = "CompilerToVM::Data::Klass_vtable_length_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassVtableLengthOffset;
|
||||||
|
|
||||||
@HotSpotVMConstant(name = "InstanceKlass::linked") @Stable public int instanceKlassStateLinked;
|
@HotSpotVMConstant(name = "InstanceKlass::linked") @Stable public int instanceKlassStateLinked;
|
||||||
@HotSpotVMConstant(name = "InstanceKlass::fully_initialized") @Stable public int instanceKlassStateFullyInitialized;
|
@HotSpotVMConstant(name = "InstanceKlass::fully_initialized") @Stable public int instanceKlassStateFullyInitialized;
|
||||||
|
|
||||||
/**
|
|
||||||
* See {@code InstanceKlass::vtable_start_offset()}.
|
|
||||||
*/
|
|
||||||
public final int instanceKlassVtableStartOffset() {
|
|
||||||
return instanceKlassVtableStartOffset * heapWordSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
@HotSpotVMType(name = "arrayOopDesc", get = HotSpotVMType.Type.SIZE) @Stable public int arrayOopDescSize;
|
@HotSpotVMType(name = "arrayOopDesc", get = HotSpotVMType.Type.SIZE) @Stable public int arrayOopDescSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +59,7 @@ public enum DeoptimizationAction {
|
|||||||
|
|
||||||
private final boolean invalidatesCompilation;
|
private final boolean invalidatesCompilation;
|
||||||
|
|
||||||
private DeoptimizationAction(boolean invalidatesCompilation) {
|
DeoptimizationAction(boolean invalidatesCompilation) {
|
||||||
this.invalidatesCompilation = invalidatesCompilation;
|
this.invalidatesCompilation = invalidatesCompilation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public enum JavaKind {
|
|||||||
private final Class<?> boxedJavaClass;
|
private final Class<?> boxedJavaClass;
|
||||||
private final int slotCount;
|
private final int slotCount;
|
||||||
|
|
||||||
private JavaKind(char typeChar, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) {
|
JavaKind(char typeChar, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) {
|
||||||
this.typeChar = typeChar;
|
this.typeChar = typeChar;
|
||||||
this.javaName = javaName;
|
this.javaName = javaName;
|
||||||
this.slotCount = slotCount;
|
this.slotCount = slotCount;
|
||||||
|
@ -57,7 +57,7 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
public final class LIRKind {
|
public final class LIRKind {
|
||||||
|
|
||||||
private static enum IllegalKind implements PlatformKind {
|
private enum IllegalKind implements PlatformKind {
|
||||||
ILLEGAL;
|
ILLEGAL;
|
||||||
|
|
||||||
private final EnumKey<IllegalKind> key = new EnumKey<>(this);
|
private final EnumKey<IllegalKind> key = new EnumKey<>(this);
|
||||||
|
@ -35,7 +35,7 @@ public interface MethodHandleAccessProvider {
|
|||||||
* Identification for methods defined on the class {@link MethodHandle} that are processed by
|
* Identification for methods defined on the class {@link MethodHandle} that are processed by
|
||||||
* the {@link MethodHandleAccessProvider}.
|
* the {@link MethodHandleAccessProvider}.
|
||||||
*/
|
*/
|
||||||
public enum IntrinsicMethod {
|
enum IntrinsicMethod {
|
||||||
/** The method {@code MethodHandle.invokeBasic}. */
|
/** The method {@code MethodHandle.invokeBasic}. */
|
||||||
INVOKE_BASIC,
|
INVOKE_BASIC,
|
||||||
/** The method {@code MethodHandle.linkToStatic}. */
|
/** The method {@code MethodHandle.linkToStatic}. */
|
||||||
|
@ -33,7 +33,7 @@ public interface PlatformKind {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EnumKey<E extends Enum<E>> implements Key {
|
class EnumKey<E extends Enum<E>> implements Key {
|
||||||
private final Enum<E> e;
|
private final Enum<E> e;
|
||||||
|
|
||||||
public EnumKey(Enum<E> e) {
|
public EnumKey(Enum<E> e) {
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
package jdk.vm.ci.meta;
|
package jdk.vm.ci.meta;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
|
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
|
||||||
|
|
||||||
@ -307,11 +306,6 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider {
|
|||||||
*/
|
*/
|
||||||
String getSourceFileName();
|
String getSourceFileName();
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the class file path - if available - of this type, or {@code null}.
|
|
||||||
*/
|
|
||||||
URL getClassFilePath();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if the type is a local type.
|
* Returns {@code true} if the type is a local type.
|
||||||
*/
|
*/
|
||||||
|
@ -47,13 +47,13 @@ public enum SPARCKind implements PlatformKind {
|
|||||||
private final SPARCKind scalar;
|
private final SPARCKind scalar;
|
||||||
private final EnumKey<SPARCKind> key = new EnumKey<>(this);
|
private final EnumKey<SPARCKind> key = new EnumKey<>(this);
|
||||||
|
|
||||||
private SPARCKind(int size) {
|
SPARCKind(int size) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.scalar = this;
|
this.scalar = this;
|
||||||
this.vectorLength = 1;
|
this.vectorLength = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SPARCKind(int size, SPARCKind scalar) {
|
SPARCKind(int size, SPARCKind scalar) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.scalar = scalar;
|
this.scalar = scalar;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -48,7 +48,10 @@
|
|||||||
"Load DLLs with executable-stack attribute in the VM Thread") \
|
"Load DLLs with executable-stack attribute in the VM Thread") \
|
||||||
\
|
\
|
||||||
product(bool, UseSHM, false, \
|
product(bool, UseSHM, false, \
|
||||||
"Use SYSV shared memory for large pages")
|
"Use SYSV shared memory for large pages") \
|
||||||
|
\
|
||||||
|
diagnostic(bool, UseCpuAllocPath, false, \
|
||||||
|
"Use CPU_ALLOC code path in os::active_processor_count ")
|
||||||
|
|
||||||
//
|
//
|
||||||
// Defines Linux-specific default values. The flags are available on all
|
// Defines Linux-specific default values. The flags are available on all
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -32,6 +32,7 @@
|
|||||||
#include "compiler/disassembler.hpp"
|
#include "compiler/disassembler.hpp"
|
||||||
#include "interpreter/interpreter.hpp"
|
#include "interpreter/interpreter.hpp"
|
||||||
#include "jvm_linux.h"
|
#include "jvm_linux.h"
|
||||||
|
#include "logging/log.hpp"
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/filemap.hpp"
|
#include "memory/filemap.hpp"
|
||||||
#include "mutex_linux.inline.hpp"
|
#include "mutex_linux.inline.hpp"
|
||||||
@ -106,6 +107,14 @@
|
|||||||
# include <inttypes.h>
|
# include <inttypes.h>
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#include <sched.h>
|
||||||
|
#undef _GNU_SOURCE
|
||||||
|
#else
|
||||||
|
#include <sched.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
|
// if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
|
||||||
// getrusage() is prepared to handle the associated failure.
|
// getrusage() is prepared to handle the associated failure.
|
||||||
#ifndef RUSAGE_THREAD
|
#ifndef RUSAGE_THREAD
|
||||||
@ -4762,12 +4771,72 @@ void os::make_polling_page_readable(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the current number of available processors for this process.
|
||||||
|
// This value can change at any time during a process's lifetime.
|
||||||
|
// sched_getaffinity gives an accurate answer as it accounts for cpusets.
|
||||||
|
// If it appears there may be more than 1024 processors then we do a
|
||||||
|
// dynamic check - see 6515172 for details.
|
||||||
|
// If anything goes wrong we fallback to returning the number of online
|
||||||
|
// processors - which can be greater than the number available to the process.
|
||||||
int os::active_processor_count() {
|
int os::active_processor_count() {
|
||||||
// Linux doesn't yet have a (official) notion of processor sets,
|
cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors
|
||||||
// so just return the number of online processors.
|
cpu_set_t* cpus_p = &cpus;
|
||||||
int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN);
|
int cpus_size = sizeof(cpu_set_t);
|
||||||
assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check");
|
|
||||||
return online_cpus;
|
int configured_cpus = processor_count(); // upper bound on available cpus
|
||||||
|
int cpu_count = 0;
|
||||||
|
|
||||||
|
// To enable easy testing of the dynamic path on different platforms we
|
||||||
|
// introduce a diagnostic flag: UseCpuAllocPath
|
||||||
|
if (configured_cpus >= CPU_SETSIZE || UseCpuAllocPath) {
|
||||||
|
// kernel may use a mask bigger than cpu_set_t
|
||||||
|
log_trace(os)("active_processor_count: using dynamic path %s"
|
||||||
|
"- configured processors: %d",
|
||||||
|
UseCpuAllocPath ? "(forced) " : "",
|
||||||
|
configured_cpus);
|
||||||
|
cpus_p = CPU_ALLOC(configured_cpus);
|
||||||
|
if (cpus_p != NULL) {
|
||||||
|
cpus_size = CPU_ALLOC_SIZE(configured_cpus);
|
||||||
|
// zero it just to be safe
|
||||||
|
CPU_ZERO_S(cpus_size, cpus_p);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// failed to allocate so fallback to online cpus
|
||||||
|
int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
log_trace(os)("active_processor_count: "
|
||||||
|
"CPU_ALLOC failed (%s) - using "
|
||||||
|
"online processor count: %d",
|
||||||
|
strerror(errno), online_cpus);
|
||||||
|
return online_cpus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log_trace(os)("active_processor_count: using static path - configured processors: %d",
|
||||||
|
configured_cpus);
|
||||||
|
}
|
||||||
|
|
||||||
|
// pid 0 means the current thread - which we have to assume represents the process
|
||||||
|
if (sched_getaffinity(0, cpus_size, cpus_p) == 0) {
|
||||||
|
if (cpus_p != &cpus) {
|
||||||
|
cpu_count = CPU_COUNT_S(cpus_size, cpus_p);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cpu_count = CPU_COUNT(cpus_p);
|
||||||
|
}
|
||||||
|
log_trace(os)("active_processor_count: sched_getaffinity processor count: %d", cpu_count);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cpu_count = ::sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
warning("sched_getaffinity failed (%s)- using online processor count (%d) "
|
||||||
|
"which may exceed available processors", strerror(errno), cpu_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cpus_p != &cpus) {
|
||||||
|
CPU_FREE(cpus_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(cpu_count > 0 && cpu_count <= processor_count(), "sanity check");
|
||||||
|
return cpu_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::set_native_thread_name(const char *name) {
|
void os::set_native_thread_name(const char *name) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -5267,8 +5267,29 @@ bool os::check_heap(bool force) {
|
|||||||
|
|
||||||
|
|
||||||
bool os::find(address addr, outputStream* st) {
|
bool os::find(address addr, outputStream* st) {
|
||||||
// Nothing yet
|
int offset = -1;
|
||||||
return false;
|
bool result = false;
|
||||||
|
char buf[256];
|
||||||
|
if (os::dll_address_to_library_name(addr, buf, sizeof(buf), &offset)) {
|
||||||
|
st->print(PTR_FORMAT " ", addr);
|
||||||
|
if (strlen(buf) < sizeof(buf) - 1) {
|
||||||
|
char* p = strrchr(buf, '\\');
|
||||||
|
if (p) {
|
||||||
|
st->print("%s", p + 1);
|
||||||
|
} else {
|
||||||
|
st->print("%s", buf);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// The library name is probably truncated. Let's omit the library name.
|
||||||
|
// See also JDK-8147512.
|
||||||
|
}
|
||||||
|
if (os::dll_address_to_function_name(addr, buf, sizeof(buf), &offset)) {
|
||||||
|
st->print("::%s + 0x%x", buf, offset);
|
||||||
|
}
|
||||||
|
st->cr();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
|
LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
|
||||||
|
@ -599,6 +599,7 @@ void os::print_register_info(outputStream *st, const void *context) {
|
|||||||
// this is only for the "general purpose" registers
|
// this is only for the "general purpose" registers
|
||||||
|
|
||||||
#ifdef AMD64
|
#ifdef AMD64
|
||||||
|
st->print("RIP="); print_location(st, uc->Rip);
|
||||||
st->print("RAX="); print_location(st, uc->Rax);
|
st->print("RAX="); print_location(st, uc->Rax);
|
||||||
st->print("RBX="); print_location(st, uc->Rbx);
|
st->print("RBX="); print_location(st, uc->Rbx);
|
||||||
st->print("RCX="); print_location(st, uc->Rcx);
|
st->print("RCX="); print_location(st, uc->Rcx);
|
||||||
@ -616,6 +617,7 @@ void os::print_register_info(outputStream *st, const void *context) {
|
|||||||
st->print("R14="); print_location(st, uc->R14);
|
st->print("R14="); print_location(st, uc->R14);
|
||||||
st->print("R15="); print_location(st, uc->R15);
|
st->print("R15="); print_location(st, uc->R15);
|
||||||
#else
|
#else
|
||||||
|
st->print("EIP="); print_location(st, uc->Eip);
|
||||||
st->print("EAX="); print_location(st, uc->Eax);
|
st->print("EAX="); print_location(st, uc->Eax);
|
||||||
st->print("EBX="); print_location(st, uc->Ebx);
|
st->print("EBX="); print_location(st, uc->Ebx);
|
||||||
st->print("ECX="); print_location(st, uc->Ecx);
|
st->print("ECX="); print_location(st, uc->Ecx);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -2972,8 +2972,8 @@ void LIRGenerator::do_Invoke(Invoke* x) {
|
|||||||
SharedRuntime::get_resolve_virtual_call_stub(),
|
SharedRuntime::get_resolve_virtual_call_stub(),
|
||||||
arg_list, info);
|
arg_list, info);
|
||||||
} else {
|
} else {
|
||||||
int entry_offset = InstanceKlass::vtable_start_offset() + x->vtable_index() * vtableEntry::size();
|
int entry_offset = in_bytes(Klass::vtable_start_offset()) + x->vtable_index() * vtableEntry::size_in_bytes();
|
||||||
int vtable_offset = entry_offset * wordSize + vtableEntry::method_offset_in_bytes();
|
int vtable_offset = entry_offset + vtableEntry::method_offset_in_bytes();
|
||||||
__ call_virtual(target, receiver, result_register, vtable_offset, arg_list, info);
|
__ call_virtual(target, receiver, result_register, vtable_offset, arg_list, info);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "classfile/verifier.hpp"
|
#include "classfile/verifier.hpp"
|
||||||
#include "classfile/vmSymbols.hpp"
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "gc/shared/gcLocker.hpp"
|
#include "gc/shared/gcLocker.hpp"
|
||||||
|
#include "logging/log.hpp"
|
||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
#include "memory/metadataFactory.hpp"
|
#include "memory/metadataFactory.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
@ -79,7 +80,7 @@
|
|||||||
|
|
||||||
#define JAVA_CLASSFILE_MAGIC 0xCAFEBABE
|
#define JAVA_CLASSFILE_MAGIC 0xCAFEBABE
|
||||||
#define JAVA_MIN_SUPPORTED_VERSION 45
|
#define JAVA_MIN_SUPPORTED_VERSION 45
|
||||||
#define JAVA_MAX_SUPPORTED_VERSION 52
|
#define JAVA_MAX_SUPPORTED_VERSION 53
|
||||||
#define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
|
#define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
|
||||||
|
|
||||||
// Used for two backward compatibility reasons:
|
// Used for two backward compatibility reasons:
|
||||||
@ -100,6 +101,8 @@
|
|||||||
// Extension method support.
|
// Extension method support.
|
||||||
#define JAVA_8_VERSION 52
|
#define JAVA_8_VERSION 52
|
||||||
|
|
||||||
|
#define JAVA_9_VERSION 53
|
||||||
|
|
||||||
enum { LegalClass, LegalField, LegalMethod }; // used to verify unqualified names
|
enum { LegalClass, LegalField, LegalMethod }; // used to verify unqualified names
|
||||||
|
|
||||||
void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const stream,
|
void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const stream,
|
||||||
@ -2705,7 +2708,7 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
|
|||||||
ConstMethod::NORMAL,
|
ConstMethod::NORMAL,
|
||||||
CHECK_NULL);
|
CHECK_NULL);
|
||||||
|
|
||||||
ClassLoadingService::add_class_method_size(m->size()*HeapWordSize);
|
ClassLoadingService::add_class_method_size(m->size()*wordSize);
|
||||||
|
|
||||||
// Fill in information from fixed part (access_flags already set)
|
// Fill in information from fixed part (access_flags already set)
|
||||||
m->set_constants(_cp);
|
m->set_constants(_cp);
|
||||||
@ -4602,8 +4605,8 @@ void ClassFileParser::verify_legal_method_modifiers(jint flags,
|
|||||||
}
|
}
|
||||||
} else if (major_gte_15) {
|
} else if (major_gte_15) {
|
||||||
// Class file version in the interval [JAVA_1_5_VERSION, JAVA_8_VERSION)
|
// Class file version in the interval [JAVA_1_5_VERSION, JAVA_8_VERSION)
|
||||||
if (!is_public || is_static || is_final || is_synchronized ||
|
if (!is_public || is_private || is_protected || is_static || is_final ||
|
||||||
is_native || !is_abstract || is_strict) {
|
is_synchronized || is_native || !is_abstract || is_strict) {
|
||||||
is_illegal = true;
|
is_illegal = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -5347,30 +5350,12 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, TRAPS) {
|
|||||||
ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
|
ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
|
||||||
|
|
||||||
if (!is_internal()) {
|
if (!is_internal()) {
|
||||||
if (TraceClassLoading) {
|
if (log_is_enabled(Info, classload)) {
|
||||||
ResourceMark rm;
|
ik->print_loading_log(LogLevel::Info, _loader_data, _stream);
|
||||||
// print in a single call to reduce interleaving of output
|
}
|
||||||
if (_stream->source() != NULL) {
|
// No 'else' here as logging levels are not mutually exclusive
|
||||||
tty->print("[Loaded %s from %s]\n",
|
if (log_is_enabled(Debug, classload)) {
|
||||||
ik->external_name(),
|
ik->print_loading_log(LogLevel::Debug, _loader_data, _stream);
|
||||||
_stream->source());
|
|
||||||
} else if (_loader_data->class_loader() == NULL) {
|
|
||||||
const Klass* const caller =
|
|
||||||
THREAD->is_Java_thread()
|
|
||||||
? ((JavaThread*)THREAD)->security_get_caller_class(1)
|
|
||||||
: NULL;
|
|
||||||
// caller can be NULL, for example, during a JVMTI VM_Init hook
|
|
||||||
if (caller != NULL) {
|
|
||||||
tty->print("[Loaded %s by instance of %s]\n",
|
|
||||||
ik->external_name(),
|
|
||||||
caller->external_name());
|
|
||||||
} else {
|
|
||||||
tty->print("[Loaded %s]\n", ik->external_name());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tty->print("[Loaded %s from %s]\n", ik->external_name(),
|
|
||||||
_loader_data->class_loader()->klass()->external_name());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log_is_enabled(Info, classresolve)) {
|
if (log_is_enabled(Info, classresolve)) {
|
||||||
|
@ -578,15 +578,14 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TraceClassLoading || TraceClassPaths) {
|
if (TraceClassPaths) {
|
||||||
tty->print_cr("[Opened %s]", path);
|
tty->print_cr("[Opened %s]", path);
|
||||||
}
|
}
|
||||||
|
log_info(classload)("opened: %s", path);
|
||||||
} else {
|
} else {
|
||||||
// Directory
|
// Directory
|
||||||
new_entry = new ClassPathDirEntry(path);
|
new_entry = new ClassPathDirEntry(path);
|
||||||
if (TraceClassLoading) {
|
log_info(classload)("path: %s", path);
|
||||||
tty->print_cr("[Path %s]", path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return new_entry;
|
return new_entry;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -54,12 +54,14 @@
|
|||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "code/codeCache.hpp"
|
#include "code/codeCache.hpp"
|
||||||
#include "gc/shared/gcLocker.hpp"
|
#include "gc/shared/gcLocker.hpp"
|
||||||
|
#include "logging/log.hpp"
|
||||||
#include "memory/metadataFactory.hpp"
|
#include "memory/metadataFactory.hpp"
|
||||||
#include "memory/metaspaceShared.hpp"
|
#include "memory/metaspaceShared.hpp"
|
||||||
#include "memory/oopFactory.hpp"
|
#include "memory/oopFactory.hpp"
|
||||||
#include "oops/objArrayOop.inline.hpp"
|
#include "oops/objArrayOop.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/jniHandles.hpp"
|
#include "runtime/jniHandles.hpp"
|
||||||
#include "runtime/mutex.hpp"
|
#include "runtime/mutex.hpp"
|
||||||
#include "runtime/safepoint.hpp"
|
#include "runtime/safepoint.hpp"
|
||||||
@ -286,9 +288,9 @@ void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) {
|
|||||||
_klasses = k;
|
_klasses = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicize && TraceClassLoaderData && Verbose && k->class_loader_data() != NULL) {
|
if (publicize && k->class_loader_data() != NULL) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: "
|
log_trace(classloaderdata)("Adding k: " PTR_FORMAT " %s to CLD: "
|
||||||
PTR_FORMAT " loader: " PTR_FORMAT " %s",
|
PTR_FORMAT " loader: " PTR_FORMAT " %s",
|
||||||
p2i(k),
|
p2i(k),
|
||||||
k->external_name(),
|
k->external_name(),
|
||||||
@ -326,15 +328,16 @@ void ClassLoaderData::unload() {
|
|||||||
// Tell serviceability tools these classes are unloading
|
// Tell serviceability tools these classes are unloading
|
||||||
classes_do(InstanceKlass::notify_unload_class);
|
classes_do(InstanceKlass::notify_unload_class);
|
||||||
|
|
||||||
if (TraceClassLoaderData) {
|
if (log_is_enabled(Debug, classloaderdata)) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this));
|
outputStream* log = LogHandle(classloaderdata)::debug_stream();
|
||||||
tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
|
log->print(": unload loader data " INTPTR_FORMAT, p2i(this));
|
||||||
|
log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
|
||||||
loader_name());
|
loader_name());
|
||||||
if (is_anonymous()) {
|
if (is_anonymous()) {
|
||||||
tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses));
|
log->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses));
|
||||||
}
|
}
|
||||||
tty->print_cr("]");
|
log->cr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,13 +411,13 @@ Metaspace* ClassLoaderData::metaspace_non_null() {
|
|||||||
assert (class_loader() == NULL, "Must be");
|
assert (class_loader() == NULL, "Must be");
|
||||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType));
|
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType));
|
||||||
} else if (is_anonymous()) {
|
} else if (is_anonymous()) {
|
||||||
if (TraceClassLoaderData && Verbose && class_loader() != NULL) {
|
if (class_loader() != NULL) {
|
||||||
tty->print_cr("is_anonymous: %s", class_loader()->klass()->internal_name());
|
log_trace(classloaderdata)("is_anonymous: %s", class_loader()->klass()->internal_name());
|
||||||
}
|
}
|
||||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType));
|
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType));
|
||||||
} else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
|
} else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
|
||||||
if (TraceClassLoaderData && Verbose && class_loader() != NULL) {
|
if (class_loader() != NULL) {
|
||||||
tty->print_cr("is_reflection: %s", class_loader()->klass()->internal_name());
|
log_trace(classloaderdata)("is_reflection: %s", class_loader()->klass()->internal_name());
|
||||||
}
|
}
|
||||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType));
|
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType));
|
||||||
} else {
|
} else {
|
||||||
@ -601,21 +604,47 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA
|
|||||||
cld->set_next(next);
|
cld->set_next(next);
|
||||||
ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next);
|
ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next);
|
||||||
if (exchanged == next) {
|
if (exchanged == next) {
|
||||||
if (TraceClassLoaderData) {
|
if (log_is_enabled(Debug, classloaderdata)) {
|
||||||
ResourceMark rm;
|
PauseNoSafepointVerifier pnsv(&no_safepoints); // Need safe points for JavaCalls::call_virtual
|
||||||
tty->print("[ClassLoaderData: ");
|
log_creation(loader, cld, CHECK_NULL);
|
||||||
tty->print("create class loader data " INTPTR_FORMAT, p2i(cld));
|
|
||||||
tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
|
|
||||||
cld->loader_name());
|
|
||||||
tty->print_cr("]");
|
|
||||||
}
|
}
|
||||||
return cld;
|
return cld;
|
||||||
}
|
}
|
||||||
next = exchanged;
|
next = exchanged;
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClassLoaderDataGraph::log_creation(Handle loader, ClassLoaderData* cld, TRAPS) {
|
||||||
|
Handle string;
|
||||||
|
if (loader.not_null()) {
|
||||||
|
// Include the result of loader.toString() in the output. This allows
|
||||||
|
// the user of the log to identify the class loader instance.
|
||||||
|
JavaValue result(T_OBJECT);
|
||||||
|
KlassHandle spec_klass(THREAD, SystemDictionary::ClassLoader_klass());
|
||||||
|
JavaCalls::call_virtual(&result,
|
||||||
|
loader,
|
||||||
|
spec_klass,
|
||||||
|
vmSymbols::toString_name(),
|
||||||
|
vmSymbols::void_string_signature(),
|
||||||
|
CHECK);
|
||||||
|
assert(result.get_type() == T_OBJECT, "just checking");
|
||||||
|
string = (oop)result.get_jobject();
|
||||||
|
}
|
||||||
|
|
||||||
|
ResourceMark rm;
|
||||||
|
outputStream* log = LogHandle(classloaderdata)::debug_stream();
|
||||||
|
log->print("create class loader data " INTPTR_FORMAT, p2i(cld));
|
||||||
|
log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
|
||||||
|
cld->loader_name());
|
||||||
|
|
||||||
|
if (string.not_null()) {
|
||||||
|
log->print(": ");
|
||||||
|
java_lang_String::print(string(), log);
|
||||||
|
}
|
||||||
|
log->cr();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClassLoaderDataGraph::oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim) {
|
void ClassLoaderDataGraph::oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim) {
|
||||||
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
|
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
|
||||||
cld->oops_do(f, klass_closure, must_claim);
|
cld->oops_do(f, klass_closure, must_claim);
|
||||||
@ -709,10 +738,11 @@ GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() {
|
|||||||
if (!curr->claimed()) {
|
if (!curr->claimed()) {
|
||||||
array->push(curr);
|
array->push(curr);
|
||||||
|
|
||||||
if (TraceClassLoaderData) {
|
if (log_is_enabled(Debug, classloaderdata)) {
|
||||||
tty->print("[ClassLoaderData] found new CLD: ");
|
outputStream* log = LogHandle(classloaderdata)::debug_stream();
|
||||||
curr->print_value_on(tty);
|
log->print("found new CLD: ");
|
||||||
tty->cr();
|
curr->print_value_on(log);
|
||||||
|
log->cr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ class ClassLoaderDataGraph : public AllStatic {
|
|||||||
static void dump_on(outputStream * const out) PRODUCT_RETURN;
|
static void dump_on(outputStream * const out) PRODUCT_RETURN;
|
||||||
static void dump() { dump_on(tty); }
|
static void dump() { dump_on(tty); }
|
||||||
static void verify();
|
static void verify();
|
||||||
|
static void log_creation(Handle loader, ClassLoaderData* cld, TRAPS);
|
||||||
|
|
||||||
static bool unload_list_contains(const void* x);
|
static bool unload_list_contains(const void* x);
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
@ -365,14 +365,14 @@ bool HashtableTextDump::skip_newline() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int HashtableTextDump::skip(char must_be_char) {
|
int HashtableTextDump::skip(char must_be_char) {
|
||||||
corrupted_if(remain() < 1);
|
corrupted_if(remain() < 1, "Truncated");
|
||||||
corrupted_if(*_p++ != must_be_char);
|
corrupted_if(*_p++ != must_be_char, "Unexpected character");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HashtableTextDump::skip_past(char c) {
|
void HashtableTextDump::skip_past(char c) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
corrupted_if(remain() < 1);
|
corrupted_if(remain() < 1, "Truncated");
|
||||||
if (*_p++ == c) {
|
if (*_p++ == c) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -381,7 +381,7 @@ void HashtableTextDump::skip_past(char c) {
|
|||||||
|
|
||||||
void HashtableTextDump::check_version(const char* ver) {
|
void HashtableTextDump::check_version(const char* ver) {
|
||||||
int len = (int)strlen(ver);
|
int len = (int)strlen(ver);
|
||||||
corrupted_if(remain() < len);
|
corrupted_if(remain() < len, "Truncated");
|
||||||
if (strncmp(_p, ver, len) != 0) {
|
if (strncmp(_p, ver, len) != 0) {
|
||||||
quit("wrong version of hashtable dump file", _filename);
|
quit("wrong version of hashtable dump file", _filename);
|
||||||
}
|
}
|
||||||
@ -451,7 +451,7 @@ int HashtableTextDump::scan_symbol_prefix() {
|
|||||||
jchar HashtableTextDump::unescape(const char* from, const char* end, int count) {
|
jchar HashtableTextDump::unescape(const char* from, const char* end, int count) {
|
||||||
jchar value = 0;
|
jchar value = 0;
|
||||||
|
|
||||||
corrupted_if(from + count > end);
|
corrupted_if(from + count > end, "Truncated");
|
||||||
|
|
||||||
for (int i=0; i<count; i++) {
|
for (int i=0; i<count; i++) {
|
||||||
char c = *from++;
|
char c = *from++;
|
||||||
@ -486,7 +486,7 @@ void HashtableTextDump::get_utf8(char* utf8_buffer, int utf8_length) {
|
|||||||
if (*from != '\\') {
|
if (*from != '\\') {
|
||||||
*to++ = *from++;
|
*to++ = *from++;
|
||||||
} else {
|
} else {
|
||||||
corrupted_if(from + 2 > end);
|
corrupted_if(from + 2 > end, "Truncated");
|
||||||
char c = from[1];
|
char c = from[1];
|
||||||
from += 2;
|
from += 2;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@ -507,7 +507,7 @@ void HashtableTextDump::get_utf8(char* utf8_buffer, int utf8_length) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
corrupted_if(n > 0); // expected more chars but file has ended
|
corrupted_if(n > 0, "Truncated"); // expected more chars but file has ended
|
||||||
_p = from;
|
_p = from;
|
||||||
skip_newline();
|
skip_newline();
|
||||||
}
|
}
|
||||||
|
@ -276,9 +276,9 @@ public:
|
|||||||
|
|
||||||
void corrupted(const char *p, const char *msg);
|
void corrupted(const char *p, const char *msg);
|
||||||
|
|
||||||
inline void corrupted_if(bool cond) {
|
inline void corrupted_if(bool cond, const char *msg) {
|
||||||
if (cond) {
|
if (cond) {
|
||||||
corrupted(_p, NULL);
|
corrupted(_p, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,27 +287,30 @@ public:
|
|||||||
void skip_past(char c);
|
void skip_past(char c);
|
||||||
void check_version(const char* ver);
|
void check_version(const char* ver);
|
||||||
|
|
||||||
inline bool get_num(char delim, int *utf8_length) {
|
inline void get_num(char delim, int *num) {
|
||||||
const char* p = _p;
|
const char* p = _p;
|
||||||
const char* end = _end;
|
const char* end = _end;
|
||||||
int num = 0;
|
u8 n = 0;
|
||||||
|
|
||||||
while (p < end) {
|
while (p < end) {
|
||||||
char c = *p ++;
|
char c = *p ++;
|
||||||
if ('0' <= c && c <= '9') {
|
if ('0' <= c && c <= '9') {
|
||||||
num = num * 10 + (c - '0');
|
n = n * 10 + (c - '0');
|
||||||
|
if (n > (u8)INT_MAX) {
|
||||||
|
corrupted(_p, "Num overflow");
|
||||||
|
}
|
||||||
} else if (c == delim) {
|
} else if (c == delim) {
|
||||||
_p = p;
|
_p = p;
|
||||||
*utf8_length = num;
|
*num = (int)n;
|
||||||
return true;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Not [0-9], not 'delim'
|
// Not [0-9], not 'delim'
|
||||||
return false;
|
corrupted(_p, "Unrecognized format");;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
corrupted(_end, "Incorrect format");
|
corrupted(_end, "Incorrect format");
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void scan_prefix_type();
|
void scan_prefix_type();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -129,7 +129,7 @@ compute_offset(int &dest_offset,
|
|||||||
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
||||||
}
|
}
|
||||||
#endif //PRODUCT
|
#endif //PRODUCT
|
||||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class");
|
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class");
|
||||||
}
|
}
|
||||||
dest_offset = fd.offset();
|
dest_offset = fd.offset();
|
||||||
}
|
}
|
||||||
@ -3972,7 +3972,7 @@ int InjectedField::compute_offset() {
|
|||||||
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
||||||
}
|
}
|
||||||
#endif //PRODUCT
|
#endif //PRODUCT
|
||||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class");
|
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ bool StringTable::copy_compact_table(char** top, char *end, GrowableArray<MemReg
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ch_table.dump(top, end);
|
ch_table.dump(top, end);
|
||||||
*top = (char*)align_pointer_up(*top, sizeof(void*));
|
*top = (char*)align_ptr_up(*top, sizeof(void*));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
@ -760,7 +760,7 @@ const char* StringTable::init_shared_table(FileMapInfo *mapinfo, char *buffer) {
|
|||||||
juint *p = (juint*)buffer;
|
juint *p = (juint*)buffer;
|
||||||
const char* end = _shared_table.init(
|
const char* end = _shared_table.init(
|
||||||
CompactHashtable<oop, char>::_string_table, (char*)p);
|
CompactHashtable<oop, char>::_string_table, (char*)p);
|
||||||
const char* aligned_end = (const char*)align_pointer_up(end, sizeof(void*));
|
const char* aligned_end = (const char*)align_ptr_up(end, sizeof(void*));
|
||||||
|
|
||||||
if (_ignore_shared_strings) {
|
if (_ignore_shared_strings) {
|
||||||
_shared_table.reset();
|
_shared_table.reset();
|
||||||
|
@ -544,7 +544,7 @@ bool SymbolTable::copy_compact_table(char** top, char*end) {
|
|||||||
|
|
||||||
ch_table.dump(top, end);
|
ch_table.dump(top, end);
|
||||||
|
|
||||||
*top = (char*)align_pointer_up(*top, sizeof(void*));
|
*top = (char*)align_ptr_up(*top, sizeof(void*));
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -552,7 +552,7 @@ bool SymbolTable::copy_compact_table(char** top, char*end) {
|
|||||||
const char* SymbolTable::init_shared_table(const char* buffer) {
|
const char* SymbolTable::init_shared_table(const char* buffer) {
|
||||||
const char* end = _shared_table.init(
|
const char* end = _shared_table.init(
|
||||||
CompactHashtable<Symbol*, char>::_symbol_table, buffer);
|
CompactHashtable<Symbol*, char>::_symbol_table, buffer);
|
||||||
return (const char*)align_pointer_up(end, sizeof(void*));
|
return (const char*)align_ptr_up(end, sizeof(void*));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@ -600,7 +600,7 @@ void SymbolTable::print_histogram() {
|
|||||||
tty->print_cr("Symbol Table Histogram:");
|
tty->print_cr("Symbol Table Histogram:");
|
||||||
tty->print_cr(" Total number of symbols %7d", total_count);
|
tty->print_cr(" Total number of symbols %7d", total_count);
|
||||||
tty->print_cr(" Total size in memory %7dK",
|
tty->print_cr(" Total size in memory %7dK",
|
||||||
(total_size*HeapWordSize)/1024);
|
(total_size*wordSize)/1024);
|
||||||
tty->print_cr(" Total counted %7d", _symbols_counted);
|
tty->print_cr(" Total counted %7d", _symbols_counted);
|
||||||
tty->print_cr(" Total removed %7d", _symbols_removed);
|
tty->print_cr(" Total removed %7d", _symbols_removed);
|
||||||
if (_symbols_counted > 0) {
|
if (_symbols_counted > 0) {
|
||||||
@ -617,11 +617,11 @@ void SymbolTable::print_histogram() {
|
|||||||
tty->print_cr(" %6s %10s %10s", "Length", "#Symbols", "Size");
|
tty->print_cr(" %6s %10s %10s", "Length", "#Symbols", "Size");
|
||||||
for (i = 0; i < results_length; i++) {
|
for (i = 0; i < results_length; i++) {
|
||||||
if (counts[i] > 0) {
|
if (counts[i] > 0) {
|
||||||
tty->print_cr(" %6d %10d %10dK", i, counts[i], (sizes[i]*HeapWordSize)/1024);
|
tty->print_cr(" %6d %10d %10dK", i, counts[i], (sizes[i]*wordSize)/1024);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tty->print_cr(" >=%6d %10d %10dK\n", results_length,
|
tty->print_cr(" >=%6d %10d %10dK\n", results_length,
|
||||||
out_of_range_count, (out_of_range_size*HeapWordSize)/1024);
|
out_of_range_count, (out_of_range_size*wordSize)/1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbolTable::print() {
|
void SymbolTable::print() {
|
||||||
|
@ -1302,14 +1302,13 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
|
|||||||
ik->restore_unshareable_info(loader_data, protection_domain, CHECK_(nh));
|
ik->restore_unshareable_info(loader_data, protection_domain, CHECK_(nh));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TraceClassLoading) {
|
if (log_is_enabled(Info, classload)) {
|
||||||
ResourceMark rm;
|
ik()->print_loading_log(LogLevel::Info, loader_data, NULL);
|
||||||
tty->print("[Loaded %s", ik->external_name());
|
}
|
||||||
tty->print(" from shared objects file");
|
// No 'else' here as logging levels are not mutually exclusive
|
||||||
if (class_loader.not_null()) {
|
|
||||||
tty->print(" by %s", loader_data->loader_name());
|
if (log_is_enabled(Debug, classload)) {
|
||||||
}
|
ik()->print_loading_log(LogLevel::Debug, loader_data, NULL);
|
||||||
tty->print_cr("]");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DumpLoadedClassList != NULL && classlist_file->is_open()) {
|
if (DumpLoadedClassList != NULL && classlist_file->is_open()) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -651,6 +651,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
|
|||||||
int ex_max = -1;
|
int ex_max = -1;
|
||||||
// Look through each item on the exception table. Each of the fields must refer
|
// Look through each item on the exception table. Each of the fields must refer
|
||||||
// to a legal instruction.
|
// to a legal instruction.
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
verify_exception_handler_table(
|
verify_exception_handler_table(
|
||||||
code_length, code_data, ex_min, ex_max, CHECK_VERIFY(this));
|
code_length, code_data, ex_min, ex_max, CHECK_VERIFY(this));
|
||||||
|
|
||||||
@ -737,11 +738,14 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
|
|||||||
// should be used for this check. So, do the check here before a possible
|
// should be used for this check. So, do the check here before a possible
|
||||||
// local is added to the type state.
|
// local is added to the type state.
|
||||||
if (Bytecodes::is_store_into_local(opcode) && bci >= ex_min && bci < ex_max) {
|
if (Bytecodes::is_store_into_local(opcode) && bci >= ex_min && bci < ex_max) {
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
verify_exception_handler_targets(
|
verify_exception_handler_targets(
|
||||||
bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this));
|
bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this));
|
||||||
verified_exc_handlers = true;
|
verified_exc_handlers = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case Bytecodes::_nop :
|
case Bytecodes::_nop :
|
||||||
no_control_flow = false; break;
|
no_control_flow = false; break;
|
||||||
@ -1730,6 +1734,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
|
|||||||
assert(!(verified_exc_handlers && this_uninit),
|
assert(!(verified_exc_handlers && this_uninit),
|
||||||
"Exception handler targets got verified before this_uninit got set");
|
"Exception handler targets got verified before this_uninit got set");
|
||||||
if (!verified_exc_handlers && bci >= ex_min && bci < ex_max) {
|
if (!verified_exc_handlers && bci >= ex_min && bci < ex_max) {
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
verify_exception_handler_targets(
|
verify_exception_handler_targets(
|
||||||
bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this));
|
bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this));
|
||||||
}
|
}
|
||||||
@ -1767,6 +1772,9 @@ char* ClassVerifier::generate_code_data(const methodHandle& m, u4 code_length, T
|
|||||||
return code_data;
|
return code_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since this method references the constant pool, call was_recursively_verified()
|
||||||
|
// before calling this method to make sure a prior class load did not cause the
|
||||||
|
// current class to get verified.
|
||||||
void ClassVerifier::verify_exception_handler_table(u4 code_length, char* code_data, int& min, int& max, TRAPS) {
|
void ClassVerifier::verify_exception_handler_table(u4 code_length, char* code_data, int& min, int& max, TRAPS) {
|
||||||
ExceptionTable exhandlers(_method());
|
ExceptionTable exhandlers(_method());
|
||||||
int exlength = exhandlers.length();
|
int exlength = exhandlers.length();
|
||||||
@ -1874,7 +1882,11 @@ u2 ClassVerifier::verify_stackmap_table(u2 stackmap_index, u2 bci,
|
|||||||
return stackmap_index;
|
return stackmap_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, StackMapFrame* current_frame,
|
// Since this method references the constant pool, call was_recursively_verified()
|
||||||
|
// before calling this method to make sure a prior class load did not cause the
|
||||||
|
// current class to get verified.
|
||||||
|
void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit,
|
||||||
|
StackMapFrame* current_frame,
|
||||||
StackMapTable* stackmap_table, TRAPS) {
|
StackMapTable* stackmap_table, TRAPS) {
|
||||||
constantPoolHandle cp (THREAD, _method->constants());
|
constantPoolHandle cp (THREAD, _method->constants());
|
||||||
ExceptionTable exhandlers(_method());
|
ExceptionTable exhandlers(_method());
|
||||||
@ -1889,6 +1901,7 @@ void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, S
|
|||||||
if (this_uninit) { flags |= FLAG_THIS_UNINIT; }
|
if (this_uninit) { flags |= FLAG_THIS_UNINIT; }
|
||||||
StackMapFrame* new_frame = current_frame->frame_in_exception_handler(flags);
|
StackMapFrame* new_frame = current_frame->frame_in_exception_handler(flags);
|
||||||
if (catch_type_index != 0) {
|
if (catch_type_index != 0) {
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
// We know that this index refers to a subclass of Throwable
|
// We know that this index refers to a subclass of Throwable
|
||||||
VerificationType catch_type = cp_index_to_type(
|
VerificationType catch_type = cp_index_to_type(
|
||||||
catch_type_index, cp, CHECK_VERIFY(this));
|
catch_type_index, cp, CHECK_VERIFY(this));
|
||||||
@ -2269,6 +2282,7 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
|
|||||||
check_protected: {
|
check_protected: {
|
||||||
if (_this_type == stack_object_type)
|
if (_this_type == stack_object_type)
|
||||||
break; // stack_object_type must be assignable to _current_class_type
|
break; // stack_object_type must be assignable to _current_class_type
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
Symbol* ref_class_name =
|
Symbol* ref_class_name =
|
||||||
cp->klass_name_at(cp->klass_ref_index_at(index));
|
cp->klass_name_at(cp->klass_ref_index_at(index));
|
||||||
if (!name_in_supers(ref_class_name, current_class()))
|
if (!name_in_supers(ref_class_name, current_class()))
|
||||||
@ -2531,6 +2545,7 @@ void ClassVerifier::verify_invoke_init(
|
|||||||
// Check the exception handler target stackmaps with the locals from the
|
// Check the exception handler target stackmaps with the locals from the
|
||||||
// incoming stackmap (before initialize_object() changes them to outgoing
|
// incoming stackmap (before initialize_object() changes them to outgoing
|
||||||
// state).
|
// state).
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
verify_exception_handler_targets(bci, true, current_frame,
|
verify_exception_handler_targets(bci, true, current_frame,
|
||||||
stackmap_table, CHECK_VERIFY(this));
|
stackmap_table, CHECK_VERIFY(this));
|
||||||
} // in_try_block
|
} // in_try_block
|
||||||
@ -2548,6 +2563,7 @@ void ClassVerifier::verify_invoke_init(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u2 new_class_index = Bytes::get_Java_u2(new_bcp + 1);
|
u2 new_class_index = Bytes::get_Java_u2(new_bcp + 1);
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
verify_cp_class_type(bci, new_class_index, cp, CHECK_VERIFY(this));
|
verify_cp_class_type(bci, new_class_index, cp, CHECK_VERIFY(this));
|
||||||
|
|
||||||
// The method must be an <init> method of the indicated class
|
// The method must be an <init> method of the indicated class
|
||||||
@ -2567,6 +2583,7 @@ void ClassVerifier::verify_invoke_init(
|
|||||||
VerificationType objectref_type = new_class_type;
|
VerificationType objectref_type = new_class_type;
|
||||||
if (name_in_supers(ref_class_type.name(), current_class())) {
|
if (name_in_supers(ref_class_type.name(), current_class())) {
|
||||||
Klass* ref_klass = load_class(ref_class_type.name(), CHECK);
|
Klass* ref_klass = load_class(ref_class_type.name(), CHECK);
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
|
Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
|
||||||
vmSymbols::object_initializer_name(),
|
vmSymbols::object_initializer_name(),
|
||||||
cp->signature_ref_at(bcs->get_index_u2()),
|
cp->signature_ref_at(bcs->get_index_u2()),
|
||||||
@ -2591,6 +2608,7 @@ void ClassVerifier::verify_invoke_init(
|
|||||||
// incoming stackmap (before initialize_object() changes them to outgoing
|
// incoming stackmap (before initialize_object() changes them to outgoing
|
||||||
// state).
|
// state).
|
||||||
if (in_try_block) {
|
if (in_try_block) {
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
verify_exception_handler_targets(bci, *this_uninit, current_frame,
|
verify_exception_handler_targets(bci, *this_uninit, current_frame,
|
||||||
stackmap_table, CHECK_VERIFY(this));
|
stackmap_table, CHECK_VERIFY(this));
|
||||||
}
|
}
|
||||||
@ -2791,6 +2809,7 @@ void ClassVerifier::verify_invoke_instructions(
|
|||||||
verify_invoke_init(bcs, index, ref_class_type, current_frame,
|
verify_invoke_init(bcs, index, ref_class_type, current_frame,
|
||||||
code_length, in_try_block, this_uninit, cp, stackmap_table,
|
code_length, in_try_block, this_uninit, cp, stackmap_table,
|
||||||
CHECK_VERIFY(this));
|
CHECK_VERIFY(this));
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
} else { // other methods
|
} else { // other methods
|
||||||
// Ensures that target class is assignable to method class.
|
// Ensures that target class is assignable to method class.
|
||||||
if (opcode == Bytecodes::_invokespecial) {
|
if (opcode == Bytecodes::_invokespecial) {
|
||||||
@ -2816,6 +2835,7 @@ void ClassVerifier::verify_invoke_instructions(
|
|||||||
VerificationType stack_object_type =
|
VerificationType stack_object_type =
|
||||||
current_frame->pop_stack(ref_class_type, CHECK_VERIFY(this));
|
current_frame->pop_stack(ref_class_type, CHECK_VERIFY(this));
|
||||||
if (current_type() != stack_object_type) {
|
if (current_type() != stack_object_type) {
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
assert(cp->cache() == NULL, "not rewritten yet");
|
assert(cp->cache() == NULL, "not rewritten yet");
|
||||||
Symbol* ref_class_name =
|
Symbol* ref_class_name =
|
||||||
cp->klass_name_at(cp->klass_ref_index_at(index));
|
cp->klass_name_at(cp->klass_ref_index_at(index));
|
||||||
@ -2894,6 +2914,7 @@ void ClassVerifier::verify_anewarray(
|
|||||||
current_frame->pop_stack(
|
current_frame->pop_stack(
|
||||||
VerificationType::integer_type(), CHECK_VERIFY(this));
|
VerificationType::integer_type(), CHECK_VERIFY(this));
|
||||||
|
|
||||||
|
if (was_recursively_verified()) return;
|
||||||
VerificationType component_type =
|
VerificationType component_type =
|
||||||
cp_index_to_type(index, cp, CHECK_VERIFY(this));
|
cp_index_to_type(index, cp, CHECK_VERIFY(this));
|
||||||
int length;
|
int length;
|
||||||
|
@ -109,13 +109,13 @@
|
|||||||
template(java_io_ByteArrayInputStream, "java/io/ByteArrayInputStream") \
|
template(java_io_ByteArrayInputStream, "java/io/ByteArrayInputStream") \
|
||||||
template(java_io_Serializable, "java/io/Serializable") \
|
template(java_io_Serializable, "java/io/Serializable") \
|
||||||
template(java_util_Arrays, "java/util/Arrays") \
|
template(java_util_Arrays, "java/util/Arrays") \
|
||||||
template(java_util_Objects, "java/util/Objects") \
|
template(java_util_Objects, "java/util/Objects") \
|
||||||
template(java_util_Properties, "java/util/Properties") \
|
template(java_util_Properties, "java/util/Properties") \
|
||||||
template(java_util_Vector, "java/util/Vector") \
|
template(java_util_Vector, "java/util/Vector") \
|
||||||
template(java_util_AbstractList, "java/util/AbstractList") \
|
template(java_util_AbstractList, "java/util/AbstractList") \
|
||||||
template(java_util_Hashtable, "java/util/Hashtable") \
|
template(java_util_Hashtable, "java/util/Hashtable") \
|
||||||
template(java_lang_Compiler, "java/lang/Compiler") \
|
template(java_lang_Compiler, "java/lang/Compiler") \
|
||||||
template(sun_misc_Signal, "sun/misc/Signal") \
|
template(jdk_internal_misc_Signal, "jdk/internal/misc/Signal") \
|
||||||
template(sun_misc_Launcher, "sun/misc/Launcher") \
|
template(sun_misc_Launcher, "sun/misc/Launcher") \
|
||||||
template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \
|
template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \
|
||||||
template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \
|
template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \
|
||||||
|
@ -1494,7 +1494,7 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CodeCache::print_codelist(outputStream* st) {
|
void CodeCache::print_codelist(outputStream* st) {
|
||||||
assert_locked_or_safepoint(CodeCache_lock);
|
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||||
|
|
||||||
NMethodIterator iter;
|
NMethodIterator iter;
|
||||||
while(iter.next_alive()) {
|
while(iter.next_alive()) {
|
||||||
@ -1508,9 +1508,8 @@ void CodeCache::print_codelist(outputStream* st) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CodeCache::print_layout(outputStream* st) {
|
void CodeCache::print_layout(outputStream* st) {
|
||||||
assert_locked_or_safepoint(CodeCache_lock);
|
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
|
|
||||||
print_summary(st, true);
|
print_summary(st, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -48,6 +48,7 @@
|
|||||||
#include "utilities/dtrace.hpp"
|
#include "utilities/dtrace.hpp"
|
||||||
#include "utilities/events.hpp"
|
#include "utilities/events.hpp"
|
||||||
#include "utilities/xmlstream.hpp"
|
#include "utilities/xmlstream.hpp"
|
||||||
|
#include "logging/log.hpp"
|
||||||
#ifdef TARGET_ARCH_x86
|
#ifdef TARGET_ARCH_x86
|
||||||
# include "nativeInst_x86.hpp"
|
# include "nativeInst_x86.hpp"
|
||||||
#endif
|
#endif
|
||||||
@ -321,9 +322,12 @@ address ExceptionCache::test_address(address addr) {
|
|||||||
|
|
||||||
bool ExceptionCache::add_address_and_handler(address addr, address handler) {
|
bool ExceptionCache::add_address_and_handler(address addr, address handler) {
|
||||||
if (test_address(addr) == handler) return true;
|
if (test_address(addr) == handler) return true;
|
||||||
if (count() < cache_size) {
|
|
||||||
set_pc_at(count(),addr);
|
int index = count();
|
||||||
set_handler_at(count(), handler);
|
if (index < cache_size) {
|
||||||
|
set_pc_at(index, addr);
|
||||||
|
set_handler_at(index, handler);
|
||||||
|
OrderAccess::storestore();
|
||||||
increment_count();
|
increment_count();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1310,13 +1314,14 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
|
|||||||
flush_dependencies(is_alive);
|
flush_dependencies(is_alive);
|
||||||
|
|
||||||
// Break cycle between nmethod & method
|
// Break cycle between nmethod & method
|
||||||
if (TraceClassUnloading && WizardMode) {
|
if (log_is_enabled(Trace, classunload)) {
|
||||||
tty->print_cr("[Class unloading: Making nmethod " INTPTR_FORMAT
|
outputStream* log = LogHandle(classunload)::trace_stream();
|
||||||
" unloadable], Method*(" INTPTR_FORMAT
|
log->print_cr("making nmethod " INTPTR_FORMAT
|
||||||
|
" unloadable, Method*(" INTPTR_FORMAT
|
||||||
"), cause(" INTPTR_FORMAT ")",
|
"), cause(" INTPTR_FORMAT ")",
|
||||||
p2i(this), p2i(_method), p2i(cause));
|
p2i(this), p2i(_method), p2i(cause));
|
||||||
if (!Universe::heap()->is_gc_active())
|
if (!Universe::heap()->is_gc_active())
|
||||||
cause->klass()->print();
|
cause->klass()->print_on(log);
|
||||||
}
|
}
|
||||||
// Unlink the osr method, so we do not look this up again
|
// Unlink the osr method, so we do not look this up again
|
||||||
if (is_osr_method()) {
|
if (is_osr_method()) {
|
||||||
|
@ -466,9 +466,16 @@ CompileQueue* CompileBroker::compile_queue(int comp_level) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CompileBroker::print_compile_queues(outputStream* st) {
|
void CompileBroker::print_compile_queues(outputStream* st) {
|
||||||
|
st->print_cr("Current compiles: ");
|
||||||
MutexLocker locker(MethodCompileQueue_lock);
|
MutexLocker locker(MethodCompileQueue_lock);
|
||||||
|
MutexLocker locker2(Threads_lock);
|
||||||
|
|
||||||
|
char buf[2000];
|
||||||
|
int buflen = sizeof(buf);
|
||||||
|
Threads::print_threads_compiling(st, buf, buflen);
|
||||||
|
|
||||||
|
st->cr();
|
||||||
if (_c1_compile_queue != NULL) {
|
if (_c1_compile_queue != NULL) {
|
||||||
_c1_compile_queue->print(st);
|
_c1_compile_queue->print(st);
|
||||||
}
|
}
|
||||||
@ -479,8 +486,7 @@ void CompileBroker::print_compile_queues(outputStream* st) {
|
|||||||
|
|
||||||
void CompileQueue::print(outputStream* st) {
|
void CompileQueue::print(outputStream* st) {
|
||||||
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
||||||
st->print_cr("Contents of %s", name());
|
st->print_cr("%s:", name());
|
||||||
st->print_cr("----------------------------");
|
|
||||||
CompileTask* task = _first;
|
CompileTask* task = _first;
|
||||||
if (task == NULL) {
|
if (task == NULL) {
|
||||||
st->print_cr("Empty");
|
st->print_cr("Empty");
|
||||||
@ -490,7 +496,7 @@ void CompileQueue::print(outputStream* st) {
|
|||||||
task = task->next();
|
task = task->next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
st->print_cr("----------------------------");
|
st->cr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompileQueue::print_tty() {
|
void CompileQueue::print_tty() {
|
||||||
@ -539,7 +545,7 @@ void CompileBroker::compilation_init(TRAPS) {
|
|||||||
c1_count = JVMCIHostThreads;
|
c1_count = JVMCIHostThreads;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UseInterpreter) {
|
if (!UseInterpreter || !BackgroundCompilation) {
|
||||||
// Force initialization of JVMCI compiler otherwise JVMCI
|
// Force initialization of JVMCI compiler otherwise JVMCI
|
||||||
// compilations will not block until JVMCI is initialized
|
// compilations will not block until JVMCI is initialized
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
@ -1340,49 +1346,55 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if INCLUDE_JVMCI
|
#if INCLUDE_JVMCI
|
||||||
// The number of milliseconds to wait before checking if the
|
// The number of milliseconds to wait before checking if
|
||||||
// JVMCI compiler thread is blocked.
|
// JVMCI compilation has made progress.
|
||||||
static const long BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE = 500;
|
static const long JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE = 500;
|
||||||
|
|
||||||
// The number of successive times the above check is allowed to
|
// The number of JVMCI compilation progress checks that must fail
|
||||||
// see a blocked JVMCI compiler thread before unblocking the
|
// before unblocking a thread waiting for a blocking compilation.
|
||||||
// thread waiting for the compilation to finish.
|
static const int JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS = 5;
|
||||||
static const int BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS = 5;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for a JVMCI compiler to complete a given task. This thread
|
* Waits for a JVMCI compiler to complete a given task. This thread
|
||||||
* waits until either the task completes or it sees the JVMCI compiler
|
* waits until either the task completes or it sees no JVMCI compilation
|
||||||
* thread is blocked for N consecutive milliseconds where N is
|
* progress for N consecutive milliseconds where N is
|
||||||
* BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE *
|
* JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE *
|
||||||
* BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS.
|
* JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS.
|
||||||
*
|
*
|
||||||
* @return true if this thread needs to free/recycle the task
|
* @return true if this thread needs to free/recycle the task
|
||||||
*/
|
*/
|
||||||
bool CompileBroker::wait_for_jvmci_completion(CompileTask* task, JavaThread* thread) {
|
bool CompileBroker::wait_for_jvmci_completion(JVMCICompiler* jvmci, CompileTask* task, JavaThread* thread) {
|
||||||
MutexLocker waiter(task->lock(), thread);
|
MutexLocker waiter(task->lock(), thread);
|
||||||
int consecutively_blocked = 0;
|
int progress_wait_attempts = 0;
|
||||||
while (task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE)) {
|
int methods_compiled = jvmci->methods_compiled();
|
||||||
|
while (!task->is_complete() && !is_compilation_disabled_forever() &&
|
||||||
|
task->lock()->wait(!Mutex::_no_safepoint_check_flag, JVMCI_COMPILATION_PROGRESS_WAIT_TIMESLICE)) {
|
||||||
CompilerThread* jvmci_compiler_thread = task->jvmci_compiler_thread();
|
CompilerThread* jvmci_compiler_thread = task->jvmci_compiler_thread();
|
||||||
|
|
||||||
|
bool progress;
|
||||||
if (jvmci_compiler_thread != NULL) {
|
if (jvmci_compiler_thread != NULL) {
|
||||||
JavaThreadState state;
|
// If the JVMCI compiler thread is not blocked, we deem it to be making progress.
|
||||||
{
|
progress = jvmci_compiler_thread->thread_state() != _thread_blocked;
|
||||||
// A JVMCI compiler thread should not disappear at this point
|
} else {
|
||||||
// but let's be extra safe.
|
// Still waiting on JVMCI compiler queue. This thread may be holding a lock
|
||||||
MutexLocker mu(Threads_lock, thread);
|
// that all JVMCI compiler threads are blocked on. We use the counter for
|
||||||
state = jvmci_compiler_thread->thread_state();
|
// successful JVMCI compilations to determine whether JVMCI compilation
|
||||||
}
|
// is still making progress through the JVMCI compiler queue.
|
||||||
if (state == _thread_blocked) {
|
progress = jvmci->methods_compiled() != methods_compiled;
|
||||||
if (++consecutively_blocked == BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS) {
|
}
|
||||||
if (PrintCompilation) {
|
|
||||||
task->print(tty, "wait for blocking compilation timed out");
|
if (!progress) {
|
||||||
}
|
if (++progress_wait_attempts == JVMCI_COMPILATION_PROGRESS_WAIT_ATTEMPTS) {
|
||||||
break;
|
if (PrintCompilation) {
|
||||||
|
task->print(tty, "wait for blocking compilation timed out");
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
consecutively_blocked = 0;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Still waiting on JVMCI compiler queue
|
progress_wait_attempts = 0;
|
||||||
|
if (jvmci_compiler_thread == NULL) {
|
||||||
|
methods_compiled = jvmci->methods_compiled();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
task->clear_waiter();
|
task->clear_waiter();
|
||||||
@ -1407,8 +1419,9 @@ void CompileBroker::wait_for_completion(CompileTask* task) {
|
|||||||
methodHandle method(thread, task->method());
|
methodHandle method(thread, task->method());
|
||||||
bool free_task;
|
bool free_task;
|
||||||
#if INCLUDE_JVMCI
|
#if INCLUDE_JVMCI
|
||||||
if (compiler(task->comp_level())->is_jvmci()) {
|
AbstractCompiler* comp = compiler(task->comp_level());
|
||||||
free_task = wait_for_jvmci_completion(task, thread);
|
if (comp->is_jvmci()) {
|
||||||
|
free_task = wait_for_jvmci_completion((JVMCICompiler*) comp, task, thread);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -2355,10 +2368,3 @@ void CompileBroker::print_last_compile() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CompileBroker::print_compiler_threads_on(outputStream* st) {
|
|
||||||
#ifndef PRODUCT
|
|
||||||
st->print_cr("Compiler thread printing unimplemented.");
|
|
||||||
st->cr();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
#include "runtime/perfData.hpp"
|
#include "runtime/perfData.hpp"
|
||||||
#include "trace/tracing.hpp"
|
#include "trace/tracing.hpp"
|
||||||
#include "utilities/stack.hpp"
|
#include "utilities/stack.hpp"
|
||||||
|
#if INCLUDE_JVMCI
|
||||||
|
#include "jvmci/jvmciCompiler.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
class nmethod;
|
class nmethod;
|
||||||
class nmethodLocker;
|
class nmethodLocker;
|
||||||
@ -234,7 +237,7 @@ class CompileBroker: AllStatic {
|
|||||||
bool blocking);
|
bool blocking);
|
||||||
static void wait_for_completion(CompileTask* task);
|
static void wait_for_completion(CompileTask* task);
|
||||||
#if INCLUDE_JVMCI
|
#if INCLUDE_JVMCI
|
||||||
static bool wait_for_jvmci_completion(CompileTask* task, JavaThread* thread);
|
static bool wait_for_jvmci_completion(JVMCICompiler* comp, CompileTask* task, JavaThread* thread);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void invoke_compiler_on_method(CompileTask* task);
|
static void invoke_compiler_on_method(CompileTask* task);
|
||||||
@ -350,8 +353,6 @@ public:
|
|||||||
// Debugging output for failure
|
// Debugging output for failure
|
||||||
static void print_last_compile();
|
static void print_last_compile();
|
||||||
|
|
||||||
static void print_compiler_threads_on(outputStream* st);
|
|
||||||
|
|
||||||
// compiler name for debugging
|
// compiler name for debugging
|
||||||
static const char* compiler_name(int comp_level);
|
static const char* compiler_name(int comp_level);
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ class Disassembler {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static bool can_decode() {
|
static bool can_decode() {
|
||||||
|
ttyLocker tl;
|
||||||
return (_decode_instructions_virtual != NULL) ||
|
return (_decode_instructions_virtual != NULL) ||
|
||||||
(_decode_instructions != NULL) ||
|
(_decode_instructions != NULL) ||
|
||||||
load_library();
|
load_library();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -35,6 +35,7 @@
|
|||||||
#include "gc/shared/space.hpp"
|
#include "gc/shared/space.hpp"
|
||||||
#include "gc/shared/vmGCOperations.hpp"
|
#include "gc/shared/vmGCOperations.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/universe.hpp"
|
||||||
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
#include "runtime/globals_extension.hpp"
|
#include "runtime/globals_extension.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -40,15 +40,9 @@ class MarkFromRootsClosure;
|
|||||||
class ParMarkFromRootsClosure;
|
class ParMarkFromRootsClosure;
|
||||||
|
|
||||||
// Decode the oop and call do_oop on it.
|
// Decode the oop and call do_oop on it.
|
||||||
#define DO_OOP_WORK_DEFN \
|
#define DO_OOP_WORK_DEFN \
|
||||||
void do_oop(oop obj); \
|
void do_oop(oop obj); \
|
||||||
template <class T> inline void do_oop_work(T* p) { \
|
template <class T> inline void do_oop_work(T* p);
|
||||||
T heap_oop = oopDesc::load_heap_oop(p); \
|
|
||||||
if (!oopDesc::is_null(heap_oop)) { \
|
|
||||||
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); \
|
|
||||||
do_oop(obj); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: This duplication of the MetadataAwareOopClosure class is only needed
|
// TODO: This duplication of the MetadataAwareOopClosure class is only needed
|
||||||
// because some CMS OopClosures derive from OopsInGenClosure. It would be
|
// because some CMS OopClosures derive from OopsInGenClosure. It would be
|
||||||
@ -131,8 +125,8 @@ class PushAndMarkClosure: public MetadataAwareOopClosure {
|
|||||||
bool concurrent_precleaning);
|
bool concurrent_precleaning);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { PushAndMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { PushAndMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// In the parallel case, the bit map and the
|
// In the parallel case, the bit map and the
|
||||||
@ -157,8 +151,8 @@ class ParPushAndMarkClosure: public MetadataAwareOopClosure {
|
|||||||
OopTaskQueue* work_queue);
|
OopTaskQueue* work_queue);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { ParPushAndMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// The non-parallel version (the parallel version appears further below).
|
// The non-parallel version (the parallel version appears further below).
|
||||||
@ -186,8 +180,8 @@ class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure {
|
|||||||
bool concurrent_precleaning);
|
bool concurrent_precleaning);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
|
|
||||||
void set_freelistLock(Mutex* m) {
|
void set_freelistLock(Mutex* m) {
|
||||||
_freelistLock = m;
|
_freelistLock = m;
|
||||||
@ -220,8 +214,8 @@ class ParMarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure {
|
|||||||
OopTaskQueue* work_queue);
|
OopTaskQueue* work_queue);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
|
|
||||||
void trim_queue(uint size);
|
void trim_queue(uint size);
|
||||||
};
|
};
|
||||||
@ -249,8 +243,8 @@ class PushOrMarkClosure: public MetadataAwareOopClosure {
|
|||||||
MarkFromRootsClosure* parent);
|
MarkFromRootsClosure* parent);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { PushOrMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { PushOrMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
|
|
||||||
// Deal with a stack overflow condition
|
// Deal with a stack overflow condition
|
||||||
void handle_stack_overflow(HeapWord* lost);
|
void handle_stack_overflow(HeapWord* lost);
|
||||||
@ -287,8 +281,8 @@ class ParPushOrMarkClosure: public MetadataAwareOopClosure {
|
|||||||
ParMarkFromRootsClosure* parent);
|
ParMarkFromRootsClosure* parent);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { ParPushOrMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
|
|
||||||
// Deal with a stack overflow condition
|
// Deal with a stack overflow condition
|
||||||
void handle_stack_overflow(HeapWord* lost);
|
void handle_stack_overflow(HeapWord* lost);
|
||||||
@ -318,8 +312,8 @@ class CMSKeepAliveClosure: public MetadataAwareOopClosure {
|
|||||||
bool concurrent_precleaning() const { return _concurrent_precleaning; }
|
bool concurrent_precleaning() const { return _concurrent_precleaning; }
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { CMSKeepAliveClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { CMSKeepAliveClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure {
|
class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure {
|
||||||
@ -336,8 +330,8 @@ class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure {
|
|||||||
OopTaskQueue* work_queue);
|
OopTaskQueue* work_queue);
|
||||||
virtual void do_oop(oop* p);
|
virtual void do_oop(oop* p);
|
||||||
virtual void do_oop(narrowOop* p);
|
virtual void do_oop(narrowOop* p);
|
||||||
inline void do_oop_nv(oop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); }
|
inline void do_oop_nv(oop* p);
|
||||||
inline void do_oop_nv(narrowOop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); }
|
inline void do_oop_nv(narrowOop* p);
|
||||||
};
|
};
|
||||||
|
|
||||||
// A parallel (MT) version of the above, used when
|
// A parallel (MT) version of the above, used when
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,21 +30,6 @@
|
|||||||
#include "gc/shared/taskqueue.inline.hpp"
|
#include "gc/shared/taskqueue.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
|
||||||
// Trim our work_queue so its length is below max at return
|
|
||||||
inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) {
|
|
||||||
while (_work_queue->size() > max) {
|
|
||||||
oop newOop;
|
|
||||||
if (_work_queue->pop_local(newOop)) {
|
|
||||||
assert(newOop->is_oop(), "Expected an oop");
|
|
||||||
assert(_bit_map->isMarked((HeapWord*)newOop),
|
|
||||||
"only grey objects on this stack");
|
|
||||||
// iterate over the oops in this oop, marking and pushing
|
|
||||||
// the ones in CMS heap (i.e. in _span).
|
|
||||||
newOop->oop_iterate(&_parPushAndMarkClosure);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MetadataAwareOopClosure and MetadataAwareOopsInGenClosure are duplicated,
|
// MetadataAwareOopClosure and MetadataAwareOopsInGenClosure are duplicated,
|
||||||
// until we get rid of OopsInGenClosure.
|
// until we get rid of OopsInGenClosure.
|
||||||
|
|
||||||
@ -61,4 +46,48 @@ inline void MetadataAwareOopsInGenClosure::do_cld_nv(ClassLoaderData* cld) {
|
|||||||
cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim);
|
cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Decode the oop and call do_oop on it.
|
||||||
|
#define DO_OOP_WORK_IMPL(cls) \
|
||||||
|
template <class T> void cls::do_oop_work(T* p) { \
|
||||||
|
T heap_oop = oopDesc::load_heap_oop(p); \
|
||||||
|
if (!oopDesc::is_null(heap_oop)) { \
|
||||||
|
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); \
|
||||||
|
do_oop(obj); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DO_OOP_WORK_NV_IMPL(cls) \
|
||||||
|
DO_OOP_WORK_IMPL(cls) \
|
||||||
|
void cls::do_oop_nv(oop* p) { cls::do_oop_work(p); } \
|
||||||
|
void cls::do_oop_nv(narrowOop* p) { cls::do_oop_work(p); }
|
||||||
|
|
||||||
|
DO_OOP_WORK_IMPL(MarkRefsIntoClosure)
|
||||||
|
DO_OOP_WORK_IMPL(ParMarkRefsIntoClosure)
|
||||||
|
DO_OOP_WORK_IMPL(MarkRefsIntoVerifyClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(PushAndMarkClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(ParPushAndMarkClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(MarkRefsIntoAndScanClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(ParMarkRefsIntoAndScanClosure)
|
||||||
|
|
||||||
|
// Trim our work_queue so its length is below max at return
|
||||||
|
inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) {
|
||||||
|
while (_work_queue->size() > max) {
|
||||||
|
oop newOop;
|
||||||
|
if (_work_queue->pop_local(newOop)) {
|
||||||
|
assert(newOop->is_oop(), "Expected an oop");
|
||||||
|
assert(_bit_map->isMarked((HeapWord*)newOop),
|
||||||
|
"only grey objects on this stack");
|
||||||
|
// iterate over the oops in this oop, marking and pushing
|
||||||
|
// the ones in CMS heap (i.e. in _span).
|
||||||
|
newOop->oop_iterate(&_parPushAndMarkClosure);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DO_OOP_WORK_NV_IMPL(PushOrMarkClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(ParPushOrMarkClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(CMSKeepAliveClosure)
|
||||||
|
DO_OOP_WORK_NV_IMPL(CMSInnerParMarkAndPushClosure)
|
||||||
|
DO_OOP_WORK_IMPL(CMSParKeepAliveClosure)
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_CMS_CMSOOPCLOSURES_INLINE_HPP
|
#endif // SHARE_VM_GC_CMS_CMSOOPCLOSURES_INLINE_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -219,6 +219,10 @@ void CompactibleFreeListSpace::initializeIndexedFreeListArray() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t CompactibleFreeListSpace::obj_size(const HeapWord* addr) const {
|
||||||
|
return adjustObjectSize(oop(addr)->size());
|
||||||
|
}
|
||||||
|
|
||||||
void CompactibleFreeListSpace::resetIndexedFreeListArray() {
|
void CompactibleFreeListSpace::resetIndexedFreeListArray() {
|
||||||
for (size_t i = 1; i < IndexSetSize; i++) {
|
for (size_t i = 1; i < IndexSetSize; i++) {
|
||||||
assert(_indexedFreeList[i].size() == (size_t) i,
|
assert(_indexedFreeList[i].size() == (size_t) i,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -313,9 +313,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
|||||||
return adjustObjectSize(size);
|
return adjustObjectSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline size_t obj_size(const HeapWord* addr) const {
|
inline size_t obj_size(const HeapWord* addr) const;
|
||||||
return adjustObjectSize(oop(addr)->size());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Reset the indexed free list to its initial empty condition.
|
// Reset the indexed free list to its initial empty condition.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -1517,6 +1517,8 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||||||
SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
|
SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
|
||||||
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
|
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
|
||||||
|
|
||||||
|
gch->pre_full_gc_dump(gc_timer);
|
||||||
|
|
||||||
GCTraceTime(Trace, gc) t("CMS:MSC");
|
GCTraceTime(Trace, gc) t("CMS:MSC");
|
||||||
|
|
||||||
// Temporarily widen the span of the weak reference processing to
|
// Temporarily widen the span of the weak reference processing to
|
||||||
@ -1593,6 +1595,8 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||||||
_inter_sweep_timer.reset();
|
_inter_sweep_timer.reset();
|
||||||
_inter_sweep_timer.start();
|
_inter_sweep_timer.start();
|
||||||
|
|
||||||
|
gch->post_full_gc_dump(gc_timer);
|
||||||
|
|
||||||
gc_timer->register_gc_end();
|
gc_timer->register_gc_end();
|
||||||
|
|
||||||
gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
|
gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
|
||||||
@ -3324,6 +3328,8 @@ class ParConcMarkingClosure: public MetadataAwareOopClosure {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DO_OOP_WORK_IMPL(ParConcMarkingClosure)
|
||||||
|
|
||||||
// Grey object scanning during work stealing phase --
|
// Grey object scanning during work stealing phase --
|
||||||
// the salient assumption here is that any references
|
// the salient assumption here is that any references
|
||||||
// that are in these stolen objects being scanned must
|
// that are in these stolen objects being scanned must
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -29,7 +29,7 @@
|
|||||||
#include "gc/cms/parOopClosures.inline.hpp"
|
#include "gc/cms/parOopClosures.inline.hpp"
|
||||||
#include "gc/serial/defNewGeneration.inline.hpp"
|
#include "gc/serial/defNewGeneration.inline.hpp"
|
||||||
#include "gc/shared/adaptiveSizePolicy.hpp"
|
#include "gc/shared/adaptiveSizePolicy.hpp"
|
||||||
#include "gc/shared/ageTable.hpp"
|
#include "gc/shared/ageTable.inline.hpp"
|
||||||
#include "gc/shared/copyFailedInfo.hpp"
|
#include "gc/shared/copyFailedInfo.hpp"
|
||||||
#include "gc/shared/gcHeapSummary.hpp"
|
#include "gc/shared/gcHeapSummary.hpp"
|
||||||
#include "gc/shared/gcTimer.hpp"
|
#include "gc/shared/gcTimer.hpp"
|
||||||
@ -414,7 +414,7 @@ void ParScanThreadStateSet::print_taskqueue_stats_hdr(outputStream* const st) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ParScanThreadStateSet::print_taskqueue_stats() {
|
void ParScanThreadStateSet::print_taskqueue_stats() {
|
||||||
if (!develop_log_is_enabled(Trace, gc, task, stats)) {
|
if (!log_develop_is_enabled(Trace, gc, task, stats)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogHandle(gc, task, stats) log;
|
LogHandle(gc, task, stats) log;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -34,6 +34,31 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
PromotedObject* PromotedObject::next() const {
|
||||||
|
assert(!((FreeChunk*)this)->is_free(), "Error");
|
||||||
|
PromotedObject* res;
|
||||||
|
if (UseCompressedOops) {
|
||||||
|
// The next pointer is a compressed oop stored in the top 32 bits
|
||||||
|
res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next);
|
||||||
|
} else {
|
||||||
|
res = (PromotedObject*)(_next & next_mask);
|
||||||
|
}
|
||||||
|
assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res)));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void PromotedObject::setNext(PromotedObject* x) {
|
||||||
|
assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, "
|
||||||
|
"or insufficient alignment of objects");
|
||||||
|
if (UseCompressedOops) {
|
||||||
|
assert(_data._narrow_next == 0, "Overwrite?");
|
||||||
|
_data._narrow_next = oopDesc::encode_heap_oop(oop(x));
|
||||||
|
} else {
|
||||||
|
_next |= (intptr_t)x;
|
||||||
|
}
|
||||||
|
assert(!((FreeChunk*)this)->is_free(), "Error");
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// We go over the list of promoted objects, removing each from the list,
|
// We go over the list of promoted objects, removing each from the list,
|
||||||
// and applying the closure (this may, in turn, add more elements to
|
// and applying the closure (this may, in turn, add more elements to
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -64,29 +64,8 @@ class PromotedObject VALUE_OBJ_CLASS_SPEC {
|
|||||||
Data _data;
|
Data _data;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
inline PromotedObject* next() const {
|
PromotedObject* next() const;
|
||||||
assert(!((FreeChunk*)this)->is_free(), "Error");
|
void setNext(PromotedObject* x);
|
||||||
PromotedObject* res;
|
|
||||||
if (UseCompressedOops) {
|
|
||||||
// The next pointer is a compressed oop stored in the top 32 bits
|
|
||||||
res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next);
|
|
||||||
} else {
|
|
||||||
res = (PromotedObject*)(_next & next_mask);
|
|
||||||
}
|
|
||||||
assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res)));
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
inline void setNext(PromotedObject* x) {
|
|
||||||
assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, "
|
|
||||||
"or insufficient alignment of objects");
|
|
||||||
if (UseCompressedOops) {
|
|
||||||
assert(_data._narrow_next == 0, "Overwrite?");
|
|
||||||
_data._narrow_next = oopDesc::encode_heap_oop(oop(x));
|
|
||||||
} else {
|
|
||||||
_next |= (intptr_t)x;
|
|
||||||
}
|
|
||||||
assert(!((FreeChunk*)this)->is_free(), "Error");
|
|
||||||
}
|
|
||||||
inline void setPromotedMark() {
|
inline void setPromotedMark() {
|
||||||
_next |= promoted_mask;
|
_next |= promoted_mask;
|
||||||
assert(!((FreeChunk*)this)->is_free(), "Error");
|
assert(!((FreeChunk*)this)->is_free(), "Error");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -59,10 +59,10 @@ ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *nex
|
|||||||
_monitor = DirtyCardQ_CBL_mon;
|
_monitor = DirtyCardQ_CBL_mon;
|
||||||
}
|
}
|
||||||
initialize();
|
initialize();
|
||||||
create_and_start();
|
|
||||||
|
|
||||||
// set name
|
// set name
|
||||||
set_name("G1 Refine#%d", worker_id);
|
set_name("G1 Refine#%d", worker_id);
|
||||||
|
create_and_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentG1RefineThread::initialize() {
|
void ConcurrentG1RefineThread::initialize() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -43,7 +43,7 @@
|
|||||||
SurrogateLockerThread*
|
SurrogateLockerThread*
|
||||||
ConcurrentMarkThread::_slt = NULL;
|
ConcurrentMarkThread::_slt = NULL;
|
||||||
|
|
||||||
ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
|
ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) :
|
||||||
ConcurrentGCThread(),
|
ConcurrentGCThread(),
|
||||||
_cm(cm),
|
_cm(cm),
|
||||||
_state(Idle),
|
_state(Idle),
|
||||||
@ -56,10 +56,10 @@ ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
|
|||||||
|
|
||||||
class CMCheckpointRootsFinalClosure: public VoidClosure {
|
class CMCheckpointRootsFinalClosure: public VoidClosure {
|
||||||
|
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CMCheckpointRootsFinalClosure(ConcurrentMark* cm) :
|
CMCheckpointRootsFinalClosure(G1ConcurrentMark* cm) :
|
||||||
_cm(cm) {}
|
_cm(cm) {}
|
||||||
|
|
||||||
void do_void(){
|
void do_void(){
|
||||||
@ -68,10 +68,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class CMCleanUp: public VoidClosure {
|
class CMCleanUp: public VoidClosure {
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CMCleanUp(ConcurrentMark* cm) :
|
CMCleanUp(G1ConcurrentMark* cm) :
|
||||||
_cm(cm) {}
|
_cm(cm) {}
|
||||||
|
|
||||||
void do_void(){
|
void do_void(){
|
||||||
@ -92,10 +92,10 @@ void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GCConcPhaseTimer : StackObj {
|
class GCConcPhaseTimer : StackObj {
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) {
|
GCConcPhaseTimer(G1ConcurrentMark* cm, const char* title) : _cm(cm) {
|
||||||
_cm->register_concurrent_phase_start(title);
|
_cm->register_concurrent_phase_start(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -27,10 +27,10 @@
|
|||||||
|
|
||||||
#include "gc/shared/concurrentGCThread.hpp"
|
#include "gc/shared/concurrentGCThread.hpp"
|
||||||
|
|
||||||
// The Concurrent Mark GC Thread triggers the parallel CMConcurrentMarkingTasks
|
// The Concurrent Mark GC Thread triggers the parallel G1CMConcurrentMarkingTasks
|
||||||
// as well as handling various marking cleanup.
|
// as well as handling various marking cleanup.
|
||||||
|
|
||||||
class ConcurrentMark;
|
class G1ConcurrentMark;
|
||||||
class G1CollectorPolicy;
|
class G1CollectorPolicy;
|
||||||
|
|
||||||
class ConcurrentMarkThread: public ConcurrentGCThread {
|
class ConcurrentMarkThread: public ConcurrentGCThread {
|
||||||
@ -45,7 +45,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
virtual void run();
|
virtual void run();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
Idle,
|
Idle,
|
||||||
@ -65,7 +65,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
ConcurrentMarkThread(ConcurrentMark* cm);
|
ConcurrentMarkThread(G1ConcurrentMark* cm);
|
||||||
|
|
||||||
static void makeSurrogateLockerThread(TRAPS);
|
static void makeSurrogateLockerThread(TRAPS);
|
||||||
static SurrogateLockerThread* slt() { return _slt; }
|
static SurrogateLockerThread* slt() { return _slt; }
|
||||||
@ -75,7 +75,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
// Marking virtual time so far this thread and concurrent marking tasks.
|
// Marking virtual time so far this thread and concurrent marking tasks.
|
||||||
double vtime_mark_accum();
|
double vtime_mark_accum();
|
||||||
|
|
||||||
ConcurrentMark* cm() { return _cm; }
|
G1ConcurrentMark* cm() { return _cm; }
|
||||||
|
|
||||||
void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
|
void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
|
||||||
bool idle() { return _state == Idle; }
|
bool idle() { return _state == Idle; }
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
#ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
||||||
#define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
#define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
||||||
|
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/concurrentMarkThread.hpp"
|
#include "gc/g1/concurrentMarkThread.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
|
|
||||||
// Total virtual time so far.
|
// Total virtual time so far.
|
||||||
inline double ConcurrentMarkThread::vtime_accum() {
|
inline double ConcurrentMarkThread::vtime_accum() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -438,7 +438,7 @@ void G1ArchiveAllocator::complete_archive(GrowableArray<MemRegion>* ranges,
|
|||||||
// If an end alignment was requested, insert filler objects.
|
// If an end alignment was requested, insert filler objects.
|
||||||
if (end_alignment_in_bytes != 0) {
|
if (end_alignment_in_bytes != 0) {
|
||||||
HeapWord* currtop = _allocation_region->top();
|
HeapWord* currtop = _allocation_region->top();
|
||||||
HeapWord* newtop = (HeapWord*)align_pointer_up(currtop, end_alignment_in_bytes);
|
HeapWord* newtop = (HeapWord*)align_ptr_up(currtop, end_alignment_in_bytes);
|
||||||
size_t fill_size = pointer_delta(newtop, currtop);
|
size_t fill_size = pointer_delta(newtop, currtop);
|
||||||
if (fill_size != 0) {
|
if (fill_size != 0) {
|
||||||
if (fill_size < CollectedHeap::min_fill_size()) {
|
if (fill_size < CollectedHeap::min_fill_size()) {
|
||||||
@ -447,8 +447,8 @@ void G1ArchiveAllocator::complete_archive(GrowableArray<MemRegion>* ranges,
|
|||||||
// region boundary because the max supported alignment is smaller than the min
|
// region boundary because the max supported alignment is smaller than the min
|
||||||
// region size, and because the allocation code never leaves space smaller than
|
// region size, and because the allocation code never leaves space smaller than
|
||||||
// the min_fill_size at the top of the current allocation region.
|
// the min_fill_size at the top of the current allocation region.
|
||||||
newtop = (HeapWord*)align_pointer_up(currtop + CollectedHeap::min_fill_size(),
|
newtop = (HeapWord*)align_ptr_up(currtop + CollectedHeap::min_fill_size(),
|
||||||
end_alignment_in_bytes);
|
end_alignment_in_bytes);
|
||||||
fill_size = pointer_delta(newtop, currtop);
|
fill_size = pointer_delta(newtop, currtop);
|
||||||
}
|
}
|
||||||
HeapWord* fill = archive_mem_allocate(fill_size);
|
HeapWord* fill = archive_mem_allocate(fill_size);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -74,10 +74,16 @@ class CodeRootSetTable : public Hashtable<nmethod*, mtGC> {
|
|||||||
static size_t static_mem_size() {
|
static size_t static_mem_size() {
|
||||||
return sizeof(_purge_list);
|
return sizeof(_purge_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t mem_size();
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeRootSetTable* volatile CodeRootSetTable::_purge_list = NULL;
|
CodeRootSetTable* volatile CodeRootSetTable::_purge_list = NULL;
|
||||||
|
|
||||||
|
size_t CodeRootSetTable::mem_size() {
|
||||||
|
return sizeof(CodeRootSetTable) + (entry_size() * number_of_entries()) + (sizeof(HashtableBucket<mtGC>) * table_size());
|
||||||
|
}
|
||||||
|
|
||||||
CodeRootSetTable::Entry* CodeRootSetTable::new_entry(nmethod* nm) {
|
CodeRootSetTable::Entry* CodeRootSetTable::new_entry(nmethod* nm) {
|
||||||
unsigned int hash = compute_hash(nm);
|
unsigned int hash = compute_hash(nm);
|
||||||
Entry* entry = (Entry*) new_entry_free_list();
|
Entry* entry = (Entry*) new_entry_free_list();
|
||||||
@ -232,7 +238,6 @@ void G1CodeRootSet::move_to_large() {
|
|||||||
OrderAccess::release_store_ptr(&_table, temp);
|
OrderAccess::release_store_ptr(&_table, temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void G1CodeRootSet::purge() {
|
void G1CodeRootSet::purge() {
|
||||||
CodeRootSetTable::purge();
|
CodeRootSetTable::purge();
|
||||||
}
|
}
|
||||||
@ -247,12 +252,13 @@ void G1CodeRootSet::add(nmethod* method) {
|
|||||||
allocate_small_table();
|
allocate_small_table();
|
||||||
}
|
}
|
||||||
added = _table->add(method);
|
added = _table->add(method);
|
||||||
if (_length == Threshold) {
|
|
||||||
move_to_large();
|
|
||||||
}
|
|
||||||
if (added) {
|
if (added) {
|
||||||
|
if (_length == Threshold) {
|
||||||
|
move_to_large();
|
||||||
|
}
|
||||||
++_length;
|
++_length;
|
||||||
}
|
}
|
||||||
|
assert(_length == (size_t)_table->number_of_entries(), "sizes should match");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool G1CodeRootSet::remove(nmethod* method) {
|
bool G1CodeRootSet::remove(nmethod* method) {
|
||||||
@ -266,11 +272,13 @@ bool G1CodeRootSet::remove(nmethod* method) {
|
|||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert((_length == 0 && _table == NULL) ||
|
||||||
|
(_length == (size_t)_table->number_of_entries()), "sizes should match");
|
||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool G1CodeRootSet::contains(nmethod* method) {
|
bool G1CodeRootSet::contains(nmethod* method) {
|
||||||
CodeRootSetTable* table = load_acquire_table();
|
CodeRootSetTable* table = load_acquire_table(); // contains() may be called outside of lock, so ensure mem sync.
|
||||||
if (table != NULL) {
|
if (table != NULL) {
|
||||||
return table->contains(method);
|
return table->contains(method);
|
||||||
}
|
}
|
||||||
@ -284,8 +292,7 @@ void G1CodeRootSet::clear() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t G1CodeRootSet::mem_size() {
|
size_t G1CodeRootSet::mem_size() {
|
||||||
return sizeof(*this) +
|
return sizeof(*this) + (_table != NULL ? _table->mem_size() : 0);
|
||||||
(_table != NULL ? sizeof(CodeRootSetTable) + _table->entry_size() * _length : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1CodeRootSet::nmethods_do(CodeBlobClosure* blk) const {
|
void G1CodeRootSet::nmethods_do(CodeBlobClosure* blk) const {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user