This commit is contained in:
David Holmes 2012-01-25 19:26:35 -05:00
commit ff8aa96e68
375 changed files with 20363 additions and 1975 deletions

View File

@ -140,3 +140,7 @@ b5060eae3b32fd9f884a09774338cd8186d7fafa jdk8-b15
736a63b854f321c7824b7e47890135f80aee05e3 jdk8-b16
f0eccb2946986fb9626efde7d8ed9c8192623f5c jdk8-b17
885050364691ac1ac978305c63f3368a197fb04d jdk8-b18
0ff7113a0882ec82d642cb9f0297b4e497807ced jdk8-b19
6561530ea757c3f3a6fb171c9cc7b3885cdeca85 jdk8-b20
b3a426170188f52981cf4573a2f14d487fddab0d jdk8-b21
e8f03541af27e38aafb619b96863e17f65ffe53b jdk8-b22

View File

@ -140,3 +140,7 @@ a4f28069d44a379cda99dd1d921d19f819726d22 jdk8-b15
4e06ae613e99549835896720c7a68c29ad5543f5 jdk8-b17
4e06ae613e99549835896720c7a68c29ad5543f5 jdk8-b16
7010bd24cdd07bc7daef80702f39124854dec36c jdk8-b18
237bc29afbfc6f56a4fe4a6008e2befb59c44bac jdk8-b19
5a5eaf6374bcbe23530899579fed17a05b7705f3 jdk8-b20
cc771d92284f71765eca14d6d08703c4af254c04 jdk8-b21
7ad075c809952e355d25030605da6af30456ed74 jdk8-b22

View File

@ -140,3 +140,7 @@ e59c47de1ad8982ff3b0e843773a6902b36c2337 jdk8-b14
82dc033975bb9b553b4ef97b6d483eda8de32e0f jdk8-b17
82dc033975bb9b553b4ef97b6d483eda8de32e0f jdk8-b16
312cf15d16577ef198b033d2a4cc0a52369b7343 jdk8-b18
e1366c5d84ef984095a332bcee70b3938232d07d jdk8-b19
51d8b6cb18c0978ecfa4f33e1537d35ee01b69fa jdk8-b20
f157fc2a71a38ce44007a6f18d5b011824dce705 jdk8-b21
a11d0062c445d5f36651c78650ab88aa594bcbff jdk8-b22

View File

@ -207,3 +207,9 @@ d1f29d4e0bc60e8bd7ae961f1306d8ab33290212 jdk8-b16
a2fef924d8e6f37dac2a887315e3502876cc8e24 hs23-b08
61165f53f1656b9f99e4fb806429bf98b99d59c3 jdk8-b18
4bcf61041217f8677dcec18e90e9196acc945bba hs23-b09
9232e0ecbc2cec54dcc8f93004fb00c214446460 jdk8-b19
fe2c8764998112b7fefcd7d41599714813ae4327 jdk8-b20
9952d1c439d64c5fd4ad1236a63a62bd5a49d4c3 jdk8-b21
513351373923f74a7c91755748b95c9771e59f96 hs23-b10
24727fb37561779077fdfa5a33342246f20e5c0f jdk8-b22
dcc292399a39113957eebbd3e487b7e05e2c79fc hs23-b11

View File

@ -367,7 +367,7 @@ endif
$(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
$(install-file)
# Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h)
# Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h, jfr.h)
$(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
$(install-file)
@ -384,6 +384,16 @@ $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC)
$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
$(install-file)
JFR_EXISTS=$(shell if [ -d $(HS_ALT_SRC) ]; then echo 1; else echo 0; fi)
# export jfr.h
ifeq ($JFR_EXISTS,1)
$(EXPORT_INCLUDE_DIR)/%: $(HS_ALT_SRC)/share/vm/jfr/agent/%
$(install-file)
else
$(EXPORT_INCLUDE_DIR)/jfr.h:
endif
# Doc files (jvmti.html)
$(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
$(install-file)

View File

@ -96,6 +96,10 @@ ifdef DEFAULT_LIBPATH
CPPFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\""
endif
ifndef JAVASE_EMBEDDED
CFLAGS += -DINCLUDE_TRACE
endif
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
CFLAGS += $(CFLAGS_WARN/BYFILE)
@ -147,6 +151,12 @@ SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
ifndef JAVASE_EMBEDDED
SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
find $(HS_ALT_SRC)/share/vm/jfr -type d; \
fi)
endif
CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
CORE_PATHS+=$(GENERATED)/jvmtifiles

View File

@ -294,3 +294,7 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
ifndef JAVASE_EMBEDDED
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
endif

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=23
HS_MINOR_VER=0
HS_BUILD_NUMBER=10
HS_BUILD_NUMBER=12
JDK_MAJOR_VER=1
JDK_MINOR_VER=8

View File

@ -98,6 +98,10 @@ CPPFLAGS = \
${JRE_VERSION} \
${VM_DISTRO}
ifndef JAVASE_EMBEDDED
CFLAGS += -DINCLUDE_TRACE
endif
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
CFLAGS += $(CFLAGS_WARN/BYFILE)
@ -143,6 +147,12 @@ SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
ifndef JAVASE_EMBEDDED
SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
find $(HS_ALT_SRC)/share/vm/jfr -type d; \
fi)
endif
CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
CORE_PATHS+=$(GENERATED)/jvmtifiles

View File

@ -93,7 +93,7 @@ CFLAGS += $(CFLAGS_WARN)
CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
CFLAGS += $(EXTRA_CFLAGS)
CFLAGS += $(EXTRA_CFLAGS) -DINCLUDE_TRACE
# Math Library (libm.so), do not use -lm.
# There might be two versions of libm.so on the build system:
@ -160,6 +160,10 @@ SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
find $(HS_ALT_SRC)/share/vm/jfr -type d; \
fi)
CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
CORE_PATHS+=$(GENERATED)/jvmtifiles

View File

@ -35,6 +35,8 @@ cl 2>&1 | grep "IA-64" >NUL
if %errorlevel% == 0 goto isia64
cl 2>&1 | grep "AMD64" >NUL
if %errorlevel% == 0 goto amd64
cl 2>&1 | grep "x64" >NUL
if %errorlevel% == 0 goto amd64
set ARCH=x86
set BUILDARCH=i486
set Platform_arch=x86

View File

@ -73,6 +73,13 @@ done
BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles"
if [ -d "${ALTSRC}/share/vm/jfr" ]; then
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/agent"
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/agent/isolated_deps/util"
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/jvm"
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr"
fi
CORE_PATHS="${BASE_PATHS}"
# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then

View File

@ -58,7 +58,8 @@ ProjectCreatorIncludesPRIVATE=\
-absoluteInclude $(HOTSPOTBUILDSPACE)/%f/generated \
-ignorePath $(HOTSPOTBUILDSPACE)/%f/generated \
-ignorePath src\share\vm\adlc \
-ignorePath src\share\vm\shark
-ignorePath src\share\vm\shark \
-ignorePath posix
# This is referenced externally by both the IDE and batch builds
ProjectCreatorOptions=
@ -88,7 +89,7 @@ ProjectCreatorIDEOptions=\
-jdkTargetRoot $(HOTSPOTJDKDIST) \
-define ALIGN_STACK_FRAMES \
-define VM_LITTLE_ENDIAN \
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
-postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \
-ignoreFile jsig.c \
-ignoreFile jvmtiEnvRecommended.cpp \

View File

@ -19,7 +19,7 @@
# 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.
#
#
#
# Resource file containing VERSIONINFO
@ -30,7 +30,7 @@ Res_Files=.\version.res
COMMONSRC=$(WorkSpace)\src
ALTSRC=$(WorkSpace)\src\closed
!ifdef RELEASE
!ifdef RELEASE
!ifdef DEVELOP
CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG"
!else
@ -74,6 +74,10 @@ CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\""
!ifndef JAVASE_EMBEDDED
CPP_FLAGS=$(CPP_FLAGS) /D "INCLUDE_TRACE"
!endif
CPP_FLAGS=$(CPP_FLAGS) $(CPP_INCLUDE_DIRS)
# Define that so jni.h is on correct side
@ -97,7 +101,7 @@ AGCT_EXPORT=/export:AsyncGetCallTrace
!endif
# If you modify exports below please do the corresponding changes in
# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \
/export:JNI_GetDefaultJavaVMInitArgs \
/export:JNI_CreateJavaVM \
@ -170,6 +174,7 @@ VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/oops
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/prims
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/runtime
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/services
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/trace
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/utilities
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/libadt
VM_PATH=$(VM_PATH);$(WorkSpace)/src/os/windows/vm
@ -177,6 +182,13 @@ VM_PATH=$(VM_PATH);$(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm
VM_PATH=$(VM_PATH);$(WorkSpace)/src/cpu/$(Platform_arch)/vm
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/opto
!if exists($(ALTSRC)\share\vm\jfr)
VM_PATH=$(VM_PATH);$(ALTSRC)/share/vm/jfr/agent
VM_PATH=$(VM_PATH);$(ALTSRC)/share/vm/jfr/agent/isolated_deps/util
VM_PATH=$(VM_PATH);$(ALTSRC)/share/vm/jfr/jvm
VM_PATH=$(VM_PATH);$(ALTSRC)/share/vm/jfr
!endif
VM_PATH={$(VM_PATH)}
# Special case files not using precompiled header files.
@ -263,6 +275,9 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi
{$(COMMONSRC)\share\vm\services}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(COMMONSRC)\share\vm\trace}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(COMMONSRC)\share\vm\utilities}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
@ -340,6 +355,9 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi
{$(ALTSRC)\share\vm\services}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(ALTSRC)\share\vm\trace}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(ALTSRC)\share\vm\utilities}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
@ -371,6 +389,18 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi
{..\generated\jvmtifiles}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(ALTSRC)\share\vm\jfr}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(ALTSRC)\share\vm\jfr\agent}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(ALTSRC)\share\vm\jfr\agent\isolated_deps\util}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
{$(ALTSRC)\share\vm\jfr\jvm}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
default::
_build_pch_file.obj:

View File

