mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-02 04:00:16 +00:00
Merge
This commit is contained in:
commit
b1ddf14645
@ -136,8 +136,6 @@ include $(MAKEFILES_DIR)/dtrace.make
|
||||
JVM = jvm
|
||||
LIBJVM = lib$(JVM).so
|
||||
|
||||
CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
|
||||
|
||||
LIBJVM_DEBUGINFO = lib$(JVM).debuginfo
|
||||
LIBJVM_DIZ = lib$(JVM).diz
|
||||
|
||||
|
||||
@ -146,9 +146,6 @@ JVM = jvm
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
LIBJVM = lib$(JVM).dylib
|
||||
CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
|
||||
ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug))
|
||||
CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
|
||||
endif
|
||||
|
||||
LIBJVM_DEBUGINFO = lib$(JVM).dylib.dSYM
|
||||
LIBJVM_DIZ = lib$(JVM).diz
|
||||
|
||||
@ -93,7 +93,7 @@ JRE_RELEASE_VERSION="\\\"$(JDK_MAJOR_VER).$(JDK_MINOR_VER).$(JDK_MICRO_VER)\\\""
|
||||
!if "$(HOTSPOT_RELEASE_VERSION)" != ""
|
||||
HOTSPOT_RELEASE_VERSION="\\\"$(HOTSPOT_RELEASE_VERSION)\\\""
|
||||
!else
|
||||
HOTSPOT_RELEASE_VERSION="\\\"$(JRE_RELEASE_VERSION)\\\""
|
||||
HOTSPOT_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
|
||||
!endif
|
||||
# Define HOTSPOT_VM_DISTRO if HOTSPOT_VM_DISTRO is set,
|
||||
# and if it is not see if we have the src/closed directory
|
||||
@ -105,9 +105,18 @@ HOTSPOT_VM_DISTRO="\\\"Java HotSpot(TM)\\\""
|
||||
!else
|
||||
HOTSPOT_VM_DISTRO="\\\"OpenJDK\\\""
|
||||
!endif
|
||||
!if "$(JDK_BUILD_NUMBER)" != ""
|
||||
JDK_BUILD_NUMBER="\\\"$(JDK_BUILD_NUMBER)\\\""
|
||||
!else
|
||||
JDK_BUILD_NUMBER="\\\"00\\\""
|
||||
!endif
|
||||
!endif
|
||||
|
||||
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO)
|
||||
JDK_MAJOR_VERSION="\\\"$(JDK_MAJOR_VER)\\\""
|
||||
JDK_MINOR_VERSION="\\\"$(JDK_MINOR_VER)\\\""
|
||||
JDK_MICRO_VERSION="\\\"$(JDK_MICRO_VER)\\\""
|
||||
|
||||
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER)
|
||||
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
|
||||
|
||||
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
|
||||
|
||||
@ -41,7 +41,6 @@ define_pd_global(bool, UseOnStackReplacement, true);
|
||||
define_pd_global(bool, ProfileInterpreter, true);
|
||||
define_pd_global(bool, TieredCompilation, false);
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
define_pd_global(intx, BackEdgeThreshold, 140000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 140);
|
||||
define_pd_global(intx, ConditionalMoveLimit, 3);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -149,7 +149,7 @@ void VM_Version::initialize() {
|
||||
}
|
||||
|
||||
void VM_Version::print_features() {
|
||||
tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size());
|
||||
tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
|
||||
}
|
||||
|
||||
#ifdef COMPILER2
|
||||
|
||||
@ -414,6 +414,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
__ set(_trap_request, G4);
|
||||
__ call(Runtime1::entry_for(Runtime1::deoptimize_id), relocInfo::runtime_call_type);
|
||||
__ delayed()->nop();
|
||||
ce->add_call_info_here(_info);
|
||||
|
||||
@ -781,7 +781,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
|
||||
{
|
||||
__ set_info("deoptimize", dont_gc_arguments);
|
||||
OopMap* oop_map = save_live_registers(sasm);
|
||||
int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize));
|
||||
int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), G4);
|
||||
oop_maps = new OopMapSet();
|
||||
oop_maps->add_gc_map(call_offset, oop_map);
|
||||
restore_live_registers(sasm);
|
||||
|
||||
@ -40,7 +40,6 @@ define_pd_global(bool, ProfileTraps, false);
|
||||
define_pd_global(bool, UseOnStackReplacement, true );
|
||||
define_pd_global(bool, TieredCompilation, false);
|
||||
define_pd_global(intx, CompileThreshold, 1000 ); // Design center runs on 1.3.1
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 1400 );
|
||||
define_pd_global(bool, UseTLAB, true );
|
||||
|
||||
@ -44,7 +44,6 @@ define_pd_global(bool, ProfileInterpreter, true);
|
||||
#endif // CC_INTERP
|
||||
define_pd_global(bool, TieredCompilation, trueInTiered);
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
define_pd_global(intx, BackEdgeThreshold, 140000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 140);
|
||||
define_pd_global(intx, ConditionalMoveLimit, 4);
|
||||
|
||||
@ -318,22 +318,22 @@ void VM_Version::initialize() {
|
||||
tty->print("BIS");
|
||||
}
|
||||
if (AllocatePrefetchLines > 1) {
|
||||
tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
|
||||
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
|
||||
} else {
|
||||
tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
|
||||
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
|
||||
}
|
||||
}
|
||||
if (PrefetchCopyIntervalInBytes > 0) {
|
||||
tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
|
||||
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
|
||||
}
|
||||
if (PrefetchScanIntervalInBytes > 0) {
|
||||
tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
|
||||
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
|
||||
}
|
||||
if (PrefetchFieldsAhead > 0) {
|
||||
tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
|
||||
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
|
||||
}
|
||||
if (ContendedPaddingWidth > 0) {
|
||||
tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
|
||||
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
|
||||
}
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -522,11 +522,11 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
|
||||
// these asserts are somewhat nonsensical
|
||||
#ifndef _LP64
|
||||
assert(which == imm_operand || which == disp32_operand,
|
||||
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
|
||||
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
|
||||
#else
|
||||
assert((which == call32_operand || which == imm_operand) && is_64bit ||
|
||||
which == narrow_oop_operand && !is_64bit,
|
||||
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
|
||||
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
|
||||
#endif // _LP64
|
||||
return ip;
|
||||
|
||||
|
||||
@ -430,6 +430,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
|
||||
|
||||
void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
|
||||
__ bind(_entry);
|
||||
ce->store_parameter(_trap_request, 0);
|
||||
__ call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id)));
|
||||
ce->add_call_info_here(_info);
|
||||
DEBUG_ONLY(__ should_not_reach_here());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -95,7 +95,7 @@ void LinearScan::allocate_fpu_stack() {
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (TraceFPURegisterUsage) {
|
||||
tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr("");
|
||||
tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->cr();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1468,9 +1468,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
|
||||
case deoptimize_id:
|
||||
{
|
||||
StubFrame f(sasm, "deoptimize", dont_gc_arguments);
|
||||
const int num_rt_args = 1; // thread
|
||||
const int num_rt_args = 2; // thread, trap_request
|
||||
OopMap* oop_map = save_live_registers(sasm, num_rt_args);
|
||||
int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize));
|
||||
f.load_argument(0, rax);
|
||||
int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), rax);
|
||||
oop_maps = new OopMapSet();
|
||||
oop_maps->add_gc_map(call_offset, oop_map);
|
||||
restore_live_registers(sasm);
|
||||
|
||||
@ -41,7 +41,6 @@ define_pd_global(bool, ProfileTraps, false);
|
||||
define_pd_global(bool, UseOnStackReplacement, true );
|
||||
define_pd_global(bool, TieredCompilation, false);
|
||||
define_pd_global(intx, CompileThreshold, 1500 );
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
||||
define_pd_global(intx, FreqInlineSize, 325 );
|
||||
|
||||
@ -45,7 +45,6 @@ define_pd_global(bool, ProfileInterpreter, true);
|
||||
#endif // CC_INTERP
|
||||
define_pd_global(bool, TieredCompilation, trueInTiered);
|
||||
define_pd_global(intx, CompileThreshold, 10000);
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
|
||||
define_pd_global(intx, OnStackReplacePercentage, 140);
|
||||
define_pd_global(intx, ConditionalMoveLimit, 3);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -122,7 +122,7 @@ void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry)
|
||||
if (TraceICs) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
|
||||
instruction_address(),
|
||||
p2i(instruction_address()),
|
||||
callee->name_and_sig_as_C_string());
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -48,6 +48,7 @@ void RegisterMap::check_location_valid() {
|
||||
}
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// Profiling/safepoint support
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -51,6 +51,7 @@
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
#ifdef _WIN64
|
||||
address AbstractInterpreterGenerator::generate_slow_signature_handler() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,6 +55,7 @@
|
||||
|
||||
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
#ifdef ASSERT
|
||||
bool AbstractAssembler::pd_check_instruction_mark() { return true; }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,6 +29,8 @@
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
#define __ _masm->
|
||||
|
||||
#ifdef PRODUCT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,6 +35,8 @@
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
void NativeInstruction::wrote(int offset) {
|
||||
ICache::invalidate_word(addr_at(offset));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -925,16 +925,16 @@ void VM_Version::get_processor_features() {
|
||||
if (PrintMiscellaneous && Verbose) {
|
||||
tty->print_cr("Logical CPUs per core: %u",
|
||||
logical_processors_per_package());
|
||||
tty->print("UseSSE=%d",UseSSE);
|
||||
tty->print("UseSSE=%d", (int) UseSSE);
|
||||
if (UseAVX > 0) {
|
||||
tty->print(" UseAVX=%d",UseAVX);
|
||||
tty->print(" UseAVX=%d", (int) UseAVX);
|
||||
}
|
||||
if (UseAES) {
|
||||
tty->print(" UseAES=1");
|
||||
}
|
||||
#ifdef COMPILER2
|
||||
if (MaxVectorSize > 0) {
|
||||
tty->print(" MaxVectorSize=%d", MaxVectorSize);
|
||||
tty->print(" MaxVectorSize=%d", (int) MaxVectorSize);
|
||||
}
|
||||
#endif
|
||||
tty->cr();
|
||||
@ -957,23 +957,23 @@ void VM_Version::get_processor_features() {
|
||||
}
|
||||
}
|
||||
if (AllocatePrefetchLines > 1) {
|
||||
tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
|
||||
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
|
||||
} else {
|
||||
tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
|
||||
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
|
||||
}
|
||||
}
|
||||
|
||||
if (PrefetchCopyIntervalInBytes > 0) {
|
||||
tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
|
||||
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
|
||||
}
|
||||
if (PrefetchScanIntervalInBytes > 0) {
|
||||
tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
|
||||
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
|
||||
}
|
||||
if (PrefetchFieldsAhead > 0) {
|
||||
tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
|
||||
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
|
||||
}
|
||||
if (ContendedPaddingWidth > 0) {
|
||||
tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
|
||||
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
|
||||
}
|
||||
}
|
||||
#endif // !PRODUCT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -118,7 +118,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
|
||||
|
||||
if (PrintMiscellaneous && (WizardMode || Verbose)) {
|
||||
tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d",
|
||||
vtable_index, s->entry_point(),
|
||||
vtable_index, p2i(s->entry_point()),
|
||||
(int)(s->code_end() - s->entry_point()),
|
||||
(int)(s->code_end() - __ pc()));
|
||||
}
|
||||
@ -199,7 +199,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
|
||||
|
||||
if (PrintMiscellaneous && (WizardMode || Verbose)) {
|
||||
tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d",
|
||||
itable_index, s->entry_point(),
|
||||
itable_index, p2i(s->entry_point()),
|
||||
(int)(s->code_end() - s->entry_point()),
|
||||
(int)(s->code_end() - __ pc()));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,6 +35,8 @@
|
||||
#include "opto/runtime.hpp"
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// machine-dependent part of VtableStubs: create VtableStub of correct size and
|
||||
// initialize its code
|
||||
|
||||
|
||||
@ -43,7 +43,6 @@ define_pd_global(intx, Tier2CompileThreshold, 1500);
|
||||
define_pd_global(intx, Tier3CompileThreshold, 2500);
|
||||
define_pd_global(intx, Tier4CompileThreshold, 4500);
|
||||
|
||||
define_pd_global(intx, BackEdgeThreshold, 100000);
|
||||
define_pd_global(intx, Tier2BackEdgeThreshold, 100000);
|
||||
define_pd_global(intx, Tier3BackEdgeThreshold, 100000);
|
||||
define_pd_global(intx, Tier4BackEdgeThreshold, 100000);
|
||||
|
||||
@ -1871,7 +1871,7 @@ public:
|
||||
// properties.
|
||||
|
||||
// ShmBkBlock: base class for all blocks in the shared memory bookkeeping
|
||||
class ShmBkBlock {
|
||||
class ShmBkBlock : public CHeapObj<mtInternal> {
|
||||
|
||||
ShmBkBlock* _next;
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "asm/assembler.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "loadlib_aix.hpp"
|
||||
#include "porting_aix.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
@ -67,7 +68,7 @@ inline char* align_ptr_up(char* ptr, intptr_t alignment) {
|
||||
// a primitive string map. Should this turn out to be a performance
|
||||
// problem, a better hashmap has to be used.
|
||||
class fixed_strings {
|
||||
struct node {
|
||||
struct node : public CHeapObj<mtInternal> {
|
||||
char* v;
|
||||
node* next;
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -53,7 +53,7 @@ bool MachODecoder::decode(address addr, char *buf,
|
||||
struct symtab_command * symt = (struct symtab_command *)
|
||||
mach_find_command((struct mach_header_64 *)mach_base, LC_SYMTAB);
|
||||
if (symt == NULL) {
|
||||
DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", mach_base));
|
||||
DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", p2i(mach_base)));
|
||||
return false;
|
||||
}
|
||||
uint32_t off = symt->symoff; /* symbol table offset (within this mach file) */
|
||||
|
||||
@ -124,6 +124,9 @@
|
||||
#define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
|
||||
|
||||
#define LARGEPAGES_BIT (1 << 6)
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// global variables
|
||||
julong os::Bsd::_physical_memory = 0;
|
||||
@ -2394,7 +2397,6 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
|
||||
(!FLAG_IS_DEFAULT(UseLargePages) ||
|
||||
!FLAG_IS_DEFAULT(LargePageSizeInBytes)
|
||||
);
|
||||
char msg[128];
|
||||
|
||||
// Create a large shared memory region to attach to based on size.
|
||||
// Currently, size is the total size of the heap
|
||||
@ -2415,8 +2417,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
|
||||
// coalesce into large pages. Try to reserve large pages when
|
||||
// the system is still "fresh".
|
||||
if (warn_on_failure) {
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
|
||||
warning(msg);
|
||||
warning("Failed to reserve shared memory (errno = %d).", errno);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -2433,8 +2434,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr,
|
||||
|
||||
if ((intptr_t)addr == -1) {
|
||||
if (warn_on_failure) {
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
|
||||
warning(msg);
|
||||
warning("Failed to attach shared memory (errno = %d).", err);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -3810,6 +3810,7 @@ bool os::check_heap(bool force) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ATTRIBUTE_PRINTF(3, 0)
|
||||
int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
|
||||
return ::vsnprintf(buf, count, format, args);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -925,7 +925,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||
|
||||
if (PerfTraceMemOps) {
|
||||
tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
|
||||
INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
|
||||
INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -102,6 +102,8 @@
|
||||
# include <inttypes.h>
|
||||
# include <sys/ioctl.h>
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
|
||||
// getrusage() is prepared to handle the associated failure.
|
||||
#ifndef RUSAGE_THREAD
|
||||
@ -2138,7 +2140,7 @@ void os::print_os_info(outputStream* st) {
|
||||
// Print warning if unsafe chroot environment detected
|
||||
if (unsafe_chroot_detected) {
|
||||
st->print("WARNING!! ");
|
||||
st->print_cr(unstable_chroot_error);
|
||||
st->print_cr("%s", unstable_chroot_error);
|
||||
}
|
||||
|
||||
os::Linux::print_libversion_info(st);
|
||||
@ -2199,8 +2201,8 @@ void os::Linux::print_distro_info(outputStream* st) {
|
||||
void os::Linux::print_libversion_info(outputStream* st) {
|
||||
// libc, pthread
|
||||
st->print("libc:");
|
||||
st->print(os::Linux::glibc_version()); st->print(" ");
|
||||
st->print(os::Linux::libpthread_version()); st->print(" ");
|
||||
st->print("%s ", os::Linux::glibc_version());
|
||||
st->print("%s ", os::Linux::libpthread_version());
|
||||
if (os::Linux::is_LinuxThreads()) {
|
||||
st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed");
|
||||
}
|
||||
@ -3417,7 +3419,7 @@ char* os::Linux::reserve_memory_special_shm(size_t bytes, size_t alignment, char
|
||||
// the system is still "fresh".
|
||||
if (warn_on_failure) {
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
|
||||
warning(msg);
|
||||
warning("%s", msg);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -3435,7 +3437,7 @@ char* os::Linux::reserve_memory_special_shm(size_t bytes, size_t alignment, char
|
||||
if ((intptr_t)addr == -1) {
|
||||
if (warn_on_failure) {
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
|
||||
warning(msg);
|
||||
warning("%s", msg);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -3455,7 +3457,7 @@ static void warn_on_large_pages_failure(char* req_addr, size_t bytes, int error)
|
||||
char msg[128];
|
||||
jio_snprintf(msg, sizeof(msg), "Failed to reserve large pages memory req_addr: "
|
||||
PTR_FORMAT " bytes: " SIZE_FORMAT " (errno = %d).", req_addr, bytes, error);
|
||||
warning(msg);
|
||||
warning("%s", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -931,7 +931,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||
|
||||
if (PerfTraceMemOps) {
|
||||
tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
|
||||
INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
|
||||
INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// Todo: provide a os::get_max_process_id() or similar. Number of processes
|
||||
// may have been configured, can be read more accurately from proc fs etc.
|
||||
#ifndef MAX_PID
|
||||
@ -192,10 +194,10 @@ void os::Posix::print_uname_info(outputStream* st) {
|
||||
st->print("uname:");
|
||||
struct utsname name;
|
||||
uname(&name);
|
||||
st->print(name.sysname); st->print(" ");
|
||||
st->print(name.release); st->print(" ");
|
||||
st->print(name.version); st->print(" ");
|
||||
st->print(name.machine);
|
||||
st->print("%s ", name.sysname);
|
||||
st->print("%s ", name.release);
|
||||
st->print("%s ", name.version);
|
||||
st->print("%s", name.machine);
|
||||
st->cr();
|
||||
}
|
||||
|
||||
@ -682,7 +684,7 @@ const char* os::Posix::describe_signal_set_short(const sigset_t* set, char* buff
|
||||
void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
|
||||
char buf[NUM_IMPORTANT_SIGS + 1];
|
||||
os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
|
||||
st->print(buf);
|
||||
st->print("%s", buf);
|
||||
}
|
||||
|
||||
// Writes one-line description of a combination of sigaction.sa_flags into a user
|
||||
@ -742,7 +744,7 @@ const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) {
|
||||
void os::Posix::print_sa_flags(outputStream* st, int flags) {
|
||||
char buffer[0x100];
|
||||
os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
|
||||
st->print(buffer);
|
||||
st->print("%s", buffer);
|
||||
}
|
||||
|
||||
// Helper function for os::Posix::print_siginfo_...():
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -276,6 +276,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
address os::current_stack_pointer() {
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
register void *esp;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -89,6 +89,8 @@
|
||||
#define SPELL_REG_FP "ebp"
|
||||
#endif // AMD64
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
address os::current_stack_pointer() {
|
||||
#ifdef SPARC_WORKS
|
||||
register void *esp;
|
||||
|
||||
@ -30,12 +30,13 @@
|
||||
//
|
||||
|
||||
// standard library constants
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include <iostream>
|
||||
#include "string.h"
|
||||
#include "ctype.h"
|
||||
#include "stdarg.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Make sure that we have the intptr_t and uintptr_t definitions */
|
||||
|
||||
@ -64,8 +64,6 @@ class PeepMatch;
|
||||
class PeepConstraint;
|
||||
class PeepReplace;
|
||||
|
||||
// class ostream; // ostream is a typedef in some systems
|
||||
|
||||
extern char *toUpper(const char *str);
|
||||
|
||||
//---------------------------ADLParser-----------------------------------------
|
||||
|
||||
@ -25,8 +25,6 @@
|
||||
// FILEBUFF.CPP - Routines for handling a parser file buffer
|
||||
#include "adlc.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//------------------------------FileBuff---------------------------------------
|
||||
// Create a new parsing buffer
|
||||
FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(archDesc) {
|
||||
|
||||
@ -26,9 +26,6 @@
|
||||
#define SHARE_VM_ADLC_FILEBUFF_HPP
|
||||
|
||||
// FILEBUFF.HPP - Definitions for parser file buffering routines
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1322,7 +1322,7 @@ void InstructForm::rep_var_format(FILE *fp, const char *rep_var) {
|
||||
OperandForm* oper = form->is_operand();
|
||||
if (oper != NULL && oper->is_bound_register()) {
|
||||
const RegDef* first = oper->get_RegClass()->find_first_elem();
|
||||
fprintf(fp, " st->print(\"%s\");\n", first->_regname);
|
||||
fprintf(fp, " st->print_raw(\"%s\");\n", first->_regname);
|
||||
} else {
|
||||
globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
|
||||
}
|
||||
@ -2530,7 +2530,7 @@ void OperandForm::format_constant(FILE *fp, uint const_index, uint const_type) {
|
||||
case Form::idealP: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
|
||||
case Form::idealNKlass:
|
||||
case Form::idealN: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
|
||||
case Form::idealL: fprintf(fp," st->print(\"#%%lld\", _c%d);\n", const_index); break;
|
||||
case Form::idealL: fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", const_index); break;
|
||||
case Form::idealF: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
|
||||
case Form::idealD: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
|
||||
default:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -211,7 +211,7 @@ static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper)
|
||||
const char *type = oper->ideal_type(globals);
|
||||
if (!strcmp(type, "ConI")) {
|
||||
if (i > 0) fprintf(fp,", ");
|
||||
fprintf(fp," int32 _c%d;\n", i);
|
||||
fprintf(fp," int32_t _c%d;\n", i);
|
||||
}
|
||||
else if (!strcmp(type, "ConP")) {
|
||||
if (i > 0) fprintf(fp,", ");
|
||||
@ -307,7 +307,7 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
|
||||
assert(num_consts == 1, "Bad component list detected.\n");
|
||||
switch( constant_type ) {
|
||||
case Form::idealI : {
|
||||
fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
|
||||
fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32_t c%d", i);
|
||||
break;
|
||||
}
|
||||
case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
|
||||
@ -326,7 +326,7 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
|
||||
while((comp = lst.iter()) != NULL) {
|
||||
if (!strcmp(comp->base_type(globals), "ConI")) {
|
||||
if (i > 0) fprintf(fp,", ");
|
||||
fprintf(fp,"int32 c%d", i);
|
||||
fprintf(fp,"int32_t c%d", i);
|
||||
i++;
|
||||
}
|
||||
else if (!strcmp(comp->base_type(globals), "ConP")) {
|
||||
@ -386,14 +386,14 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
|
||||
static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
|
||||
assert(oper != NULL, "what");
|
||||
CondInterface* cond = oper->_interface->is_CondInterface();
|
||||
fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format);
|
||||
fprintf(fp, " if( _c%d == BoolTest::eq ) st->print_raw(\"%s\");\n",i,cond->_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print_raw(\"%s\");\n",i,cond->_not_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::le ) st->print_raw(\"%s\");\n",i,cond->_less_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print_raw(\"%s\");\n",i,cond->_greater_equal_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print_raw(\"%s\");\n",i,cond->_less_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print_raw(\"%s\");\n",i,cond->_greater_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print_raw(\"%s\");\n",i,cond->_overflow_format);
|
||||
fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print_raw(\"%s\");\n",i,cond->_no_overflow_format);
|
||||
}
|
||||
|
||||
// Output code that dumps constant values, increment "i" if type is constant
|
||||
@ -416,8 +416,8 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
|
||||
++i;
|
||||
}
|
||||
else if (!strcmp(ideal_type, "ConL")) {
|
||||
fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
|
||||
fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
|
||||
fprintf(fp," st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", i);
|
||||
fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%d);\n", i);
|
||||
++i;
|
||||
}
|
||||
else if (!strcmp(ideal_type, "ConF")) {
|
||||
@ -429,7 +429,7 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
|
||||
else if (!strcmp(ideal_type, "ConD")) {
|
||||
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
|
||||
fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
|
||||
fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
|
||||
fprintf(fp," st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%dl);\n", i);
|
||||
++i;
|
||||
}
|
||||
else if (!strcmp(ideal_type, "Bool")) {
|
||||
@ -471,7 +471,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
|
||||
if ( string != NameList::_signal ) {
|
||||
// Normal string
|
||||
// Pass through to st->print
|
||||
fprintf(fp," st->print(\"%s\");\n", string);
|
||||
fprintf(fp," st->print_raw(\"%s\");\n", string);
|
||||
} else {
|
||||
// Replacement variable
|
||||
const char *rep_var = oper._format->_rep_vars.iter();
|
||||
@ -542,7 +542,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
|
||||
if ( string != NameList::_signal ) {
|
||||
// Normal string
|
||||
// Pass through to st->print
|
||||
fprintf(fp," st->print(\"%s\");\n", string);
|
||||
fprintf(fp," st->print_raw(\"%s\");\n", string);
|
||||
} else {
|
||||
// Replacement variable
|
||||
const char *rep_var = oper._format->_rep_vars.iter();
|
||||
@ -669,7 +669,7 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
|
||||
} else if( string == NameList::_signal2 ) // Raw program text
|
||||
fputs(inst._format->_strings.iter(), fp);
|
||||
else
|
||||
fprintf(fp,"st->print(\"%s\");\n", string);
|
||||
fprintf(fp,"st->print_raw(\"%s\");\n", string);
|
||||
} // Done with all format strings
|
||||
} // Done generating the user-defined portion of the format
|
||||
|
||||
@ -696,13 +696,13 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
|
||||
default:
|
||||
assert(0,"ShouldNotReachHere");
|
||||
}
|
||||
fprintf(fp, " st->print_cr(\"\");\n" );
|
||||
fprintf(fp, " st->cr();\n" );
|
||||
fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
|
||||
fprintf(fp, " st->print(\" # \");\n" );
|
||||
fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
|
||||
}
|
||||
else if(inst.is_ideal_safepoint()) {
|
||||
fprintf(fp, " st->print(\"\");\n" );
|
||||
fprintf(fp, " st->print_raw(\"\");\n" );
|
||||
fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
|
||||
fprintf(fp, " st->print(\" # \");\n" );
|
||||
fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
|
||||
|
||||
@ -119,7 +119,7 @@ void AbstractAssembler::bind(Label& L) {
|
||||
L.patch_instructions((MacroAssembler*)this);
|
||||
}
|
||||
|
||||
void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) {
|
||||
void AbstractAssembler::generate_stack_overflow_check(int frame_size_in_bytes) {
|
||||
if (UseStackBanging) {
|
||||
// Each code entry causes one stack bang n pages down the stack where n
|
||||
// is configurable by StackShadowPages. The setting depends on the maximum
|
||||
@ -134,7 +134,7 @@ void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes)
|
||||
// is greater than a page.
|
||||
|
||||
const int page_size = os::vm_page_size();
|
||||
int bang_end = StackShadowPages*page_size;
|
||||
int bang_end = StackShadowPages * page_size;
|
||||
|
||||
// This is how far the previous frame's stack banging extended.
|
||||
const int bang_end_safe = bang_end;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -988,7 +988,7 @@ void CodeSection::dump() {
|
||||
for (csize_t step; ptr < end(); ptr += step) {
|
||||
step = end() - ptr;
|
||||
if (step > jintSize * 4) step = jintSize * 4;
|
||||
tty->print(PTR_FORMAT ": ", ptr);
|
||||
tty->print(INTPTR_FORMAT ": ", p2i(ptr));
|
||||
while (step > 0) {
|
||||
tty->print(" " PTR32_FORMAT, *(jint*)ptr);
|
||||
ptr += jintSize;
|
||||
@ -1098,7 +1098,7 @@ void CodeStrings::print_block_comment(outputStream* stream, intptr_t offset) con
|
||||
while (c && c->offset() == offset) {
|
||||
stream->bol();
|
||||
stream->print(" ;; ");
|
||||
stream->print_cr(c->string());
|
||||
stream->print_cr("%s", c->string());
|
||||
c = c->next_comment();
|
||||
}
|
||||
}
|
||||
@ -1154,10 +1154,10 @@ void CodeBuffer::decode_all() {
|
||||
void CodeSection::print(const char* name) {
|
||||
csize_t locs_size = locs_end() - locs_start();
|
||||
tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
|
||||
name, start(), end(), limit(), size(), capacity(),
|
||||
name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
|
||||
is_frozen()? " [frozen]": "");
|
||||
tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d",
|
||||
name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off());
|
||||
name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off());
|
||||
if (PrintRelocations) {
|
||||
RelocIterator iter(this);
|
||||
iter.print();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -173,7 +173,7 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
|
||||
bool allocates(address pc) const { return pc >= _start && pc < _limit; }
|
||||
bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
|
||||
|
||||
void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT, _start, pc, _limit)); _end = pc; }
|
||||
void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; }
|
||||
void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer");
|
||||
_mark = pc; }
|
||||
void set_mark_off(int offset) { assert(contains2(offset+_start),"not in codeBuffer");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -118,8 +118,8 @@ inline void assert_different_registers(
|
||||
) {
|
||||
assert(
|
||||
a != b,
|
||||
err_msg_res("registers must be different: a=%d, b=%d",
|
||||
a, b)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b))
|
||||
);
|
||||
}
|
||||
|
||||
@ -132,8 +132,9 @@ inline void assert_different_registers(
|
||||
assert(
|
||||
a != b && a != c
|
||||
&& b != c,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d",
|
||||
a, b, c)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c))
|
||||
);
|
||||
}
|
||||
|
||||
@ -148,8 +149,9 @@ inline void assert_different_registers(
|
||||
a != b && a != c && a != d
|
||||
&& b != c && b != d
|
||||
&& c != d,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d",
|
||||
a, b, c, d)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c), p2i(d))
|
||||
);
|
||||
}
|
||||
|
||||
@ -166,8 +168,9 @@ inline void assert_different_registers(
|
||||
&& b != c && b != d && b != e
|
||||
&& c != d && c != e
|
||||
&& d != e,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d",
|
||||
a, b, c, d, e)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e))
|
||||
);
|
||||
}
|
||||
|
||||
@ -186,8 +189,10 @@ inline void assert_different_registers(
|
||||
&& c != d && c != e && c != f
|
||||
&& d != e && d != f
|
||||
&& e != f,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d",
|
||||
a, b, c, d, e, f)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
|
||||
", f=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f))
|
||||
);
|
||||
}
|
||||
|
||||
@ -208,8 +213,10 @@ inline void assert_different_registers(
|
||||
&& d != e && d != f && d != g
|
||||
&& e != f && e != g
|
||||
&& f != g,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d",
|
||||
a, b, c, d, e, f, g)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
|
||||
", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g))
|
||||
);
|
||||
}
|
||||
|
||||
@ -232,8 +239,10 @@ inline void assert_different_registers(
|
||||
&& e != f && e != g && e != h
|
||||
&& f != g && f != h
|
||||
&& g != h,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d",
|
||||
a, b, c, d, e, f, g, h)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
|
||||
", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h))
|
||||
);
|
||||
}
|
||||
|
||||
@ -258,8 +267,11 @@ inline void assert_different_registers(
|
||||
&& f != g && f != h && f != i
|
||||
&& g != h && g != i
|
||||
&& h != i,
|
||||
err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d",
|
||||
a, b, c, d, e, f, g, h, i)
|
||||
err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
|
||||
", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
|
||||
", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
|
||||
", i=" INTPTR_FORMAT "",
|
||||
p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -50,7 +50,7 @@ class CFGPrinterOutput : public CHeapObj<mtCompiler> {
|
||||
|
||||
void inc_indent();
|
||||
void dec_indent();
|
||||
void print(const char* format, ...);
|
||||
void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
|
||||
void print_begin(const char* tag);
|
||||
void print_end(const char* tag);
|
||||
|
||||
@ -161,7 +161,7 @@ void CFGPrinterOutput::print_compilation() {
|
||||
|
||||
print("name \"%s\"", method_name(_compilation->method(), true));
|
||||
print("method \"%s\"", method_name(_compilation->method()));
|
||||
print("date "INT64_FORMAT, os::javaTimeMillis());
|
||||
print("date "INT64_FORMAT, (int64_t) os::javaTimeMillis());
|
||||
|
||||
print_end("compilation");
|
||||
}
|
||||
|
||||
@ -450,9 +450,11 @@ class PatchingStub: public CodeStub {
|
||||
class DeoptimizeStub : public CodeStub {
|
||||
private:
|
||||
CodeEmitInfo* _info;
|
||||
jint _trap_request;
|
||||
|
||||
public:
|
||||
DeoptimizeStub(CodeEmitInfo* info) : _info(new CodeEmitInfo(info)) {}
|
||||
DeoptimizeStub(CodeEmitInfo* info, Deoptimization::DeoptReason reason, Deoptimization::DeoptAction action) :
|
||||
_info(new CodeEmitInfo(info)), _trap_request(Deoptimization::make_trap_request(reason, action)) {}
|
||||
|
||||
virtual void emit_code(LIR_Assembler* e);
|
||||
virtual CodeEmitInfo* info() const { return _info; }
|
||||
|
||||
@ -251,6 +251,10 @@ class Compilation: public StackObj {
|
||||
return env()->comp_level() == CompLevel_full_profile &&
|
||||
C1UpdateMethodData && MethodData::profile_return();
|
||||
}
|
||||
bool age_code() const {
|
||||
return _method->profile_aging();
|
||||
}
|
||||
|
||||
// will compilation make optimistic assumptions that might lead to
|
||||
// deoptimization and that the runtime will account for?
|
||||
bool is_optimistic() const {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -134,23 +134,23 @@ void InstructionPrinter::print_object(Value obj) {
|
||||
if (value->is_null_object()) {
|
||||
output()->print("null");
|
||||
} else if (!value->is_loaded()) {
|
||||
output()->print("<unloaded object " PTR_FORMAT ">", value);
|
||||
output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value));
|
||||
} else {
|
||||
output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding());
|
||||
output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
|
||||
print_klass(value->klass());
|
||||
output()->print(">");
|
||||
}
|
||||
} else if (type->as_InstanceConstant() != NULL) {
|
||||
ciInstance* value = type->as_InstanceConstant()->value();
|
||||
if (value->is_loaded()) {
|
||||
output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding());
|
||||
output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
|
||||
print_klass(value->klass());
|
||||
output()->print(">");
|
||||
} else {
|
||||
output()->print("<unloaded instance " PTR_FORMAT ">", value);
|
||||
output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value));
|
||||
}
|
||||
} else if (type->as_ArrayConstant() != NULL) {
|
||||
output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding());
|
||||
output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding()));
|
||||
} else if (type->as_ClassConstant() != NULL) {
|
||||
ciInstanceKlass* klass = type->as_ClassConstant()->value();
|
||||
if (!klass->is_loaded()) {
|
||||
@ -268,7 +268,7 @@ void InstructionPrinter::print_inline_level(BlockBegin* block) {
|
||||
|
||||
|
||||
void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) {
|
||||
output()->print(name);
|
||||
output()->print("%s", name);
|
||||
output()->print(".(");
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ void InstructionPrinter::do_TypeCast(TypeCast* x) {
|
||||
if (x->declared_type()->is_klass())
|
||||
print_klass(x->declared_type()->as_klass());
|
||||
else
|
||||
output()->print(type2name(x->declared_type()->basic_type()));
|
||||
output()->print("%s", type2name(x->declared_type()->basic_type()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1563,15 +1563,15 @@ void LIR_OprDesc::print(outputStream* out) const {
|
||||
} else if (is_virtual()) {
|
||||
out->print("R%d", vreg_number());
|
||||
} else if (is_single_cpu()) {
|
||||
out->print(as_register()->name());
|
||||
out->print("%s", as_register()->name());
|
||||
} else if (is_double_cpu()) {
|
||||
out->print(as_register_hi()->name());
|
||||
out->print(as_register_lo()->name());
|
||||
out->print("%s", as_register_hi()->name());
|
||||
out->print("%s", as_register_lo()->name());
|
||||
#if defined(X86)
|
||||
} else if (is_single_xmm()) {
|
||||
out->print(as_xmm_float_reg()->name());
|
||||
out->print("%s", as_xmm_float_reg()->name());
|
||||
} else if (is_double_xmm()) {
|
||||
out->print(as_xmm_double_reg()->name());
|
||||
out->print("%s", as_xmm_double_reg()->name());
|
||||
} else if (is_single_fpu()) {
|
||||
out->print("fpu%d", fpu_regnr());
|
||||
} else if (is_double_fpu()) {
|
||||
@ -1583,9 +1583,9 @@ void LIR_OprDesc::print(outputStream* out) const {
|
||||
out->print("d%d", fpu_regnrLo() >> 1);
|
||||
#else
|
||||
} else if (is_single_fpu()) {
|
||||
out->print(as_float_reg()->name());
|
||||
out->print("%s", as_float_reg()->name());
|
||||
} else if (is_double_fpu()) {
|
||||
out->print(as_double_reg()->name());
|
||||
out->print("%s", as_double_reg()->name());
|
||||
#endif
|
||||
|
||||
} else if (is_illegal()) {
|
||||
@ -1611,9 +1611,9 @@ void LIR_Const::print_value_on(outputStream* out) const {
|
||||
case T_LONG: out->print("lng:" JLONG_FORMAT, as_jlong()); break;
|
||||
case T_FLOAT: out->print("flt:%f", as_jfloat()); break;
|
||||
case T_DOUBLE: out->print("dbl:%f", as_jdouble()); break;
|
||||
case T_OBJECT: out->print("obj:0x%x", as_jobject()); break;
|
||||
case T_METADATA: out->print("metadata:0x%x", as_metadata());break;
|
||||
default: out->print("%3d:0x%x",type(), as_jdouble()); break;
|
||||
case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject())); break;
|
||||
case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break;
|
||||
default: out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1629,7 +1629,7 @@ void LIR_Address::print_value_on(outputStream* out) const {
|
||||
case times_8: out->print(" * 8"); break;
|
||||
}
|
||||
}
|
||||
out->print(" Disp: %d", _disp);
|
||||
out->print(" Disp: " INTX_FORMAT, _disp);
|
||||
}
|
||||
|
||||
// debug output of block header without InstructionPrinter
|
||||
@ -1703,7 +1703,7 @@ void LIR_Op::print_on(outputStream* out) const {
|
||||
} else {
|
||||
out->print(" ");
|
||||
}
|
||||
out->print(name()); out->print(" ");
|
||||
out->print("%s ", name());
|
||||
print_instr(out);
|
||||
if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci());
|
||||
#ifdef ASSERT
|
||||
@ -1833,7 +1833,7 @@ const char * LIR_Op::name() const {
|
||||
// LIR_OpJavaCall
|
||||
void LIR_OpJavaCall::print_instr(outputStream* out) const {
|
||||
out->print("call: ");
|
||||
out->print("[addr: 0x%x]", address());
|
||||
out->print("[addr: " INTPTR_FORMAT "]", p2i(address()));
|
||||
if (receiver()->is_valid()) {
|
||||
out->print(" [recv: "); receiver()->print(out); out->print("]");
|
||||
}
|
||||
@ -1844,7 +1844,7 @@ void LIR_OpJavaCall::print_instr(outputStream* out) const {
|
||||
|
||||
// LIR_OpLabel
|
||||
void LIR_OpLabel::print_instr(outputStream* out) const {
|
||||
out->print("[label:0x%x]", _label);
|
||||
out->print("[label:" INTPTR_FORMAT "]", p2i(_label));
|
||||
}
|
||||
|
||||
// LIR_OpArrayCopy
|
||||
@ -1911,7 +1911,7 @@ void LIR_Op1::print_instr(outputStream* out) const {
|
||||
// LIR_Op1
|
||||
void LIR_OpRTCall::print_instr(outputStream* out) const {
|
||||
intx a = (intx)addr();
|
||||
out->print(Runtime1::name_for_address(addr()));
|
||||
out->print("%s", Runtime1::name_for_address(addr()));
|
||||
out->print(" ");
|
||||
tmp()->print(out);
|
||||
}
|
||||
@ -1934,10 +1934,10 @@ void LIR_OpBranch::print_instr(outputStream* out) const {
|
||||
} else if (stub() != NULL) {
|
||||
out->print("[");
|
||||
stub()->print_name(out);
|
||||
out->print(": 0x%x]", stub());
|
||||
out->print(": " INTPTR_FORMAT "]", p2i(stub()));
|
||||
if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci());
|
||||
} else {
|
||||
out->print("[label:0x%x] ", label());
|
||||
out->print("[label:" INTPTR_FORMAT "] ", p2i(label()));
|
||||
}
|
||||
if (ublock() != NULL) {
|
||||
out->print("unordered: [B%d] ", ublock()->block_id());
|
||||
@ -2004,7 +2004,7 @@ void LIR_OpAllocObj::print_instr(outputStream* out) const {
|
||||
tmp4()->print(out); out->print(" ");
|
||||
out->print("[hdr:%d]", header_size()); out->print(" ");
|
||||
out->print("[obj:%d]", object_size()); out->print(" ");
|
||||
out->print("[lbl:0x%x]", stub()->entry());
|
||||
out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
|
||||
}
|
||||
|
||||
void LIR_OpRoundFP::print_instr(outputStream* out) const {
|
||||
@ -2037,7 +2037,7 @@ void LIR_OpAllocArray::print_instr(outputStream* out) const {
|
||||
tmp3()->print(out); out->print(" ");
|
||||
tmp4()->print(out); out->print(" ");
|
||||
out->print("[type:0x%x]", type()); out->print(" ");
|
||||
out->print("[label:0x%x]", stub()->entry());
|
||||
out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry()));
|
||||
}
|
||||
|
||||
|
||||
@ -2074,7 +2074,7 @@ void LIR_OpLock::print_instr(outputStream* out) const {
|
||||
if (_scratch->is_valid()) {
|
||||
_scratch->print(out); out->print(" ");
|
||||
}
|
||||
out->print("[lbl:0x%x]", stub()->entry());
|
||||
out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
@ -2082,7 +2082,7 @@ void LIR_OpAssert::print_instr(outputStream* out) const {
|
||||
print_condition(out, condition()); out->print(" ");
|
||||
in_opr1()->print(out); out->print(" ");
|
||||
in_opr2()->print(out); out->print(", \"");
|
||||
out->print(msg()); out->print("\"");
|
||||
out->print("%s", msg()); out->print("\"");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -2782,7 +2782,10 @@ void LIRGenerator::do_Base(Base* x) {
|
||||
__ lock_object(syncTempOpr(), obj, lock, new_register(T_OBJECT), slow_path, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (compilation()->age_code()) {
|
||||
CodeEmitInfo* info = new CodeEmitInfo(scope()->start()->state()->copy(ValueStack::StateBefore, 0), NULL, false);
|
||||
decrement_age(info);
|
||||
}
|
||||
// increment invocation counters if needed
|
||||
if (!method()->is_accessor()) { // Accessors do not have MDOs, so no counting.
|
||||
profile_parameters(x);
|
||||
@ -3328,6 +3331,27 @@ void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool bac
|
||||
increment_event_counter_impl(info, info->scope()->method(), (1 << freq_log) - 1, bci, backedge, true);
|
||||
}
|
||||
|
||||
void LIRGenerator::decrement_age(CodeEmitInfo* info) {
|
||||
ciMethod* method = info->scope()->method();
|
||||
MethodCounters* mc_adr = method->ensure_method_counters();
|
||||
if (mc_adr != NULL) {
|
||||
LIR_Opr mc = new_pointer_register();
|
||||
__ move(LIR_OprFact::intptrConst(mc_adr), mc);
|
||||
int offset = in_bytes(MethodCounters::nmethod_age_offset());
|
||||
LIR_Address* counter = new LIR_Address(mc, offset, T_INT);
|
||||
LIR_Opr result = new_register(T_INT);
|
||||
__ load(counter, result);
|
||||
__ sub(result, LIR_OprFact::intConst(1), result);
|
||||
__ store(result, counter);
|
||||
// DeoptimizeStub will reexecute from the current state in code info.
|
||||
CodeStub* deopt = new DeoptimizeStub(info, Deoptimization::Reason_tenured,
|
||||
Deoptimization::Action_make_not_entrant);
|
||||
__ cmp(lir_cond_lessEqual, result, LIR_OprFact::intConst(0));
|
||||
__ branch(lir_cond_lessEqual, T_INT, deopt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
|
||||
ciMethod *method, int frequency,
|
||||
int bci, bool backedge, bool notify) {
|
||||
|
||||
@ -372,7 +372,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
|
||||
increment_event_counter(info, bci, true);
|
||||
}
|
||||
}
|
||||
|
||||
void decrement_age(CodeEmitInfo* info);
|
||||
CodeEmitInfo* state_for(Instruction* x, ValueStack* state, bool ignore_xhandler = false);
|
||||
CodeEmitInfo* state_for(Instruction* x);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -62,10 +62,10 @@ RangeCheckEliminator::RangeCheckEliminator(IR *ir) :
|
||||
_optimistic = ir->compilation()->is_optimistic();
|
||||
|
||||
TRACE_RANGE_CHECK_ELIMINATION(
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
tty->print_cr("Range check elimination");
|
||||
ir->method()->print_name(tty);
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
);
|
||||
|
||||
TRACE_RANGE_CHECK_ELIMINATION(
|
||||
@ -1024,7 +1024,7 @@ void RangeCheckEliminator::dump_condition_stack(BlockBegin *block) {
|
||||
tty->print("i%d", phi->id());
|
||||
tty->print(": ");
|
||||
bound->print();
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
);
|
||||
}
|
||||
});
|
||||
@ -1039,7 +1039,7 @@ void RangeCheckEliminator::dump_condition_stack(BlockBegin *block) {
|
||||
tty->print("i%d", instr->id());
|
||||
tty->print(": ");
|
||||
bound->print();
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1400,7 +1400,7 @@ Value RangeCheckEliminator::Bound::lower_instr() {
|
||||
|
||||
// print
|
||||
void RangeCheckEliminator::Bound::print() {
|
||||
tty->print("");
|
||||
tty->print("%s", "");
|
||||
if (this->_lower_instr || this->_lower != min_jint) {
|
||||
if (this->_lower_instr) {
|
||||
tty->print("i%d", this->_lower_instr->id());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -532,8 +532,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||
if (TraceExceptions) {
|
||||
ttyLocker ttyl;
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x",
|
||||
exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread);
|
||||
tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
|
||||
exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
|
||||
}
|
||||
// for AbortVMOnException flag
|
||||
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
|
||||
@ -563,7 +563,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||
ttyLocker ttyl;
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT,
|
||||
thread, continuation, pc);
|
||||
p2i(thread), p2i(continuation), p2i(pc));
|
||||
}
|
||||
|
||||
return continuation;
|
||||
@ -685,19 +685,32 @@ JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock))
|
||||
JRT_END
|
||||
|
||||
// Cf. OptoRuntime::deoptimize_caller_frame
|
||||
JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
|
||||
JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
|
||||
// Called from within the owner thread, so no need for safepoint
|
||||
RegisterMap reg_map(thread, false);
|
||||
frame stub_frame = thread->last_frame();
|
||||
assert(stub_frame.is_runtime_frame(), "sanity check");
|
||||
assert(stub_frame.is_runtime_frame(), "Sanity check");
|
||||
frame caller_frame = stub_frame.sender(®_map);
|
||||
nmethod* nm = caller_frame.cb()->as_nmethod_or_null();
|
||||
assert(nm != NULL, "Sanity check");
|
||||
methodHandle method(thread, nm->method());
|
||||
assert(nm == CodeCache::find_nmethod(caller_frame.pc()), "Should be the same");
|
||||
Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request);
|
||||
Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
|
||||
|
||||
// We are coming from a compiled method; check this is true.
|
||||
assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
|
||||
if (action == Deoptimization::Action_make_not_entrant) {
|
||||
if (nm->make_not_entrant()) {
|
||||
if (reason == Deoptimization::Reason_tenured) {
|
||||
MethodData* trap_mdo = Deoptimization::get_method_data(thread, method, true /*create_if_missing*/);
|
||||
if (trap_mdo != NULL) {
|
||||
trap_mdo->inc_tenure_traps();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deoptimize the caller frame.
|
||||
Deoptimization::deoptimize_frame(thread, caller_frame.id());
|
||||
|
||||
// Return to the now deoptimized frame.
|
||||
JRT_END
|
||||
|
||||
@ -988,8 +1001,8 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||
address copy_buff = stub_location - *byte_skip - *byte_count;
|
||||
address being_initialized_entry = stub_location - *being_initialized_entry_offset;
|
||||
if (TracePatching) {
|
||||
tty->print_cr(" Patching %s at bci %d at address 0x%x (%s)", Bytecodes::name(code), bci,
|
||||
instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
|
||||
tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci,
|
||||
p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
|
||||
nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc());
|
||||
assert(caller_code != NULL, "nmethod not found");
|
||||
|
||||
@ -1448,7 +1461,7 @@ JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
|
||||
methodHandle inlinee = methodHandle(vfst.method());
|
||||
inlinee->print_short_name(&ss1);
|
||||
m->print_short_name(&ss2);
|
||||
tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc());
|
||||
tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc " INTPTR_FORMAT, ss1.as_string(), vfst.bci(), ss2.as_string(), p2i(caller_frame.pc()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ class Runtime1: public AllStatic {
|
||||
static void monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock);
|
||||
static void monitorexit (JavaThread* thread, BasicObjectLock* lock);
|
||||
|
||||
static void deoptimize(JavaThread* thread);
|
||||
static void deoptimize(JavaThread* thread, jint trap_request);
|
||||
|
||||
static int access_field_patching(JavaThread* thread);
|
||||
static int move_klass_patching(JavaThread* thread);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -175,7 +175,7 @@ class ValueType: public CompilationResourceObj {
|
||||
ValueType* join(ValueType* y) const;
|
||||
|
||||
// debugging
|
||||
void print(outputStream* s = tty) { s->print(name()); }
|
||||
void print(outputStream* s = tty) { s->print("%s", name()); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1287,10 +1287,10 @@ void BCEscapeAnalyzer::compute_escape_info() {
|
||||
tty->print_cr("class of method is not initialized.");
|
||||
else if (_level > MaxBCEAEstimateLevel)
|
||||
tty->print_cr("level (%d) exceeds MaxBCEAEstimateLevel (%d).",
|
||||
_level, MaxBCEAEstimateLevel);
|
||||
_level, (int) MaxBCEAEstimateLevel);
|
||||
else if (method()->code_size() > MaxBCEAEstimateSize)
|
||||
tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize.",
|
||||
method()->code_size(), MaxBCEAEstimateSize);
|
||||
tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize (%d).",
|
||||
method()->code_size(), (int) MaxBCEAEstimateSize);
|
||||
else
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -48,7 +48,7 @@ void ciConstant::print() {
|
||||
tty->print("%d", _value._int);
|
||||
break;
|
||||
case T_LONG:
|
||||
tty->print(INT64_FORMAT, _value._long);
|
||||
tty->print(INT64_FORMAT, (int64_t)(_value._long));
|
||||
break;
|
||||
case T_FLOAT:
|
||||
tty->print("%f", _value._float);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1250,8 +1250,7 @@ void ciEnv::dump_replay_data(int compile_id) {
|
||||
if (replay_data_file != NULL) {
|
||||
fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
|
||||
dump_replay_data(&replay_data_stream);
|
||||
tty->print("# Compiler replay data is saved as: ");
|
||||
tty->print_cr(buffer);
|
||||
tty->print_cr("# Compiler replay data is saved as: %s", buffer);
|
||||
} else {
|
||||
tty->print_cr("# Can't open file to dump replay data.");
|
||||
}
|
||||
@ -1274,7 +1273,7 @@ void ciEnv::dump_inline_data(int compile_id) {
|
||||
)
|
||||
replay_data_stream.flush();
|
||||
tty->print("# Compiler inline data is saved as: ");
|
||||
tty->print_cr(buffer);
|
||||
tty->print_cr("%s", buffer);
|
||||
} else {
|
||||
tty->print_cr("# Can't open file to dump inline data.");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -292,7 +292,7 @@ bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) {
|
||||
// Implementation of the print method.
|
||||
void ciInstanceKlass::print_impl(outputStream* st) {
|
||||
ciKlass::print_impl(st);
|
||||
GUARDED_VM_ENTRY(st->print(" loader=0x%x", (address)loader());)
|
||||
GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));)
|
||||
if (is_loaded()) {
|
||||
st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",
|
||||
bool_to_str(is_initialized()),
|
||||
@ -618,7 +618,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
|
||||
case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break;
|
||||
case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break;
|
||||
case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break;
|
||||
case T_LONG: _out->print_cr(INT64_FORMAT, mirror->long_field(fd->offset())); break;
|
||||
case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break;
|
||||
case T_FLOAT: {
|
||||
float f = mirror->float_field(fd->offset());
|
||||
_out->print_cr("%d", *(int*)&f);
|
||||
@ -626,7 +626,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
|
||||
}
|
||||
case T_DOUBLE: {
|
||||
double d = mirror->double_field(fd->offset());
|
||||
_out->print_cr(INT64_FORMAT, *(jlong*)&d);
|
||||
_out->print_cr(INT64_FORMAT, *(int64_t*)&d);
|
||||
break;
|
||||
}
|
||||
case T_ARRAY: {
|
||||
@ -656,7 +656,7 @@ class StaticFinalFieldPrinter : public FieldClosure {
|
||||
_out->print_cr("\"");
|
||||
} else {
|
||||
const char* klass_name = value->klass()->name()->as_quoted_ascii();
|
||||
_out->print_cr(klass_name);
|
||||
_out->print_cr("%s", klass_name);
|
||||
}
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,7 +38,7 @@
|
||||
void ciMetadata::print(outputStream* st) {
|
||||
st->print("<%s", type_string());
|
||||
GUARDED_VM_ENTRY(print_impl(st);)
|
||||
st->print(" ident=%d address=0x%x>", ident(), (address)this);
|
||||
st->print(" ident=%d address=" INTPTR_FORMAT ">", ident(), p2i((address)this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -129,6 +129,7 @@ ciMethod::ciMethod(methodHandle h_m) : ciMetadata(h_m()) {
|
||||
constantPoolHandle cpool = h_m()->constants();
|
||||
_signature = new (env->arena()) ciSignature(_holder, cpool, sig_symbol);
|
||||
_method_data = NULL;
|
||||
_nmethod_age = h_m()->nmethod_age();
|
||||
// Take a snapshot of these values, so they will be commensurate with the MDO.
|
||||
if (ProfileInterpreter || TieredCompilation) {
|
||||
int invcnt = h_m()->interpreter_invocation_count();
|
||||
@ -1275,6 +1276,14 @@ bool ciMethod::check_call(int refinfo_index, bool is_static) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::profile_aging
|
||||
//
|
||||
// Should the method be compiled with an age counter?
|
||||
bool ciMethod::profile_aging() const {
|
||||
return UseCodeAging && (!MethodCounters::is_nmethod_hot(nmethod_age()) &&
|
||||
!MethodCounters::is_nmethod_age_unset(nmethod_age()));
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::print_codes
|
||||
//
|
||||
|
||||
@ -68,6 +68,7 @@ class ciMethod : public ciMetadata {
|
||||
int _max_locals;
|
||||
vmIntrinsics::ID _intrinsic_id;
|
||||
int _handler_count;
|
||||
int _nmethod_age;
|
||||
int _interpreter_invocation_count;
|
||||
int _interpreter_throwout_count;
|
||||
int _instructions_size;
|
||||
@ -168,6 +169,10 @@ class ciMethod : public ciMetadata {
|
||||
int interpreter_invocation_count() const { check_is_loaded(); return _interpreter_invocation_count; }
|
||||
int interpreter_throwout_count() const { check_is_loaded(); return _interpreter_throwout_count; }
|
||||
int size_of_parameters() const { check_is_loaded(); return _size_of_parameters; }
|
||||
int nmethod_age() const { check_is_loaded(); return _nmethod_age; }
|
||||
|
||||
// Should the method be compiled with an age counter?
|
||||
bool profile_aging() const;
|
||||
|
||||
// Code size for inlining decisions.
|
||||
int code_size_for_inlining();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -557,7 +557,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
|
||||
if (round == 0) {
|
||||
count++;
|
||||
} else {
|
||||
out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
|
||||
out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -569,7 +569,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
|
||||
if (round == 0) {
|
||||
count++;
|
||||
} else {
|
||||
out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
|
||||
out->print(" %d %s", (int)(dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -213,9 +213,9 @@ void ciObject::init_flags_from(oop x) {
|
||||
void ciObject::print(outputStream* st) {
|
||||
st->print("<%s", type_string());
|
||||
GUARDED_VM_ENTRY(print_impl(st);)
|
||||
st->print(" ident=%d %s address=0x%x>", ident(),
|
||||
st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(),
|
||||
is_scavengable() ? "SCAVENGABLE" : "",
|
||||
(address)this);
|
||||
p2i((address)this));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -148,5 +148,5 @@ void ciSignature::print() {
|
||||
print_signature();
|
||||
tty->print(" accessing_klass=");
|
||||
_accessing_klass->print();
|
||||
tty->print(" address=0x%x>", (address)this);
|
||||
tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -87,7 +87,7 @@ void ciType::print_impl(outputStream* st) {
|
||||
// Print the name of this type
|
||||
void ciType::print_name_on(outputStream* st) {
|
||||
ResourceMark rm;
|
||||
st->print(name());
|
||||
st->print("%s", name());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,6 +29,9 @@
|
||||
|
||||
// Keep these in a separate file to prevent inlining
|
||||
|
||||
PRAGMA_DIAG_PUSH
|
||||
PRAGMA_FORMAT_NONLITERAL_IGNORED
|
||||
|
||||
void ClassFileParser::classfile_parse_error(const char* msg, TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_ClassFormatError(),
|
||||
@ -53,6 +56,8 @@ void ClassFileParser::classfile_parse_error(const char* msg, int index, const ch
|
||||
msg, index, name, _class_name->as_C_string());
|
||||
}
|
||||
|
||||
PRAGMA_DIAG_POP
|
||||
|
||||
void StackMapStream::stackmap_format_error(const char* msg, TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
Exceptions::fthrow(
|
||||
|
||||
@ -875,6 +875,7 @@ void ClassFileParser::parse_field_attributes(u2 attributes_count,
|
||||
int runtime_visible_type_annotations_length = 0;
|
||||
u1* runtime_invisible_type_annotations = NULL;
|
||||
int runtime_invisible_type_annotations_length = 0;
|
||||
bool runtime_invisible_annotations_exists = false;
|
||||
bool runtime_invisible_type_annotations_exists = false;
|
||||
while (attributes_count--) {
|
||||
cfs->guarantee_more(6, CHECK); // attribute_name_index, attribute_length
|
||||
@ -920,6 +921,10 @@ void ClassFileParser::parse_field_attributes(u2 attributes_count,
|
||||
}
|
||||
generic_signature_index = cfs->get_u2(CHECK);
|
||||
} else if (attribute_name == vmSymbols::tag_runtime_visible_annotations()) {
|
||||
if (runtime_visible_annotations != NULL) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeVisibleAnnotations attributes for field in class file %s", CHECK);
|
||||
}
|
||||
runtime_visible_annotations_length = attribute_length;
|
||||
runtime_visible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_visible_annotations != NULL, "null visible annotations");
|
||||
@ -928,11 +933,18 @@ void ClassFileParser::parse_field_attributes(u2 attributes_count,
|
||||
parsed_annotations,
|
||||
CHECK);
|
||||
cfs->skip_u1(runtime_visible_annotations_length, CHECK);
|
||||
} else if (PreserveAllAnnotations && attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
|
||||
runtime_invisible_annotations_length = attribute_length;
|
||||
runtime_invisible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_annotations != NULL, "null invisible annotations");
|
||||
cfs->skip_u1(runtime_invisible_annotations_length, CHECK);
|
||||
} else if (attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
|
||||
if (runtime_invisible_annotations_exists) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeInvisibleAnnotations attributes for field in class file %s", CHECK);
|
||||
}
|
||||
runtime_invisible_annotations_exists = true;
|
||||
if (PreserveAllAnnotations) {
|
||||
runtime_invisible_annotations_length = attribute_length;
|
||||
runtime_invisible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_annotations != NULL, "null invisible annotations");
|
||||
}
|
||||
cfs->skip_u1(attribute_length, CHECK);
|
||||
} else if (attribute_name == vmSymbols::tag_runtime_visible_type_annotations()) {
|
||||
if (runtime_visible_type_annotations != NULL) {
|
||||
classfile_parse_error(
|
||||
@ -2066,7 +2078,9 @@ methodHandle ClassFileParser::parse_method(bool is_interface,
|
||||
int runtime_visible_type_annotations_length = 0;
|
||||
u1* runtime_invisible_type_annotations = NULL;
|
||||
int runtime_invisible_type_annotations_length = 0;
|
||||
bool runtime_invisible_annotations_exists = false;
|
||||
bool runtime_invisible_type_annotations_exists = false;
|
||||
bool runtime_invisible_parameter_annotations_exists = false;
|
||||
u1* annotation_default = NULL;
|
||||
int annotation_default_length = 0;
|
||||
|
||||
@ -2295,6 +2309,10 @@ methodHandle ClassFileParser::parse_method(bool is_interface,
|
||||
cfs->guarantee_more(2, CHECK_(nullHandle)); // generic_signature_index
|
||||
generic_signature_index = cfs->get_u2_fast();
|
||||
} else if (method_attribute_name == vmSymbols::tag_runtime_visible_annotations()) {
|
||||
if (runtime_visible_annotations != NULL) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeVisibleAnnotations attributes for method in class file %s", CHECK_(nullHandle));
|
||||
}
|
||||
runtime_visible_annotations_length = method_attribute_length;
|
||||
runtime_visible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_visible_annotations != NULL, "null visible annotations");
|
||||
@ -2302,22 +2320,45 @@ methodHandle ClassFileParser::parse_method(bool is_interface,
|
||||
runtime_visible_annotations_length, &parsed_annotations,
|
||||
CHECK_(nullHandle));
|
||||
cfs->skip_u1(runtime_visible_annotations_length, CHECK_(nullHandle));
|
||||
} else if (PreserveAllAnnotations && method_attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
|
||||
runtime_invisible_annotations_length = method_attribute_length;
|
||||
runtime_invisible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_annotations != NULL, "null invisible annotations");
|
||||
cfs->skip_u1(runtime_invisible_annotations_length, CHECK_(nullHandle));
|
||||
} else if (method_attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
|
||||
if (runtime_invisible_annotations_exists) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeInvisibleAnnotations attributes for method in class file %s", CHECK_(nullHandle));
|
||||
}
|
||||
runtime_invisible_annotations_exists = true;
|
||||
if (PreserveAllAnnotations) {
|
||||
runtime_invisible_annotations_length = method_attribute_length;
|
||||
runtime_invisible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_annotations != NULL, "null invisible annotations");
|
||||
}
|
||||
cfs->skip_u1(method_attribute_length, CHECK_(nullHandle));
|
||||
} else if (method_attribute_name == vmSymbols::tag_runtime_visible_parameter_annotations()) {
|
||||
if (runtime_visible_parameter_annotations != NULL) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeVisibleParameterAnnotations attributes for method in class file %s", CHECK_(nullHandle));
|
||||
}
|
||||
runtime_visible_parameter_annotations_length = method_attribute_length;
|
||||
runtime_visible_parameter_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_visible_parameter_annotations != NULL, "null visible parameter annotations");
|
||||
cfs->skip_u1(runtime_visible_parameter_annotations_length, CHECK_(nullHandle));
|
||||
} else if (PreserveAllAnnotations && method_attribute_name == vmSymbols::tag_runtime_invisible_parameter_annotations()) {
|
||||
runtime_invisible_parameter_annotations_length = method_attribute_length;
|
||||
runtime_invisible_parameter_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_parameter_annotations != NULL, "null invisible parameter annotations");
|
||||
cfs->skip_u1(runtime_invisible_parameter_annotations_length, CHECK_(nullHandle));
|
||||
} else if (method_attribute_name == vmSymbols::tag_runtime_invisible_parameter_annotations()) {
|
||||
if (runtime_invisible_parameter_annotations_exists) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeInvisibleParameterAnnotations attributes for method in class file %s", CHECK_(nullHandle));
|
||||
}
|
||||
runtime_invisible_parameter_annotations_exists = true;
|
||||
if (PreserveAllAnnotations) {
|
||||
runtime_invisible_parameter_annotations_length = method_attribute_length;
|
||||
runtime_invisible_parameter_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_parameter_annotations != NULL, "null invisible parameter annotations");
|
||||
}
|
||||
cfs->skip_u1(method_attribute_length, CHECK_(nullHandle));
|
||||
} else if (method_attribute_name == vmSymbols::tag_annotation_default()) {
|
||||
if (annotation_default != NULL) {
|
||||
classfile_parse_error(
|
||||
"Multiple AnnotationDefault attributes for method in class file %s",
|
||||
CHECK_(nullHandle));
|
||||
}
|
||||
annotation_default_length = method_attribute_length;
|
||||
annotation_default = cfs->get_u1_buffer();
|
||||
assert(annotation_default != NULL, "null annotation default");
|
||||
@ -2846,6 +2887,8 @@ void ClassFileParser::parse_classfile_attributes(ClassFileParser::ClassAnnotatio
|
||||
u1* runtime_invisible_type_annotations = NULL;
|
||||
int runtime_invisible_type_annotations_length = 0;
|
||||
bool runtime_invisible_type_annotations_exists = false;
|
||||
bool runtime_invisible_annotations_exists = false;
|
||||
bool parsed_source_debug_ext_annotations_exist = false;
|
||||
u1* inner_classes_attribute_start = NULL;
|
||||
u4 inner_classes_attribute_length = 0;
|
||||
u2 enclosing_method_class_index = 0;
|
||||
@ -2873,6 +2916,11 @@ void ClassFileParser::parse_classfile_attributes(ClassFileParser::ClassAnnotatio
|
||||
parse_classfile_sourcefile_attribute(CHECK);
|
||||
} else if (tag == vmSymbols::tag_source_debug_extension()) {
|
||||
// Check for SourceDebugExtension tag
|
||||
if (parsed_source_debug_ext_annotations_exist) {
|
||||
classfile_parse_error(
|
||||
"Multiple SourceDebugExtension attributes in class file %s", CHECK);
|
||||
}
|
||||
parsed_source_debug_ext_annotations_exist = true;
|
||||
parse_classfile_source_debug_extension_attribute((int)attribute_length, CHECK);
|
||||
} else if (tag == vmSymbols::tag_inner_classes()) {
|
||||
// Check for InnerClasses tag
|
||||
@ -2909,6 +2957,10 @@ void ClassFileParser::parse_classfile_attributes(ClassFileParser::ClassAnnotatio
|
||||
}
|
||||
parse_classfile_signature_attribute(CHECK);
|
||||
} else if (tag == vmSymbols::tag_runtime_visible_annotations()) {
|
||||
if (runtime_visible_annotations != NULL) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeVisibleAnnotations attributes in class file %s", CHECK);
|
||||
}
|
||||
runtime_visible_annotations_length = attribute_length;
|
||||
runtime_visible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_visible_annotations != NULL, "null visible annotations");
|
||||
@ -2917,11 +2969,18 @@ void ClassFileParser::parse_classfile_attributes(ClassFileParser::ClassAnnotatio
|
||||
parsed_annotations,
|
||||
CHECK);
|
||||
cfs->skip_u1(runtime_visible_annotations_length, CHECK);
|
||||
} else if (PreserveAllAnnotations && tag == vmSymbols::tag_runtime_invisible_annotations()) {
|
||||
runtime_invisible_annotations_length = attribute_length;
|
||||
runtime_invisible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_annotations != NULL, "null invisible annotations");
|
||||
cfs->skip_u1(runtime_invisible_annotations_length, CHECK);
|
||||
} else if (tag == vmSymbols::tag_runtime_invisible_annotations()) {
|
||||
if (runtime_invisible_annotations_exists) {
|
||||
classfile_parse_error(
|
||||
"Multiple RuntimeInvisibleAnnotations attributes in class file %s", CHECK);
|
||||
}
|
||||
runtime_invisible_annotations_exists = true;
|
||||
if (PreserveAllAnnotations) {
|
||||
runtime_invisible_annotations_length = attribute_length;
|
||||
runtime_invisible_annotations = cfs->get_u1_buffer();
|
||||
assert(runtime_invisible_annotations != NULL, "null invisible annotations");
|
||||
}
|
||||
cfs->skip_u1(attribute_length, CHECK);
|
||||
} else if (tag == vmSymbols::tag_enclosing_method()) {
|
||||
if (parsed_enclosingmethod_attribute) {
|
||||
classfile_parse_error("Multiple EnclosingMethod attributes in class file %s", CHECK);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -312,7 +312,9 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
if (!b) { classfile_parse_error(msg, CHECK); }
|
||||
}
|
||||
|
||||
inline void assert_property(bool b, const char* msg, TRAPS) {
|
||||
PRAGMA_DIAG_PUSH
|
||||
PRAGMA_FORMAT_NONLITERAL_IGNORED
|
||||
inline void assert_property(bool b, const char* msg, TRAPS) {
|
||||
#ifdef ASSERT
|
||||
if (!b) {
|
||||
ResourceMark rm(THREAD);
|
||||
@ -329,6 +331,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
PRAGMA_DIAG_POP
|
||||
|
||||
inline void check_property(bool property, const char* msg, int index, TRAPS) {
|
||||
if (_need_verify) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -343,7 +343,7 @@ static void print_meta_index(LazyClassPathEntry* entry,
|
||||
tty->print("[Meta index for %s=", entry->name());
|
||||
for (int i = 0; i < meta_packages.length(); i++) {
|
||||
if (i > 0) tty->print(" ");
|
||||
tty->print(meta_packages.at(i));
|
||||
tty->print("%s", meta_packages.at(i));
|
||||
}
|
||||
tty->print_cr("]");
|
||||
}
|
||||
@ -1299,7 +1299,7 @@ void ClassLoader::compile_the_world() {
|
||||
e = e->next();
|
||||
}
|
||||
jlong end = os::javaTimeMillis();
|
||||
tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)",
|
||||
tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)",
|
||||
_compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
|
||||
{
|
||||
// Print statistics as if before normal exit:
|
||||
|
||||
@ -281,10 +281,10 @@ void ClassLoaderData::add_class(Klass* k) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: "
|
||||
PTR_FORMAT " loader: " PTR_FORMAT " %s",
|
||||
k,
|
||||
p2i(k),
|
||||
k->external_name(),
|
||||
k->class_loader_data(),
|
||||
(void *)k->class_loader(),
|
||||
p2i(k->class_loader_data()),
|
||||
p2i((void *)k->class_loader()),
|
||||
loader_name());
|
||||
}
|
||||
}
|
||||
@ -319,11 +319,11 @@ void ClassLoaderData::unload() {
|
||||
|
||||
if (TraceClassLoaderData) {
|
||||
ResourceMark rm;
|
||||
tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
|
||||
tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(),
|
||||
tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this));
|
||||
tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
|
||||
loader_name());
|
||||
if (is_anonymous()) {
|
||||
tty->print(" for anonymous class "PTR_FORMAT " ", _klasses);
|
||||
tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses));
|
||||
}
|
||||
tty->print_cr("]");
|
||||
}
|
||||
@ -485,14 +485,14 @@ const char* ClassLoaderData::loader_name() {
|
||||
void ClassLoaderData::dump(outputStream * const out) {
|
||||
ResourceMark rm;
|
||||
out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
|
||||
this, (void *)class_loader(),
|
||||
class_loader() != NULL ? class_loader()->klass() : NULL, loader_name());
|
||||
p2i(this), p2i((void *)class_loader()),
|
||||
p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
|
||||
if (claimed()) out->print(" claimed ");
|
||||
if (is_unloading()) out->print(" unloading ");
|
||||
out->print(" handles " INTPTR_FORMAT, handles());
|
||||
out->print(" handles " INTPTR_FORMAT, p2i(handles()));
|
||||
out->cr();
|
||||
if (metaspace_or_null() != NULL) {
|
||||
out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null());
|
||||
out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
|
||||
metaspace_or_null()->dump(out);
|
||||
} else {
|
||||
out->print_cr("metaspace: NULL");
|
||||
@ -586,8 +586,8 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA
|
||||
if (TraceClassLoaderData) {
|
||||
ResourceMark rm;
|
||||
tty->print("[ClassLoaderData: ");
|
||||
tty->print("create class loader data "PTR_FORMAT, cld);
|
||||
tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(),
|
||||
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("]");
|
||||
}
|
||||
@ -847,7 +847,7 @@ void ClassLoaderData::print_value_on(outputStream* out) const {
|
||||
if (class_loader() == NULL) {
|
||||
out->print("NULL class_loader");
|
||||
} else {
|
||||
out->print("class loader "PTR_FORMAT, this);
|
||||
out->print("class loader " INTPTR_FORMAT, p2i(this));
|
||||
class_loader()->print_value_on(out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ class MethodFamily : public ResourceObj {
|
||||
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
|
||||
if (TraceDefaultMethods) {
|
||||
_exception_message->print_value_on(tty);
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -463,7 +463,7 @@ class MethodFamily : public ResourceObj {
|
||||
if (_members.at(i).second == DISQUALIFIED) {
|
||||
str->print(" (disqualified)");
|
||||
}
|
||||
str->print_cr("");
|
||||
str->cr();
|
||||
}
|
||||
|
||||
if (_selected_target != NULL) {
|
||||
@ -480,7 +480,7 @@ class MethodFamily : public ResourceObj {
|
||||
if (!method_holder->is_interface()) {
|
||||
tty->print(" : in superclass");
|
||||
}
|
||||
str->print_cr("");
|
||||
str->cr();
|
||||
}
|
||||
|
||||
void print_exception(outputStream* str, int indent) {
|
||||
@ -688,7 +688,7 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
|
||||
for (int i = 0; i < slots->length(); ++i) {
|
||||
tty->indent();
|
||||
slots->at(i)->print_on(tty);
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
}
|
||||
}
|
||||
#endif // ndef PRODUCT
|
||||
@ -828,7 +828,7 @@ void DefaultMethods::generate_default_methods(
|
||||
streamIndentor si(tty, 2);
|
||||
tty->indent().print("Looking for default methods for slot ");
|
||||
slot->print_on(tty);
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
}
|
||||
#endif // ndef PRODUCT
|
||||
|
||||
@ -946,7 +946,7 @@ static void create_defaults_and_exceptions(
|
||||
if (TraceDefaultMethods) {
|
||||
tty->print("for slot: ");
|
||||
slot->print_on(tty);
|
||||
tty->print_cr("");
|
||||
tty->cr();
|
||||
if (method->has_target()) {
|
||||
method->print_selected(tty, 1);
|
||||
} else if (method->throws_exception()) {
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include "runtime/orderAccess.inline.hpp"
|
||||
#include "utilities/hashtable.inline.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
DictionaryEntry* Dictionary::_current_class_entry = NULL;
|
||||
int Dictionary::_current_class_index = 0;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -379,7 +379,7 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
|
||||
}
|
||||
if (method_type() != NULL) {
|
||||
if (printed) st->print(" and ");
|
||||
st->print(INTPTR_FORMAT, (void *)method_type());
|
||||
st->print(INTPTR_FORMAT, p2i((void *)method_type()));
|
||||
printed = true;
|
||||
}
|
||||
st->print_cr(printed ? "" : "(empty)");
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/altHashing.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/symbolTable.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "code/debugInfo.hpp"
|
||||
#include "code/pcDesc.hpp"
|
||||
@ -51,6 +51,8 @@
|
||||
#include "runtime/vframe.hpp"
|
||||
#include "utilities/preserveException.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
#define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java) \
|
||||
klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
|
||||
|
||||
@ -1490,7 +1492,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
|
||||
while (h_throwable.not_null()) {
|
||||
objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
|
||||
if (result.is_null()) {
|
||||
st->print_cr(no_stack_trace_message());
|
||||
st->print_cr("%s", no_stack_trace_message());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
533
hotspot/src/share/vm/classfile/stringTable.cpp
Normal file
533
hotspot/src/share/vm/classfile/stringTable.cpp
Normal file
@ -0,0 +1,533 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "classfile/altHashing.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "gc_interface/collectedHeap.inline.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/filemap.hpp"
|
||||
#include "memory/gcLocker.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/oop.inline2.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "utilities/hashtable.inline.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// the number of buckets a thread claims
|
||||
const int ClaimChunkSize = 32;
|
||||
|
||||
#ifdef ASSERT
|
||||
class StableMemoryChecker : public StackObj {
|
||||
enum { _bufsize = wordSize*4 };
|
||||
|
||||
address _region;
|
||||
jint _size;
|
||||
u1 _save_buf[_bufsize];
|
||||
|
||||
int sample(u1* save_buf) {
|
||||
if (_size <= _bufsize) {
|
||||
memcpy(save_buf, _region, _size);
|
||||
return _size;
|
||||
} else {
|
||||
// copy head and tail
|
||||
memcpy(&save_buf[0], _region, _bufsize/2);
|
||||
memcpy(&save_buf[_bufsize/2], _region + _size - _bufsize/2, _bufsize/2);
|
||||
return (_bufsize/2)*2;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
StableMemoryChecker(const void* region, jint size) {
|
||||
_region = (address) region;
|
||||
_size = size;
|
||||
sample(_save_buf);
|
||||
}
|
||||
|
||||
bool verify() {
|
||||
u1 check_buf[sizeof(_save_buf)];
|
||||
int check_size = sample(check_buf);
|
||||
return (0 == memcmp(_save_buf, check_buf, check_size));
|
||||
}
|
||||
|
||||
void set_region(const void* region) { _region = (address) region; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
StringTable* StringTable::_the_table = NULL;
|
||||
|
||||
bool StringTable::_needs_rehashing = false;
|
||||
|
||||
volatile int StringTable::_parallel_claimed_idx = 0;
|
||||
|
||||
// Pick hashing algorithm
|
||||
unsigned int StringTable::hash_string(const jchar* s, int len) {
|
||||
return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
|
||||
java_lang_String::hash_code(s, len);
|
||||
}
|
||||
|
||||
oop StringTable::lookup(int index, jchar* name,
|
||||
int len, unsigned int hash) {
|
||||
int count = 0;
|
||||
for (HashtableEntry<oop, mtSymbol>* l = bucket(index); l != NULL; l = l->next()) {
|
||||
count++;
|
||||
if (l->hash() == hash) {
|
||||
if (java_lang_String::equals(l->literal(), name, len)) {
|
||||
return l->literal();
|
||||
}
|
||||
}
|
||||
}
|
||||
// If the bucket size is too deep check if this hash code is insufficient.
|
||||
if (count >= BasicHashtable<mtSymbol>::rehash_count && !needs_rehashing()) {
|
||||
_needs_rehashing = check_rehash_table(count);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
|
||||
int len, unsigned int hashValue_arg, TRAPS) {
|
||||
|
||||
assert(java_lang_String::equals(string(), name, len),
|
||||
"string must be properly initialized");
|
||||
// Cannot hit a safepoint in this function because the "this" pointer can move.
|
||||
No_Safepoint_Verifier nsv;
|
||||
|
||||
// Check if the symbol table has been rehashed, if so, need to recalculate
|
||||
// the hash value and index before second lookup.
|
||||
unsigned int hashValue;
|
||||
int index;
|
||||
if (use_alternate_hashcode()) {
|
||||
hashValue = hash_string(name, len);
|
||||
index = hash_to_index(hashValue);
|
||||
} else {
|
||||
hashValue = hashValue_arg;
|
||||
index = index_arg;
|
||||
}
|
||||
|
||||
// Since look-up was done lock-free, we need to check if another
|
||||
// thread beat us in the race to insert the symbol.
|
||||
|
||||
oop test = lookup(index, name, len, hashValue); // calls lookup(u1*, int)
|
||||
if (test != NULL) {
|
||||
// Entry already added
|
||||
return test;
|
||||
}
|
||||
|
||||
HashtableEntry<oop, mtSymbol>* entry = new_entry(hashValue, string());
|
||||
add_entry(index, entry);
|
||||
return string();
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::lookup(Symbol* symbol) {
|
||||
ResourceMark rm;
|
||||
int length;
|
||||
jchar* chars = symbol->as_unicode(length);
|
||||
return lookup(chars, length);
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::lookup(jchar* name, int len) {
|
||||
unsigned int hash = hash_string(name, len);
|
||||
int index = the_table()->hash_to_index(hash);
|
||||
return the_table()->lookup(index, name, len, hash);
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::intern(Handle string_or_null, jchar* name,
|
||||
int len, TRAPS) {
|
||||
unsigned int hashValue = hash_string(name, len);
|
||||
int index = the_table()->hash_to_index(hashValue);
|
||||
oop found_string = the_table()->lookup(index, name, len, hashValue);
|
||||
|
||||
// Found
|
||||
if (found_string != NULL) return found_string;
|
||||
|
||||
debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
|
||||
assert(!Universe::heap()->is_in_reserved(name),
|
||||
"proposed name of symbol must be stable");
|
||||
|
||||
Handle string;
|
||||
// try to reuse the string if possible
|
||||
if (!string_or_null.is_null()) {
|
||||
string = string_or_null;
|
||||
} else {
|
||||
string = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
|
||||
}
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
if (G1StringDedup::is_enabled()) {
|
||||
// Deduplicate the string before it is interned. Note that we should never
|
||||
// deduplicate a string after it has been interned. Doing so will counteract
|
||||
// compiler optimizations done on e.g. interned string literals.
|
||||
G1StringDedup::deduplicate(string());
|
||||
}
|
||||
#endif
|
||||
|
||||
// Grab the StringTable_lock before getting the_table() because it could
|
||||
// change at safepoint.
|
||||
MutexLocker ml(StringTable_lock, THREAD);
|
||||
|
||||
// Otherwise, add to symbol to table
|
||||
return the_table()->basic_add(index, string, name, len,
|
||||
hashValue, CHECK_NULL);
|
||||
}
|
||||
|
||||
oop StringTable::intern(Symbol* symbol, TRAPS) {
|
||||
if (symbol == NULL) return NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
int length;
|
||||
jchar* chars = symbol->as_unicode(length);
|
||||
Handle string;
|
||||
oop result = intern(string, chars, length, CHECK_NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::intern(oop string, TRAPS)
|
||||
{
|
||||
if (string == NULL) return NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
int length;
|
||||
Handle h_string (THREAD, string);
|
||||
jchar* chars = java_lang_String::as_unicode_string(string, length, CHECK_NULL);
|
||||
oop result = intern(h_string, chars, length, CHECK_NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::intern(const char* utf8_string, TRAPS) {
|
||||
if (utf8_string == NULL) return NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
int length = UTF8::unicode_length(utf8_string);
|
||||
jchar* chars = NEW_RESOURCE_ARRAY(jchar, length);
|
||||
UTF8::convert_to_unicode(utf8_string, chars, length);
|
||||
Handle string;
|
||||
oop result = intern(string, chars, length, CHECK_NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
|
||||
buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, removed);
|
||||
}
|
||||
|
||||
void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
|
||||
// Readers of the table are unlocked, so we should only be removing
|
||||
// entries at a safepoint.
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
for (;;) {
|
||||
// Grab next set of buckets to scan
|
||||
int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
|
||||
if (start_idx >= limit) {
|
||||
// End of table
|
||||
break;
|
||||
}
|
||||
|
||||
int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
|
||||
buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed);
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
assert(0 <= start_idx && start_idx <= limit,
|
||||
err_msg("start_idx (%d) is out of bounds", start_idx));
|
||||
assert(0 <= end_idx && end_idx <= limit,
|
||||
err_msg("end_idx (%d) is out of bounds", end_idx));
|
||||
assert(start_idx <= end_idx,
|
||||
err_msg("Index ordering: start_idx=%d, end_idx=%d",
|
||||
start_idx, end_idx));
|
||||
|
||||
for (int i = start_idx; i < end_idx; i += 1) {
|
||||
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||
while (entry != NULL) {
|
||||
assert(!entry->is_shared(), "CDS not used for the StringTable");
|
||||
|
||||
f->do_oop((oop*)entry->literal_addr());
|
||||
|
||||
entry = entry->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) {
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
assert(0 <= start_idx && start_idx <= limit,
|
||||
err_msg("start_idx (%d) is out of bounds", start_idx));
|
||||
assert(0 <= end_idx && end_idx <= limit,
|
||||
err_msg("end_idx (%d) is out of bounds", end_idx));
|
||||
assert(start_idx <= end_idx,
|
||||
err_msg("Index ordering: start_idx=%d, end_idx=%d",
|
||||
start_idx, end_idx));
|
||||
|
||||
for (int i = start_idx; i < end_idx; ++i) {
|
||||
HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||
while (entry != NULL) {
|
||||
assert(!entry->is_shared(), "CDS not used for the StringTable");
|
||||
|
||||
if (is_alive->do_object_b(entry->literal())) {
|
||||
if (f != NULL) {
|
||||
f->do_oop((oop*)entry->literal_addr());
|
||||
}
|
||||
p = entry->next_addr();
|
||||
} else {
|
||||
*p = entry->next();
|
||||
the_table()->free_entry(entry);
|
||||
(*removed)++;
|
||||
}
|
||||
(*processed)++;
|
||||
entry = *p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::oops_do(OopClosure* f) {
|
||||
buckets_oops_do(f, 0, the_table()->table_size());
|
||||
}
|
||||
|
||||
void StringTable::possibly_parallel_oops_do(OopClosure* f) {
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
for (;;) {
|
||||
// Grab next set of buckets to scan
|
||||
int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
|
||||
if (start_idx >= limit) {
|
||||
// End of table
|
||||
break;
|
||||
}
|
||||
|
||||
int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
|
||||
buckets_oops_do(f, start_idx, end_idx);
|
||||
}
|
||||
}
|
||||
|
||||
// This verification is part of Universe::verify() and needs to be quick.
|
||||
// See StringTable::verify_and_compare() below for exhaustive verification.
|
||||
void StringTable::verify() {
|
||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||
HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
|
||||
for ( ; p != NULL; p = p->next()) {
|
||||
oop s = p->literal();
|
||||
guarantee(s != NULL, "interned string is NULL");
|
||||
unsigned int h = java_lang_String::hash_string(s);
|
||||
guarantee(p->hash() == h, "broken hash in string table entry");
|
||||
guarantee(the_table()->hash_to_index(h) == i,
|
||||
"wrong index in string table");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::dump(outputStream* st) {
|
||||
the_table()->dump_table(st, "StringTable");
|
||||
}
|
||||
|
||||
StringTable::VerifyRetTypes StringTable::compare_entries(
|
||||
int bkt1, int e_cnt1,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1,
|
||||
int bkt2, int e_cnt2,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2) {
|
||||
// These entries are sanity checked by verify_and_compare_entries()
|
||||
// before this function is called.
|
||||
oop str1 = e_ptr1->literal();
|
||||
oop str2 = e_ptr2->literal();
|
||||
|
||||
if (str1 == str2) {
|
||||
tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
|
||||
"in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
|
||||
(void *)str1, bkt1, e_cnt1, bkt2, e_cnt2);
|
||||
return _verify_fail_continue;
|
||||
}
|
||||
|
||||
if (java_lang_String::equals(str1, str2)) {
|
||||
tty->print_cr("ERROR: identical String values in entry @ "
|
||||
"bucket[%d][%d] and entry @ bucket[%d][%d]",
|
||||
bkt1, e_cnt1, bkt2, e_cnt2);
|
||||
return _verify_fail_continue;
|
||||
}
|
||||
|
||||
return _verify_pass;
|
||||
}
|
||||
|
||||
StringTable::VerifyRetTypes StringTable::verify_entry(int bkt, int e_cnt,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr,
|
||||
StringTable::VerifyMesgModes mesg_mode) {
|
||||
|
||||
VerifyRetTypes ret = _verify_pass; // be optimistic
|
||||
|
||||
oop str = e_ptr->literal();
|
||||
if (str == NULL) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: NULL oop value in entry @ bucket[%d][%d]", bkt,
|
||||
e_cnt);
|
||||
}
|
||||
// NULL oop means no more verifications are possible
|
||||
return _verify_fail_done;
|
||||
}
|
||||
|
||||
if (str->klass() != SystemDictionary::String_klass()) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: oop is not a String in entry @ bucket[%d][%d]",
|
||||
bkt, e_cnt);
|
||||
}
|
||||
// not a String means no more verifications are possible
|
||||
return _verify_fail_done;
|
||||
}
|
||||
|
||||
unsigned int h = java_lang_String::hash_string(str);
|
||||
if (e_ptr->hash() != h) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: broken hash value in entry @ bucket[%d][%d], "
|
||||
"bkt_hash=%d, str_hash=%d", bkt, e_cnt, e_ptr->hash(), h);
|
||||
}
|
||||
ret = _verify_fail_continue;
|
||||
}
|
||||
|
||||
if (the_table()->hash_to_index(h) != bkt) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: wrong index value for entry @ bucket[%d][%d], "
|
||||
"str_hash=%d, hash_to_index=%d", bkt, e_cnt, h,
|
||||
the_table()->hash_to_index(h));
|
||||
}
|
||||
ret = _verify_fail_continue;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// See StringTable::verify() above for the quick verification that is
|
||||
// part of Universe::verify(). This verification is exhaustive and
|
||||
// reports on every issue that is found. StringTable::verify() only
|
||||
// reports on the first issue that is found.
|
||||
//
|
||||
// StringTable::verify_entry() checks:
|
||||
// - oop value != NULL (same as verify())
|
||||
// - oop value is a String
|
||||
// - hash(String) == hash in entry (same as verify())
|
||||
// - index for hash == index of entry (same as verify())
|
||||
//
|
||||
// StringTable::compare_entries() checks:
|
||||
// - oops are unique across all entries
|
||||
// - String values are unique across all entries
|
||||
//
|
||||
int StringTable::verify_and_compare_entries() {
|
||||
assert(StringTable_lock->is_locked(), "sanity check");
|
||||
|
||||
int fail_cnt = 0;
|
||||
|
||||
// first, verify all the entries individually:
|
||||
for (int bkt = 0; bkt < the_table()->table_size(); bkt++) {
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr = the_table()->bucket(bkt);
|
||||
for (int e_cnt = 0; e_ptr != NULL; e_ptr = e_ptr->next(), e_cnt++) {
|
||||
VerifyRetTypes ret = verify_entry(bkt, e_cnt, e_ptr, _verify_with_mesgs);
|
||||
if (ret != _verify_pass) {
|
||||
fail_cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Optimization: if the above check did not find any failures, then
|
||||
// the comparison loop below does not need to call verify_entry()
|
||||
// before calling compare_entries(). If there were failures, then we
|
||||
// have to call verify_entry() to see if the entry can be passed to
|
||||
// compare_entries() safely. When we call verify_entry() in the loop
|
||||
// below, we do so quietly to void duplicate messages and we don't
|
||||
// increment fail_cnt because the failures have already been counted.
|
||||
bool need_entry_verify = (fail_cnt != 0);
|
||||
|
||||
// second, verify all entries relative to each other:
|
||||
for (int bkt1 = 0; bkt1 < the_table()->table_size(); bkt1++) {
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1 = the_table()->bucket(bkt1);
|
||||
for (int e_cnt1 = 0; e_ptr1 != NULL; e_ptr1 = e_ptr1->next(), e_cnt1++) {
|
||||
if (need_entry_verify) {
|
||||
VerifyRetTypes ret = verify_entry(bkt1, e_cnt1, e_ptr1,
|
||||
_verify_quietly);
|
||||
if (ret == _verify_fail_done) {
|
||||
// cannot use the current entry to compare against other entries
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int bkt2 = bkt1; bkt2 < the_table()->table_size(); bkt2++) {
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2 = the_table()->bucket(bkt2);
|
||||
int e_cnt2;
|
||||
for (e_cnt2 = 0; e_ptr2 != NULL; e_ptr2 = e_ptr2->next(), e_cnt2++) {
|
||||
if (bkt1 == bkt2 && e_cnt2 <= e_cnt1) {
|
||||
// skip the entries up to and including the one that
|
||||
// we're comparing against
|
||||
continue;
|
||||
}
|
||||
|
||||
if (need_entry_verify) {
|
||||
VerifyRetTypes ret = verify_entry(bkt2, e_cnt2, e_ptr2,
|
||||
_verify_quietly);
|
||||
if (ret == _verify_fail_done) {
|
||||
// cannot compare against this entry
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// compare two entries, report and count any failures:
|
||||
if (compare_entries(bkt1, e_cnt1, e_ptr1, bkt2, e_cnt2, e_ptr2)
|
||||
!= _verify_pass) {
|
||||
fail_cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return fail_cnt;
|
||||
}
|
||||
|
||||
// Create a new table and using alternate hash code, populate the new table
|
||||
// with the existing strings. Set flag to use the alternate hash code afterwards.
|
||||
void StringTable::rehash_table() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
||||
// This should never happen with -Xshare:dump but it might in testing mode.
|
||||
if (DumpSharedSpaces) return;
|
||||
StringTable* new_table = new StringTable();
|
||||
|
||||
// Rehash the table
|
||||
the_table()->move_to(new_table);
|
||||
|
||||
// Delete the table and buckets (entries are reused in new table).
|
||||
delete _the_table;
|
||||
// Don't check if we need rehashing until the table gets unbalanced again.
|
||||
// Then rehash with a new global seed.
|
||||
_needs_rehashing = false;
|
||||
_the_table = new_table;
|
||||
}
|
||||
162
hotspot/src/share/vm/classfile/stringTable.hpp
Normal file
162
hotspot/src/share/vm/classfile/stringTable.hpp
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
|
||||
#define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
|
||||
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "utilities/hashtable.hpp"
|
||||
|
||||
class StringTable : public Hashtable<oop, mtSymbol> {
|
||||
friend class VMStructs;
|
||||
friend class Symbol;
|
||||
|
||||
private:
|
||||
// The string table
|
||||
static StringTable* _the_table;
|
||||
|
||||
// Set if one bucket is out of balance due to hash algorithm deficiency
|
||||
static bool _needs_rehashing;
|
||||
|
||||
// Claimed high water mark for parallel chunked scanning
|
||||
static volatile int _parallel_claimed_idx;
|
||||
|
||||
static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS);
|
||||
oop basic_add(int index, Handle string_or_null, jchar* name, int len,
|
||||
unsigned int hashValue, TRAPS);
|
||||
|
||||
oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
|
||||
|
||||
// Apply the give oop closure to the entries to the buckets
|
||||
// in the range [start_idx, end_idx).
|
||||
static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
|
||||
// Unlink or apply the give oop closure to the entries to the buckets
|
||||
// in the range [start_idx, end_idx).
|
||||
static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
|
||||
|
||||
StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
|
||||
sizeof (HashtableEntry<oop, mtSymbol>)) {}
|
||||
|
||||
StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
|
||||
: Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
|
||||
number_of_entries) {}
|
||||
public:
|
||||
// The string table
|
||||
static StringTable* the_table() { return _the_table; }
|
||||
|
||||
// Size of one bucket in the string table. Used when checking for rollover.
|
||||
static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
|
||||
|
||||
static void create_table() {
|
||||
assert(_the_table == NULL, "One string table allowed.");
|
||||
_the_table = new StringTable();
|
||||
}
|
||||
|
||||
// GC support
|
||||
// Delete pointers to otherwise-unreachable objects.
|
||||
static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f) {
|
||||
int processed = 0;
|
||||
int removed = 0;
|
||||
unlink_or_oops_do(cl, f, &processed, &removed);
|
||||
}
|
||||
static void unlink(BoolObjectClosure* cl) {
|
||||
int processed = 0;
|
||||
int removed = 0;
|
||||
unlink_or_oops_do(cl, NULL, &processed, &removed);
|
||||
}
|
||||
static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
|
||||
static void unlink(BoolObjectClosure* cl, int* processed, int* removed) {
|
||||
unlink_or_oops_do(cl, NULL, processed, removed);
|
||||
}
|
||||
// Serially invoke "f->do_oop" on the locations of all oops in the table.
|
||||
static void oops_do(OopClosure* f);
|
||||
|
||||
// Possibly parallel versions of the above
|
||||
static void possibly_parallel_unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
|
||||
static void possibly_parallel_unlink(BoolObjectClosure* cl, int* processed, int* removed) {
|
||||
possibly_parallel_unlink_or_oops_do(cl, NULL, processed, removed);
|
||||
}
|
||||
static void possibly_parallel_oops_do(OopClosure* f);
|
||||
|
||||
// Hashing algorithm, used as the hash value used by the
|
||||
// StringTable for bucket selection and comparison (stored in the
|
||||
// HashtableEntry structures). This is used in the String.intern() method.
|
||||
static unsigned int hash_string(const jchar* s, int len);
|
||||
|
||||
// Internal test.
|
||||
static void test_alt_hash() PRODUCT_RETURN;
|
||||
|
||||
// Probing
|
||||
static oop lookup(Symbol* symbol);
|
||||
static oop lookup(jchar* chars, int length);
|
||||
|
||||
// Interning
|
||||
static oop intern(Symbol* symbol, TRAPS);
|
||||
static oop intern(oop string, TRAPS);
|
||||
static oop intern(const char *utf8_string, TRAPS);
|
||||
|
||||
// Debugging
|
||||
static void verify();
|
||||
static void dump(outputStream* st);
|
||||
|
||||
enum VerifyMesgModes {
|
||||
_verify_quietly = 0,
|
||||
_verify_with_mesgs = 1
|
||||
};
|
||||
|
||||
enum VerifyRetTypes {
|
||||
_verify_pass = 0,
|
||||
_verify_fail_continue = 1,
|
||||
_verify_fail_done = 2
|
||||
};
|
||||
|
||||
static VerifyRetTypes compare_entries(int bkt1, int e_cnt1,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1,
|
||||
int bkt2, int e_cnt2,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2);
|
||||
static VerifyRetTypes verify_entry(int bkt, int e_cnt,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr,
|
||||
VerifyMesgModes mesg_mode);
|
||||
static int verify_and_compare_entries();
|
||||
|
||||
// Sharing
|
||||
static void copy_buckets(char** top, char*end) {
|
||||
the_table()->Hashtable<oop, mtSymbol>::copy_buckets(top, end);
|
||||
}
|
||||
static void copy_table(char** top, char*end) {
|
||||
the_table()->Hashtable<oop, mtSymbol>::copy_table(top, end);
|
||||
}
|
||||
static void reverse() {
|
||||
the_table()->Hashtable<oop, mtSymbol>::reverse();
|
||||
}
|
||||
|
||||
// Rehash the symbol table if it gets out of balance
|
||||
static void rehash_table();
|
||||
static bool needs_rehashing() { return _needs_rehashing; }
|
||||
|
||||
// Parallel chunked scanning
|
||||
static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; }
|
||||
static int parallel_claimed_index() { return _parallel_claimed_idx; }
|
||||
};
|
||||
#endif // SHARE_VM_CLASSFILE_STRINGTABLE_HPP
|
||||
@ -35,12 +35,10 @@
|
||||
#include "oops/oop.inline2.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "utilities/hashtable.inline.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// the number of buckets a thread claims
|
||||
const int ClaimChunkSize = 32;
|
||||
|
||||
@ -587,493 +585,3 @@ void SymbolTable::print() {
|
||||
}
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#ifdef ASSERT
|
||||
class StableMemoryChecker : public StackObj {
|
||||
enum { _bufsize = wordSize*4 };
|
||||
|
||||
address _region;
|
||||
jint _size;
|
||||
u1 _save_buf[_bufsize];
|
||||
|
||||
int sample(u1* save_buf) {
|
||||
if (_size <= _bufsize) {
|
||||
memcpy(save_buf, _region, _size);
|
||||
return _size;
|
||||
} else {
|
||||
// copy head and tail
|
||||
memcpy(&save_buf[0], _region, _bufsize/2);
|
||||
memcpy(&save_buf[_bufsize/2], _region + _size - _bufsize/2, _bufsize/2);
|
||||
return (_bufsize/2)*2;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
StableMemoryChecker(const void* region, jint size) {
|
||||
_region = (address) region;
|
||||
_size = size;
|
||||
sample(_save_buf);
|
||||
}
|
||||
|
||||
bool verify() {
|
||||
u1 check_buf[sizeof(_save_buf)];
|
||||
int check_size = sample(check_buf);
|
||||
return (0 == memcmp(_save_buf, check_buf, check_size));
|
||||
}
|
||||
|
||||
void set_region(const void* region) { _region = (address) region; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
StringTable* StringTable::_the_table = NULL;
|
||||
|
||||
bool StringTable::_needs_rehashing = false;
|
||||
|
||||
volatile int StringTable::_parallel_claimed_idx = 0;
|
||||
|
||||
// Pick hashing algorithm
|
||||
unsigned int StringTable::hash_string(const jchar* s, int len) {
|
||||
return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
|
||||
java_lang_String::hash_code(s, len);
|
||||
}
|
||||
|
||||
oop StringTable::lookup(int index, jchar* name,
|
||||
int len, unsigned int hash) {
|
||||
int count = 0;
|
||||
for (HashtableEntry<oop, mtSymbol>* l = bucket(index); l != NULL; l = l->next()) {
|
||||
count++;
|
||||
if (l->hash() == hash) {
|
||||
if (java_lang_String::equals(l->literal(), name, len)) {
|
||||
return l->literal();
|
||||
}
|
||||
}
|
||||
}
|
||||
// If the bucket size is too deep check if this hash code is insufficient.
|
||||
if (count >= BasicHashtable<mtSymbol>::rehash_count && !needs_rehashing()) {
|
||||
_needs_rehashing = check_rehash_table(count);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
|
||||
int len, unsigned int hashValue_arg, TRAPS) {
|
||||
|
||||
assert(java_lang_String::equals(string(), name, len),
|
||||
"string must be properly initialized");
|
||||
// Cannot hit a safepoint in this function because the "this" pointer can move.
|
||||
No_Safepoint_Verifier nsv;
|
||||
|
||||
// Check if the symbol table has been rehashed, if so, need to recalculate
|
||||
// the hash value and index before second lookup.
|
||||
unsigned int hashValue;
|
||||
int index;
|
||||
if (use_alternate_hashcode()) {
|
||||
hashValue = hash_string(name, len);
|
||||
index = hash_to_index(hashValue);
|
||||
} else {
|
||||
hashValue = hashValue_arg;
|
||||
index = index_arg;
|
||||
}
|
||||
|
||||
// Since look-up was done lock-free, we need to check if another
|
||||
// thread beat us in the race to insert the symbol.
|
||||
|
||||
oop test = lookup(index, name, len, hashValue); // calls lookup(u1*, int)
|
||||
if (test != NULL) {
|
||||
// Entry already added
|
||||
return test;
|
||||
}
|
||||
|
||||
HashtableEntry<oop, mtSymbol>* entry = new_entry(hashValue, string());
|
||||
add_entry(index, entry);
|
||||
return string();
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::lookup(Symbol* symbol) {
|
||||
ResourceMark rm;
|
||||
int length;
|
||||
jchar* chars = symbol->as_unicode(length);
|
||||
return lookup(chars, length);
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::lookup(jchar* name, int len) {
|
||||
unsigned int hash = hash_string(name, len);
|
||||
int index = the_table()->hash_to_index(hash);
|
||||
return the_table()->lookup(index, name, len, hash);
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::intern(Handle string_or_null, jchar* name,
|
||||
int len, TRAPS) {
|
||||
unsigned int hashValue = hash_string(name, len);
|
||||
int index = the_table()->hash_to_index(hashValue);
|
||||
oop found_string = the_table()->lookup(index, name, len, hashValue);
|
||||
|
||||
// Found
|
||||
if (found_string != NULL) return found_string;
|
||||
|
||||
debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
|
||||
assert(!Universe::heap()->is_in_reserved(name),
|
||||
"proposed name of symbol must be stable");
|
||||
|
||||
Handle string;
|
||||
// try to reuse the string if possible
|
||||
if (!string_or_null.is_null()) {
|
||||
string = string_or_null;
|
||||
} else {
|
||||
string = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
|
||||
}
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
if (G1StringDedup::is_enabled()) {
|
||||
// Deduplicate the string before it is interned. Note that we should never
|
||||
// deduplicate a string after it has been interned. Doing so will counteract
|
||||
// compiler optimizations done on e.g. interned string literals.
|
||||
G1StringDedup::deduplicate(string());
|
||||
}
|
||||
#endif
|
||||
|
||||
// Grab the StringTable_lock before getting the_table() because it could
|
||||
// change at safepoint.
|
||||
MutexLocker ml(StringTable_lock, THREAD);
|
||||
|
||||
// Otherwise, add to symbol to table
|
||||
return the_table()->basic_add(index, string, name, len,
|
||||
hashValue, CHECK_NULL);
|
||||
}
|
||||
|
||||
oop StringTable::intern(Symbol* symbol, TRAPS) {
|
||||
if (symbol == NULL) return NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
int length;
|
||||
jchar* chars = symbol->as_unicode(length);
|
||||
Handle string;
|
||||
oop result = intern(string, chars, length, CHECK_NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::intern(oop string, TRAPS)
|
||||
{
|
||||
if (string == NULL) return NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
int length;
|
||||
Handle h_string (THREAD, string);
|
||||
jchar* chars = java_lang_String::as_unicode_string(string, length, CHECK_NULL);
|
||||
oop result = intern(h_string, chars, length, CHECK_NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
oop StringTable::intern(const char* utf8_string, TRAPS) {
|
||||
if (utf8_string == NULL) return NULL;
|
||||
ResourceMark rm(THREAD);
|
||||
int length = UTF8::unicode_length(utf8_string);
|
||||
jchar* chars = NEW_RESOURCE_ARRAY(jchar, length);
|
||||
UTF8::convert_to_unicode(utf8_string, chars, length);
|
||||
Handle string;
|
||||
oop result = intern(string, chars, length, CHECK_NULL);
|
||||
return result;
|
||||
}
|
||||
|
||||
void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
|
||||
buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, removed);
|
||||
}
|
||||
|
||||
void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
|
||||
// Readers of the table are unlocked, so we should only be removing
|
||||
// entries at a safepoint.
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
for (;;) {
|
||||
// Grab next set of buckets to scan
|
||||
int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
|
||||
if (start_idx >= limit) {
|
||||
// End of table
|
||||
break;
|
||||
}
|
||||
|
||||
int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
|
||||
buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed);
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
assert(0 <= start_idx && start_idx <= limit,
|
||||
err_msg("start_idx (%d) is out of bounds", start_idx));
|
||||
assert(0 <= end_idx && end_idx <= limit,
|
||||
err_msg("end_idx (%d) is out of bounds", end_idx));
|
||||
assert(start_idx <= end_idx,
|
||||
err_msg("Index ordering: start_idx=%d, end_idx=%d",
|
||||
start_idx, end_idx));
|
||||
|
||||
for (int i = start_idx; i < end_idx; i += 1) {
|
||||
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||
while (entry != NULL) {
|
||||
assert(!entry->is_shared(), "CDS not used for the StringTable");
|
||||
|
||||
f->do_oop((oop*)entry->literal_addr());
|
||||
|
||||
entry = entry->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) {
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
assert(0 <= start_idx && start_idx <= limit,
|
||||
err_msg("start_idx (%d) is out of bounds", start_idx));
|
||||
assert(0 <= end_idx && end_idx <= limit,
|
||||
err_msg("end_idx (%d) is out of bounds", end_idx));
|
||||
assert(start_idx <= end_idx,
|
||||
err_msg("Index ordering: start_idx=%d, end_idx=%d",
|
||||
start_idx, end_idx));
|
||||
|
||||
for (int i = start_idx; i < end_idx; ++i) {
|
||||
HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||
while (entry != NULL) {
|
||||
assert(!entry->is_shared(), "CDS not used for the StringTable");
|
||||
|
||||
if (is_alive->do_object_b(entry->literal())) {
|
||||
if (f != NULL) {
|
||||
f->do_oop((oop*)entry->literal_addr());
|
||||
}
|
||||
p = entry->next_addr();
|
||||
} else {
|
||||
*p = entry->next();
|
||||
the_table()->free_entry(entry);
|
||||
(*removed)++;
|
||||
}
|
||||
(*processed)++;
|
||||
entry = *p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::oops_do(OopClosure* f) {
|
||||
buckets_oops_do(f, 0, the_table()->table_size());
|
||||
}
|
||||
|
||||
void StringTable::possibly_parallel_oops_do(OopClosure* f) {
|
||||
const int limit = the_table()->table_size();
|
||||
|
||||
for (;;) {
|
||||
// Grab next set of buckets to scan
|
||||
int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
|
||||
if (start_idx >= limit) {
|
||||
// End of table
|
||||
break;
|
||||
}
|
||||
|
||||
int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
|
||||
buckets_oops_do(f, start_idx, end_idx);
|
||||
}
|
||||
}
|
||||
|
||||
// This verification is part of Universe::verify() and needs to be quick.
|
||||
// See StringTable::verify_and_compare() below for exhaustive verification.
|
||||
void StringTable::verify() {
|
||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||
HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
|
||||
for ( ; p != NULL; p = p->next()) {
|
||||
oop s = p->literal();
|
||||
guarantee(s != NULL, "interned string is NULL");
|
||||
unsigned int h = java_lang_String::hash_string(s);
|
||||
guarantee(p->hash() == h, "broken hash in string table entry");
|
||||
guarantee(the_table()->hash_to_index(h) == i,
|
||||
"wrong index in string table");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::dump(outputStream* st) {
|
||||
the_table()->dump_table(st, "StringTable");
|
||||
}
|
||||
|
||||
StringTable::VerifyRetTypes StringTable::compare_entries(
|
||||
int bkt1, int e_cnt1,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1,
|
||||
int bkt2, int e_cnt2,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2) {
|
||||
// These entries are sanity checked by verify_and_compare_entries()
|
||||
// before this function is called.
|
||||
oop str1 = e_ptr1->literal();
|
||||
oop str2 = e_ptr2->literal();
|
||||
|
||||
if (str1 == str2) {
|
||||
tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
|
||||
"in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
|
||||
(void *)str1, bkt1, e_cnt1, bkt2, e_cnt2);
|
||||
return _verify_fail_continue;
|
||||
}
|
||||
|
||||
if (java_lang_String::equals(str1, str2)) {
|
||||
tty->print_cr("ERROR: identical String values in entry @ "
|
||||
"bucket[%d][%d] and entry @ bucket[%d][%d]",
|
||||
bkt1, e_cnt1, bkt2, e_cnt2);
|
||||
return _verify_fail_continue;
|
||||
}
|
||||
|
||||
return _verify_pass;
|
||||
}
|
||||
|
||||
StringTable::VerifyRetTypes StringTable::verify_entry(int bkt, int e_cnt,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr,
|
||||
StringTable::VerifyMesgModes mesg_mode) {
|
||||
|
||||
VerifyRetTypes ret = _verify_pass; // be optimistic
|
||||
|
||||
oop str = e_ptr->literal();
|
||||
if (str == NULL) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: NULL oop value in entry @ bucket[%d][%d]", bkt,
|
||||
e_cnt);
|
||||
}
|
||||
// NULL oop means no more verifications are possible
|
||||
return _verify_fail_done;
|
||||
}
|
||||
|
||||
if (str->klass() != SystemDictionary::String_klass()) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: oop is not a String in entry @ bucket[%d][%d]",
|
||||
bkt, e_cnt);
|
||||
}
|
||||
// not a String means no more verifications are possible
|
||||
return _verify_fail_done;
|
||||
}
|
||||
|
||||
unsigned int h = java_lang_String::hash_string(str);
|
||||
if (e_ptr->hash() != h) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: broken hash value in entry @ bucket[%d][%d], "
|
||||
"bkt_hash=%d, str_hash=%d", bkt, e_cnt, e_ptr->hash(), h);
|
||||
}
|
||||
ret = _verify_fail_continue;
|
||||
}
|
||||
|
||||
if (the_table()->hash_to_index(h) != bkt) {
|
||||
if (mesg_mode == _verify_with_mesgs) {
|
||||
tty->print_cr("ERROR: wrong index value for entry @ bucket[%d][%d], "
|
||||
"str_hash=%d, hash_to_index=%d", bkt, e_cnt, h,
|
||||
the_table()->hash_to_index(h));
|
||||
}
|
||||
ret = _verify_fail_continue;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// See StringTable::verify() above for the quick verification that is
|
||||
// part of Universe::verify(). This verification is exhaustive and
|
||||
// reports on every issue that is found. StringTable::verify() only
|
||||
// reports on the first issue that is found.
|
||||
//
|
||||
// StringTable::verify_entry() checks:
|
||||
// - oop value != NULL (same as verify())
|
||||
// - oop value is a String
|
||||
// - hash(String) == hash in entry (same as verify())
|
||||
// - index for hash == index of entry (same as verify())
|
||||
//
|
||||
// StringTable::compare_entries() checks:
|
||||
// - oops are unique across all entries
|
||||
// - String values are unique across all entries
|
||||
//
|
||||
int StringTable::verify_and_compare_entries() {
|
||||
assert(StringTable_lock->is_locked(), "sanity check");
|
||||
|
||||
int fail_cnt = 0;
|
||||
|
||||
// first, verify all the entries individually:
|
||||
for (int bkt = 0; bkt < the_table()->table_size(); bkt++) {
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr = the_table()->bucket(bkt);
|
||||
for (int e_cnt = 0; e_ptr != NULL; e_ptr = e_ptr->next(), e_cnt++) {
|
||||
VerifyRetTypes ret = verify_entry(bkt, e_cnt, e_ptr, _verify_with_mesgs);
|
||||
if (ret != _verify_pass) {
|
||||
fail_cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Optimization: if the above check did not find any failures, then
|
||||
// the comparison loop below does not need to call verify_entry()
|
||||
// before calling compare_entries(). If there were failures, then we
|
||||
// have to call verify_entry() to see if the entry can be passed to
|
||||
// compare_entries() safely. When we call verify_entry() in the loop
|
||||
// below, we do so quietly to void duplicate messages and we don't
|
||||
// increment fail_cnt because the failures have already been counted.
|
||||
bool need_entry_verify = (fail_cnt != 0);
|
||||
|
||||
// second, verify all entries relative to each other:
|
||||
for (int bkt1 = 0; bkt1 < the_table()->table_size(); bkt1++) {
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1 = the_table()->bucket(bkt1);
|
||||
for (int e_cnt1 = 0; e_ptr1 != NULL; e_ptr1 = e_ptr1->next(), e_cnt1++) {
|
||||
if (need_entry_verify) {
|
||||
VerifyRetTypes ret = verify_entry(bkt1, e_cnt1, e_ptr1,
|
||||
_verify_quietly);
|
||||
if (ret == _verify_fail_done) {
|
||||
// cannot use the current entry to compare against other entries
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int bkt2 = bkt1; bkt2 < the_table()->table_size(); bkt2++) {
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2 = the_table()->bucket(bkt2);
|
||||
int e_cnt2;
|
||||
for (e_cnt2 = 0; e_ptr2 != NULL; e_ptr2 = e_ptr2->next(), e_cnt2++) {
|
||||
if (bkt1 == bkt2 && e_cnt2 <= e_cnt1) {
|
||||
// skip the entries up to and including the one that
|
||||
// we're comparing against
|
||||
continue;
|
||||
}
|
||||
|
||||
if (need_entry_verify) {
|
||||
VerifyRetTypes ret = verify_entry(bkt2, e_cnt2, e_ptr2,
|
||||
_verify_quietly);
|
||||
if (ret == _verify_fail_done) {
|
||||
// cannot compare against this entry
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// compare two entries, report and count any failures:
|
||||
if (compare_entries(bkt1, e_cnt1, e_ptr1, bkt2, e_cnt2, e_ptr2)
|
||||
!= _verify_pass) {
|
||||
fail_cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return fail_cnt;
|
||||
}
|
||||
|
||||
// Create a new table and using alternate hash code, populate the new table
|
||||
// with the existing strings. Set flag to use the alternate hash code afterwards.
|
||||
void StringTable::rehash_table() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
||||
// This should never happen with -Xshare:dump but it might in testing mode.
|
||||
if (DumpSharedSpaces) return;
|
||||
StringTable* new_table = new StringTable();
|
||||
|
||||
// Rehash the table
|
||||
the_table()->move_to(new_table);
|
||||
|
||||
// Delete the table and buckets (entries are reused in new table).
|
||||
delete _the_table;
|
||||
// Don't check if we need rehashing until the table gets unbalanced again.
|
||||
// Then rehash with a new global seed.
|
||||
_needs_rehashing = false;
|
||||
_the_table = new_table;
|
||||
}
|
||||
|
||||
@ -42,7 +42,6 @@
|
||||
class BoolObjectClosure;
|
||||
class outputStream;
|
||||
|
||||
|
||||
// Class to hold a newly created or referenced Symbol* temporarily in scope.
|
||||
// new_symbol() and lookup() will create a Symbol* if not already in the
|
||||
// symbol table and add to the symbol's reference count.
|
||||
@ -252,134 +251,4 @@ public:
|
||||
static int parallel_claimed_index() { return _parallel_claimed_idx; }
|
||||
};
|
||||
|
||||
class StringTable : public Hashtable<oop, mtSymbol> {
|
||||
friend class VMStructs;
|
||||
|
||||
private:
|
||||
// The string table
|
||||
static StringTable* _the_table;
|
||||
|
||||
// Set if one bucket is out of balance due to hash algorithm deficiency
|
||||
static bool _needs_rehashing;
|
||||
|
||||
// Claimed high water mark for parallel chunked scanning
|
||||
static volatile int _parallel_claimed_idx;
|
||||
|
||||
static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS);
|
||||
oop basic_add(int index, Handle string_or_null, jchar* name, int len,
|
||||
unsigned int hashValue, TRAPS);
|
||||
|
||||
oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
|
||||
|
||||
// Apply the give oop closure to the entries to the buckets
|
||||
// in the range [start_idx, end_idx).
|
||||
static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
|
||||
// Unlink or apply the give oop closure to the entries to the buckets
|
||||
// in the range [start_idx, end_idx).
|
||||
static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
|
||||
|
||||
StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
|
||||
sizeof (HashtableEntry<oop, mtSymbol>)) {}
|
||||
|
||||
StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
|
||||
: Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
|
||||
number_of_entries) {}
|
||||
public:
|
||||
// The string table
|
||||
static StringTable* the_table() { return _the_table; }
|
||||
|
||||
// Size of one bucket in the string table. Used when checking for rollover.
|
||||
static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
|
||||
|
||||
static void create_table() {
|
||||
assert(_the_table == NULL, "One string table allowed.");
|
||||
_the_table = new StringTable();
|
||||
}
|
||||
|
||||
// GC support
|
||||
// Delete pointers to otherwise-unreachable objects.
|
||||
static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f) {
|
||||
int processed = 0;
|
||||
int removed = 0;
|
||||
unlink_or_oops_do(cl, f, &processed, &removed);
|
||||
}
|
||||
static void unlink(BoolObjectClosure* cl) {
|
||||
int processed = 0;
|
||||
int removed = 0;
|
||||
unlink_or_oops_do(cl, NULL, &processed, &removed);
|
||||
}
|
||||
static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
|
||||
static void unlink(BoolObjectClosure* cl, int* processed, int* removed) {
|
||||
unlink_or_oops_do(cl, NULL, processed, removed);
|
||||
}
|
||||
// Serially invoke "f->do_oop" on the locations of all oops in the table.
|
||||
static void oops_do(OopClosure* f);
|
||||
|
||||
// Possibly parallel versions of the above
|
||||
static void possibly_parallel_unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
|
||||
static void possibly_parallel_unlink(BoolObjectClosure* cl, int* processed, int* removed) {
|
||||
possibly_parallel_unlink_or_oops_do(cl, NULL, processed, removed);
|
||||
}
|
||||
static void possibly_parallel_oops_do(OopClosure* f);
|
||||
|
||||
// Hashing algorithm, used as the hash value used by the
|
||||
// StringTable for bucket selection and comparison (stored in the
|
||||
// HashtableEntry structures). This is used in the String.intern() method.
|
||||
static unsigned int hash_string(const jchar* s, int len);
|
||||
|
||||
// Internal test.
|
||||
static void test_alt_hash() PRODUCT_RETURN;
|
||||
|
||||
// Probing
|
||||
static oop lookup(Symbol* symbol);
|
||||
static oop lookup(jchar* chars, int length);
|
||||
|
||||
// Interning
|
||||
static oop intern(Symbol* symbol, TRAPS);
|
||||
static oop intern(oop string, TRAPS);
|
||||
static oop intern(const char *utf8_string, TRAPS);
|
||||
|
||||
// Debugging
|
||||
static void verify();
|
||||
static void dump(outputStream* st);
|
||||
|
||||
enum VerifyMesgModes {
|
||||
_verify_quietly = 0,
|
||||
_verify_with_mesgs = 1
|
||||
};
|
||||
|
||||
enum VerifyRetTypes {
|
||||
_verify_pass = 0,
|
||||
_verify_fail_continue = 1,
|
||||
_verify_fail_done = 2
|
||||
};
|
||||
|
||||
static VerifyRetTypes compare_entries(int bkt1, int e_cnt1,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr1,
|
||||
int bkt2, int e_cnt2,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr2);
|
||||
static VerifyRetTypes verify_entry(int bkt, int e_cnt,
|
||||
HashtableEntry<oop, mtSymbol>* e_ptr,
|
||||
VerifyMesgModes mesg_mode);
|
||||
static int verify_and_compare_entries();
|
||||
|
||||
// Sharing
|
||||
static void copy_buckets(char** top, char*end) {
|
||||
the_table()->Hashtable<oop, mtSymbol>::copy_buckets(top, end);
|
||||
}
|
||||
static void copy_table(char** top, char*end) {
|
||||
the_table()->Hashtable<oop, mtSymbol>::copy_table(top, end);
|
||||
}
|
||||
static void reverse() {
|
||||
the_table()->Hashtable<oop, mtSymbol>::reverse();
|
||||
}
|
||||
|
||||
// Rehash the symbol table if it gets out of balance
|
||||
static void rehash_table();
|
||||
static bool needs_rehashing() { return _needs_rehashing; }
|
||||
|
||||
// Parallel chunked scanning
|
||||
static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; }
|
||||
static int parallel_claimed_index() { return _parallel_claimed_idx; }
|
||||
};
|
||||
#endif // SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "classfile/loaderConstraints.hpp"
|
||||
#include "classfile/placeholders.hpp"
|
||||
#include "classfile/resolutionErrors.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
@ -2269,7 +2270,7 @@ static methodHandle unpack_method_and_appendix(Handle mname,
|
||||
oop appendix = appendix_box->obj_at(0);
|
||||
if (TraceMethodHandles) {
|
||||
#ifndef PRODUCT
|
||||
tty->print("Linked method="INTPTR_FORMAT": ", m);
|
||||
tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m));
|
||||
m->print();
|
||||
if (appendix != NULL) { tty->print("appendix = "); appendix->print(); }
|
||||
tty->cr();
|
||||
|
||||
@ -364,7 +364,7 @@ void TypeOrigin::print_on(outputStream* str) const {
|
||||
|
||||
void ErrorContext::details(outputStream* ss, const Method* method) const {
|
||||
if (is_valid()) {
|
||||
ss->print_cr("");
|
||||
ss->cr();
|
||||
ss->print_cr("Exception Details:");
|
||||
location_details(ss, method);
|
||||
reason_details(ss);
|
||||
@ -379,7 +379,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
|
||||
streamIndentor si(ss);
|
||||
ss->indent().print_cr("Reason:");
|
||||
streamIndentor si2(ss);
|
||||
ss->indent().print("");
|
||||
ss->indent().print("%s", "");
|
||||
switch (_fault) {
|
||||
case INVALID_BYTECODE:
|
||||
ss->print("Error exists in the bytecode");
|
||||
@ -432,7 +432,7 @@ void ErrorContext::reason_details(outputStream* ss) const {
|
||||
ShouldNotReachHere();
|
||||
ss->print_cr("Unknown");
|
||||
}
|
||||
ss->print_cr("");
|
||||
ss->cr();
|
||||
}
|
||||
|
||||
void ErrorContext::location_details(outputStream* ss, const Method* method) const {
|
||||
@ -507,7 +507,7 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons
|
||||
for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
|
||||
ss->indent();
|
||||
sm_frame->print_on(ss, current_offset);
|
||||
ss->print_cr("");
|
||||
ss->cr();
|
||||
current_offset += sm_frame->offset_delta();
|
||||
sm_frame = sm_frame->next();
|
||||
}
|
||||
@ -579,7 +579,8 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
|
||||
tty->print_cr("Verifying method %s", m->name_and_sig_as_C_string());
|
||||
}
|
||||
|
||||
const char* bad_type_msg = "Bad type on operand stack in %s";
|
||||
// For clang, the only good constant format string is a literal constant format string.
|
||||
#define bad_type_msg "Bad type on operand stack in %s"
|
||||
|
||||
int32_t max_stack = m->verifier_max_stack();
|
||||
int32_t max_locals = m->max_locals();
|
||||
@ -1676,6 +1677,8 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
#undef bad_type_message
|
||||
|
||||
char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) {
|
||||
char* code_data = NEW_RESOURCE_ARRAY(char, code_length);
|
||||
memset(code_data, 0, sizeof(char) * code_length);
|
||||
@ -2363,8 +2366,8 @@ void ClassVerifier::verify_invoke_instructions(
|
||||
if (opcode == Bytecodes::_invokedynamic) {
|
||||
if (_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
|
||||
class_format_error(
|
||||
"invokedynamic instructions not supported by this class file version",
|
||||
_klass->external_name());
|
||||
"invokedynamic instructions not supported by this class file version (%d), class %s",
|
||||
_klass->major_version(), _klass->external_name());
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -375,15 +375,15 @@ class ClassVerifier : public StackObj {
|
||||
bool has_error() const { return result() != NULL; }
|
||||
char* exception_message() {
|
||||
stringStream ss;
|
||||
ss.print(_message);
|
||||
ss.print("%s", _message);
|
||||
_error_context.details(&ss, _method());
|
||||
return ss.as_string();
|
||||
}
|
||||
|
||||
// Called when verify or class format errors are encountered.
|
||||
// May throw an exception based upon the mode.
|
||||
void verify_error(ErrorContext ctx, const char* fmt, ...);
|
||||
void class_format_error(const char* fmt, ...);
|
||||
void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
|
||||
void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3);
|
||||
|
||||
Klass* load_class(Symbol* name, TRAPS);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -533,7 +533,7 @@ void vmIntrinsics::verify_method(ID actual_id, Method* m) {
|
||||
xtty->begin_elem("intrinsic_misdeclared actual='%s' declared='%s'",
|
||||
actual_name, declared_name);
|
||||
xtty->method(mh);
|
||||
xtty->end_elem("");
|
||||
xtty->end_elem("%s", "");
|
||||
}
|
||||
if (PrintMiscellaneous && (WizardMode || Verbose)) {
|
||||
tty->print_cr("*** misidentified method; %s(%d) should be %s(%d):",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -530,7 +530,7 @@ void CodeBlob::verify() {
|
||||
}
|
||||
|
||||
void CodeBlob::print_on(outputStream* st) const {
|
||||
st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
|
||||
st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this));
|
||||
st->print_cr("Framesize: %d", _frame_size);
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ void BufferBlob::print_on(outputStream* st) const {
|
||||
}
|
||||
|
||||
void BufferBlob::print_value_on(outputStream* st) const {
|
||||
st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", this, name());
|
||||
st->print_cr("BufferBlob (" INTPTR_FORMAT ") used for %s", p2i(this), name());
|
||||
}
|
||||
|
||||
void RuntimeStub::verify() {
|
||||
@ -558,13 +558,13 @@ void RuntimeStub::verify() {
|
||||
void RuntimeStub::print_on(outputStream* st) const {
|
||||
ttyLocker ttyl;
|
||||
CodeBlob::print_on(st);
|
||||
st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
|
||||
st->print_cr(name());
|
||||
st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this));
|
||||
st->print_cr("%s", name());
|
||||
Disassembler::decode((CodeBlob*)this, st);
|
||||
}
|
||||
|
||||
void RuntimeStub::print_value_on(outputStream* st) const {
|
||||
st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
|
||||
st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name());
|
||||
}
|
||||
|
||||
void SingletonBlob::verify() {
|
||||
@ -574,12 +574,12 @@ void SingletonBlob::verify() {
|
||||
void SingletonBlob::print_on(outputStream* st) const {
|
||||
ttyLocker ttyl;
|
||||
CodeBlob::print_on(st);
|
||||
st->print_cr(name());
|
||||
st->print_cr("%s", name());
|
||||
Disassembler::decode((CodeBlob*)this, st);
|
||||
}
|
||||
|
||||
void SingletonBlob::print_value_on(outputStream* st) const {
|
||||
st->print_cr(name());
|
||||
st->print_cr("%s", name());
|
||||
}
|
||||
|
||||
void DeoptimizationBlob::print_value_on(outputStream* st) const {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -81,10 +81,10 @@ class CodeBlob_sizes {
|
||||
bool is_empty() { return count == 0; }
|
||||
|
||||
void print(const char* title) {
|
||||
tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])",
|
||||
tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])",
|
||||
count,
|
||||
title,
|
||||
total() / K,
|
||||
(int)(total() / K),
|
||||
header_size * 100 / total_size,
|
||||
relocation_size * 100 / total_size,
|
||||
code_size * 100 / total_size,
|
||||
@ -178,10 +178,12 @@ CodeBlob* CodeCache::allocate(int size, bool is_critical) {
|
||||
// cache will contain a garbage CodeBlob until the caller can
|
||||
// run the constructor for the CodeBlob subclass he is busy
|
||||
// instantiating.
|
||||
guarantee(size >= 0, "allocation request must be reasonable");
|
||||
assert_locked_or_safepoint(CodeCache_lock);
|
||||
assert(size > 0, "allocation request must be reasonable");
|
||||
if (size <= 0) {
|
||||
return NULL;
|
||||
}
|
||||
CodeBlob* cb = NULL;
|
||||
_number_of_blobs++;
|
||||
while (true) {
|
||||
cb = (CodeBlob*)_heap->allocate(size, is_critical);
|
||||
if (cb != NULL) break;
|
||||
@ -191,7 +193,7 @@ CodeBlob* CodeCache::allocate(int size, bool is_critical) {
|
||||
}
|
||||
if (PrintCodeCacheExtension) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
|
||||
tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
|
||||
(intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(),
|
||||
(address)_heap->high() - (address)_heap->low_boundary());
|
||||
}
|
||||
@ -199,6 +201,7 @@ CodeBlob* CodeCache::allocate(int size, bool is_critical) {
|
||||
maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() -
|
||||
(address)_heap->low_boundary()) - unallocated_capacity());
|
||||
print_trace("allocation", cb, size);
|
||||
_number_of_blobs++;
|
||||
return cb;
|
||||
}
|
||||
|
||||
@ -487,7 +490,7 @@ void CodeCache::gc_epilogue() {
|
||||
if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
|
||||
CompiledIC *ic = CompiledIC_at(iter.reloc());
|
||||
if (TraceCompiledIC) {
|
||||
tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder());
|
||||
tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
|
||||
ic->print();
|
||||
}
|
||||
assert(ic->cached_icholder() != NULL, "must be non-NULL");
|
||||
@ -741,10 +744,10 @@ void CodeCache::print_memory_overhead() {
|
||||
}
|
||||
// Print bytes that are allocated in the freelist
|
||||
ttyLocker ttl;
|
||||
tty->print_cr("Number of elements in freelist: %d", freelist_length());
|
||||
tty->print_cr("Allocated in freelist: %dkB", bytes_allocated_in_freelist()/K);
|
||||
tty->print_cr("Unused bytes in CodeBlobs: %dkB", (int)(wasted_bytes/K));
|
||||
tty->print_cr("Segment map size: %dkB", allocated_segments()/K); // 1 byte per segment
|
||||
tty->print_cr("Number of elements in freelist: " SSIZE_FORMAT, freelist_length());
|
||||
tty->print_cr("Allocated in freelist: " SSIZE_FORMAT "kB", bytes_allocated_in_freelist()/K);
|
||||
tty->print_cr("Unused bytes in CodeBlobs: " SSIZE_FORMAT "kB", (wasted_bytes/K));
|
||||
tty->print_cr("Segment map size: " SSIZE_FORMAT "kB", allocated_segments()/K); // 1 byte per segment
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
@ -756,7 +759,7 @@ void CodeCache::print_trace(const char* event, CodeBlob* cb, int size) {
|
||||
if (PrintCodeCache2) { // Need to add a new flag
|
||||
ResourceMark rm;
|
||||
if (size == 0) size = cb->size();
|
||||
tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size);
|
||||
tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -926,9 +929,9 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
|
||||
|
||||
if (detailed) {
|
||||
st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
|
||||
_heap->low_boundary(),
|
||||
_heap->high(),
|
||||
_heap->high_boundary());
|
||||
p2i(_heap->low_boundary()),
|
||||
p2i(_heap->high()),
|
||||
p2i(_heap->high_boundary()));
|
||||
st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
|
||||
" adapters=" UINT32_FORMAT,
|
||||
nof_blobs(), nof_nmethods(), nof_adapters());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -88,9 +88,9 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub
|
||||
if (TraceCompiledIC) {
|
||||
tty->print(" ");
|
||||
print_compiled_ic();
|
||||
tty->print(" changing destination to " INTPTR_FORMAT, entry_point);
|
||||
tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point));
|
||||
if (!is_optimized()) {
|
||||
tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", (address)cache);
|
||||
tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache));
|
||||
}
|
||||
if (is_icstub) {
|
||||
tty->print(" (icstub)");
|
||||
@ -195,7 +195,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
if (TraceICs) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
|
||||
instruction_address(), call_info->selected_method()->print_value_string(), entry);
|
||||
p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
|
||||
}
|
||||
|
||||
// We can't check this anymore. With lazy deopt we could have already
|
||||
@ -272,7 +272,7 @@ bool CompiledIC::is_call_to_interpreted() const {
|
||||
void CompiledIC::set_to_clean() {
|
||||
assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call");
|
||||
if (TraceInlineCacheClearing || TraceICs) {
|
||||
tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", instruction_address());
|
||||
tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address()));
|
||||
print();
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
if (TraceICs) {
|
||||
ResourceMark rm(thread);
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s",
|
||||
instruction_address(),
|
||||
p2i(instruction_address()),
|
||||
method->print_value_string());
|
||||
}
|
||||
} else {
|
||||
@ -362,7 +362,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());
|
||||
if (TraceICs) {
|
||||
ResourceMark rm(thread);
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", instruction_address());
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -392,7 +392,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
ResourceMark rm(thread);
|
||||
assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s",
|
||||
instruction_address(),
|
||||
p2i(instruction_address()),
|
||||
((Klass*)info.cached_metadata())->print_value_string(),
|
||||
(safe) ? "" : "via stub");
|
||||
}
|
||||
@ -530,8 +530,8 @@ void CompiledStaticCall::set(const StaticCallInfo& info) {
|
||||
if (TraceICs) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT,
|
||||
instruction_address(),
|
||||
info.entry());
|
||||
p2i(instruction_address()),
|
||||
p2i(info.entry()));
|
||||
}
|
||||
// Call to compiled code
|
||||
assert (CodeCache::contains(info.entry()), "wrong entry point");
|
||||
@ -600,11 +600,11 @@ void CompiledIC::print() {
|
||||
|
||||
void CompiledIC::print_compiled_ic() {
|
||||
tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT,
|
||||
instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination(), is_optimized() ? NULL : cached_value());
|
||||
p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value()));
|
||||
}
|
||||
|
||||
void CompiledStaticCall::print() {
|
||||
tty->print("static call at " INTPTR_FORMAT " -> ", instruction_address());
|
||||
tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address()));
|
||||
if (is_clean()) {
|
||||
tty->print("clean");
|
||||
} else if (is_call_to_compiled()) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -212,6 +212,8 @@ static jlong stretch(jint x, int bits) {
|
||||
return h ^ l;
|
||||
}
|
||||
|
||||
PRAGMA_DIAG_PUSH
|
||||
PRAGMA_FORMAT_IGNORED // Someone needs to deal with this.
|
||||
void test_compressed_stream(int trace) {
|
||||
CompressedWriteStream bytes(stretch_limit * 100);
|
||||
jint n;
|
||||
@ -275,6 +277,7 @@ void test_compressed_stream(int trace) {
|
||||
guarantee(length == length2, "bad length");
|
||||
guarantee(fails == 0, "test failures");
|
||||
}
|
||||
PRAGMA_DIAG_POP
|
||||
|
||||
#if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64)
|
||||
#pragma warning(default: 4748)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,9 @@
|
||||
#include "code/nmethod.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
// Comstructors
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// Constructors
|
||||
|
||||
DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size)
|
||||
: CompressedWriteStream(initial_size) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,6 +27,8 @@
|
||||
#include "code/nmethod.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
|
||||
_nesting.check();
|
||||
if (_length >= _size) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,6 +39,7 @@
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
DEF_STUB_INTERFACE(ICStub);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -48,6 +48,8 @@
|
||||
#include "shark/sharkCompiler.hpp"
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
#ifdef DTRACE_ENABLED
|
||||
|
||||
// Only bother with this argument setup if dtrace is available
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,6 +29,8 @@
|
||||
#include "code/scopeDesc.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
|
||||
_pc_offset = pc_offset;
|
||||
_scope_decode_offset = scope_decode_offset;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,6 +31,7 @@
|
||||
#include "runtime/stubCodeGenerator.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,6 +30,7 @@
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
|
||||
_code = code;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,6 +39,8 @@
|
||||
#include "opto/matcher.hpp"
|
||||
#endif
|
||||
|
||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// Implementation of VtableStub
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -172,7 +172,7 @@ class CompilationLog : public StringEventLog {
|
||||
void log_nmethod(JavaThread* thread, nmethod* nm) {
|
||||
log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]",
|
||||
nm->compile_id(), nm->is_osr_method() ? "%" : "",
|
||||
nm, nm->code_begin(), nm->code_end());
|
||||
p2i(nm), p2i(nm->code_begin()), p2i(nm->code_end()));
|
||||
}
|
||||
|
||||
void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) {
|
||||
@ -704,13 +704,39 @@ CompileTask* CompileQueue::get() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CompileTask* task = CompilationPolicy::policy()->select_task(this);
|
||||
CompileTask* task;
|
||||
{
|
||||
No_Safepoint_Verifier nsv;
|
||||
task = CompilationPolicy::policy()->select_task(this);
|
||||
}
|
||||
remove(task);
|
||||
purge_stale_tasks(); // may temporarily release MCQ lock
|
||||
return task;
|
||||
}
|
||||
|
||||
void CompileQueue::remove(CompileTask* task)
|
||||
{
|
||||
// Clean & deallocate stale compile tasks.
|
||||
// Temporarily releases MethodCompileQueue lock.
|
||||
void CompileQueue::purge_stale_tasks() {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
if (_first_stale != NULL) {
|
||||
// Stale tasks are purged when MCQ lock is released,
|
||||
// but _first_stale updates are protected by MCQ lock.
|
||||
// Once task processing starts and MCQ lock is released,
|
||||
// other compiler threads can reuse _first_stale.
|
||||
CompileTask* head = _first_stale;
|
||||
_first_stale = NULL;
|
||||
{
|
||||
MutexUnlocker ul(lock());
|
||||
for (CompileTask* task = head; task != NULL; ) {
|
||||
CompileTask* next_task = task->next();
|
||||
CompileTaskWrapper ctw(task); // Frees the task
|
||||
task = next_task;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CompileQueue::remove(CompileTask* task) {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
if (task->prev() != NULL) {
|
||||
task->prev()->set_next(task->next());
|
||||
@ -730,6 +756,16 @@ void CompileQueue::remove(CompileTask* task)
|
||||
--_size;
|
||||
}
|
||||
|
||||
void CompileQueue::remove_and_mark_stale(CompileTask* task) {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
remove(task);
|
||||
|
||||
// Enqueue the task for reclamation (should be done outside MCQ lock)
|
||||
task->set_next(_first_stale);
|
||||
task->set_prev(NULL);
|
||||
_first_stale = task;
|
||||
}
|
||||
|
||||
// methods in the compile queue need to be marked as used on the stack
|
||||
// so that they don't get reclaimed by Redefine Classes
|
||||
void CompileQueue::mark_on_stack() {
|
||||
@ -1786,7 +1822,7 @@ void CompileBroker::init_compiler_thread_log() {
|
||||
if (xtty != NULL) {
|
||||
ttyLocker ttyl;
|
||||
// Record any per thread log files
|
||||
xtty->elem("thread_logfile thread='%d' filename='%s'", thread_id, file_name);
|
||||
xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1817,7 +1853,7 @@ void CompileBroker::maybe_block() {
|
||||
if (_should_block) {
|
||||
#ifndef PRODUCT
|
||||
if (PrintCompilation && (Verbose || WizardMode))
|
||||
tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", Thread::current());
|
||||
tty->print_cr("compiler thread " INTPTR_FORMAT " poll detects block request", p2i(Thread::current()));
|
||||
#endif
|
||||
ThreadInVMfromNative tivfn(JavaThread::current());
|
||||
}
|
||||
@ -1834,7 +1870,7 @@ static void codecache_print(bool detailed)
|
||||
CodeCache::print_summary(&s, detailed);
|
||||
}
|
||||
ttyLocker ttyl;
|
||||
tty->print(s.as_string());
|
||||
tty->print("%s", s.as_string());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@ -2006,7 +2042,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
|
||||
// Note that the queued_for_compilation bits are cleared without
|
||||
// protection of a mutex. [They were set by the requester thread,
|
||||
// when adding the task to the complie queue -- at which time the
|
||||
// when adding the task to the compile queue -- at which time the
|
||||
// compile queue lock was held. Subsequently, we acquired the compile
|
||||
// queue lock to get this task off the compile queue; thus (to belabour
|
||||
// the point somewhat) our clearing of the bits must be occurring
|
||||
@ -2039,7 +2075,7 @@ void CompileBroker::handle_full_code_cache() {
|
||||
// Lock to prevent tearing
|
||||
ttyLocker ttyl;
|
||||
xtty->begin_elem("code_cache_full");
|
||||
xtty->print(s.as_string());
|
||||
xtty->print("%s", s.as_string());
|
||||
xtty->stamp();
|
||||
xtty->end_elem();
|
||||
}
|
||||
|
||||
@ -196,7 +196,11 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
||||
CompileTask* _first;
|
||||
CompileTask* _last;
|
||||
|
||||
CompileTask* _first_stale;
|
||||
|
||||
int _size;
|
||||
|
||||
void purge_stale_tasks();
|
||||
public:
|
||||
CompileQueue(const char* name, Monitor* lock) {
|
||||
_name = name;
|
||||
@ -204,6 +208,7 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
||||
_first = NULL;
|
||||
_last = NULL;
|
||||
_size = 0;
|
||||
_first_stale = NULL;
|
||||
}
|
||||
|
||||
const char* name() const { return _name; }
|
||||
@ -211,6 +216,7 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
||||
|
||||
void add(CompileTask* task);
|
||||
void remove(CompileTask* task);
|
||||
void remove_and_mark_stale(CompileTask* task);
|
||||
CompileTask* first() { return _first; }
|
||||
CompileTask* last() { return _last; }
|
||||
|
||||
@ -219,6 +225,7 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
||||
bool is_empty() const { return _first == NULL; }
|
||||
int size() const { return _size; }
|
||||
|
||||
|
||||
// Redefine Classes support
|
||||
void mark_on_stack();
|
||||
void free_all();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -174,9 +174,9 @@ void CompileLog::name(ciSymbol* name) {
|
||||
void CompileLog::name(ciKlass* k) {
|
||||
print(" name='");
|
||||
if (!k->is_loaded()) {
|
||||
text()->print(k->name()->as_klass_external_name());
|
||||
text()->print("%s", k->name()->as_klass_external_name());
|
||||
} else {
|
||||
text()->print(k->external_name());
|
||||
text()->print("%s", k->external_name());
|
||||
}
|
||||
print("'");
|
||||
}
|
||||
@ -303,7 +303,7 @@ void CompileLog::finish_log(outputStream* file) {
|
||||
// Print about successful method inlining.
|
||||
void CompileLog::inline_success(const char* reason) {
|
||||
begin_elem("inline_success reason='");
|
||||
text(reason);
|
||||
text("%s", reason);
|
||||
end_elem("'");
|
||||
}
|
||||
|
||||
@ -313,7 +313,7 @@ void CompileLog::inline_success(const char* reason) {
|
||||
// Print about failed method inlining.
|
||||
void CompileLog::inline_fail(const char* reason) {
|
||||
begin_elem("inline_fail reason='");
|
||||
text(reason);
|
||||
text("%s", reason);
|
||||
end_elem("'");
|
||||
}
|
||||
|
||||
@ -339,5 +339,5 @@ void CompileLog::set_context(const char* format, ...) {
|
||||
void CompileLog::code_cache_state() {
|
||||
begin_elem("code_cache");
|
||||
CodeCache::log_state(this);
|
||||
end_elem("");
|
||||
end_elem("%s", "");
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user