@ -391,7 +391,7 @@ int LIR_Assembler::emit_exception_handler() {
__ call(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id), relocInfo::runtime_call_type);
__ delayed()->nop();
__ should_not_reach_here();
assert(code_offset() - offset <= exception_handler_size, "overflow");
guarantee(code_offset() - offset <= exception_handler_size, "overflow");
__ end_a_stub();
return offset;
@ -474,8 +474,7 @@ int LIR_Assembler::emit_deopt_handler() {
AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
__ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp
__ delayed()->nop();
assert(code_offset() - offset <= deopt_handler_size, "overflow");
debug_only(__ stop("should have gone to the caller");)
guarantee(code_offset() - offset <= deopt_handler_size, "overflow");
__ end_a_stub();
return offset;

View File

@ -69,7 +69,7 @@ enum {
#else
call_stub_size = 20,
#endif // _LP64
exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4),
deopt_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4) };
exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(128),
deopt_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(64) };
#endif // CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -82,6 +82,8 @@ inline address* frame::O0_addr() const { return (address*) &younger_sp()[ I0->s
inline intptr_t* frame::sender_sp() const { return fp(); }
inline intptr_t* frame::real_fp() const { return fp(); }
// Used only in frame::oopmapreg_to_location
// This return a value in VMRegImpl::slot_size
inline int frame::pd_oop_map_offset_adjustment() const {

View File

@ -1045,7 +1045,7 @@ int MethodHandles::adapter_conversion_ops_supported_mask() {
|(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
// OP_COLLECT_ARGS is below...
|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS)
|(!UseRicochetFrames ? 0 :
|(
java_lang_invoke_MethodTypeForm::vmlayout_offset_in_bytes() <= 0 ? 0 :
((1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS)

View File

@ -406,7 +406,7 @@ int LIR_Assembler::emit_exception_handler() {
// search an exception handler (rax: exception oop, rdx: throwing pc)
__ call(RuntimeAddress(Runtime1::entry_for(Runtime1::handle_exception_from_callee_id)));
__ should_not_reach_here();
assert(code_offset() - offset <= exception_handler_size, "overflow");
guarantee(code_offset() - offset <= exception_handler_size, "overflow");
__ end_a_stub();
return offset;
@ -490,8 +490,7 @@ int LIR_Assembler::emit_deopt_handler() {
__ pushptr(here.addr());
__ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack()));
assert(code_offset() - offset <= deopt_handler_size, "overflow");
guarantee(code_offset() - offset <= deopt_handler_size, "overflow");
__ end_a_stub();
return offset;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -675,3 +675,21 @@ intptr_t *frame::initial_deoptimization_info() {
// used to reset the saved FP
return fp();
}
intptr_t* frame::real_fp() const {
if (_cb != NULL) {
// use the frame size if valid
int size = _cb->frame_size();
if ((size > 0) &&
(! is_ricochet_frame())) {
// Work-around: ricochet explicitly excluded because frame size is not
// constant for the ricochet blob but its frame_size could not, for
// some reasons, be declared as <= 0. This potentially confusing
// size declaration should be fixed as another CR.
return unextended_sp() + size;
}
}
// else rely on fp()
assert(! is_compiled_frame(), "unknown compiled frame size");
return fp();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -188,6 +188,7 @@
frame(intptr_t* sp, intptr_t* fp);
// accessors for the instance variables
// Note: not necessarily the real 'frame pointer' (see real_fp)
intptr_t* fp() const { return _fp; }
inline address* sender_pc_addr() const;

View File

@ -1005,7 +1005,7 @@ void trace_method_handle_stub(const char* adaptername,
intptr_t* base_sp = last_sp;
typedef MethodHandles::RicochetFrame RicochetFrame;
RicochetFrame* rfp = (RicochetFrame*)((address)saved_bp - RicochetFrame::sender_link_offset_in_bytes());
if (!UseRicochetFrames || Universe::heap()->is_in((address) rfp->saved_args_base())) {
if (Universe::heap()->is_in((address) rfp->saved_args_base())) {
// Probably an interpreter frame.
base_sp = (intptr_t*) saved_bp[frame::interpreter_frame_monitor_block_top_offset];
}
@ -1104,7 +1104,7 @@ int MethodHandles::adapter_conversion_ops_supported_mask() {
|(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
//OP_COLLECT_ARGS is below...
|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS)
|(!UseRicochetFrames ? 0 :
|(
java_lang_invoke_MethodTypeForm::vmlayout_offset_in_bytes() <= 0 ? 0 :
((1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF)
|(1<<java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -72,6 +72,10 @@ inline intptr_t* frame::sender_sp() const {
return fp() + 1;
}
inline intptr_t* frame::real_fp() const {
return fp();
}
inline intptr_t* frame::link() const {
ShouldNotCallThis();
}

View File

@ -29,43 +29,3 @@ enum /* platform_dependent_constants */ {
adapter_code_size = 0
};
#define TARGET_ARCH_NYI_6939861 1
// ..#ifdef TARGET_ARCH_NYI_6939861
// .. // Here are some backward compatible declarations until the 6939861 ports are updated.
// .. #define _adapter_flyby (_EK_LIMIT + 10)
// .. #define _adapter_ricochet (_EK_LIMIT + 11)
// .. #define _adapter_opt_spread_1 _adapter_opt_spread_1_ref
// .. #define _adapter_opt_spread_more _adapter_opt_spread_ref
// .. enum {
// .. _INSERT_NO_MASK = -1,
// .. _INSERT_REF_MASK = 0,
// .. _INSERT_INT_MASK = 1,
// .. _INSERT_LONG_MASK = 3
// .. };
// .. static void get_ek_bound_mh_info(EntryKind ek, BasicType& arg_type, int& arg_mask, int& arg_slots) {
// .. arg_type = ek_bound_mh_arg_type(ek);
// .. arg_mask = 0;
// .. arg_slots = type2size[arg_type];;
// .. }
// .. static void get_ek_adapter_opt_swap_rot_info(EntryKind ek, int& swap_bytes, int& rotate) {
// .. int swap_slots = ek_adapter_opt_swap_slots(ek);
// .. rotate = ek_adapter_opt_swap_mode(ek);
// .. swap_bytes = swap_slots * Interpreter::stackElementSize;
// .. }
// .. static int get_ek_adapter_opt_spread_info(EntryKind ek) {
// .. return ek_adapter_opt_spread_count(ek);
// .. }
// ..
// .. static void insert_arg_slots(MacroAssembler* _masm,
// .. RegisterOrConstant arg_slots,
// .. int arg_mask,
// .. Register argslot_reg,
// .. Register temp_reg, Register temp2_reg, Register temp3_reg = noreg);
// ..
// .. static void remove_arg_slots(MacroAssembler* _masm,
// .. RegisterOrConstant arg_slots,
// .. Register argslot_reg,
// .. Register temp_reg, Register temp2_reg, Register temp3_reg = noreg);
// ..
// .. static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
// ..#endif //TARGET_ARCH_NYI_6939861

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2011, 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"
#ifdef __APPLE__
#include "decoder_machO.hpp"
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
@ -22,45 +22,21 @@
*
*/
#include "prims/jvm.h"
#include "utilities/decoder.hpp"
#include <cxxabi.h>
#ifndef OS_BSD_VM_DECODER_MACHO_HPP
#define OS_BSD_VM_DECODER_MACHO_HPP
#ifdef __APPLE__
void Decoder::initialize() {
_initialized = true;
}
void Decoder::uninitialize() {
_initialized = false;
}
bool Decoder::can_decode_C_frame_in_vm() {
return false;
}
Decoder::decoder_status Decoder::decode(address addr, const char* filepath, char *buf, int buflen, int *offset) {
return symbol_not_found;
}
#include "utilities/decoder.hpp"
// Just a placehold for now
class MachODecoder: public NullDecoder {
public:
MachODecoder() { }
~MachODecoder() { }
};
#endif
bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
int status;
char* result;
size_t size = (size_t)buflen;
#endif // OS_BSD_VM_DECODER_MACHO_HPP
// Don't pass buf to __cxa_demangle. In case of the 'buf' is too small,
// __cxa_demangle will call system "realloc" for additional memory, which
// may use different malloc/realloc mechanism that allocates 'buf'.
if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) {
jio_snprintf(buf, buflen, "%s", result);
// call c library's free
::free(result);
return true;
}
return false;
}

View File

@ -1920,7 +1920,7 @@ bool os::dll_address_to_function_name(address addr, char *buf,
return true;
} else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
buf, buflen, offset, dlinfo.dli_fname)) {
return true;
}
}

View File

@ -23,11 +23,11 @@
*/
#include "prims/jvm.h"
#include "utilities/decoder.hpp"
#include "utilities/decoder_elf.hpp"
#include <cxxabi.h>
bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) {
int status;
char* result;
size_t size = (size_t)buflen;
@ -43,3 +43,4 @@ bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
}
return false;
}

View File

@ -1732,7 +1732,7 @@ bool os::dll_address_to_function_name(address addr, char *buf,
return true;
} else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
buf, buflen, offset, dlinfo.dli_fname)) {
return true;
}
}

View File

@ -22,10 +22,11 @@
*
*/
#include "utilities/decoder.hpp"
#include "utilities/decoder_elf.hpp"
#include <demangle.h>
bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
bool ElfDecoder::demangle(const char* symbol, char *buf, int buflen) {
return !cplus_demangle(symbol, buf, (size_t)buflen);
}

View File

@ -1997,7 +1997,7 @@ bool os::dll_address_to_function_name(address addr, char *buf,
}
if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
buf, buflen, offset, dlinfo.dli_fname)) {
return true;
}
}
@ -2015,7 +2015,7 @@ bool os::dll_address_to_function_name(address addr, char *buf,
return true;
} else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) {
buf, buflen, offset, dlinfo.dli_fname)) {
return true;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, 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
@ -24,22 +24,24 @@
#include "precompiled.hpp"
#include "prims/jvm.h"
#include "runtime/os.hpp"
#include "utilities/decoder.hpp"
#include "decoder_windows.hpp"
HMODULE Decoder::_dbghelp_handle = NULL;
bool Decoder::_can_decode_in_vm = false;
pfn_SymGetSymFromAddr64 Decoder::_pfnSymGetSymFromAddr64 = NULL;
pfn_UndecorateSymbolName Decoder::_pfnUndecorateSymbolName = NULL;
WindowsDecoder::WindowsDecoder() {
_dbghelp_handle = NULL;
_can_decode_in_vm = false;
_pfnSymGetSymFromAddr64 = NULL;
_pfnUndecorateSymbolName = NULL;
void Decoder::initialize() {
if (!_initialized) {
_initialized = true;
_decoder_status = no_error;
initialize();
}
HINSTANCE handle = os::win32::load_Windows_dll("dbghelp.dll", NULL, 0);
void WindowsDecoder::initialize() {
if (!has_error() && _dbghelp_handle == NULL) {
HMODULE handle = ::LoadLibrary("dbghelp.dll");
if (!handle) {
_decoder_status = helper_not_found;
return;
return;
}
_dbghelp_handle = handle;
@ -70,32 +72,29 @@ void Decoder::initialize() {
// find out if jvm.dll contains private symbols, by decoding
// current function and comparing the result
address addr = (address)Decoder::initialize;
address addr = (address)Decoder::decode;
char buf[MAX_PATH];
if (decode(addr, buf, sizeof(buf), NULL) == no_error) {
_can_decode_in_vm = !strcmp(buf, "Decoder::initialize");
if (decode(addr, buf, sizeof(buf), NULL)) {
_can_decode_in_vm = !strcmp(buf, "Decoder::decode");
}
}
}
void Decoder::uninitialize() {
assert(_initialized, "Decoder not yet initialized");
void WindowsDecoder::uninitialize() {
_pfnSymGetSymFromAddr64 = NULL;
_pfnUndecorateSymbolName = NULL;
if (_dbghelp_handle != NULL) {
::FreeLibrary(_dbghelp_handle);
}
_initialized = false;
_dbghelp_handle = NULL;
}
bool Decoder::can_decode_C_frame_in_vm() {
initialize();
return _can_decode_in_vm;
bool WindowsDecoder::can_decode_C_frame_in_vm() const {
return (!has_error() && _can_decode_in_vm);
}
Decoder::decoder_status Decoder::decode(address addr, char *buf, int buflen, int *offset) {
assert(_initialized, "Decoder not yet initialized");
bool WindowsDecoder::decode(address addr, char *buf, int buflen, int* offset, const char* modulepath) {
if (_pfnSymGetSymFromAddr64 != NULL) {
PIMAGEHLP_SYMBOL64 pSymbol;
char symbolInfo[MAX_PATH + sizeof(IMAGEHLP_SYMBOL64)];
@ -105,19 +104,20 @@ Decoder::decoder_status Decoder::decode(address addr, char *buf, int buflen, int
DWORD64 displacement;
if (_pfnSymGetSymFromAddr64(::GetCurrentProcess(), (DWORD64)addr, &displacement, pSymbol)) {
if (buf != NULL) {
if (!demangle(pSymbol->Name, buf, buflen)) {
if (demangle(pSymbol->Name, buf, buflen)) {
jio_snprintf(buf, buflen, "%s", pSymbol->Name);
}
}
if (offset != NULL) *offset = (int)displacement;
return no_error;
if(offset != NULL) *offset = (int)displacement;
return true;
}
}
return helper_not_found;
if (buf != NULL && buflen > 0) buf[0] = '\0';
if (offset != NULL) *offset = -1;
return false;
}
bool Decoder::demangle(const char* symbol, char *buf, int buflen) {
assert(_initialized, "Decoder not yet initialized");
bool WindowsDecoder::demangle(const char* symbol, char *buf, int buflen) {
return _pfnUndecorateSymbolName != NULL &&
_pfnUndecorateSymbolName(symbol, buf, buflen, UNDNAME_COMPLETE);
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2011, 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 OS_WINDOWS_VM_DECODER_WINDOWS_HPP
#define OS_WINDOWS_VM_DECIDER_WINDOWS_HPP
#include <windows.h>
#include <imagehlp.h>
#include "utilities/decoder.hpp"
// functions needed for decoding symbols
typedef DWORD (WINAPI *pfn_SymSetOptions)(DWORD);
typedef BOOL (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL);
typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD);
class WindowsDecoder: public NullDecoder {
public:
WindowsDecoder();
~WindowsDecoder() { uninitialize(); };
bool can_decode_C_frame_in_vm() const;
bool demangle(const char* symbol, char *buf, int buflen);
bool decode(address addr, char *buf, int buflen, int* offset, const char* modulepath = NULL);
private:
void initialize();
void uninitialize();
private:
HMODULE _dbghelp_handle;
bool _can_decode_in_vm;
pfn_SymGetSymFromAddr64 _pfnSymGetSymFromAddr64;
pfn_UndecorateSymbolName _pfnUndecorateSymbolName;
};
#endif // OS_WINDOWS_VM_DECODER_WINDOWS_HPP

View File

@ -1391,7 +1391,7 @@ bool os::dll_address_to_library_name(address addr, char* buf,
bool os::dll_address_to_function_name(address addr, char *buf,
int buflen, int *offset) {
if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) {
if (Decoder::decode(addr, buf, buflen, offset)) {
return true;
}
if (offset != NULL) *offset = -1;

View File

@ -204,6 +204,24 @@ Symbol* SymbolTable::lookup_only(const char* name, int len,
return s;
}
// Look up the address of the literal in the SymbolTable for this Symbol*
// Do not create any new symbols
// Do not increment the reference count to keep this alive
Symbol** SymbolTable::lookup_symbol_addr(Symbol* sym){
unsigned int hash = hash_symbol((char*)sym->bytes(), sym->utf8_length());
int index = the_table()->hash_to_index(hash);
for (HashtableEntry<Symbol*>* e = the_table()->bucket(index); e != NULL; e = e->next()) {
if (e->hash() == hash) {
Symbol* literal_sym = e->literal();
if (sym == literal_sym) {
return e->literal_addr();
}
}
}
return NULL;
}
// Suggestion: Push unicode-based lookup all the way into the hashing
// and probing logic, so there is no need for convert_to_utf8 until
// an actual new Symbol* is created.

View File

@ -144,6 +144,9 @@ public:
static void release(Symbol* sym);
// Look up the address of the literal in the SymbolTable for this Symbol*
static Symbol** lookup_symbol_addr(Symbol* sym);
// jchar (utf16) version of lookups
static Symbol* lookup_unicode(const jchar* name, int len, TRAPS);
static Symbol* lookup_only_unicode(const jchar* name, int len, unsigned int& hash);

View File

@ -2131,6 +2131,12 @@ void SystemDictionary::update_dictionary(int d_index, unsigned int d_hash,
}
}
// Assign a classid if one has not already been assigned. The
// counter does not need to be atomically incremented since this
// is only done while holding the SystemDictionary_lock.
// All loaded classes get a unique ID.
TRACE_INIT_ID(k);
// Check for a placeholder. If there, remove it and make a
// new system dictionary entry.
placeholders()->find_and_remove(p_index, p_hash, name, class_loader, THREAD);

View File

@ -158,6 +158,9 @@ klassOop Klass::base_create_klass_oop(KlassHandle& klass, int size,
kl->set_next_sibling(NULL);
kl->set_alloc_count(0);
kl->set_alloc_size(0);
#ifdef TRACE_SET_KLASS_TRACE_ID
TRACE_SET_KLASS_TRACE_ID(kl, 0);
#endif
kl->set_prototype_header(markOopDesc::prototype());
kl->set_biased_lock_revocation_count(0);

View File

@ -33,6 +33,7 @@
#include "oops/klassPS.hpp"
#include "oops/oop.hpp"
#include "runtime/orderAccess.hpp"
#include "trace/traceMacros.hpp"
#include "utilities/accessFlags.hpp"
#ifndef SERIALGC
#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
@ -80,6 +81,7 @@
// [last_biased_lock_bulk_revocation_time] (64 bits)
// [prototype_header]
// [biased_lock_revocation_count]
// [trace_id]
// Forward declarations.
@ -263,6 +265,9 @@ class Klass : public Klass_vtbl {
markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type
jint _biased_lock_revocation_count;
#ifdef TRACE_DEFINE_KLASS_TRACE_ID
TRACE_DEFINE_KLASS_TRACE_ID;
#endif
public:
// returns the enclosing klassOop
@ -683,6 +688,9 @@ class Klass : public Klass_vtbl {
jlong last_biased_lock_bulk_revocation_time() { return _last_biased_lock_bulk_revocation_time; }
void set_last_biased_lock_bulk_revocation_time(jlong cur_time) { _last_biased_lock_bulk_revocation_time = cur_time; }
#ifdef TRACE_DEFINE_KLASS_METHODS
TRACE_DEFINE_KLASS_METHODS;
#endif
// garbage collection support
virtual void follow_weak_klass_links(

View File

@ -83,6 +83,7 @@ methodOop methodKlass::allocate(constMethodHandle xconst,
m->set_max_stack(0);
m->set_max_locals(0);
m->set_intrinsic_id(vmIntrinsics::_none);
m->set_jfr_towrite(false);
m->set_method_data(NULL);
m->set_interpreter_throwout_count(0);
m->set_vtable_index(methodOopDesc::garbage_vtable_index);

View File

@ -77,7 +77,7 @@
// | method_size | max_stack |
// | max_locals | size_of_parameters |
// |------------------------------------------------------|
// | intrinsic_id, (unused) | throwout_count |
// |intrinsic_id| flags | throwout_count |
// |------------------------------------------------------|
// | num_breakpoints | (unused) |
// |------------------------------------------------------|
@ -124,6 +124,8 @@ class methodOopDesc : public oopDesc {
u2 _max_locals; // Number of local variables used by this method
u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
u1 _jfr_towrite : 1, // Flags
: 7;
u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting
u2 _number_of_breakpoints; // fullspeed debugging support
InvocationCounter _invocation_counter; // Incremented before each activation of the method - used to trigger frequency-based optimizations
@ -225,6 +227,7 @@ class methodOopDesc : public oopDesc {
void clear_number_of_breakpoints() { _number_of_breakpoints = 0; }
// index into instanceKlass methods() array
// note: also used by jfr
u2 method_idnum() const { return constMethod()->method_idnum(); }
void set_method_idnum(u2 idnum) { constMethod()->set_method_idnum(idnum); }
@ -650,6 +653,9 @@ class methodOopDesc : public oopDesc {
void init_intrinsic_id(); // updates from _none if a match
static vmSymbols::SID klass_id_for_intrinsics(klassOop holder);
bool jfr_towrite() { return _jfr_towrite; }
void set_jfr_towrite(bool towrite) { _jfr_towrite = towrite; }
// On-stack replacement support
bool has_osr_nmethod(int level, bool match_level) {
return instanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL;

View File

@ -1625,21 +1625,20 @@ Node *LockNode::Ideal(PhaseGVN *phase, bool can_reshape) {
//=============================================================================
bool LockNode::is_nested_lock_region() {
Node* box = box_node();
if (!box->is_BoxLock() || box->as_BoxLock()->stack_slot() <= 0)
BoxLockNode* box = box_node()->as_BoxLock();
int stk_slot = box->stack_slot();
if (stk_slot <= 0)
return false; // External lock or it is not Box (Phi node).
// Ignore complex cases: merged locks or multiple locks.
BoxLockNode* box_lock = box->as_BoxLock();
Node* obj = obj_node();
LockNode* unique_lock = NULL;
if (!box_lock->is_simple_lock_region(&unique_lock, obj) ||
if (!box->is_simple_lock_region(&unique_lock, obj) ||
(unique_lock != this)) {
return false;
}
// Look for external lock for the same object.
int stk_slot = box_lock->stack_slot();
SafePointNode* sfn = this->as_SafePoint();
JVMState* youngest_jvms = sfn->jvms();
int max_depth = youngest_jvms->depth();
@ -1649,7 +1648,7 @@ bool LockNode::is_nested_lock_region() {
// Loop over monitors
for (int idx = 0; idx < num_mon; idx++) {
Node* obj_node = sfn->monitor_obj(jvms, idx);
BoxLockNode* box_node = BoxLockNode::box_node(sfn->monitor_box(jvms, idx));
BoxLockNode* box_node = sfn->monitor_box(jvms, idx)->as_BoxLock();
if ((box_node->stack_slot() < stk_slot) && obj_node->eqv_uncast(obj)) {
return true;
}

View File

@ -63,7 +63,7 @@ uint BoxLockNode::cmp( const Node &n ) const {
}
BoxLockNode* BoxLockNode::box_node(Node* box) {
// Chase down the BoxNode
// Chase down the BoxNode after RA which may spill box nodes.
while (!box->is_BoxLock()) {
// if (box_node->is_SpillCopy()) {
// Node *m = box_node->in(1);
@ -84,18 +84,13 @@ OptoReg::Name BoxLockNode::reg(Node* box) {
return box_node(box)->in_RegMask(0).find_first_elem();
}
bool BoxLockNode::same_slot(Node* box1, Node* box2) {
return box_node(box1)->_slot == box_node(box2)->_slot;
}
// Is BoxLock node used for one simple lock region (same box and obj)?
bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) {
LockNode* lock = NULL;
bool has_one_lock = false;
for (uint i = 0; i < this->outcnt(); i++) {
Node* n = this->raw_out(i);
if (n->is_Phi())
return false; // Merged regions
assert(!n->is_Phi(), "should not merge BoxLock nodes");
if (n->is_AbstractLock()) {
AbstractLockNode* alock = n->as_AbstractLock();
// Check lock's box since box could be referenced by Lock's debug info.
@ -123,23 +118,12 @@ bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) {
FastLockNode* flock = n->as_FastLock();
assert((flock->box_node() == this) && flock->obj_node()->eqv_uncast(obj),"");
}
if (n->is_SafePoint() && n->as_SafePoint()->jvms()) {
SafePointNode* sfn = n->as_SafePoint();
JVMState* youngest_jvms = sfn->jvms();
int max_depth = youngest_jvms->depth();
for (int depth = 1; depth <= max_depth; depth++) {
JVMState* jvms = youngest_jvms->of_depth(depth);
int num_mon = jvms->nof_monitors();
// Loop over monitors
for (int idx = 0; idx < num_mon; idx++) {
Node* obj_node = sfn->monitor_obj(jvms, idx);
Node* box_node = sfn->monitor_box(jvms, idx);
if (box_node == this) {
assert(obj_node->eqv_uncast(obj),"");
}
}
}
}
// Don't check monitor info in safepoints since the referenced object could
// be different from the locked object. It could be Phi node of different
// cast nodes which point to this locked object.
// We assume that no other objects could be referenced in monitor info
// associated with this BoxLock node because all associated locks and
// unlocks are reference only this one object.
}
#endif
if (unique_lock != NULL && has_one_lock) {

View File

@ -49,9 +49,9 @@
//------------------------------BoxLockNode------------------------------------
class BoxLockNode : public Node {
const int _slot;
RegMask _inmask;
bool _is_eliminated; // indicates this lock was safely eliminated
const int _slot; // stack slot
RegMask _inmask; // OptoReg corresponding to stack slot
bool _is_eliminated; // Associated locks were safely eliminated
public:
BoxLockNode( int lock );
@ -68,7 +68,9 @@ public:
static OptoReg::Name reg(Node* box_node);
static BoxLockNode* box_node(Node* box_node);
static bool same_slot(Node* box1, Node* box2);
static bool same_slot(Node* box1, Node* box2) {
return box1->as_BoxLock()->_slot == box2->as_BoxLock()->_slot;
}
int stack_slot() const { return _slot; }
bool is_eliminated() const { return _is_eliminated; }

View File

@ -1802,10 +1802,14 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
// Mark all associated (same box and obj) lock and unlock nodes for
// elimination if some of them marked already.
void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
if (oldbox->is_BoxLock() && oldbox->as_BoxLock()->is_eliminated())
return;
if (oldbox->as_BoxLock()->is_eliminated())
return; // This BoxLock node was processed already.
if (oldbox->is_BoxLock() &&
// New implementation (EliminateNestedLocks) has separate BoxLock
// node for each locked region so mark all associated locks/unlocks as
// eliminated even if different objects are referenced in one locked region
// (for example, OSR compilation of nested loop inside locked scope).
if (EliminateNestedLocks ||
oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj)) {
// Box is used only in one lock region. Mark this box as eliminated.
_igvn.hash_delete(oldbox);
@ -1818,7 +1822,6 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
AbstractLockNode* alock = u->as_AbstractLock();
// Check lock's box since box could be referenced by Lock's debug info.
if (alock->box_node() == oldbox) {
assert(alock->obj_node()->eqv_uncast(obj), "");
// Mark eliminated all related locks and unlocks.
alock->set_non_esc_obj();
}
@ -1829,8 +1832,7 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
// Create new "eliminated" BoxLock node and use it in monitor debug info
// instead of oldbox for the same object.
BoxLockNode* box = BoxLockNode::box_node(oldbox);
BoxLockNode* newbox = box->clone()->as_BoxLock();
BoxLockNode* newbox = oldbox->clone()->as_BoxLock();
// Note: BoxLock node is marked eliminated only here and it is used
// to indicate that all associated lock and unlock nodes are marked
@ -2047,7 +2049,7 @@ void PhaseMacroExpand::expand_lock_node(LockNode *lock) {
Node* box = lock->box_node();
Node* flock = lock->fastlock_node();
assert(!BoxLockNode::box_node(box)->is_eliminated(), "sanity");
assert(!box->as_BoxLock()->is_eliminated(), "sanity");
// Make the merge point
Node *region;
@ -2283,7 +2285,7 @@ void PhaseMacroExpand::expand_unlock_node(UnlockNode *unlock) {
Node* obj = unlock->obj_node();
Node* box = unlock->box_node();
assert(!BoxLockNode::box_node(box)->is_eliminated(), "sanity");
assert(!box->as_BoxLock()->is_eliminated(), "sanity");
// No need for a null check on unlock

View File

@ -1604,7 +1604,16 @@ void Parse::merge_common(Parse::Block* target, int pnum) {
continue;
default: // All normal stuff
if (phi == NULL) {
if (!check_elide_phi || !target->can_elide_SEL_phi(j)) {
const JVMState* jvms = map()->jvms();
if (EliminateNestedLocks &&
jvms->is_mon(j) && jvms->is_monitor_box(j)) {
// BoxLock nodes are not commoning.
// Use old BoxLock node as merged box.
assert(newin->jvms()->is_monitor_box(j), "sanity");
// This assert also tests that nodes are BoxLock.
assert(BoxLockNode::same_slot(n, m), "sanity");
C->gvn_replace_by(n, m);
} else if (!check_elide_phi || !target->can_elide_SEL_phi(j)) {
phi = ensure_phi(j, nophi);
}
}
@ -1819,12 +1828,8 @@ PhiNode *Parse::ensure_phi(int idx, bool nocreate) {
} else if (jvms->is_stk(idx)) {
t = block()->stack_type_at(idx - jvms->stkoff());
} else if (jvms->is_mon(idx)) {
if (EliminateNestedLocks && jvms->is_monitor_box(idx)) {
// BoxLock nodes are not commoning. Create Phi.
t = o->bottom_type(); // TypeRawPtr::BOTTOM
} else {
t = TypeInstPtr::BOTTOM; // this is sufficient for a lock object
}
assert(!jvms->is_monitor_box(idx), "no phis for boxes");
t = TypeInstPtr::BOTTOM; // this is sufficient for a lock object
} else if ((uint)idx < TypeFunc::Parms) {
t = o->bottom_type(); // Type::RETURN_ADDRESS or such-like.
} else {

View File

@ -48,6 +48,7 @@
#include "oops/typeArrayOop.hpp"
#include "prims/jni.h"
#include "prims/jniCheck.hpp"
#include "prims/jniExport.hpp"
#include "prims/jniFastGetField.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
@ -66,6 +67,8 @@
#include "runtime/signature.hpp"
#include "runtime/vm_operations.hpp"
#include "services/runtimeService.hpp"
#include "trace/tracing.hpp"
#include "trace/traceEventTypes.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
@ -5139,6 +5142,11 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v
if (JvmtiExport::should_post_thread_life()) {
JvmtiExport::post_thread_start(thread);
}
EVENT_BEGIN(TraceEventThreadStart, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(thread->threadObj())));
// Check if we should compile all classes on bootclasspath
NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
// Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
@ -5337,6 +5345,10 @@ static jint attach_current_thread(JavaVM *vm, void **penv, void *_args, bool dae
JvmtiExport::post_thread_start(thread);
}
EVENT_BEGIN(TraceEventThreadStart, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(thread->threadObj())));
*(JNIEnv**)penv = thread->jni_environment();
// Now leaving the VM, so change thread_state. This is normally automatically taken care
@ -5464,8 +5476,7 @@ jint JNICALL jni_GetEnv(JavaVM *vm, void **penv, jint version) {
return ret;
}
if (JvmtiExport::is_jvmti_version(version)) {
ret = JvmtiExport::get_jvmti_interface(vm, penv, version);
if (JniExportedInterface::GetExportedInterface(vm, penv, version, &ret)) {
return ret;
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 1997, 2011, 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_PRIMS_JNI_EXPORT_HPP
#define SHARE_VM_PRIMS_JNI_EXPORT_HPP
#include "prims/jni.h"
#include "prims/jvmtiExport.hpp"
class JniExportedInterface {
public:
static bool GetExportedInterface(JavaVM* vm, void** penv, jint version, jint* iface) {
if (JvmtiExport::is_jvmti_version(version)) {
*iface = JvmtiExport::get_jvmti_interface(vm, penv, version);
return true;
}
return false;
}
};
#endif // SHARE_VM_PRIMS_JNI_EXPORT_HPP

View File

@ -194,9 +194,6 @@ bool MethodHandles::spot_check_entry_names() {
// MethodHandles::generate_adapters
//
void MethodHandles::generate_adapters() {
#ifdef TARGET_ARCH_NYI_6939861
if (FLAG_IS_DEFAULT(UseRicochetFrames)) UseRicochetFrames = false;
#endif
if (!EnableInvokeDynamic || SystemDictionary::MethodHandle_klass() == NULL) return;
assert(_adapter_code == NULL, "generate only once");
@ -230,18 +227,6 @@ void MethodHandlesAdapterGenerator::generate() {
}
#ifdef TARGET_ARCH_NYI_6939861
// these defs belong in methodHandles_<arch>.cpp
frame MethodHandles::ricochet_frame_sender(const frame& fr, RegisterMap *map) {
ShouldNotCallThis();
return fr;
}
void MethodHandles::ricochet_frame_oops_do(const frame& fr, OopClosure* f, const RegisterMap* reg_map) {
ShouldNotCallThis();
}
#endif //TARGET_ARCH_NYI_6939861
//------------------------------------------------------------------------------
// MethodHandles::ek_supported
//
@ -251,28 +236,11 @@ bool MethodHandles::ek_supported(MethodHandles::EntryKind ek) {
case _adapter_unused_13:
return false; // not defined yet
case _adapter_prim_to_ref:
return UseRicochetFrames && conv_op_supported(java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF);
return conv_op_supported(java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_REF);
case _adapter_collect_args:
return UseRicochetFrames && conv_op_supported(java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS);
return conv_op_supported(java_lang_invoke_AdapterMethodHandle::OP_COLLECT_ARGS);
case _adapter_fold_args:
return UseRicochetFrames && conv_op_supported(java_lang_invoke_AdapterMethodHandle::OP_FOLD_ARGS);
case _adapter_opt_return_any:
return UseRicochetFrames;
#ifdef TARGET_ARCH_NYI_6939861
// ports before 6939861 supported only three kinds of spread ops
case _adapter_spread_args:
// restrict spreads to three kinds:
switch (ek) {
case _adapter_opt_spread_0:
case _adapter_opt_spread_1:
case _adapter_opt_spread_more:
break;
default:
return false;
break;
}
break;
#endif //TARGET_ARCH_NYI_6939861
return conv_op_supported(java_lang_invoke_AdapterMethodHandle::OP_FOLD_ARGS);
}
return true;
}
@ -1988,9 +1956,6 @@ void MethodHandles::verify_AdapterMethodHandle(Handle mh, int argnum, TRAPS) {
case _adapter_prim_to_ref: // boxer MH to use
case _adapter_collect_args: // method handle which collects the args
case _adapter_fold_args: // method handle which collects the args
if (!UseRicochetFrames) {
{ err = "box/collect/fold operators are not supported"; break; }
}
if (!java_lang_invoke_MethodHandle::is_instance(argument()))
{ err = "MethodHandle adapter argument required"; break; }
arg_mtype = Handle(THREAD, java_lang_invoke_MethodHandle::type(argument()));
@ -2370,7 +2335,6 @@ void MethodHandles::init_AdapterMethodHandle(Handle mh, Handle target, int argnu
case _adapter_prim_to_ref:
{
assert(UseRicochetFrames, "else don't come here");
// vminfo will be the location to insert the return value
vminfo = argslot;
ek_opt = _adapter_opt_collect_ref;
@ -2436,20 +2400,6 @@ void MethodHandles::init_AdapterMethodHandle(Handle mh, Handle target, int argnu
case _adapter_spread_args:
{
#ifdef TARGET_ARCH_NYI_6939861
// ports before 6939861 supported only three kinds of spread ops
if (!UseRicochetFrames) {
int array_size = slots_pushed + 1;
assert(array_size >= 0, "");
vminfo = array_size;
switch (array_size) {
case 0: ek_opt = _adapter_opt_spread_0; break;
case 1: ek_opt = _adapter_opt_spread_1; break;
default: ek_opt = _adapter_opt_spread_more; break;
}
break;
}
#endif //TARGET_ARCH_NYI_6939861
// vminfo will be the required length of the array
int array_size = (slots_pushed + 1) / (type2size[dest] == 2 ? 2 : 1);
vminfo = array_size;
@ -2494,7 +2444,6 @@ void MethodHandles::init_AdapterMethodHandle(Handle mh, Handle target, int argnu
case _adapter_collect_args:
{
assert(UseRicochetFrames, "else don't come here");
int elem_slots = argument_slot_count(java_lang_invoke_MethodHandle::type(argument()));
// vminfo will be the location to insert the return value
vminfo = argslot;
@ -2563,7 +2512,6 @@ void MethodHandles::init_AdapterMethodHandle(Handle mh, Handle target, int argnu
case _adapter_fold_args:
{
assert(UseRicochetFrames, "else don't come here");
int elem_slots = argument_slot_count(java_lang_invoke_MethodHandle::type(argument()));
// vminfo will be the location to insert the return value
vminfo = argslot + elem_slots;

View File

@ -738,46 +738,6 @@ public:
#ifdef TARGET_ARCH_ppc
# include "methodHandles_ppc.hpp"
#endif
#ifdef TARGET_ARCH_NYI_6939861
// Here are some backward compatible declarations until the 6939861 ports are updated.
#define _adapter_flyby (_EK_LIMIT + 10)
#define _adapter_ricochet (_EK_LIMIT + 11)
#define _adapter_opt_spread_1 _adapter_opt_spread_1_ref
#define _adapter_opt_spread_more _adapter_opt_spread_ref
enum {
_INSERT_NO_MASK = -1,
_INSERT_REF_MASK = 0,
_INSERT_INT_MASK = 1,
_INSERT_LONG_MASK = 3
};
static void get_ek_bound_mh_info(EntryKind ek, BasicType& arg_type, int& arg_mask, int& arg_slots) {
arg_type = ek_bound_mh_arg_type(ek);
arg_mask = 0;
arg_slots = type2size[arg_type];;
}
static void get_ek_adapter_opt_swap_rot_info(EntryKind ek, int& swap_bytes, int& rotate) {
int swap_slots = ek_adapter_opt_swap_slots(ek);
rotate = ek_adapter_opt_swap_mode(ek);
swap_bytes = swap_slots * Interpreter::stackElementSize;
}
static int get_ek_adapter_opt_spread_info(EntryKind ek) {
return ek_adapter_opt_spread_count(ek);
}
static void insert_arg_slots(MacroAssembler* _masm,
RegisterOrConstant arg_slots,
int arg_mask,
Register argslot_reg,
Register temp_reg, Register temp2_reg, Register temp3_reg = noreg);
static void remove_arg_slots(MacroAssembler* _masm,
RegisterOrConstant arg_slots,
Register argslot_reg,
Register temp_reg, Register temp2_reg, Register temp3_reg = noreg);
static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
#endif //TARGET_ARCH_NYI_6939861
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -1334,24 +1334,21 @@ void frame::interpreter_frame_verify_monitor(BasicObjectLock* value) const {
void frame::describe(FrameValues& values, int frame_no) {
intptr_t* frame_pointer = real_fp();
if (is_entry_frame() || is_compiled_frame() || is_interpreted_frame() || is_native_frame()) {
// Label values common to most frames
values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no));
values.describe(-1, sp(), err_msg("sp for #%d", frame_no));
if (is_compiled_frame()) {
values.describe(-1, sp() + _cb->frame_size(), err_msg("computed fp for #%d", frame_no));
} else {
values.describe(-1, fp(), err_msg("fp for #%d", frame_no));
}
values.describe(-1, frame_pointer, err_msg("frame pointer for #%d", frame_no));
}
if (is_interpreted_frame()) {
methodOop m = interpreter_frame_method();
int bci = interpreter_frame_bci();
// Label the method and current bci
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
FormatBuffer<1024>("#%d method %s @ %d", frame_no, m->name_and_sig_as_C_string(), bci), 2);
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
err_msg("- %d locals %d max stack", m->max_locals(), m->max_stack()), 1);
if (m->max_locals() > 0) {
intptr_t* l0 = interpreter_frame_local_at(0);
@ -1383,18 +1380,18 @@ void frame::describe(FrameValues& values, int frame_no) {
}
} else if (is_entry_frame()) {
// For now just label the frame
values.describe(-1, MAX2(sp(), fp()), err_msg("#%d entry frame", frame_no), 2);
values.describe(-1, MAX2(sp(), frame_pointer), err_msg("#%d entry frame", frame_no), 2);
} else if (is_compiled_frame()) {
// For now just label the frame
nmethod* nm = cb()->as_nmethod_or_null();
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no,
nm, nm->method()->name_and_sig_as_C_string(),
is_deoptimized_frame() ? " (deoptimized" : ""), 2);
} else if (is_native_frame()) {
// For now just label the frame
nmethod* nm = cb()->as_nmethod_or_null();
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no,
nm, nm->method()->name_and_sig_as_C_string()), 2);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -221,6 +221,15 @@ class frame VALUE_OBJ_CLASS_SPEC {
// returns the stack pointer of the calling frame
intptr_t* sender_sp() const;
// Returns the real 'frame pointer' for the current frame.
// This is the value expected by the platform ABI when it defines a
// frame pointer register. It may differ from the effective value of
// the FP register when that register is used in the JVM for other
// purposes (like compiled frames on some platforms).
// On other platforms, it is defined so that the stack area used by
// this frame goes from real_fp() to sp().
intptr_t* real_fp() const;
// Deoptimization info, if needed (platform dependent).
// Stored in the initial_info field of the unroll info, to be used by
// the platform dependent deoptimization blobs.

View File

@ -3826,10 +3826,6 @@ class CommandLineFlags {
develop(bool, StressMethodHandleWalk, false, \
"Process all method handles with MethodHandleWalk") \
\
diagnostic(bool, UseRicochetFrames, true, \
"use ricochet stack frames for method handle combination, " \
"if the platform supports them") \
\
experimental(bool, TrustFinalNonStaticFields, false, \
"trust final non-static declarations for constant folding") \
\

View File

@ -57,6 +57,8 @@
#include "runtime/task.hpp"
#include "runtime/timer.hpp"
#include "runtime/vm_operations.hpp"
#include "trace/tracing.hpp"
#include "trace/traceEventTypes.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/histogram.hpp"
@ -502,6 +504,11 @@ void before_exit(JavaThread * thread) {
if (JvmtiExport::should_post_thread_life()) {
JvmtiExport::post_thread_end(thread);
}
EVENT_BEGIN(TraceEventThreadEnd, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(thread->threadObj())));
// Always call even when there are not JVMTI environments yet, since environments
// may be attached late and JVMTI must track phases of VM execution
JvmtiExport::post_vm_death();

View File

@ -132,7 +132,13 @@ Mutex* HotCardCache_lock = NULL;
Monitor* GCTaskManager_lock = NULL;
Mutex* Management_lock = NULL;
Monitor* Service_lock = NULL;
Monitor* Service_lock = NULL;
Mutex* Stacktrace_lock = NULL;
Monitor* JfrQuery_lock = NULL;
Monitor* JfrMsg_lock = NULL;
Mutex* JfrBuffer_lock = NULL;
Mutex* JfrStream_lock = NULL;
#define MAX_NUM_MUTEX 128
static Monitor * _mutex_array[MAX_NUM_MUTEX];
@ -207,6 +213,7 @@ void mutex_init() {
def(Patching_lock , Mutex , special, true ); // used for safepointing and code patching.
def(ObjAllocPost_lock , Monitor, special, false);
def(Service_lock , Monitor, special, true ); // used for service thread operations
def(Stacktrace_lock , Mutex, special, true ); // used for JFR stacktrace database
def(JmethodIdCreation_lock , Mutex , leaf, true ); // used for creating jmethodIDs.
def(SystemDictionary_lock , Monitor, leaf, true ); // lookups done by VM thread
@ -271,6 +278,11 @@ void mutex_init() {
def(Debug3_lock , Mutex , nonleaf+4, true );
def(ProfileVM_lock , Monitor, nonleaf+4, false); // used for profiling of the VMThread
def(CompileThread_lock , Monitor, nonleaf+5, false );
def(JfrQuery_lock , Monitor, nonleaf, true); // JFR locks, keep these in consecutive order
def(JfrMsg_lock , Monitor, nonleaf+2, true);
def(JfrBuffer_lock , Mutex, nonleaf+3, true);
def(JfrStream_lock , Mutex, nonleaf+4, true);
}
GCMutexLocker::GCMutexLocker(Monitor * mutex) {

View File

@ -135,6 +135,12 @@ extern Mutex* HotCardCache_lock; // protects the hot card cache
extern Mutex* Management_lock; // a lock used to serialize JVM management
extern Monitor* Service_lock; // a lock used for service thread operation
extern Mutex* Stacktrace_lock; // used to guard access to the stacktrace table
extern Monitor* JfrQuery_lock; // protects JFR use
extern Monitor* JfrMsg_lock; // protects JFR messaging
extern Mutex* JfrBuffer_lock; // protects JFR buffer operations
extern Mutex* JfrStream_lock; // protects JFR stream access
// A MutexLocker provides mutual exclusion with respect to a given mutex
// for the scope which contains the locker. The lock is an OS lock, not

View File

@ -1101,6 +1101,7 @@ bool os::set_boot_path(char fileSep, char pathSep) {
"%/lib/jsse.jar:"
"%/lib/jce.jar:"
"%/lib/charsets.jar:"
"%/lib/jfr.jar:"
#ifdef __APPLE__
"%/lib/JObjC.jar:"
#endif

View File

@ -121,7 +121,6 @@ void SharedRuntime::generate_stubs() {
void SharedRuntime::generate_ricochet_blob() {
if (!EnableInvokeDynamic) return; // leave it as a null
#ifndef TARGET_ARCH_NYI_6939861
// allocate space for the code
ResourceMark rm;
// setup code generation tools
@ -142,7 +141,6 @@ void SharedRuntime::generate_ricochet_blob() {
}
_ricochet_blob = RicochetBlob::create(&buffer, bounce_offset, exception_offset, frame_size_in_words);
#endif
}

View File

@ -73,6 +73,7 @@
#include "services/attachListener.hpp"
#include "services/management.hpp"
#include "services/threadService.hpp"
#include "trace/traceEventTypes.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
@ -232,6 +233,7 @@ Thread::Thread() {
CHECK_UNHANDLED_OOPS_ONLY(_gc_locked_out_count = 0;)
_jvmti_env_iteration_count = 0;
set_allocated_bytes(0);
set_trace_buffer(NULL);
_vm_operation_started_count = 0;
_vm_operation_completed_count = 0;
_current_pending_monitor = NULL;
@ -1512,6 +1514,10 @@ void JavaThread::run() {
JvmtiExport::post_thread_start(this);
}
EVENT_BEGIN(TraceEventThreadStart, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(this->threadObj())));
// We call another function to do the rest so we are sure that the stack addresses used
// from there will be lower than the stack base just computed
thread_main_inner();
@ -1641,6 +1647,15 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
}
}
// Called before the java thread exit since we want to read info
// from java_lang_Thread object
EVENT_BEGIN(TraceEventThreadEnd, event);
EVENT_COMMIT(event,
EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(this->threadObj())));
// Call after last event on thread
EVENT_THREAD_EXIT(this);
// Call Thread.exit(). We try 3 times in case we got another Thread.stop during
// the execution of the method. If that is not enough, then we don't really care. Thread.stop
// is deprecated anyhow.
@ -3186,6 +3201,11 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
return status;
}
// Must be run after init_ft which initializes ft_enabled
if (TRACE_INITIALIZE() != JNI_OK) {
vm_exit_during_initialization("Failed to initialize tracing backend");
}
// Should be done after the heap is fully created
main_thread->cache_global_variables();
@ -3423,6 +3443,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
create_vm_init_libraries();
}
if (!TRACE_START()) {
vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
}
// Notify JVMTI agents that VM initialization is complete - nop if no agents.
JvmtiExport::post_vm_initialized();

View File

@ -41,6 +41,7 @@
#include "runtime/stubRoutines.hpp"
#include "runtime/threadLocalStorage.hpp"
#include "runtime/unhandledOops.hpp"
#include "trace/tracing.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/top.hpp"
#ifndef SERIALGC
@ -246,6 +247,8 @@ class Thread: public ThreadShadow {
jlong _allocated_bytes; // Cumulative number of bytes allocated on
// the Java heap
TRACE_BUFFER _trace_buffer; // Thread-local buffer for tracing
int _vm_operation_started_count; // VM_Operation support
int _vm_operation_completed_count; // VM_Operation support
@ -414,6 +417,9 @@ class Thread: public ThreadShadow {
return allocated_bytes;
}
TRACE_BUFFER trace_buffer() { return _trace_buffer; }
void set_trace_buffer(TRACE_BUFFER buf) { _trace_buffer = buf; }
// VM operation support
int vm_operation_ticket() { return ++_vm_operation_started_count; }
int vm_operation_completed_count() { return _vm_operation_completed_count; }

View File

@ -93,6 +93,7 @@
template(HeapWalkOperation) \
template(HeapIterateOperation) \
template(ReportJavaOutOfMemory) \
template(JFRCheckpoint) \
template(Exit) \
class VM_Operation: public CHeapObj {

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 1997, 2012, 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_TRACE_TRACE_EVENT_TYPES_HPP
#define SHARE_VM_TRACE_TRACE_EVENT_TYPES_HPP
/* Empty, just a placeholder for tracing events */
#endif

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 1997, 2011, 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_TRACE_TRACE_MACRO_HPP
#define SHARE_VM_TRACE_TRACE_MACRO_HPP
#define EVENT_BEGIN(type, name)
#define EVENT_SET(name, field, value)
#define EVENT_COMMIT(name, ...)
#define EVENT_STARTED(name, time)
#define EVENT_ENDED(name, time)
#define EVENT_THREAD_EXIT(thread)
#define TRACE_ENABLED 0
#define TRACE_INIT_ID(k)
#define TRACE_BUFFER void*
#define TRACE_START() true
#define TRACE_INITIALIZE() 0
#endif

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 1997, 2011, 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_TRACE_TRACING_HPP
#define SHARE_VM_TRACE_TRACING_HPP
#include "trace/traceMacros.hpp"
#endif

View File

@ -24,80 +24,85 @@
#include "precompiled.hpp"
#include "prims/jvm.h"
#include "runtime/mutexLocker.hpp"
#include "utilities/decoder.hpp"
Decoder::decoder_status Decoder::_decoder_status = Decoder::no_error;
bool Decoder::_initialized = false;
#if defined(_WINDOWS)
#include "decoder_windows.hpp"
#elif defined(__APPLE__)
#include "decoder_machO.hpp"
#else
#include "decoder_elf.hpp"
#endif
#if !defined(_WINDOWS) && !defined(__APPLE__)
NullDecoder* Decoder::_decoder = NULL;
NullDecoder Decoder::_do_nothing_decoder;
Mutex* Decoder::_decoder_lock = new Mutex(Mutex::safepoint,
"DecoderLock");
// Implementation of common functionalities among Solaris and Linux
#include "utilities/elfFile.hpp"
// _decoder_lock should already acquired before enter this method
NullDecoder* Decoder::get_decoder() {
assert(_decoder_lock != NULL && _decoder_lock->owned_by_self(),
"Require DecoderLock to enter");
ElfFile* Decoder::_opened_elf_files = NULL;
if (_decoder != NULL) {
return _decoder;
}
// Decoder is a secondary service. Although, it is good to have,
// but we can live without it.
#if defined(_WINDOWS)
_decoder = new (std::nothrow) WindowsDecoder();
#elif defined (__APPLE__)
_decoder = new (std::nothrow)MachODecoder();
#else
_decoder = new (std::nothrow)ElfDecoder();
#endif
if (_decoder == NULL || _decoder->has_error()) {
if (_decoder != NULL) {
delete _decoder;
}
_decoder = &_do_nothing_decoder;
}
return _decoder;
}
bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath) {
assert(_decoder_lock != NULL, "Just check");
MutexLockerEx locker(_decoder_lock, true);
NullDecoder* decoder = get_decoder();
assert(decoder != NULL, "null decoder");
return decoder->decode(addr, buf, buflen, offset, modulepath);
}
bool Decoder::demangle(const char* symbol, char* buf, int buflen) {
assert(_decoder_lock != NULL, "Just check");
MutexLockerEx locker(_decoder_lock, true);
NullDecoder* decoder = get_decoder();
assert(decoder != NULL, "null decoder");
return decoder->demangle(symbol, buf, buflen);
}
bool Decoder::can_decode_C_frame_in_vm() {
return true;
assert(_decoder_lock != NULL, "Just check");
MutexLockerEx locker(_decoder_lock, true);
NullDecoder* decoder = get_decoder();
assert(decoder != NULL, "null decoder");
return decoder->can_decode_C_frame_in_vm();
}
void Decoder::initialize() {
_initialized = true;
// shutdown real decoder and replace it with
// _do_nothing_decoder
void Decoder::shutdown() {
assert(_decoder_lock != NULL, "Just check");
MutexLockerEx locker(_decoder_lock, true);
if (_decoder != NULL && _decoder != &_do_nothing_decoder) {
delete _decoder;
}
_decoder = &_do_nothing_decoder;
}
void Decoder::uninitialize() {
if (_opened_elf_files != NULL) {
delete _opened_elf_files;
_opened_elf_files = NULL;
}
_initialized = false;
}
Decoder::decoder_status Decoder::decode(address addr, const char* filepath, char *buf, int buflen, int *offset) {
if (_decoder_status != no_error) {
return _decoder_status;
}
ElfFile* file = get_elf_file(filepath);
if (_decoder_status != no_error) {
return _decoder_status;
}
const char* symbol = file->decode(addr, offset);
if (file->get_status() == out_of_memory) {
_decoder_status = out_of_memory;
return _decoder_status;
} else if (symbol != NULL) {
if (!demangle(symbol, buf, buflen)) {
jio_snprintf(buf, buflen, "%s", symbol);
}
return no_error;
} else {
return symbol_not_found;
}
}
ElfFile* Decoder::get_elf_file(const char* filepath) {
if (_decoder_status != no_error) {
return NULL;
}
ElfFile* file = _opened_elf_files;
while (file != NULL) {
if (file->same_elf_file(filepath)) {
return file;
}
file = file->m_next;
}
file = new ElfFile(filepath);
if (file == NULL) {
_decoder_status = out_of_memory;
}
if (_opened_elf_files != NULL) {
file->m_next = _opened_elf_files;
}
_opened_elf_files = file;
return file;
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,83 +23,78 @@
*/
#ifndef __DECODER_HPP
#define __DECODER_HPP
#ifndef SHARE_VM_UTILITIES_DECODER_HPP
#define SHARE_VM_UTILITIES_DECODER_HPP
#include "memory/allocation.hpp"
#include "runtime/mutex.hpp"
#ifdef _WINDOWS
#include <windows.h>
#include <imagehlp.h>
// functions needed for decoding symbols
typedef DWORD (WINAPI *pfn_SymSetOptions)(DWORD);
typedef BOOL (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL);
typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD);
#elif defined(__APPLE__)
#else
class ElfFile;
#endif // _WINDOWS
class Decoder: public StackObj {
public:
class NullDecoder: public CHeapObj {
public:
// status code for decoding native C frame
enum decoder_status {
no_error, // successfully decoded frames
not_available = -10, // real decoder is not available
no_error = 0, // successfully decoded frames
out_of_memory, // out of memory
file_invalid, // invalid elf file
file_not_found, // could not found symbol file (on windows), such as jvm.pdb or jvm.map
helper_not_found, // could not load dbghelp.dll (Windows only)
helper_func_error, // decoding functions not found (Windows only)
helper_init_error, // SymInitialize failed (Windows only)
symbol_not_found // could not find the symbol
helper_init_error // SymInitialize failed (Windows only)
};
public:
Decoder() { initialize(); };
~Decoder() { uninitialize(); };
NullDecoder() {
_decoder_status = not_available;
}
static bool can_decode_C_frame_in_vm();
~NullDecoder() {};
static void initialize();
static void uninitialize();
virtual bool decode(address pc, char* buf, int buflen, int* offset,
const char* modulepath = NULL) {
return false;
}
#ifdef _WINDOWS
static decoder_status decode(address addr, char *buf, int buflen, int *offset);
#else
static decoder_status decode(address addr, const char* filepath, char *buf, int buflen, int *offset);
#endif
virtual bool demangle(const char* symbol, char* buf, int buflen) {
return false;
}
static bool demangle(const char* symbol, char *buf, int buflen);
virtual bool can_decode_C_frame_in_vm() const {
return false;
}
static decoder_status get_status() { return _decoder_status; };
virtual decoder_status status() const {
return _decoder_status;
}
#if !defined(_WINDOWS) && !defined(__APPLE__)
private:
static ElfFile* get_elf_file(const char* filepath);
#endif // _WINDOWS
virtual bool has_error() const {
return is_error(_decoder_status);
}
static bool is_error(decoder_status status) {
return (status > 0);
}
private:
static decoder_status _decoder_status;
static bool _initialized;
#ifdef _WINDOWS
static HMODULE _dbghelp_handle;
static bool _can_decode_in_vm;
static pfn_SymGetSymFromAddr64 _pfnSymGetSymFromAddr64;
static pfn_UndecorateSymbolName _pfnUndecorateSymbolName;
#elif __APPLE__
#else
static ElfFile* _opened_elf_files;
#endif // _WINDOWS
protected:
decoder_status _decoder_status;
};
#endif // __DECODER_HPP
class Decoder: AllStatic {
public:
static bool decode(address pc, char* buf, int buflen, int* offset, const char* modulepath = NULL);
static bool demangle(const char* symbol, char* buf, int buflen);
static bool can_decode_C_frame_in_vm();
static void shutdown();
protected:
static NullDecoder* get_decoder();
private:
static NullDecoder* _decoder;
static NullDecoder _do_nothing_decoder;
protected:
static Mutex* _decoder_lock;
};
#endif // SHARE_VM_UTILITIES_DECODER_HPP

View File

@ -0,0 +1,76 @@
/*
* Copyright (c) 2011, 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"
#if !defined(_WINDOWS) && !defined(__APPLE__)
#include "decoder_elf.hpp"
ElfDecoder::~ElfDecoder() {
if (_opened_elf_files != NULL) {
delete _opened_elf_files;
_opened_elf_files = NULL;
}
}
bool ElfDecoder::decode(address addr, char *buf, int buflen, int* offset, const char* filepath) {
assert(filepath, "null file path");
assert(buf != NULL && buflen > 0, "Invalid buffer");
if (has_error()) return false;
ElfFile* file = get_elf_file(filepath);
if (file == NULL) {
return false;
}
if (!file->decode(addr, buf, buflen, offset)) {
return false;
}
if (buf[0] != '\0') {
demangle(buf, buf, buflen);
}
return true;
}
ElfFile* ElfDecoder::get_elf_file(const char* filepath) {
ElfFile* file;
file = _opened_elf_files;
while (file != NULL) {
if (file->same_elf_file(filepath)) {
return file;
}
file = file->next();
}
file = new (std::nothrow)ElfFile(filepath);
if (file != NULL) {
if (_opened_elf_files != NULL) {
file->set_next(_opened_elf_files);
}
_opened_elf_files = file;
}
return file;
}
#endif

View File

@ -0,0 +1,55 @@
/*
* Copyright (c) 2011, 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_UTILITIES_DECODER_ELF_HPP
#define SHARE_VM_UTILITIES_DECODER_ELF_HPP
#if !defined(_WINDOWS) && !defined(__APPLE__)
#include "utilities/decoder.hpp"
#include "utilities/elfFile.hpp"
class ElfDecoder: public NullDecoder {
public:
ElfDecoder() {
_opened_elf_files = NULL;
_decoder_status = no_error;
}
~ElfDecoder();
bool can_decode_C_frame_in_vm() const { return true; }
bool demangle(const char* symbol, char *buf, int buflen);
bool decode(address addr, char *buf, int buflen, int* offset, const char* filepath = NULL);
private:
ElfFile* get_elf_file(const char* filepath);
private:
ElfFile* _opened_elf_files;
};
#endif
#endif // SHARE_VM_UTILITIES_DECODER_ELF_HPP

View File

@ -44,7 +44,7 @@ ElfFile::ElfFile(const char* filepath) {
m_string_tables = NULL;
m_symbol_tables = NULL;
m_next = NULL;
m_status = Decoder::no_error;
m_status = NullDecoder::no_error;
int len = strlen(filepath) + 1;
m_filepath = (const char*)os::malloc(len * sizeof(char));
@ -54,10 +54,10 @@ ElfFile::ElfFile(const char* filepath) {
if (m_file != NULL) {
load_tables();
} else {
m_status = Decoder::file_not_found;
m_status = NullDecoder::file_not_found;
}
} else {
m_status = Decoder::out_of_memory;
m_status = NullDecoder::out_of_memory;
}
}
@ -96,41 +96,41 @@ bool ElfFile::is_elf_file(Elf_Ehdr& hdr) {
bool ElfFile::load_tables() {
assert(m_file, "file not open");
assert(m_status == Decoder::no_error, "already in error");
assert(!NullDecoder::is_error(m_status), "already in error");
// read elf file header
if (fread(&m_elfHdr, sizeof(m_elfHdr), 1, m_file) != 1) {
m_status = Decoder::file_invalid;
m_status = NullDecoder::file_invalid;
return false;
}
if (!is_elf_file(m_elfHdr)) {
m_status = Decoder::file_invalid;
m_status = NullDecoder::file_invalid;
return false;
}
// walk elf file's section headers, and load string tables
Elf_Shdr shdr;
if (!fseek(m_file, m_elfHdr.e_shoff, SEEK_SET)) {
if (m_status != Decoder::no_error) return false;
if (NullDecoder::is_error(m_status)) return false;
for (int index = 0; index < m_elfHdr.e_shnum; index ++) {
if (fread((void*)&shdr, sizeof(Elf_Shdr), 1, m_file) != 1) {
m_status = Decoder::file_invalid;
m_status = NullDecoder::file_invalid;
return false;
}
// string table
if (shdr.sh_type == SHT_STRTAB) {
ElfStringTable* table = new (std::nothrow) ElfStringTable(m_file, shdr, index);
if (table == NULL) {
m_status = Decoder::out_of_memory;
m_status = NullDecoder::out_of_memory;
return false;
}
add_string_table(table);
} else if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) {
ElfSymbolTable* table = new (std::nothrow) ElfSymbolTable(m_file, shdr);
if (table == NULL) {
m_status = Decoder::out_of_memory;
m_status = NullDecoder::out_of_memory;
return false;
}
add_symbol_table(table);
@ -140,32 +140,33 @@ bool ElfFile::load_tables() {
return true;
}
const char* ElfFile::decode(address addr, int* offset) {
bool ElfFile::decode(address addr, char* buf, int buflen, int* offset) {
// something already went wrong, just give up
if (m_status != Decoder::no_error) {
return NULL;
if (NullDecoder::is_error(m_status)) {
return false;
}
ElfSymbolTable* symbol_table = m_symbol_tables;
int string_table_index;
int pos_in_string_table;
int off = INT_MAX;
bool found_symbol = false;
while (symbol_table != NULL) {
if (Decoder::no_error == symbol_table->lookup(addr, &string_table_index, &pos_in_string_table, &off)) {
if (symbol_table->lookup(addr, &string_table_index, &pos_in_string_table, &off)) {
found_symbol = true;
}
symbol_table = symbol_table->m_next;
}
if (!found_symbol) return NULL;
if (!found_symbol) return false;
ElfStringTable* string_table = get_string_table(string_table_index);
if (string_table == NULL) {
m_status = Decoder::file_invalid;
return NULL;
m_status = NullDecoder::file_invalid;
return false;
}
if (offset) *offset = off;
return string_table->string_at(pos_in_string_table);
return string_table->string_at(pos_in_string_table, buf, buflen);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, 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
@ -22,8 +22,8 @@
*
*/
#ifndef __ELF_FILE_HPP
#define __ELF_FILE_HPP
#ifndef SHARE_VM_UTILITIES_ELF_FILE_HPP
#define SHARE_VM_UTILITIES_ELF_FILE_HPP
#if !defined(_WINDOWS) && !defined(__APPLE__)
@ -83,12 +83,12 @@ class ElfSymbolTable;
// part of code to be very defensive, and bait out if anything went wrong.
class ElfFile: public CHeapObj {
friend class Decoder;
friend class ElfDecoder;
public:
ElfFile(const char* filepath);
~ElfFile();
const char* decode(address addr, int* offset);
bool decode(address addr, char* buf, int buflen, int* offset);
const char* filepath() {
return m_filepath;
}
@ -99,7 +99,7 @@ class ElfFile: public CHeapObj {
return (m_filepath && !strcmp(filepath, m_filepath));
}
Decoder::decoder_status get_status() {
NullDecoder::decoder_status get_status() {
return m_status;
}
@ -119,8 +119,9 @@ class ElfFile: public CHeapObj {
// return a string table at specified section index
ElfStringTable* get_string_table(int index);
// look up an address and return the nearest symbol
const char* look_up(Elf_Shdr shdr, address addr, int* offset);
protected:
ElfFile* next() const { return m_next; }
void set_next(ElfFile* file) { m_next = file; }
protected:
ElfFile* m_next;
@ -131,17 +132,17 @@ class ElfFile: public CHeapObj {
FILE* m_file;
// Elf header
Elf_Ehdr m_elfHdr;
Elf_Ehdr m_elfHdr;
// symbol tables
ElfSymbolTable* m_symbol_tables;
ElfSymbolTable* m_symbol_tables;
// string tables
ElfStringTable* m_string_tables;
ElfStringTable* m_string_tables;
Decoder::decoder_status m_status;
NullDecoder::decoder_status m_status;
};
#endif // _WINDOWS
#endif // __ELF_FILE_HPP
#endif // SHARE_VM_UTILITIES_ELF_FILE_HPP

View File

@ -38,7 +38,7 @@ ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
m_index = index;
m_next = NULL;
m_file = file;
m_status = Decoder::no_error;
m_status = NullDecoder::no_error;
// try to load the string table
long cur_offset = ftell(file);
@ -48,7 +48,7 @@ ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
if (fseek(file, shdr.sh_offset, SEEK_SET) ||
fread((void*)m_table, shdr.sh_size, 1, file) != 1 ||
fseek(file, cur_offset, SEEK_SET)) {
m_status = Decoder::file_invalid;
m_status = NullDecoder::file_invalid;
os::free((void*)m_table);
m_table = NULL;
}
@ -67,22 +67,23 @@ ElfStringTable::~ElfStringTable() {
}
}
const char* ElfStringTable::string_at(int pos) {
if (m_status != Decoder::no_error) {
return NULL;
bool ElfStringTable::string_at(int pos, char* buf, int buflen) {
if (NullDecoder::is_error(m_status)) {
return false;
}
if (m_table != NULL) {
return (const char*)(m_table + pos);
jio_snprintf(buf, buflen, "%s", (const char*)(m_table + pos));
return true;
} else {
long cur_pos = ftell(m_file);
if (cur_pos == -1 ||
fseek(m_file, m_shdr.sh_offset + pos, SEEK_SET) ||
fread(m_symbol, 1, MAX_SYMBOL_LEN, m_file) <= 0 ||
fread(buf, 1, buflen, m_file) <= 0 ||
fseek(m_file, cur_pos, SEEK_SET)) {
m_status = Decoder::file_invalid;
return NULL;
m_status = NullDecoder::file_invalid;
return false;
}
return (const char*)m_symbol;
return true;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, 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
@ -22,8 +22,8 @@
*
*/
#ifndef __ELF_STRING_TABLE_HPP
#define __ELF_STRING_TABLE_HPP
#ifndef SHARE_VM_UTILITIES_ELF_STRING_TABLE_HPP
#define SHARE_VM_UTILITIES_ELF_STRING_TABLE_HPP
#if !defined(_WINDOWS) && !defined(__APPLE__)
@ -35,9 +35,6 @@
// The string table represents a string table section in an elf file.
// Whenever there is enough memory, it will load whole string table as
// one blob. Otherwise, it will load string from file when requested.
#define MAX_SYMBOL_LEN 256
class ElfStringTable: CHeapObj {
friend class ElfFile;
public:
@ -48,10 +45,10 @@ class ElfStringTable: CHeapObj {
int index() { return m_index; };
// get string at specified offset
const char* string_at(int offset);
bool string_at(int offset, char* buf, int buflen);
// get status code
Decoder::decoder_status get_status() { return m_status; };
NullDecoder::decoder_status get_status() { return m_status; };
protected:
ElfStringTable* m_next;
@ -69,13 +66,10 @@ class ElfStringTable: CHeapObj {
// section header
Elf_Shdr m_shdr;
// buffer for reading individual string
char m_symbol[MAX_SYMBOL_LEN];
// error code
Decoder::decoder_status m_status;
NullDecoder::decoder_status m_status;
};
#endif // _WINDOWS
#endif // _WINDOWS and _APPLE
#endif // __ELF_STRING_TABLE_HPP
#endif // SHARE_VM_UTILITIES_ELF_STRING_TABLE_HPP

View File

@ -34,7 +34,7 @@ ElfSymbolTable::ElfSymbolTable(FILE* file, Elf_Shdr shdr) {
m_symbols = NULL;
m_next = NULL;
m_file = file;
m_status = Decoder::no_error;
m_status = NullDecoder::no_error;
// try to load the string table
long cur_offset = ftell(file);
@ -45,16 +45,16 @@ ElfSymbolTable::ElfSymbolTable(FILE* file, Elf_Shdr shdr) {
if (fseek(file, shdr.sh_offset, SEEK_SET) ||
fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 ||
fseek(file, cur_offset, SEEK_SET)) {
m_status = Decoder::file_invalid;
m_status = NullDecoder::file_invalid;
os::free(m_symbols);
m_symbols = NULL;
}
}
if (m_status == Decoder::no_error) {
if (!NullDecoder::is_error(m_status)) {
memcpy(&m_shdr, &shdr, sizeof(Elf_Shdr));
}
} else {
m_status = Decoder::file_invalid;
m_status = NullDecoder::file_invalid;
}
}
@ -68,13 +68,13 @@ ElfSymbolTable::~ElfSymbolTable() {
}
}
Decoder::decoder_status ElfSymbolTable::lookup(address addr, int* stringtableIndex, int* posIndex, int* offset) {
bool ElfSymbolTable::lookup(address addr, int* stringtableIndex, int* posIndex, int* offset) {
assert(stringtableIndex, "null string table index pointer");
assert(posIndex, "null string table offset pointer");
assert(offset, "null offset pointer");
if (m_status != Decoder::no_error) {
return m_status;
if (NullDecoder::is_error(m_status)) {
return false;
}
address pc = 0;
@ -97,8 +97,8 @@ Decoder::decoder_status ElfSymbolTable::lookup(address addr, int* stringtableInd
long cur_pos;
if ((cur_pos = ftell(m_file)) == -1 ||
fseek(m_file, m_shdr.sh_offset, SEEK_SET)) {
m_status = Decoder::file_invalid;
return m_status;
m_status = NullDecoder::file_invalid;
return false;
}
Elf_Sym sym;
@ -114,13 +114,13 @@ Decoder::decoder_status ElfSymbolTable::lookup(address addr, int* stringtableInd
}
}
} else {
m_status = Decoder::file_invalid;
return m_status;
m_status = NullDecoder::file_invalid;
return false;
}
}
fseek(m_file, cur_pos, SEEK_SET);
}
return m_status;
return true;
}
#endif // _WINDOWS

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, 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
@ -22,8 +22,8 @@
*
*/
#ifndef __ELF_SYMBOL_TABLE_HPP
#define __ELF_SYMBOL_TABLE_HPP
#ifndef SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP
#define SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP
#if !defined(_WINDOWS) && !defined(__APPLE__)
@ -45,9 +45,9 @@ class ElfSymbolTable: public CHeapObj {
~ElfSymbolTable();
// search the symbol that is nearest to the specified address.
Decoder::decoder_status lookup(address addr, int* stringtableIndex, int* posIndex, int* offset);
bool lookup(address addr, int* stringtableIndex, int* posIndex, int* offset);
Decoder::decoder_status get_status() { return m_status; };
NullDecoder::decoder_status get_status() { return m_status; };
protected:
ElfSymbolTable* m_next;
@ -62,9 +62,9 @@ class ElfSymbolTable: public CHeapObj {
// section header
Elf_Shdr m_shdr;
Decoder::decoder_status m_status;
NullDecoder::decoder_status m_status;
};
#endif // _WINDOWS
#endif // _WINDOWS and _APPLE
#endif // __ELF_SYMBOL_TABLE_HPP
#endif // SHARE_VM_UTILITIES_ELF_SYMBOL_TABLE_HPP

View File

@ -298,6 +298,11 @@ const jushort max_jushort = (jushort)-1; // 0xFFFF largest jushort
const juint max_juint = (juint)-1; // 0xFFFFFFFF largest juint
const julong max_julong = (julong)-1; // 0xFF....FF largest julong
typedef jbyte s1;
typedef jshort s2;
typedef jint s4;
typedef jlong s8;
//----------------------------------------------------------------------------------------------------
// JVM spec restrictions

View File

@ -571,8 +571,6 @@ void VMError::report(outputStream* st) {
if (fr.pc()) {
st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)");
// initialize decoder to decode C frames
Decoder decoder;
int count = 0;
while (count++ < StackPrintLimit) {

View File

@ -140,3 +140,7 @@ bcc739229f6384786c7ac0b52c1822c85674dcf1 jdk8-b13
09eb517404b059607aca30cdd1af83ffc57eafeb jdk8-b17
09eb517404b059607aca30cdd1af83ffc57eafeb jdk8-b16
ebec6a7e8d4e481d205a2109ddeea8121d76db7f jdk8-b18
dffeb62b1a7fc8b316bf58fe5479323f3661894e jdk8-b19
f052abb8f37444ba77858913887d0d92795dd6b8 jdk8-b20
d41eeadf5c1344b88c5051a997aec9e1ad7ce1db jdk8-b21
cf9d6ec44f891236ad18451021d6dcd57dc82f7b jdk8-b22

View File

@ -140,3 +140,7 @@ c9ab96ff23d52d85d5dcce1f9c0fd7a3de418c74 jdk8-b15
3d45ab79643d5b4cc7e050ae2d9c08b4d89d665e jdk8-b17
3d45ab79643d5b4cc7e050ae2d9c08b4d89d665e jdk8-b16
54928c8850f5498670dd43d6c9299f36de1a6746 jdk8-b18
b73b733214aa43648d69a2da51e6b48fda902a2d jdk8-b19
2b2818e3386f4510c390f6aea90d77e1c6a5bf9e jdk8-b20
c266cab0e3fff05f2048c23046c14d60f7102175 jdk8-b21
8d3df89b0f2d3c603b2edb0f5e24af1245397cc6 jdk8-b22

View File

@ -96,6 +96,10 @@
</replaceregexp>
<mkdir dir="${build.classes.dir}/META-INF/services"/>
<copy todir="${build.classes.dir}/META-INF"
file="${secondary.src.dir}/META-INF/mailcap.default"/>
<copy todir="${build.classes.dir}/META-INF"
file="${secondary.src.dir}/META-INF/mimetypes.default"/>
<copy todir="${build.classes.dir}/META-INF/services"
file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory"/>
<copy todir="${build.classes.dir}/META-INF/services"
@ -118,6 +122,7 @@
<!-- Set up source to use drop.dir. -->
<target name="-use-drop" depends="-set-props">
<property name="primary.src.dir" value="${jaxws_src.src.dir}"/>
<property name="secondary.src.dir" value="${jaf_src.src.dir}"/>
<path id="src.dir.id">
<pathelement path="${primary.src.dir}"/>
<pathelement path="${jaf_src.src.dir}"/>

View File

@ -140,3 +140,7 @@ f1ec21b8142168ff40f3278d2f6b5fe4bd5f3b26 jdk8-b09
b71d1acfae5240d8c1359443cd02b5ddb587231c jdk8-b17
929597c6e777f742ad252660045ebaa4a3ea4772 jdk8-b16
334bd51fb3f321cd6777416ae7bafac71a84140a jdk8-b18
3778f85773055e81eab6c5ef828935ecca241810 jdk8-b19
39e938cd1b82ec3aab0a9aa66fd8a0457cd0c9c2 jdk8-b20
664fa4fb0ee411ef048903c479f8b962fcdb2f4b jdk8-b21
dda27c73d8db4a9c7a23872b6f0c5106edcb2021 jdk8-b22

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -25,15 +25,24 @@
BUILDDIR = ../..
PRODUCT = oracle
#SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
#SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
#SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
include $(BUILDDIR)/common/Defs.gmk
#
# Files to compile
#
AUTO_FILES_JAVA_DIRS = com/oracle
# build com/oracle/security/ucrypto on Solaris platform for non-OpenJDK builds
UCRYPTO =
ifndef OPENJDK
ifeq ($(PLATFORM), solaris)
UCRYPTO = security/ucrypto
endif
endif
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
SUBDIRS = net nio util $(UCRYPTO)
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)

View File

@ -0,0 +1,40 @@
#
# Copyright (c) 2012, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
BUILDDIR = ../../..
PACKAGE = com.oracle.net
PRODUCT = oracle
include $(BUILDDIR)/common/Defs.gmk
#
# Files
#
AUTO_FILES_JAVA_DIRS = com/oracle/net
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk

View File

@ -0,0 +1,40 @@
#
# Copyright (c) 2012, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
BUILDDIR = ../../..
PACKAGE = com.oracle.nio
PRODUCT = oracle
include $(BUILDDIR)/common/Defs.gmk
#
# Files
#
AUTO_FILES_JAVA_DIRS = com/oracle/nio
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk

View File

@ -0,0 +1,30 @@
#
# Copyright (c) 2012, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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 OPENJDK
FILES_c = \
nativeFunc.c \
nativeCrypto.c
endif

View File

@ -0,0 +1,270 @@
#
# Copyright (c) 2012, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
#
# Makefile for building ucrypto.jar and its native libraries.
#
# This file was modified from make/sun/security/pkcs11/Makefile.
#
#
# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle
# JDK builds respectively.)
#
# This Makefile does the "real" build of the Ucrypto provider files.
# Since the sources are unavailable for OpenJDK, this Makefile is only
# useful for JDK.
#
#
# Main Targets (JDK on Solaris):
#
# all The usual, ucrypto.jar plus the native libraries.
# builds and installs the prebuilt/signed jar.
#
# clobber/clean Cleans up the temp directory, ucrypto.jar, the
# native libraries, and the config file from the
# build area
#
# jar Builds, signs and installs ucrypto.jar
# (Can only be done on machines with access to
# the signing keystore)
#
# Other lesser-used Targets (JDK on Solaris):
#
# build-jar Builds ucrypto.jar (no sign/install)
#
# sign Builds/signs ucrypto.jar (no install)
#
# release Builds all targets in preparation
# for workspace integration.
# (Can only be done on machines with access to
# the signing keystore)
#
# install-prebuilt Installs the pre-built jar files
#
# NOTE: None of the above target will update the prebuilt provider binary
# under the closed workspace. To update it, you must explicitly copy the
# binary from either the tmp/signed or lib/ext directory.
#
# This makefile was written to support parallel target execution.
#
BUILDDIR = ../../../..
include $(BUILDDIR)/common/Defs.gmk
ifndef OPENJDK
ifneq ($(PLATFORM), solaris)
all:
else
PACKAGE = com.oracle.security.ucrypto
LIBRARY = j2ucrypto
PRODUCT = oracle
#
# The following is for when we need to do postprocessing
# (signing/obfuscation) against a read-only build. If the OUTPUTDIR
# isn't writable, the build currently crashes out.
#
ifdef ALT_JCE_BUILD_DIR
# =====================================================
# Where to place the output, in case we're building from a read-only
# build area. (e.g. a release engineering build.)
JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
IGNORE_WRITABLE_OUTPUTDIR_TEST=true
else
JCE_BUILD_DIR=${TEMPDIR}
endif
JAVAC_MAX_WARNINGS=false
JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
JAVAC_WARNINGS_FATAL=true
#
# C and Java Files
#
include FILES_c.gmk
#
# Subdirectories of these are automatically included.
#
AUTO_FILES_JAVA_DIRS = com/oracle/security/ucrypto
#
# Java files that define native methods
#
FILES_export = \
com/oracle/security/ucrypto/UcryptoProvider.java \
com/oracle/security/ucrypto/NativeCipher.java \
com/oracle/security/ucrypto/NativeDigest.java \
com/oracle/security/ucrypto/NativeKey.java \
com/oracle/security/ucrypto/NativeRSASignature.java \
com/oracle/security/ucrypto/NativeRSACipher.java
#
# Find native code
#
vpath %.c \
$(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
#
# Find include files
#
OTHER_INCLUDES += \
-I$(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
#
# Rules
#
CLASSDESTDIR = $(TEMPDIR)/classes
JAVAHFLAGS = -bootclasspath \
"$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
include $(BUILDDIR)/common/Mapfile-vers.gmk
include $(BUILDDIR)/common/Library.gmk
#
# Libraries to link
#
OTHER_LDLIBS = -ldl
# Default config file
UCRYPTO_CFG_SRC = $(CLOSED_SRC)/share/lib/security/ucrypto-solaris.cfg
UCRYPTO_CFG_BUILD = $(LIBDIR)/security/ucrypto-solaris.cfg
#
# We use a variety of subdirectories in the $(TEMPDIR) depending on what
# part of the build we're doing. Build is initially done in the unsigned
# area and when files are signed, they will be placed in the appropriate area.
#
UNSIGNED_DIR = $(TEMPDIR)/unsigned
#
# Rules
#
all: ucrypto-cfg build-jar install-prebuilt
$(build-warning)
ucrypto-cfg: $(UCRYPTO_CFG_BUILD)
$(UCRYPTO_CFG_BUILD): $(UCRYPTO_CFG_SRC)
$(install-file)
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
# =====================================================
# Build the unsigned ucrypto.jar file.
#
JAR_DESTFILE = $(EXTDIR)/ucrypto.jar
#
# The ucrypto.jar needs to be in the extension class directory,
# therefore none of its classes can appear in $(CLASSBINDIR).
# Currently no one is using any of the internals, so these files
# should not have been built.
#
#
# Since the -C option to jar is used below, each directory entry must be
# preceded with the appropriate directory to "cd" into.
#
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
build-jar: $(UNSIGNED_DIR)/ucrypto.jar
#
# Build ucrypto.jar.
#
$(UNSIGNED_DIR)/ucrypto.jar: build
$(prep-target)
$(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
#
# Sign ucrypto.jar
#
SIGNED_DIR = $(JCE_BUILD_DIR)/signed
sign: $(SIGNED_DIR)/ucrypto.jar
ifndef ALT_JCE_BUILD_DIR
$(SIGNED_DIR)/ucrypto.jar: $(UNSIGNED_DIR)/ucrypto.jar
else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(SIGNED_DIR)/ucrypto.jar:
@if [ ! -r $(UNSIGNED_DIR)/ucrypto.jar ] ; then \
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/ucrypto.jar"; \
exit 1; \
fi
endif
$(call sign-file, $(UNSIGNED_DIR)/ucrypto.jar)
# =====================================================
# Create the Release Engineering files. Signed builds, etc.
#
release: $(SIGNED_DIR)/ucrypto.jar
$(RM) $(JCE_BUILD_DIR)/release/ucrypto.jar
$(MKDIR) -p $(JCE_BUILD_DIR)/release
$(CP) $(SIGNED_DIR)/ucrypto.jar $(JCE_BUILD_DIR)/release
$(release-warning)
# =====================================================
# Install routines.
#
#
# Install ucrypto.jar, depending on which type is requested.
#
jar: $(JAR_DESTFILE)
$(release-warning)
$(JAR_DESTFILE): $(SIGNED_DIR)/ucrypto.jar
$(install-file)
install-prebuilt:
@$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..."
$(RM) $(JAR_DESTFILE)
$(CP) $(PREBUILT_DIR)/ucrypto/ucrypto.jar $(JAR_DESTFILE)
# =====================================================
# Support routines.
#
clobber clean::
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
$(RM) -r $(UCRYPTO_CFG_BUILD)
.PHONY: build-jar jar sign release install-prebuilt
endif #ifneq ($(PLATFORM), solaris)
endif #ifndef OPENJDK

View File

@ -0,0 +1,69 @@
#
# Copyright (c) 2012, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
# Define public interface.
SUNWprivate_1.1 {
global:
JNI_OnLoad;
Java_com_oracle_security_ucrypto_UcryptoProvider_loadLibraries;
Java_com_oracle_security_ucrypto_UcryptoProvider_getMechList;
Java_com_oracle_security_ucrypto_NativeDigest_nativeInit;
Java_com_oracle_security_ucrypto_NativeDigest_nativeUpdate;
Java_com_oracle_security_ucrypto_NativeDigest_nativeDigest;
Java_com_oracle_security_ucrypto_NativeDigest_nativeClone;
Java_com_oracle_security_ucrypto_NativeDigest_nativeFree;
Java_com_oracle_security_ucrypto_NativeCipher_nativeInit;
Java_com_oracle_security_ucrypto_NativeCipher_nativeUpdate;
Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal;
Java_com_oracle_security_ucrypto_NativeKey_nativeFree;
Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit;
Java_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit;
Java_com_oracle_security_ucrypto_NativeRSASignature_nativeInit;
Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII;
Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI;
Java_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal;
Java_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic;
JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit;
JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate;
JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest;
JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeClone;
JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree;
JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit;
JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate;
JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal;
JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree;
JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit;
JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit;
JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit;
JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII;
JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI;
JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal;
JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic;
local:
*;
};

View File

@ -0,0 +1,40 @@
#
# Copyright (c) 2012, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
BUILDDIR = ../../..
PACKAGE = com.oracle.util
PRODUCT = oracle
include $(BUILDDIR)/common/Defs.gmk
#
# Files
#
AUTO_FILES_JAVA_DIRS = com/oracle/util
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk

View File

@ -32,6 +32,9 @@
BUILDDIR = ../../../../..
PACKAGE = com.sun.demo.jvmti.hprof
PRODUCT = sun
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
#

View File

@ -28,6 +28,9 @@
BUILDDIR = ../../../../..
PACKAGE = com.sun.java.browser.net
PRODUCT = plugin
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
#

View File

@ -30,6 +30,9 @@
BUILDDIR = ../../..
PACKAGE = com.sun.tools
PRODUCT = sun
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = com/sun/tools/extcheck

View File

@ -28,6 +28,9 @@ BUILDDIR = ../../../..
PACKAGE = com.sun.tools.attach
LIBRARY = attach
PRODUCT = sun
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
ifeq ($(PLATFORM), solaris)

View File

@ -30,6 +30,9 @@
BUILDDIR = ../../..
PACKAGE = com.sun.tracing
PRODUCT = sun
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dtrace

View File

@ -29,6 +29,9 @@
BUILDDIR = ../../../..
PACKAGE = com.sun.tracing.dtrace
PRODUCT = sun
JAVAC_MAX_WARNINGS = true
JAVAC_WARNINGS_FATAL = true
include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = com/sun/tracing/dtrace

View File

@ -72,7 +72,6 @@ FDDLIBM_SUFFIX = a
SCRIPT_SUFFIX =
# CC compiler object code output directive flag value
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
# Default OBJCOPY comes from GNU Binutils on Linux:
DEF_OBJCOPY=/usr/bin/objcopy

View File

@ -72,7 +72,6 @@ FDDLIBM_SUFFIX = a
SCRIPT_SUFFIX =
# CC compiler object code output directive flag value
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
ifdef ENABLE_FULL_DEBUG_SYMBOLS
# Only check for Full Debug Symbols support on Solaris if it is

View File

@ -36,7 +36,6 @@ include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
# CC compiler object code output directive flag value
CC_OBJECT_OUTPUT_FLAG = -Fo
CC_PROGRAM_OUTPUT_FLAG = -Fe
# The suffix applied to the library name for FDLIBM
FDDLIBM_SUFFIX = lib

View File

@ -319,9 +319,12 @@ $(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS)
@$(prep-target)
ifeq ($(PLATFORM),windows)
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE)
endif
$(LINK.demo) $(SHARED_LIBRARY_FLAG) $(CC_PROGRAM_OUTPUT_FLAG)$@ \
$(LINK.demo) $(SHARED_LIBRARY_FLAG) -Fe$@ \
$(DEMO_FULL_OBJECTS) $(LDLIBS.demo)
else
$(LINK.demo) $(SHARED_LIBRARY_FLAG) -o $@ \
$(DEMO_FULL_OBJECTS) $(LDLIBS.demo)
endif
@$(call binary_file_verification,$@)
# Generation of any javah include file, make sure objects are dependent on it

View File

@ -82,11 +82,13 @@ ifdef OPENJDK
SHARE_JRE_DOC_SRC = $(JDK_TOPDIR)
# Same files for jdk and jre, no name changes
IMAGE_DOCLIST_JDK = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
IMAGE_DOCLIST_JDK_DEMOS_AND_SAMPLES =
IMAGE_DOCLIST_JRE = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
else
# make/closed/common/Defs.gmk for closed location of SHARE_JDK_DOC_SRC
IMAGE_DOCLIST_JDK = COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt
IMAGE_DOCLIST_JDK_DEMOS_AND_SAMPLES = demo/DEMOS_LICENSE sample/SAMPLES_LICENSE
IMAGE_DOCLIST_JRE = COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
ifeq ($(PLATFORM), windows)
IMAGE_DOCLIST_JRE += README.txt
@ -98,6 +100,7 @@ endif
# Paths to these files we need
JDK_DOCFILES = $(IMAGE_DOCLIST_JDK:%=$(JDK_IMAGE_DIR)/%)
JRE_DOCFILES = $(IMAGE_DOCLIST_JRE:%=$(JRE_IMAGE_DIR)/%)
JDK_DEMOS_AND_SAMPLES_DOCFILES = $(IMAGE_DOCLIST_JDK_DEMOS_AND_SAMPLES:%=$(JDK_IMAGE_DIR)/%)
# absolute directory names: note, these must exist prior to build
# time - they are created in the main Makefile.
@ -320,6 +323,7 @@ TOOLS = \
sun/tools/jar \
sun/tools/java \
sun/tools/javac \
sun/tools/jcmd \
sun/tools/jps \
sun/tools/jstat \
sun/tools/jstatd \
@ -432,6 +436,7 @@ NOTJRETOOLS = \
apt$(EXE_SUFFIX) \
javah$(EXE_SUFFIX) \
javap$(EXE_SUFFIX) \
jcmd$(EXE_SUFFIX) \
jdb$(EXE_SUFFIX) \
jps$(EXE_SUFFIX) \
jrunscript$(EXE_SUFFIX) \
@ -484,6 +489,12 @@ endef
$(JDK_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
$(process-doc-file)
$(JDK_IMAGE_DIR)/demo/DEMOS_LICENSE: $(SHARE_JDK_DOC_SRC)/DEMOS_LICENSE
$(process-doc-file)
$(JDK_IMAGE_DIR)/sample/SAMPLES_LICENSE: $(SHARE_JDK_DOC_SRC)/SAMPLES_LICENSE
$(process-doc-file)
# JRE files
$(JRE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
$(process-doc-file)
@ -535,6 +546,7 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "sun/tools/javac/" >> $@
$(ECHO) "com/sun/tools/classfile/" >> $@
$(ECHO) "com/sun/tools/javap/" >> $@
$(ECHO) "sun/tools/jcmd/" >> $@
$(ECHO) "sun/tools/jconsole/" >> $@
$(ECHO) "sun/tools/jps/" >> $@
$(ECHO) "sun/tools/jstat/" >> $@
@ -911,7 +923,8 @@ endif
# Standard jdk image
initial-image-jdk:: initial-image-jdk-setup \
initial-image-jdk-db \
$(JDK_DOCFILES)
$(JDK_DOCFILES) \
$(JDK_DEMOS_AND_SAMPLES_DOCFILES)
$(MKDIR) $(JDK_IMAGE_DIR)/lib
@#
@# Copy in the jars in lib that only belong in the JDK

View File

@ -75,9 +75,11 @@ include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
SRC_BUNDLEDIR = $(OUTPUTDIR)/source-bundles
ABS_SRC_BUNDLEDIR = $(ABS_OUTPUTDIR)/source-bundles
BIN_BUNDLEDIR = $(OUTPUTDIR)/bundles
BIN_DEMOS_BUNDLEDIR = $(OUTPUTDIR)/demos-bundles
ABS_BIN_BUNDLEDIR = $(ABS_OUTPUTDIR)/bundles
dummy := $(shell $(MKDIR) -p $(BIN_BUNDLEDIR))
dummy := $(shell $(MKDIR) -p $(BIN_DEMOS_BUNDLEDIR) )
dummy := $(shell $(MKDIR) -p $(SRC_BUNDLEDIR) )
TEMP_DIR = $(OUTPUTDIR)/tmp

View File

@ -147,8 +147,8 @@ ifeq ($(SYSTEM_UNAME), SunOS)
endif
# Suffix for file bundles used in previous release
BUNDLE_FILE_SUFFIX=.tar
# How much RAM does this machine have:
MB_OF_MEMORY=$(shell /usr/sbin/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
# How much RAM does this machine have (zones send an error to stderr):
MB_OF_MEMORY:=$(shell /usr/sbin/prtconf 2>/dev/null | fgrep 'Memory size:' | expand | cut -d' ' -f3)
endif
# Platform settings specific to Linux

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