Merge
This commit is contained in:
commit
b1e3e8436a
@ -545,6 +545,7 @@ uintptr_t search_symbol(struct symtab* symtab, uintptr_t base,
|
||||
return (uintptr_t)NULL;
|
||||
|
||||
item.key = (char*) strdup(sym_name);
|
||||
item.data = NULL;
|
||||
hsearch_r(item, FIND, &ret, symtab->hash_table);
|
||||
if (ret) {
|
||||
struct elf_symbol * sym = (struct elf_symbol *)(ret->data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2015, 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
|
||||
@ -403,6 +403,8 @@ $(EXPORT_LIB_ARCH_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM
|
||||
$(install-dir)
|
||||
$(EXPORT_SERVER_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM
|
||||
$(install-dir)
|
||||
$(EXPORT_SERVER_DIR)/%.symbols: $(C2_BUILD_DIR)/%.symbols
|
||||
$(install-file)
|
||||
endif
|
||||
|
||||
# Client (C1)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2015, 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
|
||||
@ -224,6 +224,11 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
|
||||
echo "OPENJDK = $(OPENJDK)"; \
|
||||
echo "$(LP64_SETTING/$(DATA_MODE))"; \
|
||||
echo; \
|
||||
echo "STATIC_BUILD = $(STATIC_BUILD)"; \
|
||||
echo "COMPILER_WARNINGS_FATAL = $(COMPILER_WARNINGS_FATAL)"; \
|
||||
echo "EXTRA_LDFLAGS = $(EXTRA_LDFLAGS)"; \
|
||||
echo "LIBRARY_SUFFIX = $(LIBRARY_SUFFIX)"; \
|
||||
echo; \
|
||||
echo "# Used for platform dispatching"; \
|
||||
echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
|
||||
echo "TARGET_DEFINES += -DTARGET_ARCH_\$$(Platform_arch)"; \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2006, 2015, 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
|
||||
@ -186,13 +186,16 @@ ifeq ($(JDK6_OR_EARLIER),0)
|
||||
# executed multiple times. We reduce the noise by at least checking that
|
||||
# BUILD_FLAVOR has been set.
|
||||
ifneq ($(BUILD_FLAVOR),)
|
||||
ifeq ($(BUILD_FLAVOR), product)
|
||||
FULL_DEBUG_SYMBOLS ?= 1
|
||||
ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
|
||||
else
|
||||
# debug variants always get Full Debug Symbols (if available)
|
||||
ENABLE_FULL_DEBUG_SYMBOLS = 1
|
||||
endif
|
||||
# FULL_DEBUG_SYMBOLS not created for individual static libraries
|
||||
ifeq ($(STATIC_BUILD),false)
|
||||
ifeq ($(BUILD_FLAVOR), product)
|
||||
FULL_DEBUG_SYMBOLS ?= 1
|
||||
ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
|
||||
else
|
||||
# debug variants always get Full Debug Symbols (if available)
|
||||
ENABLE_FULL_DEBUG_SYMBOLS = 1
|
||||
endif
|
||||
endif
|
||||
$(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
|
||||
# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
|
||||
|
||||
@ -256,16 +259,24 @@ endif # JDK_6_OR_EARLIER
|
||||
JDK_INCLUDE_SUBDIR=bsd
|
||||
|
||||
# Library suffix
|
||||
ifeq ($(OS_VENDOR),Darwin)
|
||||
LIBRARY_SUFFIX=dylib
|
||||
ifneq ($(STATIC_BUILD),true)
|
||||
ifeq ($(OS_VENDOR),Darwin)
|
||||
LIBRARY_SUFFIX=dylib
|
||||
else
|
||||
LIBRARY_SUFFIX=so
|
||||
endif
|
||||
else
|
||||
LIBRARY_SUFFIX=so
|
||||
LIBRARY_SUFFIX=a
|
||||
endif
|
||||
|
||||
|
||||
EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
|
||||
|
||||
# jsig library not needed for static builds
|
||||
ifneq ($(STATIC_BUILD),true)
|
||||
# client and server subdirectories have symbolic links to ../libjsig.so
|
||||
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
|
||||
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES),1)
|
||||
@ -286,6 +297,9 @@ EXPORT_MINIMAL_DIR = $(EXPORT_LIB_ARCH_DIR)/minimal
|
||||
ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
||||
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
|
||||
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.symbols
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES),1)
|
||||
@ -303,6 +317,9 @@ endif
|
||||
ifeq ($(JVM_VARIANT_CLIENT),true)
|
||||
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
|
||||
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.symbols
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES),1)
|
||||
@ -320,6 +337,9 @@ endif
|
||||
ifeq ($(JVM_VARIANT_MINIMAL1),true)
|
||||
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
|
||||
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.symbols
|
||||
endif
|
||||
endif
|
||||
|
||||
# Serviceability Binaries
|
||||
@ -388,7 +408,9 @@ ifeq ($(OS_VENDOR), Darwin)
|
||||
endif
|
||||
|
||||
# Binaries to 'universalize' if built
|
||||
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX)
|
||||
ifneq ($(STATIC_BUILD),true)
|
||||
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX)
|
||||
endif
|
||||
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX)
|
||||
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX)
|
||||
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX)
|
||||
@ -396,6 +418,13 @@ ifeq ($(OS_VENDOR), Darwin)
|
||||
# Files to simply copy in place
|
||||
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/Xusage.txt
|
||||
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/client/Xusage.txt
|
||||
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/libjvm.symbols
|
||||
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/client/libjvm.symbols
|
||||
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/minimal/libjvm.symbols
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES),1)
|
||||
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/libjvm.diz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2015, 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
|
||||
@ -37,15 +37,15 @@ DtraceOutDir = $(GENERATED)/dtracefiles
|
||||
# Bsd does not build libjvm_db, does not compile on macosx
|
||||
# disabled in build: rule in vm.make
|
||||
JVM_DB = libjvm_db
|
||||
LIBJVM_DB = libjvm_db.dylib
|
||||
LIBJVM_DB = libjvm_db.$(LIBRARY_SUFFIX)
|
||||
|
||||
LIBJVM_DB_DEBUGINFO = libjvm_db.dylib.dSYM
|
||||
LIBJVM_DB_DEBUGINFO = libjvm_db.$(LIBRARY_SUFFIX).dSYM
|
||||
LIBJVM_DB_DIZ = libjvm_db.diz
|
||||
|
||||
JVM_DTRACE = jvm_dtrace
|
||||
LIBJVM_DTRACE = libjvm_dtrace.dylib
|
||||
LIBJVM_DTRACE = libjvm_dtrace.$(LIBRARY_SUFFIX)
|
||||
|
||||
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.dylib.dSYM
|
||||
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.$(LIBRARY_SUFFIX).dSYM
|
||||
LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz
|
||||
|
||||
JVMOFFS = JvmOffsets
|
||||
@ -167,14 +167,14 @@ endif # ifneq ("${ISA}","${BUILDARCH}")
|
||||
|
||||
LFLAGS_GENOFFS += -L.
|
||||
|
||||
lib$(GENOFFS).dylib: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
|
||||
lib$(GENOFFS).$(LIBRARY_SUFFIX): $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
|
||||
$(LIBJVM.o)
|
||||
$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
|
||||
$(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -ljvm
|
||||
|
||||
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).dylib
|
||||
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).$(LIBRARY_SUFFIX)
|
||||
$(QUIETLY) $(LINK.CXX) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
|
||||
./lib$(GENOFFS).dylib
|
||||
./lib$(GENOFFS).$(LIBRARY_SUFFIX)
|
||||
|
||||
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
|
||||
$(JVMOFFS).h: $(GENOFFS)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 2015, 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
|
||||
@ -186,7 +186,14 @@ ifeq ($(JVM_VARIANT_ZEROSHARK), true)
|
||||
CFLAGS += $(LIBFFI_CFLAGS)
|
||||
CFLAGS += $(LLVM_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
CXXFLAGS += -DSTATIC_BUILD
|
||||
CFLAGS += -DSTATIC_BUILD
|
||||
else
|
||||
CFLAGS += $(VM_PICFLAG)
|
||||
endif
|
||||
|
||||
CFLAGS += -fno-rtti
|
||||
CFLAGS += -fno-exceptions
|
||||
ifeq ($(USE_CLANG),)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,9 +28,9 @@
|
||||
JSIG = jsig
|
||||
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
LIBJSIG = lib$(JSIG).dylib
|
||||
LIBJSIG = lib$(JSIG).$(LIBRARY_SUFFIX)
|
||||
|
||||
LIBJSIG_DEBUGINFO = lib$(JSIG).dylib.dSYM
|
||||
LIBJSIG_DEBUGINFO = lib$(JSIG).$(LIBRARY_SUFFIX).dSYM
|
||||
LIBJSIG_DIZ = lib$(JSIG).diz
|
||||
else
|
||||
LIBJSIG = lib$(JSIG).so
|
||||
@ -61,8 +61,14 @@ endif
|
||||
|
||||
$(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
|
||||
@echo $(LOG_INFO) Making signal interposition lib...
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
$(QUIETLY) $(CC) -c $(SYMFLAG) $(EXTRA_CFLAGS) $(ARCHFLAG) $(PICFLAG) \
|
||||
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $(JSIG).o $<
|
||||
$(QUIETLY) $(AR) $(ARFLAGS) $@ $(JSIG).o
|
||||
else
|
||||
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
|
||||
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
|
||||
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
|
||||
endif
|
||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
$(DSYMUTIL) $@
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,7 +39,11 @@ AS.S = $(AS) $(ASFLAGS)
|
||||
COMPILE.CC = $(CC_COMPILE) -c
|
||||
GENASM.CC = $(CC_COMPILE) -S
|
||||
LINK.CC = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
LINK_LIB.CC = $(AR) $(ARFLAGS)
|
||||
else
|
||||
LINK_LIB.CC = $(CC) $(LFLAGS) $(SHARED_FLAG)
|
||||
endif
|
||||
PREPROCESS.CC = $(CC_COMPILE) -E
|
||||
|
||||
COMPILE.CXX = $(CXX_COMPILE) -c
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,9 +28,9 @@
|
||||
SAPROC = saproc
|
||||
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
LIBSAPROC = lib$(SAPROC).dylib
|
||||
LIBSAPROC = lib$(SAPROC).$(LIBRARY_SUFFIX)
|
||||
|
||||
LIBSAPROC_DEBUGINFO = lib$(SAPROC).dylib.dSYM
|
||||
LIBSAPROC_DEBUGINFO = lib$(SAPROC).$(LIBRARY_SUFFIX).dSYM
|
||||
LIBSAPROC_DIZ = lib$(SAPROC).diz
|
||||
else
|
||||
LIBSAPROC = lib$(SAPROC).so
|
||||
|
@ -142,10 +142,10 @@ include $(MAKEFILES_DIR)/dtrace.make
|
||||
|
||||
JVM = jvm
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
LIBJVM = lib$(JVM).dylib
|
||||
LIBJVM = lib$(JVM).$(LIBRARY_SUFFIX)
|
||||
CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
|
||||
|
||||
LIBJVM_DEBUGINFO = lib$(JVM).dylib.dSYM
|
||||
LIBJVM_DEBUGINFO = lib$(JVM).$(LIBRARY_SUFFIX).dSYM
|
||||
LIBJVM_DIZ = lib$(JVM).diz
|
||||
else
|
||||
LIBJVM = lib$(JVM).so
|
||||
@ -261,6 +261,16 @@ mapfile : $(MAPFILE) mapfile_extra vm.def
|
||||
{ print $$0 } \
|
||||
}' > $@ < $(MAPFILE)
|
||||
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
EXPORTED_SYMBOLS = libjvm.symbols
|
||||
|
||||
libjvm.symbols : mapfile
|
||||
$(CP) mapfile libjvm.symbols
|
||||
|
||||
else
|
||||
EXPORTED_SYMBOLS =
|
||||
endif
|
||||
|
||||
mapfile_reorder : mapfile $(REORDERFILE)
|
||||
rm -f $@
|
||||
cat $^ > $@
|
||||
@ -288,9 +298,11 @@ else
|
||||
LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
|
||||
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/.
|
||||
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/..
|
||||
LFLAGS_VM += -Xlinker -install_name -Xlinker @rpath/$(@F)
|
||||
ifneq ($(STATIC_BUILD),true)
|
||||
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/.
|
||||
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/..
|
||||
LFLAGS_VM += -Xlinker -install_name -Xlinker @rpath/$(@F)
|
||||
endif
|
||||
else
|
||||
LFLAGS_VM += -Wl,-z,defs
|
||||
endif
|
||||
@ -345,6 +357,10 @@ LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
|
||||
endif
|
||||
|
||||
$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
|
||||
ifeq ($(STATIC_BUILD),true)
|
||||
echo Linking static vm...;
|
||||
$(LINK_LIB.CC) $@ $(LIBJVM.o)
|
||||
else
|
||||
$(QUIETLY) { \
|
||||
echo $(LOG_INFO) Linking vm...; \
|
||||
$(LINK_LIB.CXX/PRE_HOOK) \
|
||||
@ -354,6 +370,8 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
|
||||
rm -f $@.1; ln -s $@ $@.1; \
|
||||
}
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
$(DSYMUTIL) $@
|
||||
@ -410,10 +428,10 @@ include $(MAKEFILES_DIR)/saproc.make
|
||||
|
||||
ifeq ($(OS_VENDOR), Darwin)
|
||||
# no libjvm_db for macosx
|
||||
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck
|
||||
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(EXPORTED_SYMBOLS)
|
||||
echo "Doing vm.make build:"
|
||||
else
|
||||
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
|
||||
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) $(EXPORTED_SYMBOLS)
|
||||
endif
|
||||
|
||||
install: install_jvm install_jsig install_saproc
|
||||
|
@ -223,6 +223,8 @@ ifeq ($(USE_CLANG),)
|
||||
WARNING_FLAGS += -Wtype-limits
|
||||
# GCC < 4.8 don't accept this flag for C++.
|
||||
WARNING_FLAGS += -Wno-format-zero-length
|
||||
# GCC 4.8 reports less false positives than the older compilers.
|
||||
WARNING_FLAGS += -Wuninitialized
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -62,7 +62,7 @@ static int check_nonzero(const char* xname, int x) {
|
||||
void MethodHandles::verify_klass(MacroAssembler* _masm,
|
||||
Register obj, SystemDictionary::WKID klass_id,
|
||||
const char* error_message) {
|
||||
Klass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
InstanceKlass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
KlassHandle klass = SystemDictionary::well_known_klass(klass_id);
|
||||
Register temp = rscratch2;
|
||||
Register temp2 = rscratch1; // used by MacroAssembler::cmpptr
|
||||
|
@ -1276,7 +1276,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
@ -73,7 +73,7 @@ void MethodHandles::verify_klass(MacroAssembler* _masm,
|
||||
Register obj_reg, SystemDictionary::WKID klass_id,
|
||||
Register temp_reg, Register temp2_reg,
|
||||
const char* error_message) {
|
||||
Klass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
InstanceKlass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
KlassHandle klass = SystemDictionary::well_known_klass(klass_id);
|
||||
Label L_ok, L_bad;
|
||||
BLOCK_COMMENT("verify_klass {");
|
||||
|
@ -1701,7 +1701,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType *in_sig_bt,
|
||||
VMRegPair *in_regs,
|
||||
|
@ -69,7 +69,7 @@ void MethodHandles::verify_klass(MacroAssembler* _masm,
|
||||
Register obj_reg, SystemDictionary::WKID klass_id,
|
||||
Register temp_reg, Register temp2_reg,
|
||||
const char* error_message) {
|
||||
Klass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
InstanceKlass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
KlassHandle klass = SystemDictionary::well_known_klass(klass_id);
|
||||
bool did_save = false;
|
||||
if (temp_reg == noreg || temp2_reg == noreg) {
|
||||
|
@ -1955,7 +1955,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
@ -1667,8 +1667,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
Register Rtmp1 = noreg;
|
||||
|
||||
// check if it needs to be profiled
|
||||
ciMethodData* md;
|
||||
ciProfileData* data;
|
||||
ciMethodData* md = NULL;
|
||||
ciProfileData* data = NULL;
|
||||
|
||||
if (op->should_profile()) {
|
||||
ciMethod* method = op->profiled_method();
|
||||
@ -1827,8 +1827,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
CodeStub* stub = op->stub();
|
||||
|
||||
// check if it needs to be profiled
|
||||
ciMethodData* md;
|
||||
ciProfileData* data;
|
||||
ciMethodData* md = NULL;
|
||||
ciProfileData* data = NULL;
|
||||
|
||||
if (op->should_profile()) {
|
||||
ciMethod* method = op->profiled_method();
|
||||
@ -2005,7 +2005,8 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L
|
||||
case lir_cond_greater: acond = Assembler::greater; ncond = Assembler::lessEqual; break;
|
||||
case lir_cond_belowEqual: acond = Assembler::belowEqual; ncond = Assembler::above; break;
|
||||
case lir_cond_aboveEqual: acond = Assembler::aboveEqual; ncond = Assembler::below; break;
|
||||
default: ShouldNotReachHere();
|
||||
default: acond = Assembler::equal; ncond = Assembler::notEqual;
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
if (opr1->is_cpu_register()) {
|
||||
@ -3182,27 +3183,23 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
|
||||
assert(default_type != NULL && default_type->is_array_klass() && default_type->is_loaded(), "must be true at this point");
|
||||
|
||||
int elem_size = type2aelembytes(basic_type);
|
||||
int shift_amount;
|
||||
Address::ScaleFactor scale;
|
||||
|
||||
switch (elem_size) {
|
||||
case 1 :
|
||||
shift_amount = 0;
|
||||
scale = Address::times_1;
|
||||
break;
|
||||
case 2 :
|
||||
shift_amount = 1;
|
||||
scale = Address::times_2;
|
||||
break;
|
||||
case 4 :
|
||||
shift_amount = 2;
|
||||
scale = Address::times_4;
|
||||
break;
|
||||
case 8 :
|
||||
shift_amount = 3;
|
||||
scale = Address::times_8;
|
||||
break;
|
||||
default:
|
||||
scale = Address::no_scale;
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o
|
||||
|
||||
|
||||
LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) {
|
||||
LIR_Opr r;
|
||||
LIR_Opr r = NULL;
|
||||
if (type == T_LONG) {
|
||||
r = LIR_OprFact::longConst(x);
|
||||
} else if (type == T_INT) {
|
||||
@ -484,7 +484,7 @@ void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) {
|
||||
__ cmp(lir_cond_equal, right.result(), LIR_OprFact::longConst(0));
|
||||
__ branch(lir_cond_equal, T_LONG, new DivByZeroStub(info));
|
||||
|
||||
address entry;
|
||||
address entry = NULL;
|
||||
switch (x->op()) {
|
||||
case Bytecodes::_lrem:
|
||||
entry = CAST_FROM_FN_PTR(address, SharedRuntime::lrem);
|
||||
@ -1054,7 +1054,7 @@ LIR_Opr fixed_register_for(BasicType type) {
|
||||
|
||||
void LIRGenerator::do_Convert(Convert* x) {
|
||||
// flags that vary for the different operations and different SSE-settings
|
||||
bool fixed_input, fixed_result, round_result, needs_stub;
|
||||
bool fixed_input = false, fixed_result = false, round_result = false, needs_stub = false;
|
||||
|
||||
switch (x->op()) {
|
||||
case Bytecodes::_i2l: // fall through
|
||||
|
@ -48,7 +48,7 @@ GetDoubleField_t JNI_FastGetField::jni_fast_GetDoubleField_fp;
|
||||
// between loads, which is much more efficient than lfence.
|
||||
|
||||
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
|
||||
const char *name;
|
||||
const char *name = NULL;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
|
||||
case T_BYTE: name = "jni_fast_GetByteField"; break;
|
||||
@ -122,7 +122,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
|
||||
|
||||
slowcase_entry_pclist[count++] = __ pc();
|
||||
__ bind (slow);
|
||||
address slow_case_addr;
|
||||
address slow_case_addr = NULL;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
|
||||
case T_BYTE: slow_case_addr = jni_GetByteField_addr(); break;
|
||||
@ -256,7 +256,7 @@ address JNI_FastGetField::generate_fast_get_long_field() {
|
||||
}
|
||||
|
||||
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||
const char *name;
|
||||
const char *name = NULL;
|
||||
switch (type) {
|
||||
case T_FLOAT: name = "jni_fast_GetFloatField"; break;
|
||||
case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
|
||||
@ -337,7 +337,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||
|
||||
slowcase_entry_pclist[count++] = __ pc();
|
||||
__ bind (slow);
|
||||
address slow_case_addr;
|
||||
address slow_case_addr = NULL;
|
||||
switch (type) {
|
||||
case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break;
|
||||
case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break;
|
||||
|
@ -51,7 +51,7 @@ static const Register rcounter_addr = r11;
|
||||
// since that may scratch r10!
|
||||
|
||||
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
|
||||
const char *name;
|
||||
const char *name = NULL;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
|
||||
case T_BYTE: name = "jni_fast_GetByteField"; break;
|
||||
@ -111,7 +111,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
|
||||
|
||||
slowcase_entry_pclist[count++] = __ pc();
|
||||
__ bind (slow);
|
||||
address slow_case_addr;
|
||||
address slow_case_addr = NULL;
|
||||
switch (type) {
|
||||
case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
|
||||
case T_BYTE: slow_case_addr = jni_GetByteField_addr(); break;
|
||||
@ -153,7 +153,7 @@ address JNI_FastGetField::generate_fast_get_long_field() {
|
||||
}
|
||||
|
||||
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||
const char *name;
|
||||
const char *name = NULL;
|
||||
switch (type) {
|
||||
case T_FLOAT: name = "jni_fast_GetFloatField"; break;
|
||||
case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
|
||||
@ -206,7 +206,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||
|
||||
slowcase_entry_pclist[count++] = __ pc();
|
||||
__ bind (slow);
|
||||
address slow_case_addr;
|
||||
address slow_case_addr = NULL;
|
||||
switch (type) {
|
||||
case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break;
|
||||
case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr();
|
||||
|
@ -63,7 +63,7 @@ static int check_nonzero(const char* xname, int x) {
|
||||
void MethodHandles::verify_klass(MacroAssembler* _masm,
|
||||
Register obj, SystemDictionary::WKID klass_id,
|
||||
const char* error_message) {
|
||||
Klass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
InstanceKlass** klass_addr = SystemDictionary::well_known_klass_addr(klass_id);
|
||||
KlassHandle klass = SystemDictionary::well_known_klass(klass_id);
|
||||
Register temp = rdi;
|
||||
Register temp2 = noreg;
|
||||
|
@ -1502,7 +1502,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
@ -1694,7 +1694,7 @@ class ComputeMoveOrder: public StackObj {
|
||||
};
|
||||
|
||||
static void verify_oop_args(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
const BasicType* sig_bt,
|
||||
const VMRegPair* regs) {
|
||||
Register temp_reg = rbx; // not part of any compiled calling seq
|
||||
@ -1804,7 +1804,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
|
||||
// return to caller
|
||||
//
|
||||
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType* in_sig_bt,
|
||||
VMRegPair* in_regs,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -76,7 +76,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
|
||||
}
|
||||
|
||||
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int compile_id,
|
||||
BasicType *sig_bt,
|
||||
VMRegPair *regs,
|
||||
|
@ -3811,7 +3811,7 @@ bool os::find(address addr, outputStream* st) {
|
||||
// able to use structured exception handling (thread-local exception filters)
|
||||
// on, e.g., Win32.
|
||||
void
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method,
|
||||
JavaCallArguments* args, Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ line_number_from_bci(jvm_agent_t* J, Vframe_t *vf)
|
||||
if (stream_bci == vf->bci) {
|
||||
/* perfect match */
|
||||
if (debug > 2)
|
||||
fprintf(stderr, "\t line_number_from_bci: END: exact line: %ld \n\n", vf->line);
|
||||
fprintf(stderr, "\t line_number_from_bci: END: exact line: %d \n\n", vf->line);
|
||||
vf->line = stream_line;
|
||||
return PS_OK;
|
||||
} else {
|
||||
@ -843,14 +843,14 @@ line_number_from_bci(jvm_agent_t* J, Vframe_t *vf)
|
||||
best_bci = stream_bci;
|
||||
vf->line = stream_line;
|
||||
if (debug > 2) {
|
||||
fprintf(stderr, "\t line_number_from_bci: best_bci: %ld, best_line: %ld\n",
|
||||
fprintf(stderr, "\t line_number_from_bci: best_bci: %d, best_line: %d\n",
|
||||
best_bci, vf->line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (debug > 2)
|
||||
fprintf(stderr, "\t line_number_from_bci: END: line: %ld \n\n", vf->line);
|
||||
fprintf(stderr, "\t line_number_from_bci: END: line: %d \n\n", vf->line);
|
||||
return PS_OK;
|
||||
|
||||
fail:
|
||||
@ -1002,7 +1002,7 @@ static int scopeDesc_chain(Nmethod_t *N) {
|
||||
err = line_number_from_bci(N->J, vf);
|
||||
CHECK_FAIL(err);
|
||||
if (debug > 2) {
|
||||
fprintf(stderr, "\t scopeDesc_chain: method: %#8llx, line: %ld\n",
|
||||
fprintf(stderr, "\t scopeDesc_chain: method: %#8llx, line: %d\n",
|
||||
vf->method, vf->line);
|
||||
}
|
||||
}
|
||||
@ -1338,7 +1338,7 @@ int Jget_vframe(jvm_agent_t* J, int vframe_no,
|
||||
jframe->bci = vf->bci;
|
||||
jframe->line = vf->line;
|
||||
if (debug) {
|
||||
fprintf(stderr, "\t Jget_vframe: method name: %s, line: %ld\n",
|
||||
fprintf(stderr, "\t Jget_vframe: method name: %s, line: %d\n",
|
||||
name, vf->line);
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -440,6 +440,10 @@ void os::init_system_properties_values() {
|
||||
if (pslash != NULL) {
|
||||
*pslash = '\0'; // Get rid of /{client|server|hotspot}.
|
||||
}
|
||||
#ifdef STATIC_BUILD
|
||||
strcat(buf, "/lib");
|
||||
#endif
|
||||
|
||||
Arguments::set_dll_dir(buf);
|
||||
|
||||
if (pslash != NULL) {
|
||||
@ -1388,6 +1392,9 @@ bool os::dll_address_to_library_name(address addr, char* buf,
|
||||
|
||||
#ifdef __APPLE__
|
||||
void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
#ifdef STATIC_BUILD
|
||||
return os::get_default_process_handle();
|
||||
#else
|
||||
void * result= ::dlopen(filename, RTLD_LAZY);
|
||||
if (result != NULL) {
|
||||
// Successful loading
|
||||
@ -1399,9 +1406,13 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
ebuf[ebuflen-1]='\0';
|
||||
|
||||
return NULL;
|
||||
#endif // STATIC_BUILD
|
||||
}
|
||||
#else
|
||||
void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
#ifdef STATIC_BUILD
|
||||
return os::get_default_process_handle();
|
||||
#else
|
||||
void * result= ::dlopen(filename, RTLD_LAZY);
|
||||
if (result != NULL) {
|
||||
// Successful loading
|
||||
@ -1574,6 +1585,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
}
|
||||
|
||||
return NULL;
|
||||
#endif // STATIC_BUILD
|
||||
}
|
||||
#endif // !__APPLE__
|
||||
|
||||
@ -3745,7 +3757,7 @@ bool os::find(address addr, outputStream* st) {
|
||||
// able to use structured exception handling (thread-local exception filters)
|
||||
// on, e.g., Win32.
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value,
|
||||
methodHandle* method, JavaCallArguments* args,
|
||||
const methodHandle& method, JavaCallArguments* args,
|
||||
Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
@ -2794,7 +2794,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected,
|
||||
|
||||
|
||||
int os::Linux::sched_getcpu_syscall(void) {
|
||||
unsigned int cpu;
|
||||
unsigned int cpu = 0;
|
||||
int retval = -1;
|
||||
|
||||
#if defined(IA32)
|
||||
@ -4187,8 +4187,8 @@ static bool call_chained_handler(struct sigaction *actp, int sig,
|
||||
sigaddset(&(actp->sa_mask), sig);
|
||||
}
|
||||
|
||||
sa_handler_t hand;
|
||||
sa_sigaction_t sa;
|
||||
sa_handler_t hand = NULL;
|
||||
sa_sigaction_t sa = NULL;
|
||||
bool siginfo_flag_set = (actp->sa_flags & SA_SIGINFO) != 0;
|
||||
// retrieve the chained handler
|
||||
if (siginfo_flag_set) {
|
||||
@ -4393,7 +4393,7 @@ jlong os::Linux::fast_thread_cpu_time(clockid_t clockid) {
|
||||
|
||||
static const char* get_signal_handler_name(address handler,
|
||||
char* buf, int buflen) {
|
||||
int offset;
|
||||
int offset = 0;
|
||||
bool found = os::dll_address_to_library_name(handler, buf, buflen, &offset);
|
||||
if (found) {
|
||||
// skip directory names
|
||||
@ -4960,7 +4960,7 @@ bool os::find(address addr, outputStream* st) {
|
||||
// able to use structured exception handling (thread-local exception filters)
|
||||
// on, e.g., Win32.
|
||||
void
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
|
||||
os::os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method,
|
||||
JavaCallArguments* args, Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ line_number_from_bci(jvm_agent_t* J, Vframe_t *vf)
|
||||
if (stream_bci == vf->bci) {
|
||||
/* perfect match */
|
||||
if (debug > 2)
|
||||
fprintf(stderr, "\t line_number_from_bci: END: exact line: %ld \n\n", vf->line);
|
||||
fprintf(stderr, "\t line_number_from_bci: END: exact line: %d \n\n", vf->line);
|
||||
vf->line = stream_line;
|
||||
return PS_OK;
|
||||
} else {
|
||||
@ -843,14 +843,14 @@ line_number_from_bci(jvm_agent_t* J, Vframe_t *vf)
|
||||
best_bci = stream_bci;
|
||||
vf->line = stream_line;
|
||||
if (debug > 2) {
|
||||
fprintf(stderr, "\t line_number_from_bci: best_bci: %ld, best_line: %ld\n",
|
||||
fprintf(stderr, "\t line_number_from_bci: best_bci: %d, best_line: %d\n",
|
||||
best_bci, vf->line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (debug > 2)
|
||||
fprintf(stderr, "\t line_number_from_bci: END: line: %ld \n\n", vf->line);
|
||||
fprintf(stderr, "\t line_number_from_bci: END: line: %d \n\n", vf->line);
|
||||
return PS_OK;
|
||||
|
||||
fail:
|
||||
@ -1002,7 +1002,7 @@ static int scopeDesc_chain(Nmethod_t *N) {
|
||||
err = line_number_from_bci(N->J, vf);
|
||||
CHECK_FAIL(err);
|
||||
if (debug > 2) {
|
||||
fprintf(stderr, "\t scopeDesc_chain: method: %#8llx, line: %ld\n",
|
||||
fprintf(stderr, "\t scopeDesc_chain: method: %#8llx, line: %d\n",
|
||||
vf->method, vf->line);
|
||||
}
|
||||
}
|
||||
@ -1338,7 +1338,7 @@ int Jget_vframe(jvm_agent_t* J, int vframe_no,
|
||||
jframe->bci = vf->bci;
|
||||
jframe->line = vf->line;
|
||||
if (debug) {
|
||||
fprintf(stderr, "\t Jget_vframe: method name: %s, line: %ld\n",
|
||||
fprintf(stderr, "\t Jget_vframe: method name: %s, line: %d\n",
|
||||
name, vf->line);
|
||||
}
|
||||
return PS_OK;
|
||||
|
@ -3774,7 +3774,7 @@ ExtendedPC os::get_thread_pc(Thread* thread) {
|
||||
// This does not do anything on Solaris. This is basically a hook for being
|
||||
// able to use structured exception handling (thread-local exception filters) on, e.g., Win32.
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value,
|
||||
methodHandle* method, JavaCallArguments* args,
|
||||
const methodHandle& method, JavaCallArguments* args,
|
||||
Thread* thread) {
|
||||
f(value, method, args, thread);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
|
||||
(void)memmove(to, from, count * HeapWordSize);
|
||||
#else
|
||||
// Includes a zero-count check.
|
||||
intx temp;
|
||||
intx temp = 0;
|
||||
__asm__ volatile(" testl %6,%6 ;"
|
||||
" jz 7f ;"
|
||||
" cmpl %4,%5 ;"
|
||||
@ -88,7 +88,7 @@ static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
|
||||
}
|
||||
#else
|
||||
// Includes a zero-count check.
|
||||
intx temp;
|
||||
intx temp = 0;
|
||||
__asm__ volatile(" testl %6,%6 ;"
|
||||
" jz 3f ;"
|
||||
" cmpl $32,%6 ;"
|
||||
@ -145,7 +145,7 @@ static void pd_conjoint_bytes(void* from, void* to, size_t count) {
|
||||
(void)memmove(to, from, count);
|
||||
#else
|
||||
// Includes a zero-count check.
|
||||
intx temp;
|
||||
intx temp = 0;
|
||||
__asm__ volatile(" testl %6,%6 ;"
|
||||
" jz 13f ;"
|
||||
" cmpl %4,%5 ;"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -71,7 +71,7 @@
|
||||
extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
|
||||
|
||||
// Install a win32 structured exception handler around thread.
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread) {
|
||||
void os::os_exception_wrapper(java_call_t f, JavaValue* value, const methodHandle& method, JavaCallArguments* args, Thread* thread) {
|
||||
__try {
|
||||
|
||||
#ifndef AMD64
|
||||
|
@ -509,7 +509,7 @@ static void append_oop_references(GrowableArray<oop>* oops, Klass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
void CodeBuffer::finalize_oop_references(methodHandle mh) {
|
||||
void CodeBuffer::finalize_oop_references(const methodHandle& mh) {
|
||||
No_Safepoint_Verifier nsv;
|
||||
|
||||
GrowableArray<oop> oops;
|
||||
|
@ -541,7 +541,7 @@ class CodeBuffer: public StackObj {
|
||||
bool insts_contains2(address pc) const { return _insts.contains2(pc); }
|
||||
|
||||
// Record any extra oops required to keep embedded metadata alive
|
||||
void finalize_oop_references(methodHandle method);
|
||||
void finalize_oop_references(const methodHandle& method);
|
||||
|
||||
// Allocated size in all sections, when aligned and concatenated
|
||||
// (this is the eventual state of the content in its final
|
||||
|
@ -639,7 +639,7 @@ void Canonicalizer::do_If(If* x) {
|
||||
|
||||
if (l == r && !lt->is_float_kind()) {
|
||||
// pattern: If (a cond a) => simplify to Goto
|
||||
BlockBegin* sux;
|
||||
BlockBegin* sux = NULL;
|
||||
switch (x->cond()) {
|
||||
case If::eql: sux = x->sux_for(true); break;
|
||||
case If::neq: sux = x->sux_for(false); break;
|
||||
@ -647,6 +647,7 @@ void Canonicalizer::do_If(If* x) {
|
||||
case If::leq: sux = x->sux_for(true); break;
|
||||
case If::gtr: sux = x->sux_for(false); break;
|
||||
case If::geq: sux = x->sux_for(true); break;
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
// If is a safepoint then the debug information should come from the state_before of the If.
|
||||
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux)));
|
||||
@ -684,7 +685,7 @@ void Canonicalizer::do_If(If* x) {
|
||||
} else {
|
||||
// two successors differ and two successors are the same => simplify to: If (x cmp y)
|
||||
// determine new condition & successors
|
||||
If::Condition cond;
|
||||
If::Condition cond = If::eql;
|
||||
BlockBegin* tsux = NULL;
|
||||
BlockBegin* fsux = NULL;
|
||||
if (lss_sux == eql_sux) { cond = If::leq; tsux = lss_sux; fsux = gtr_sux; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -98,7 +98,7 @@ BufferBlob* Compiler::init_buffer_blob() {
|
||||
return buffer_blob;
|
||||
}
|
||||
|
||||
bool Compiler::is_intrinsic_supported(methodHandle method) {
|
||||
bool Compiler::is_intrinsic_supported(const methodHandle& method) {
|
||||
vmIntrinsics::ID id = method->intrinsic_id();
|
||||
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -56,7 +56,7 @@ class Compiler: public AbstractCompiler {
|
||||
virtual void print_timers();
|
||||
|
||||
// Check if the C1 compiler supports an intrinsic for 'method'.
|
||||
virtual bool is_intrinsic_supported(methodHandle method);
|
||||
virtual bool is_intrinsic_supported(const methodHandle& method);
|
||||
|
||||
// Size of the code buffer
|
||||
static int code_buffer_size();
|
||||
|
@ -3823,8 +3823,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
|
||||
caller_state->truncate_stack(args_base);
|
||||
assert(callee_state->stack_size() == 0, "callee stack must be empty");
|
||||
|
||||
Value lock;
|
||||
BlockBegin* sync_handler;
|
||||
Value lock = NULL;
|
||||
BlockBegin* sync_handler = NULL;
|
||||
|
||||
// Inline the locking of the receiver if the callee is synchronized
|
||||
if (callee->is_synchronized()) {
|
||||
|
@ -3348,7 +3348,7 @@ void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) {
|
||||
}
|
||||
|
||||
void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool backedge) {
|
||||
int freq_log;
|
||||
int freq_log = 0;
|
||||
int level = compilation()->env()->comp_level();
|
||||
if (level == CompLevel_limited_profile) {
|
||||
freq_log = (backedge ? Tier2BackedgeNotifyFreqLog : Tier2InvokeNotifyFreqLog);
|
||||
@ -3394,7 +3394,7 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
|
||||
assert(level > CompLevel_simple, "Shouldn't be here");
|
||||
|
||||
int offset = -1;
|
||||
LIR_Opr counter_holder;
|
||||
LIR_Opr counter_holder = NULL;
|
||||
if (level == CompLevel_limited_profile) {
|
||||
MethodCounters* counters_adr = method->ensure_method_counters();
|
||||
if (counters_adr == NULL) {
|
||||
|
@ -409,7 +409,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
|
||||
}
|
||||
|
||||
static LIR_Condition lir_cond(If::Condition cond) {
|
||||
LIR_Condition l;
|
||||
LIR_Condition l = lir_cond_unknown;
|
||||
switch (cond) {
|
||||
case If::eql: l = lir_cond_equal; break;
|
||||
case If::neq: l = lir_cond_notEqual; break;
|
||||
@ -419,6 +419,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
|
||||
case If::gtr: l = lir_cond_greater; break;
|
||||
case If::aeq: l = lir_cond_aboveEqual; break;
|
||||
case If::beq: l = lir_cond_belowEqual; break;
|
||||
default: fatal("You must pass valid If::Condition");
|
||||
};
|
||||
return l;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,7 +38,7 @@
|
||||
//
|
||||
// Loaded array klass.
|
||||
ciArrayKlass::ciArrayKlass(KlassHandle h_k) : ciKlass(h_k) {
|
||||
assert(get_Klass()->oop_is_array(), "wrong type");
|
||||
assert(get_Klass()->is_array_klass(), "wrong type");
|
||||
_dimension = get_ArrayKlass()->dimension();
|
||||
}
|
||||
|
||||
|
@ -365,11 +365,11 @@ bool ciEnv::check_klass_accessibility(ciKlass* accessing_klass,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (resolved_klass->oop_is_objArray()) {
|
||||
if (resolved_klass->is_objArray_klass()) {
|
||||
// Find the element klass, if this is an array.
|
||||
resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass();
|
||||
}
|
||||
if (resolved_klass->oop_is_instance()) {
|
||||
if (resolved_klass->is_instance_klass()) {
|
||||
return Reflection::verify_class_access(accessing_klass->get_Klass(),
|
||||
resolved_klass,
|
||||
true);
|
||||
@ -380,7 +380,7 @@ bool ciEnv::check_klass_accessibility(ciKlass* accessing_klass,
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::get_klass_by_name_impl
|
||||
ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
|
||||
constantPoolHandle cpool,
|
||||
const constantPoolHandle& cpool,
|
||||
ciSymbol* name,
|
||||
bool require_local) {
|
||||
ASSERT_IN_VM;
|
||||
@ -502,7 +502,7 @@ ciKlass* ciEnv::get_klass_by_name(ciKlass* accessing_klass,
|
||||
// ciEnv::get_klass_by_index_impl
|
||||
//
|
||||
// Implementation of get_klass_by_index.
|
||||
ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool,
|
||||
ciKlass* ciEnv::get_klass_by_index_impl(const constantPoolHandle& cpool,
|
||||
int index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* accessor) {
|
||||
@ -559,7 +559,7 @@ ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool,
|
||||
// ciEnv::get_klass_by_index
|
||||
//
|
||||
// Get a klass from the constant pool.
|
||||
ciKlass* ciEnv::get_klass_by_index(constantPoolHandle cpool,
|
||||
ciKlass* ciEnv::get_klass_by_index(const constantPoolHandle& cpool,
|
||||
int index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* accessor) {
|
||||
@ -570,7 +570,7 @@ ciKlass* ciEnv::get_klass_by_index(constantPoolHandle cpool,
|
||||
// ciEnv::get_constant_by_index_impl
|
||||
//
|
||||
// Implementation of get_constant_by_index().
|
||||
ciConstant ciEnv::get_constant_by_index_impl(constantPoolHandle cpool,
|
||||
ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* accessor) {
|
||||
bool ignore_will_link;
|
||||
@ -656,7 +656,7 @@ ciConstant ciEnv::get_constant_by_index_impl(constantPoolHandle cpool,
|
||||
// Pull a constant out of the constant pool. How appropriate.
|
||||
//
|
||||
// Implementation note: this query is currently in no way cached.
|
||||
ciConstant ciEnv::get_constant_by_index(constantPoolHandle cpool,
|
||||
ciConstant ciEnv::get_constant_by_index(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* accessor) {
|
||||
GUARDED_VM_ENTRY(return get_constant_by_index_impl(cpool, pool_index, cache_index, accessor);)
|
||||
@ -736,7 +736,7 @@ Method* ciEnv::lookup_method(InstanceKlass* accessor,
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::get_method_by_index_impl
|
||||
ciMethod* ciEnv::get_method_by_index_impl(constantPoolHandle cpool,
|
||||
ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
|
||||
int index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* accessor) {
|
||||
if (bc == Bytecodes::_invokedynamic) {
|
||||
@ -848,7 +848,7 @@ ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* m
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::get_method_by_index
|
||||
ciMethod* ciEnv::get_method_by_index(constantPoolHandle cpool,
|
||||
ciMethod* ciEnv::get_method_by_index(const constantPoolHandle& cpool,
|
||||
int index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* accessor) {
|
||||
GUARDED_VM_ENTRY(return get_method_by_index_impl(cpool, index, bc, accessor);)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -118,34 +118,34 @@ private:
|
||||
bool require_local);
|
||||
|
||||
// Constant pool access.
|
||||
ciKlass* get_klass_by_index(constantPoolHandle cpool,
|
||||
ciKlass* get_klass_by_index(const constantPoolHandle& cpool,
|
||||
int klass_index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* loading_klass);
|
||||
ciConstant get_constant_by_index(constantPoolHandle cpool,
|
||||
ciConstant get_constant_by_index(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* accessor);
|
||||
ciField* get_field_by_index(ciInstanceKlass* loading_klass,
|
||||
int field_index);
|
||||
ciMethod* get_method_by_index(constantPoolHandle cpool,
|
||||
ciMethod* get_method_by_index(const constantPoolHandle& cpool,
|
||||
int method_index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* loading_klass);
|
||||
|
||||
// Implementation methods for loading and constant pool access.
|
||||
ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass,
|
||||
constantPoolHandle cpool,
|
||||
const constantPoolHandle& cpool,
|
||||
ciSymbol* klass_name,
|
||||
bool require_local);
|
||||
ciKlass* get_klass_by_index_impl(constantPoolHandle cpool,
|
||||
ciKlass* get_klass_by_index_impl(const constantPoolHandle& cpool,
|
||||
int klass_index,
|
||||
bool& is_accessible,
|
||||
ciInstanceKlass* loading_klass);
|
||||
ciConstant get_constant_by_index_impl(constantPoolHandle cpool,
|
||||
ciConstant get_constant_by_index_impl(const constantPoolHandle& cpool,
|
||||
int pool_index, int cache_index,
|
||||
ciInstanceKlass* loading_klass);
|
||||
ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
|
||||
int field_index);
|
||||
ciMethod* get_method_by_index_impl(constantPoolHandle cpool,
|
||||
ciMethod* get_method_by_index_impl(const constantPoolHandle& cpool,
|
||||
int method_index, Bytecodes::Code bc,
|
||||
ciInstanceKlass* loading_klass);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -46,7 +46,7 @@
|
||||
ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) :
|
||||
ciKlass(h_k)
|
||||
{
|
||||
assert(get_Klass()->oop_is_instance(), "wrong type");
|
||||
assert(get_Klass()->is_instance_klass(), "wrong type");
|
||||
assert(get_instanceKlass()->is_loaded(), "must be at least loaded");
|
||||
InstanceKlass* ik = get_instanceKlass();
|
||||
|
||||
@ -356,7 +356,7 @@ ciInstanceKlass* ciInstanceKlass::unique_concrete_subklass() {
|
||||
VM_ENTRY_MARK;
|
||||
InstanceKlass* ik = get_instanceKlass();
|
||||
Klass* up = ik->up_cast_abstract();
|
||||
assert(up->oop_is_instance(), "must be InstanceKlass");
|
||||
assert(up->is_instance_klass(), "must be InstanceKlass");
|
||||
if (ik == up) {
|
||||
return NULL;
|
||||
}
|
||||
@ -683,7 +683,7 @@ void ciInstanceKlass::dump_replay_data(outputStream* out) {
|
||||
// Try to record related loaded classes
|
||||
Klass* sub = ik->subklass();
|
||||
while (sub != NULL) {
|
||||
if (sub->oop_is_instance()) {
|
||||
if (sub->is_instance_klass()) {
|
||||
out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii());
|
||||
}
|
||||
sub = sub->next_sibling();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -81,7 +81,7 @@ protected:
|
||||
ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
|
||||
|
||||
InstanceKlass* get_instanceKlass() const {
|
||||
return (InstanceKlass*)get_Klass();
|
||||
return InstanceKlass::cast(get_Klass());
|
||||
}
|
||||
|
||||
oop loader();
|
||||
|
@ -745,7 +745,7 @@ ciMethod* ciMethod::find_monomorphic_target(ciInstanceKlass* caller,
|
||||
#ifndef PRODUCT
|
||||
if (TraceDependencies && target() != NULL && target() != root_m->get_Method()) {
|
||||
tty->print("found a non-root unique target method");
|
||||
tty->print_cr(" context = %s", InstanceKlass::cast(actual_recv->get_Klass())->external_name());
|
||||
tty->print_cr(" context = %s", actual_recv->get_Klass()->external_name());
|
||||
tty->print(" method = ");
|
||||
target->print_short_name(tty);
|
||||
tty->cr();
|
||||
@ -791,7 +791,7 @@ ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, boo
|
||||
methodHandle m;
|
||||
// Only do exact lookup if receiver klass has been linked. Otherwise,
|
||||
// the vtable has not been setup, and the LinkResolver will fail.
|
||||
if (h_recv->oop_is_array()
|
||||
if (h_recv->is_array_klass()
|
||||
||
|
||||
InstanceKlass::cast(h_recv())->is_linked() && !exact_receiver->is_interface()) {
|
||||
if (holder()->is_interface()) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,7 +39,7 @@
|
||||
//
|
||||
// Constructor for loaded object array klasses.
|
||||
ciObjArrayKlass::ciObjArrayKlass(KlassHandle h_k) : ciArrayKlass(h_k) {
|
||||
assert(get_Klass()->oop_is_objArray(), "wrong type");
|
||||
assert(get_Klass()->is_objArray_klass(), "wrong type");
|
||||
Klass* element_Klass = get_ObjArrayKlass()->bottom_klass();
|
||||
_base_element_klass = CURRENT_ENV->get_klass(element_Klass);
|
||||
assert(_base_element_klass->is_instance_klass() ||
|
||||
|
@ -357,7 +357,7 @@ ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
|
||||
// Hold metadata from unloading by keeping it's holder alive.
|
||||
if (_initialized && o->is_klass()) {
|
||||
Klass* holder = ((Klass*)o);
|
||||
if (holder->oop_is_instance() && InstanceKlass::cast(holder)->is_anonymous()) {
|
||||
if (holder->is_instance_klass() && InstanceKlass::cast(holder)->is_anonymous()) {
|
||||
// Though ciInstanceKlass records class loader oop, it's not enough to keep
|
||||
// VM anonymous classes alive (loader == NULL). Klass holder should be used instead.
|
||||
// It is enough to record a ciObject, since cached elements are never removed
|
||||
@ -370,11 +370,11 @@ ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
|
||||
if (o->is_klass()) {
|
||||
KlassHandle h_k(THREAD, (Klass*)o);
|
||||
Klass* k = (Klass*)o;
|
||||
if (k->oop_is_instance()) {
|
||||
if (k->is_instance_klass()) {
|
||||
return new (arena()) ciInstanceKlass(h_k);
|
||||
} else if (k->oop_is_objArray()) {
|
||||
} else if (k->is_objArray_klass()) {
|
||||
return new (arena()) ciObjArrayKlass(h_k);
|
||||
} else if (k->oop_is_typeArray()) {
|
||||
} else if (k->is_typeArray_klass()) {
|
||||
return new (arena()) ciTypeArrayKlass(h_k);
|
||||
}
|
||||
} else if (o->is_method()) {
|
||||
@ -414,6 +414,7 @@ void ciObjectFactory::ensure_metadata_alive(ciMetadata* m) {
|
||||
metadata_owner_klass = m->as_method()->get_Method()->constants()->pool_holder();
|
||||
} else {
|
||||
fatal("Not implemented for other types of metadata");
|
||||
return;
|
||||
}
|
||||
|
||||
oop metadata_holder = metadata_owner_klass->klass_holder();
|
||||
|
@ -530,15 +530,15 @@ class CompileReplay : public StackObj {
|
||||
if (_imethod != NULL) {
|
||||
return; // Replay Inlining
|
||||
}
|
||||
Klass* k = method->method_holder();
|
||||
((InstanceKlass*)k)->initialize(THREAD);
|
||||
InstanceKlass* ik = method->method_holder();
|
||||
ik->initialize(THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
oop throwable = PENDING_EXCEPTION;
|
||||
java_lang_Throwable::print(throwable, tty);
|
||||
tty->cr();
|
||||
if (ReplayIgnoreInitErrors) {
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
((InstanceKlass*)k)->set_init_state(InstanceKlass::fully_initialized);
|
||||
ik->set_init_state(InstanceKlass::fully_initialized);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@ -842,7 +842,7 @@ class CompileReplay : public StackObj {
|
||||
} else if (field_signature[0] == 'L') {
|
||||
Symbol* klass_name = SymbolTable::lookup(field_signature, (int)strlen(field_signature), CHECK);
|
||||
KlassHandle kelem = resolve_klass(field_signature, CHECK);
|
||||
oop value = ((InstanceKlass*)kelem())->allocate_instance(CHECK);
|
||||
oop value = InstanceKlass::cast(kelem())->allocate_instance(CHECK);
|
||||
java_mirror->obj_field_put(fd.offset(), value);
|
||||
} else {
|
||||
report_error("unhandled staticfield");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciSignature::ciSignature
|
||||
ciSignature::ciSignature(ciKlass* accessing_klass, constantPoolHandle cpool, ciSymbol* symbol) {
|
||||
ciSignature::ciSignature(ciKlass* accessing_klass, const constantPoolHandle& cpool, ciSymbol* symbol) {
|
||||
ASSERT_IN_VM;
|
||||
EXCEPTION_CONTEXT;
|
||||
_accessing_klass = accessing_klass;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -46,7 +46,7 @@ private:
|
||||
friend class ciBytecodeStream;
|
||||
friend class ciObjectFactory;
|
||||
|
||||
ciSignature(ciKlass* accessing_klass, constantPoolHandle cpool, ciSymbol* signature);
|
||||
ciSignature(ciKlass* accessing_klass, const constantPoolHandle& cpool, ciSymbol* signature);
|
||||
ciSignature(ciKlass* accessing_klass, ciSymbol* signature, ciMethodType* method_type);
|
||||
|
||||
void get_all_klasses();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2015, 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
|
||||
@ -45,7 +45,7 @@ ciType::ciType(BasicType basic_type) : ciMetadata() {
|
||||
}
|
||||
|
||||
ciType::ciType(KlassHandle k) : ciMetadata(k()) {
|
||||
_basic_type = k()->oop_is_array() ? T_ARRAY : T_OBJECT;
|
||||
_basic_type = k()->is_array_klass() ? T_ARRAY : T_OBJECT;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, 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
|
||||
@ -34,7 +34,7 @@
|
||||
// ------------------------------------------------------------------
|
||||
// ciTypeArrayKlass::ciTypeArrayKlass
|
||||
ciTypeArrayKlass::ciTypeArrayKlass(KlassHandle h_k) : ciArrayKlass(h_k) {
|
||||
assert(get_Klass()->oop_is_typeArray(), "wrong type");
|
||||
assert(get_Klass()->is_typeArray_klass(), "wrong type");
|
||||
assert(element_type() == get_TypeArrayKlass()->element_type(), "");
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015, 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
|
||||
@ -140,7 +140,7 @@ class BytecodeConstantPool : ResourceObj {
|
||||
BytecodeCPEntry const& at(u2 index) const { return _entries.at(index); }
|
||||
|
||||
InstanceKlass* pool_holder() const {
|
||||
return InstanceKlass::cast(_orig->pool_holder());
|
||||
return _orig->pool_holder();
|
||||
}
|
||||
|
||||
u2 utf8(Symbol* sym) {
|
||||
|
@ -315,6 +315,7 @@ inline Symbol* check_symbol_at(constantPoolHandle cp, int index) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
PRAGMA_DIAG_PUSH
|
||||
PRAGMA_FORMAT_NONLITERAL_IGNORED
|
||||
void ClassFileParser::report_assert_property_failure(const char* msg, TRAPS) {
|
||||
@ -327,6 +328,7 @@ void ClassFileParser::report_assert_property_failure(const char* msg, int index,
|
||||
fatal(msg, index, _class_name->as_C_string());
|
||||
}
|
||||
PRAGMA_DIAG_POP
|
||||
#endif
|
||||
|
||||
constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
||||
ClassFileStream* cfs = stream();
|
||||
@ -646,7 +648,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
||||
}
|
||||
|
||||
|
||||
void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS) {
|
||||
void ClassFileParser::patch_constant_pool(const constantPoolHandle& cp, int index, Handle patch, TRAPS) {
|
||||
BasicType patch_type = T_VOID;
|
||||
|
||||
switch (cp->tag_at(index).value()) {
|
||||
@ -822,7 +824,7 @@ Array<Klass*>* ClassFileParser::parse_interfaces(int length,
|
||||
debug_only(No_Safepoint_Verifier nsv;)
|
||||
for (index = 0; index < length; index++) {
|
||||
Klass* k = _local_interfaces->at(index);
|
||||
Symbol* name = InstanceKlass::cast(k)->name();
|
||||
Symbol* name = k->name();
|
||||
// If no duplicates, add (name, NULL) in hashtable interface_names.
|
||||
if (!put_after_lookup(name, NULL, interface_names)) {
|
||||
dup = true;
|
||||
@ -3175,8 +3177,9 @@ instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
|
||||
bool is_array = false;
|
||||
if (_cp->tag_at(super_class_index).is_klass()) {
|
||||
super_klass = instanceKlassHandle(THREAD, _cp->resolved_klass_at(super_class_index));
|
||||
if (_need_verify)
|
||||
is_array = super_klass->oop_is_array();
|
||||
if (_need_verify) {
|
||||
is_array = super_klass->is_array_klass();
|
||||
}
|
||||
} else if (_need_verify) {
|
||||
is_array = (_cp->klass_name_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
|
||||
}
|
||||
@ -3211,19 +3214,19 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
||||
|
||||
// Field size and offset computation
|
||||
int nonstatic_field_size = _super_klass() == NULL ? 0 : _super_klass()->nonstatic_field_size();
|
||||
int next_static_oop_offset;
|
||||
int next_static_double_offset;
|
||||
int next_static_word_offset;
|
||||
int next_static_short_offset;
|
||||
int next_static_byte_offset;
|
||||
int next_nonstatic_oop_offset;
|
||||
int next_nonstatic_double_offset;
|
||||
int next_nonstatic_word_offset;
|
||||
int next_nonstatic_short_offset;
|
||||
int next_nonstatic_byte_offset;
|
||||
int first_nonstatic_oop_offset;
|
||||
int next_nonstatic_field_offset;
|
||||
int next_nonstatic_padded_offset;
|
||||
int next_static_oop_offset = 0;
|
||||
int next_static_double_offset = 0;
|
||||
int next_static_word_offset = 0;
|
||||
int next_static_short_offset = 0;
|
||||
int next_static_byte_offset = 0;
|
||||
int next_nonstatic_oop_offset = 0;
|
||||
int next_nonstatic_double_offset = 0;
|
||||
int next_nonstatic_word_offset = 0;
|
||||
int next_nonstatic_short_offset = 0;
|
||||
int next_nonstatic_byte_offset = 0;
|
||||
int first_nonstatic_oop_offset = 0;
|
||||
int next_nonstatic_field_offset = 0;
|
||||
int next_nonstatic_padded_offset = 0;
|
||||
|
||||
// Count the contended fields by type.
|
||||
//
|
||||
@ -3376,14 +3379,14 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
int nonstatic_oop_space_count = 0;
|
||||
int nonstatic_word_space_count = 0;
|
||||
int nonstatic_short_space_count = 0;
|
||||
int nonstatic_byte_space_count = 0;
|
||||
int nonstatic_oop_space_offset;
|
||||
int nonstatic_word_space_offset;
|
||||
int nonstatic_short_space_offset;
|
||||
int nonstatic_byte_space_offset;
|
||||
int nonstatic_oop_space_count = 0;
|
||||
int nonstatic_word_space_count = 0;
|
||||
int nonstatic_short_space_count = 0;
|
||||
int nonstatic_byte_space_count = 0;
|
||||
int nonstatic_oop_space_offset = 0;
|
||||
int nonstatic_word_space_offset = 0;
|
||||
int nonstatic_short_space_offset = 0;
|
||||
int nonstatic_byte_space_offset = 0;
|
||||
|
||||
// Try to squeeze some of the fields into the gaps due to
|
||||
// long/double alignment.
|
||||
@ -3455,7 +3458,7 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
||||
// contended instance fields are handled below
|
||||
if (fs.is_contended() && !fs.access_flags().is_static()) continue;
|
||||
|
||||
int real_offset;
|
||||
int real_offset = 0;
|
||||
FieldAllocationType atype = (FieldAllocationType) fs.allocation_type();
|
||||
|
||||
// pack the rest of the fields
|
||||
@ -3589,7 +3592,7 @@ void ClassFileParser::layout_fields(Handle class_loader,
|
||||
// handle statics below
|
||||
if (fs.access_flags().is_static()) continue;
|
||||
|
||||
int real_offset;
|
||||
int real_offset = 0;
|
||||
FieldAllocationType atype = (FieldAllocationType) fs.allocation_type();
|
||||
|
||||
switch (atype) {
|
||||
@ -4111,7 +4114,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
this_klass->set_should_verify_class(verify);
|
||||
jint lh = Klass::instance_layout_helper(info.instance_size, false);
|
||||
this_klass->set_layout_helper(lh);
|
||||
assert(this_klass->oop_is_instance(), "layout is correct");
|
||||
assert(this_klass->is_instance_klass(), "layout is correct");
|
||||
assert(this_klass->size_helper() == info.instance_size, "correct size_helper");
|
||||
// Not yet: supers are done below to support the new subtype-checking fields
|
||||
//this_klass->set_super(super_klass());
|
||||
@ -4315,13 +4318,13 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
if (caller != NULL) {
|
||||
tty->print("[Loaded %s by instance of %s]\n",
|
||||
this_klass->external_name(),
|
||||
InstanceKlass::cast(caller)->external_name());
|
||||
caller->external_name());
|
||||
} else {
|
||||
tty->print("[Loaded %s]\n", this_klass->external_name());
|
||||
}
|
||||
} else {
|
||||
tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
|
||||
InstanceKlass::cast(class_loader->klass())->external_name());
|
||||
class_loader->klass()->external_name());
|
||||
}
|
||||
}
|
||||
|
||||
@ -4330,7 +4333,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
// print out the superclass.
|
||||
const char * from = this_klass()->external_name();
|
||||
if (this_klass->java_super() != NULL) {
|
||||
tty->print("RESOLVE %s %s (super)\n", from, InstanceKlass::cast(this_klass->java_super())->external_name());
|
||||
tty->print("RESOLVE %s %s (super)\n", from, this_klass->java_super()->external_name());
|
||||
}
|
||||
// print out each of the interface classes referred to by this class.
|
||||
Array<Klass*>* local_interfaces = this_klass->local_interfaces();
|
||||
@ -4338,8 +4341,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
int length = local_interfaces->length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
Klass* k = local_interfaces->at(i);
|
||||
InstanceKlass* to_class = InstanceKlass::cast(k);
|
||||
const char * to = to_class->external_name();
|
||||
const char * to = k->external_name();
|
||||
tty->print("RESOLVE %s %s (interface)\n", from, to);
|
||||
}
|
||||
}
|
||||
@ -4411,7 +4413,7 @@ ClassFileParser::~ClassFileParser() {
|
||||
|
||||
void ClassFileParser::print_field_layout(Symbol* name,
|
||||
Array<u2>* fields,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
int instance_size,
|
||||
int instance_fields_start,
|
||||
int instance_fields_end,
|
||||
@ -4687,7 +4689,7 @@ void ClassFileParser::check_super_class_access(instanceKlassHandle this_klass, T
|
||||
vmSymbols::java_lang_IllegalAccessError(),
|
||||
"class %s cannot access its superclass %s",
|
||||
this_klass->external_name(),
|
||||
InstanceKlass::cast(super)->external_name()
|
||||
super->external_name()
|
||||
);
|
||||
return;
|
||||
}
|
||||
@ -4707,7 +4709,7 @@ void ClassFileParser::check_super_interface_access(instanceKlassHandle this_klas
|
||||
vmSymbols::java_lang_IllegalAccessError(),
|
||||
"class %s cannot access its superinterface %s",
|
||||
this_klass->external_name(),
|
||||
InstanceKlass::cast(k)->external_name()
|
||||
k->external_name()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
void print_field_layout(Symbol* name,
|
||||
Array<u2>* fields,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
int instance_size,
|
||||
int instance_fields_start,
|
||||
int instance_fields_end,
|
||||
@ -319,8 +319,8 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
if (!b) { classfile_parse_error(msg, CHECK); }
|
||||
}
|
||||
|
||||
void report_assert_property_failure(const char* msg, TRAPS);
|
||||
void report_assert_property_failure(const char* msg, int index, TRAPS);
|
||||
void report_assert_property_failure(const char* msg, TRAPS) PRODUCT_RETURN;
|
||||
void report_assert_property_failure(const char* msg, int index, TRAPS) PRODUCT_RETURN;
|
||||
|
||||
inline void assert_property(bool b, const char* msg, TRAPS) {
|
||||
#ifdef ASSERT
|
||||
@ -403,7 +403,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
assert(!has_cp_patch_at(index), "");
|
||||
return patch;
|
||||
}
|
||||
void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS);
|
||||
void patch_constant_pool(const constantPoolHandle& cp, int index, Handle patch, TRAPS);
|
||||
|
||||
// Wrapper for constantTag.is_klass_[or_]reference.
|
||||
// In older versions of the VM, Klass*s cannot sneak into early phases of
|
||||
|
@ -140,7 +140,7 @@ void ClassLoaderData::classes_do(void f(Klass * const)) {
|
||||
|
||||
void ClassLoaderData::methods_do(void f(Method*)) {
|
||||
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
|
||||
if (k->oop_is_instance()) {
|
||||
if (k->is_instance_klass()) {
|
||||
InstanceKlass::cast(k)->methods_do(f);
|
||||
}
|
||||
}
|
||||
@ -151,7 +151,7 @@ void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) {
|
||||
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
|
||||
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
|
||||
// Do not filter ArrayKlass oops here...
|
||||
if (k->oop_is_array() || (k->oop_is_instance() && InstanceKlass::cast(k)->is_loaded())) {
|
||||
if (k->is_array_klass() || (k->is_instance_klass() && InstanceKlass::cast(k)->is_loaded())) {
|
||||
klass_closure->do_klass(k);
|
||||
}
|
||||
}
|
||||
@ -159,7 +159,7 @@ void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) {
|
||||
|
||||
void ClassLoaderData::classes_do(void f(InstanceKlass*)) {
|
||||
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
|
||||
if (k->oop_is_instance()) {
|
||||
if (k->is_instance_klass()) {
|
||||
f(InstanceKlass::cast(k));
|
||||
}
|
||||
assert(k != k->next_link(), "no loops!");
|
||||
|
@ -422,7 +422,7 @@ int HashtableTextDump::scan_prefix(int* utf8_length) {
|
||||
|
||||
int HashtableTextDump::scan_string_prefix() {
|
||||
// Expect /[0-9]+: /
|
||||
int utf8_length;
|
||||
int utf8_length = 0;
|
||||
get_num(':', &utf8_length);
|
||||
if (*_p != ' ') {
|
||||
corrupted(_p, "Wrong prefix format for string");
|
||||
@ -433,13 +433,13 @@ int HashtableTextDump::scan_string_prefix() {
|
||||
|
||||
int HashtableTextDump::scan_symbol_prefix() {
|
||||
// Expect /[0-9]+ (-|)[0-9]+: /
|
||||
int utf8_length;
|
||||
int utf8_length = 0;
|
||||
get_num(' ', &utf8_length);
|
||||
if (*_p == '-') {
|
||||
_p++;
|
||||
if (*_p == '-') {
|
||||
_p++;
|
||||
}
|
||||
int ref_num;
|
||||
(void)get_num(':', &ref_num);
|
||||
get_num(':', &ref_num);
|
||||
if (*_p != ' ') {
|
||||
corrupted(_p, "Wrong prefix format for symbol");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, 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
|
||||
@ -60,7 +60,7 @@ DictionaryEntry* Dictionary::new_entry(unsigned int hash, Klass* klass,
|
||||
DictionaryEntry* entry = (DictionaryEntry*)Hashtable<Klass*, mtClass>::new_entry(hash, klass);
|
||||
entry->set_loader_data(loader_data);
|
||||
entry->set_pd_set(NULL);
|
||||
assert(klass->oop_is_instance(), "Must be");
|
||||
assert(klass->is_instance_klass(), "Must be");
|
||||
return entry;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ void Dictionary::free_entry(DictionaryEntry* entry) {
|
||||
|
||||
bool DictionaryEntry::contains_protection_domain(oop protection_domain) const {
|
||||
#ifdef ASSERT
|
||||
if (protection_domain == InstanceKlass::cast(klass())->protection_domain()) {
|
||||
if (protection_domain == klass()->protection_domain()) {
|
||||
// Ensure this doesn't show up in the pd_set (invariant)
|
||||
bool in_pd_set = false;
|
||||
for (ProtectionDomainEntry* current = _pd_set;
|
||||
@ -96,7 +96,7 @@ bool DictionaryEntry::contains_protection_domain(oop protection_domain) const {
|
||||
}
|
||||
#endif /* ASSERT */
|
||||
|
||||
if (protection_domain == InstanceKlass::cast(klass())->protection_domain()) {
|
||||
if (protection_domain == klass()->protection_domain()) {
|
||||
// Succeeds trivially
|
||||
return true;
|
||||
}
|
||||
@ -275,7 +275,7 @@ void Dictionary::classes_do(void f(Klass*)) {
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
Klass* k = probe->klass();
|
||||
if (probe->loader_data() == InstanceKlass::cast(k)->class_loader_data()) {
|
||||
if (probe->loader_data() == k->class_loader_data()) {
|
||||
f(k);
|
||||
}
|
||||
}
|
||||
@ -290,7 +290,7 @@ void Dictionary::classes_do(void f(Klass*, TRAPS), TRAPS) {
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
Klass* k = probe->klass();
|
||||
if (probe->loader_data() == InstanceKlass::cast(k)->class_loader_data()) {
|
||||
if (probe->loader_data() == k->class_loader_data()) {
|
||||
f(k, CHECK);
|
||||
}
|
||||
}
|
||||
@ -322,7 +322,7 @@ void Dictionary::methods_do(void f(Method*)) {
|
||||
probe != NULL;
|
||||
probe = probe->next()) {
|
||||
Klass* k = probe->klass();
|
||||
if (probe->loader_data() == InstanceKlass::cast(k)->class_loader_data()) {
|
||||
if (probe->loader_data() == k->class_loader_data()) {
|
||||
// only take klass is we have the entry with the defining class loader
|
||||
InstanceKlass::cast(k)->methods_do(f);
|
||||
}
|
||||
@ -476,7 +476,7 @@ void Dictionary::reorder_dictionary() {
|
||||
DictionaryEntry* p = master_list;
|
||||
master_list = master_list->next();
|
||||
p->set_next(NULL);
|
||||
Symbol* class_name = InstanceKlass::cast((Klass*)(p->klass()))->name();
|
||||
Symbol* class_name = p->klass()->name();
|
||||
// Since the null class loader data isn't copied to the CDS archive,
|
||||
// compute the hash with NULL for loader data.
|
||||
unsigned int hash = compute_hash(class_name, NULL);
|
||||
@ -723,7 +723,7 @@ void Dictionary::print(bool details) {
|
||||
Klass* e = probe->klass();
|
||||
ClassLoaderData* loader_data = probe->loader_data();
|
||||
bool is_defining_class =
|
||||
(loader_data == InstanceKlass::cast(e)->class_loader_data());
|
||||
(loader_data == e->class_loader_data());
|
||||
tty->print("%s%s", ((!details) || is_defining_class) ? " " : "^",
|
||||
e->external_name());
|
||||
|
||||
@ -756,7 +756,7 @@ void Dictionary::verify() {
|
||||
probe = probe->next()) {
|
||||
Klass* e = probe->klass();
|
||||
ClassLoaderData* loader_data = probe->loader_data();
|
||||
guarantee(e->oop_is_instance(),
|
||||
guarantee(e->is_instance_klass(),
|
||||
"Verify of system dictionary failed");
|
||||
// class loader must be present; a null class loader is the
|
||||
// boostrap loader
|
||||
|
@ -323,8 +323,7 @@ class DictionaryEntry : public HashtableEntry<Klass*, mtClass> {
|
||||
|
||||
bool equals(Symbol* class_name, ClassLoaderData* loader_data) const {
|
||||
Klass* klass = (Klass*)literal();
|
||||
return (InstanceKlass::cast(klass)->name() == class_name &&
|
||||
_loader_data == loader_data);
|
||||
return (klass->name() == class_name && _loader_data == loader_data);
|
||||
}
|
||||
|
||||
void print() {
|
||||
|
@ -114,17 +114,17 @@ static bool find_field(InstanceKlass* ik,
|
||||
// Helpful routine for computing field offsets at run time rather than hardcoding them
|
||||
static void
|
||||
compute_offset(int &dest_offset,
|
||||
Klass* klass_oop, Symbol* name_symbol, Symbol* signature_symbol,
|
||||
Klass* klass, Symbol* name_symbol, Symbol* signature_symbol,
|
||||
bool is_static = false, bool allow_super = false) {
|
||||
fieldDescriptor fd;
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass_oop);
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass);
|
||||
if (!find_field(ik, name_symbol, signature_symbol, &fd, is_static, allow_super)) {
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Invalid layout of %s at %s", ik->external_name(), name_symbol->as_C_string());
|
||||
#ifndef PRODUCT
|
||||
klass_oop->print();
|
||||
ik->print();
|
||||
tty->print_cr("all fields:");
|
||||
for (AllFieldStream fs(InstanceKlass::cast(klass_oop)); !fs.done(); fs.next()) {
|
||||
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
|
||||
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
||||
}
|
||||
#endif //PRODUCT
|
||||
@ -136,10 +136,10 @@ compute_offset(int &dest_offset,
|
||||
// Same as above but for "optional" offsets that might not be present in certain JDK versions
|
||||
static void
|
||||
compute_optional_offset(int& dest_offset,
|
||||
Klass* klass_oop, Symbol* name_symbol, Symbol* signature_symbol,
|
||||
Klass* klass, Symbol* name_symbol, Symbol* signature_symbol,
|
||||
bool allow_super = false) {
|
||||
fieldDescriptor fd;
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass_oop);
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass);
|
||||
if (find_field(ik, name_symbol, signature_symbol, &fd, allow_super)) {
|
||||
dest_offset = fd.offset();
|
||||
}
|
||||
@ -174,7 +174,7 @@ Handle java_lang_String::basic_create(int length, TRAPS) {
|
||||
// Create the String object first, so there's a chance that the String
|
||||
// and the char array it points to end up in the same cache line.
|
||||
oop obj;
|
||||
obj = InstanceKlass::cast(SystemDictionary::String_klass())->allocate_instance(CHECK_NH);
|
||||
obj = SystemDictionary::String_klass()->allocate_instance(CHECK_NH);
|
||||
|
||||
// Create the char array. The String object must be handlized here
|
||||
// because GC can happen as a result of the allocation attempt.
|
||||
@ -555,7 +555,7 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
|
||||
|
||||
// If the offset was read from the shared archive, it was fixed up already
|
||||
if (!k->is_shared()) {
|
||||
if (k->oop_is_instance()) {
|
||||
if (k->is_instance_klass()) {
|
||||
// During bootstrap, java.lang.Class wasn't loaded so static field
|
||||
// offsets were computed without the size added it. Go back and
|
||||
// update all the static field offsets to included the size.
|
||||
@ -613,13 +613,13 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
|
||||
java_lang_Class::set_static_oop_field_count(mirror(), mk->compute_static_oop_field_count(mirror()));
|
||||
|
||||
// It might also have a component mirror. This mirror must already exist.
|
||||
if (k->oop_is_array()) {
|
||||
if (k->is_array_klass()) {
|
||||
Handle comp_mirror;
|
||||
if (k->oop_is_typeArray()) {
|
||||
if (k->is_typeArray_klass()) {
|
||||
BasicType type = TypeArrayKlass::cast(k())->element_type();
|
||||
comp_mirror = Universe::java_mirror(type);
|
||||
} else {
|
||||
assert(k->oop_is_objArray(), "Must be");
|
||||
assert(k->is_objArray_klass(), "Must be");
|
||||
Klass* element_klass = ObjArrayKlass::cast(k())->element_klass();
|
||||
assert(element_klass != NULL, "Must have an element klass");
|
||||
comp_mirror = element_klass->java_mirror();
|
||||
@ -631,7 +631,7 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
|
||||
set_component_mirror(mirror(), comp_mirror());
|
||||
set_array_klass(comp_mirror(), k());
|
||||
} else {
|
||||
assert(k->oop_is_instance(), "Must be");
|
||||
assert(k->is_instance_klass(), "Must be");
|
||||
|
||||
initialize_mirror_fields(k, mirror, protection_domain, THREAD);
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
@ -770,7 +770,7 @@ void java_lang_Class::print_signature(oop java_class, outputStream* st) {
|
||||
name = vmSymbols::type_signature(primitive_type(java_class));
|
||||
} else {
|
||||
Klass* k = as_Klass(java_class);
|
||||
is_instance = k->oop_is_instance();
|
||||
is_instance = k->is_instance_klass();
|
||||
name = k->name();
|
||||
}
|
||||
if (name == NULL) {
|
||||
@ -793,7 +793,7 @@ Symbol* java_lang_Class::as_signature(oop java_class, bool intern_if_not_found,
|
||||
name->increment_refcount();
|
||||
} else {
|
||||
Klass* k = as_Klass(java_class);
|
||||
if (!k->oop_is_instance()) {
|
||||
if (!k->is_instance_klass()) {
|
||||
name = k->name();
|
||||
name->increment_refcount();
|
||||
} else {
|
||||
@ -829,13 +829,13 @@ const char* java_lang_Class::as_external_name(oop java_class) {
|
||||
|
||||
Klass* java_lang_Class::array_klass(oop java_class) {
|
||||
Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
|
||||
assert(k == NULL || k->is_klass() && k->oop_is_array(), "should be array klass");
|
||||
assert(k == NULL || k->is_klass() && k->is_array_klass(), "should be array klass");
|
||||
return k;
|
||||
}
|
||||
|
||||
|
||||
void java_lang_Class::set_array_klass(oop java_class, Klass* klass) {
|
||||
assert(klass->is_klass() && klass->oop_is_array(), "should be array klass");
|
||||
assert(klass->is_klass() && klass->is_array_klass(), "should be array klass");
|
||||
java_class->metadata_field_put(_array_klass_offset, klass);
|
||||
}
|
||||
|
||||
@ -1236,7 +1236,7 @@ void java_lang_ThreadGroup::compute_offsets() {
|
||||
}
|
||||
|
||||
oop java_lang_Throwable::unassigned_stacktrace() {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Throwable_klass());
|
||||
InstanceKlass* ik = SystemDictionary::Throwable_klass();
|
||||
address addr = ik->static_field_addr(static_unassigned_stacktrace_offset);
|
||||
if (UseCompressedOops) {
|
||||
return oopDesc::load_decode_heap_oop((narrowOop *)addr);
|
||||
@ -1293,7 +1293,7 @@ void java_lang_Throwable::print(oop throwable, outputStream* st) {
|
||||
ResourceMark rm;
|
||||
Klass* k = throwable->klass();
|
||||
assert(k != NULL, "just checking");
|
||||
st->print("%s", InstanceKlass::cast(k)->external_name());
|
||||
st->print("%s", k->external_name());
|
||||
oop msg = message(throwable);
|
||||
if (msg != NULL) {
|
||||
st->print(": %s", java_lang_String::as_utf8_string(msg));
|
||||
@ -1305,7 +1305,7 @@ void java_lang_Throwable::print(Handle throwable, outputStream* st) {
|
||||
ResourceMark rm;
|
||||
Klass* k = throwable->klass();
|
||||
assert(k != NULL, "just checking");
|
||||
st->print("%s", InstanceKlass::cast(k)->external_name());
|
||||
st->print("%s", k->external_name());
|
||||
oop msg = message(throwable);
|
||||
if (msg != NULL) {
|
||||
st->print(": %s", java_lang_String::as_utf8_string(msg));
|
||||
@ -1561,7 +1561,7 @@ void java_lang_Throwable::print_stack_element(outputStream *st, Handle mirror,
|
||||
st->print_cr("%s", buf);
|
||||
}
|
||||
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, methodHandle method, int bci) {
|
||||
void java_lang_Throwable::print_stack_element(outputStream *st, const methodHandle& method, int bci) {
|
||||
Handle mirror = method->method_holder()->java_mirror();
|
||||
int method_id = method->orig_method_idnum();
|
||||
int version = method->constants()->version();
|
||||
@ -1632,7 +1632,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
|
||||
}
|
||||
}
|
||||
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS) {
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS) {
|
||||
if (!StackTraceInThrowable) return;
|
||||
ResourceMark rm(THREAD);
|
||||
|
||||
@ -1763,7 +1763,7 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met
|
||||
set_backtrace(throwable(), bt.backtrace());
|
||||
}
|
||||
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method) {
|
||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method) {
|
||||
// No-op if stack trace is disabled
|
||||
if (!StackTraceInThrowable) {
|
||||
return;
|
||||
@ -1945,7 +1945,7 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
|
||||
return element();
|
||||
}
|
||||
|
||||
oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) {
|
||||
oop java_lang_StackTraceElement::create(const methodHandle& method, int bci, TRAPS) {
|
||||
Handle mirror (THREAD, method->method_holder()->java_mirror());
|
||||
int method_id = method->orig_method_idnum();
|
||||
int cpref = method->name_index();
|
||||
@ -2506,7 +2506,7 @@ ConstantPool* sun_reflect_ConstantPool::get_cp(oop reflect) {
|
||||
|
||||
oop mirror = reflect->obj_field(_oop_offset);
|
||||
Klass* k = java_lang_Class::as_Klass(mirror);
|
||||
assert(k->oop_is_instance(), "Must be");
|
||||
assert(k->is_instance_klass(), "Must be");
|
||||
|
||||
// Get the constant pool back from the klass. Since class redefinition
|
||||
// merges the new constant pool into the old, this is essentially the
|
||||
@ -2663,13 +2663,13 @@ void java_lang_boxing_object::print(BasicType type, jvalue* value, outputStream*
|
||||
|
||||
// Support for java_lang_ref_Reference
|
||||
HeapWord *java_lang_ref_Reference::pending_list_lock_addr() {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Reference_klass());
|
||||
InstanceKlass* ik = SystemDictionary::Reference_klass();
|
||||
address addr = ik->static_field_addr(static_lock_offset);
|
||||
return (HeapWord*) addr;
|
||||
}
|
||||
|
||||
oop java_lang_ref_Reference::pending_list_lock() {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Reference_klass());
|
||||
InstanceKlass* ik = SystemDictionary::Reference_klass();
|
||||
address addr = ik->static_field_addr(static_lock_offset);
|
||||
if (UseCompressedOops) {
|
||||
return oopDesc::load_decode_heap_oop((narrowOop *)addr);
|
||||
@ -2679,7 +2679,7 @@ oop java_lang_ref_Reference::pending_list_lock() {
|
||||
}
|
||||
|
||||
HeapWord *java_lang_ref_Reference::pending_list_addr() {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Reference_klass());
|
||||
InstanceKlass* ik = SystemDictionary::Reference_klass();
|
||||
address addr = ik->static_field_addr(static_pending_offset);
|
||||
// XXX This might not be HeapWord aligned, almost rather be char *.
|
||||
return (HeapWord*)addr;
|
||||
@ -2702,13 +2702,13 @@ jlong java_lang_ref_SoftReference::timestamp(oop ref) {
|
||||
}
|
||||
|
||||
jlong java_lang_ref_SoftReference::clock() {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::SoftReference_klass());
|
||||
InstanceKlass* ik = SystemDictionary::SoftReference_klass();
|
||||
jlong* offset = (jlong*)ik->static_field_addr(static_clock_offset);
|
||||
return *offset;
|
||||
}
|
||||
|
||||
void java_lang_ref_SoftReference::set_clock(jlong value) {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::SoftReference_klass());
|
||||
InstanceKlass* ik = SystemDictionary::SoftReference_klass();
|
||||
jlong* offset = (jlong*)ik->static_field_addr(static_clock_offset);
|
||||
*offset = value;
|
||||
}
|
||||
@ -3033,7 +3033,7 @@ int java_security_AccessControlContext::_isAuthorized_offset = -1;
|
||||
void java_security_AccessControlContext::compute_offsets() {
|
||||
assert(_isPrivileged_offset == 0, "offsets should be initialized only once");
|
||||
fieldDescriptor fd;
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::AccessControlContext_klass());
|
||||
InstanceKlass* ik = SystemDictionary::AccessControlContext_klass();
|
||||
|
||||
if (!ik->find_local_field(vmSymbols::context_name(), vmSymbols::protectiondomain_signature(), &fd)) {
|
||||
fatal("Invalid layout of java.security.AccessControlContext");
|
||||
@ -3066,9 +3066,9 @@ bool java_security_AccessControlContext::is_authorized(Handle context) {
|
||||
oop java_security_AccessControlContext::create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS) {
|
||||
assert(_isPrivileged_offset != 0, "offsets should have been initialized");
|
||||
// Ensure klass is initialized
|
||||
InstanceKlass::cast(SystemDictionary::AccessControlContext_klass())->initialize(CHECK_0);
|
||||
SystemDictionary::AccessControlContext_klass()->initialize(CHECK_0);
|
||||
// Allocate result
|
||||
oop result = InstanceKlass::cast(SystemDictionary::AccessControlContext_klass())->allocate_instance(CHECK_0);
|
||||
oop result = SystemDictionary::AccessControlContext_klass()->allocate_instance(CHECK_0);
|
||||
// Fill in values
|
||||
result->obj_field_put(_context_offset, context());
|
||||
result->obj_field_put(_privilegedContext_offset, privileged_context());
|
||||
@ -3190,7 +3190,7 @@ int java_lang_System::err_offset_in_bytes() {
|
||||
|
||||
|
||||
bool java_lang_System::has_security_manager() {
|
||||
InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::System_klass());
|
||||
InstanceKlass* ik = SystemDictionary::System_klass();
|
||||
address addr = ik->static_field_addr(static_security_offset);
|
||||
if (UseCompressedOops) {
|
||||
return oopDesc::load_decode_heap_oop((narrowOop *)addr) != NULL;
|
||||
@ -3630,8 +3630,8 @@ void JavaClasses::check_offsets() {
|
||||
#endif // PRODUCT
|
||||
|
||||
int InjectedField::compute_offset() {
|
||||
Klass* klass_oop = klass();
|
||||
for (AllFieldStream fs(InstanceKlass::cast(klass_oop)); !fs.done(); fs.next()) {
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass());
|
||||
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
|
||||
if (!may_be_java && !fs.access_flags().is_internal()) {
|
||||
// Only look at injected fields
|
||||
continue;
|
||||
@ -3641,11 +3641,11 @@ int InjectedField::compute_offset() {
|
||||
}
|
||||
}
|
||||
ResourceMark rm;
|
||||
tty->print_cr("Invalid layout of %s at %s/%s%s", InstanceKlass::cast(klass_oop)->external_name(), name()->as_C_string(), signature()->as_C_string(), may_be_java ? " (may_be_java)" : "");
|
||||
tty->print_cr("Invalid layout of %s at %s/%s%s", ik->external_name(), name()->as_C_string(), signature()->as_C_string(), may_be_java ? " (may_be_java)" : "");
|
||||
#ifndef PRODUCT
|
||||
klass_oop->print();
|
||||
ik->print();
|
||||
tty->print_cr("all fields:");
|
||||
for (AllFieldStream fs(InstanceKlass::cast(klass_oop)); !fs.done(); fs.next()) {
|
||||
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
|
||||
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
||||
}
|
||||
#endif //PRODUCT
|
||||
|
@ -532,7 +532,7 @@ class java_lang_Throwable: AllStatic {
|
||||
static Symbol* detail_message(oop throwable);
|
||||
static void print_stack_element(outputStream *st, Handle mirror, int method,
|
||||
int version, int bci, int cpref);
|
||||
static void print_stack_element(outputStream *st, methodHandle method, int bci);
|
||||
static void print_stack_element(outputStream *st, const methodHandle& method, int bci);
|
||||
static void print_stack_usage(Handle stream);
|
||||
|
||||
// Allocate space for backtrace (created but stack trace not filled in)
|
||||
@ -540,8 +540,8 @@ class java_lang_Throwable: AllStatic {
|
||||
// Fill in current stack trace for throwable with preallocated backtrace (no GC)
|
||||
static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
|
||||
// Fill in current stack trace, can cause GC
|
||||
static void fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS);
|
||||
static void fill_in_stack_trace(Handle throwable, methodHandle method = methodHandle());
|
||||
static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
|
||||
static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
|
||||
// Programmatic access to stack trace
|
||||
static oop get_stack_trace_element(oop throwable, int index, TRAPS);
|
||||
static int get_stack_trace_depth(oop throwable, TRAPS);
|
||||
@ -1347,7 +1347,7 @@ class java_lang_StackTraceElement: AllStatic {
|
||||
|
||||
// Create an instance of StackTraceElement
|
||||
static oop create(Handle mirror, int method, int version, int bci, int cpref, TRAPS);
|
||||
static oop create(methodHandle method, int bci, TRAPS);
|
||||
static oop create(const methodHandle& method, int bci, TRAPS);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, 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
|
||||
@ -320,7 +320,7 @@ Klass* LoaderConstraintTable::find_constrained_klass(Symbol* name,
|
||||
Handle loader) {
|
||||
LoaderConstraintEntry *p = *(find_loader_constraint(name, loader));
|
||||
if (p != NULL && p->klass() != NULL) {
|
||||
if (p->klass()->oop_is_instance() && !InstanceKlass::cast(p->klass())->is_loaded()) {
|
||||
if (p->klass()->is_instance_klass() && !InstanceKlass::cast(p->klass())->is_loaded()) {
|
||||
// Only return fully loaded classes. Classes found through the
|
||||
// constraints might still be in the process of loading.
|
||||
return NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2015, 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
|
||||
@ -244,7 +244,7 @@ void PlaceholderEntry::verify() const {
|
||||
guarantee(loader_data()->class_loader() == NULL || loader_data()->class_loader()->is_instance(),
|
||||
"checking type of _loader");
|
||||
guarantee(instance_klass() == NULL
|
||||
|| instance_klass()->oop_is_instance(),
|
||||
|| instance_klass()->is_instance_klass(),
|
||||
"checking type of instance_klass result");
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> {
|
||||
}
|
||||
|
||||
SeenThread* actionToQueue(PlaceholderTable::classloadAction action) {
|
||||
SeenThread* queuehead;
|
||||
SeenThread* queuehead = NULL;
|
||||
switch (action) {
|
||||
case PlaceholderTable::LOAD_INSTANCE:
|
||||
queuehead = _loadInstanceThreadQ;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
// add new entry to the table
|
||||
void ResolutionErrorTable::add_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int cp_index,
|
||||
const constantPoolHandle& pool, int cp_index,
|
||||
Symbol* error, Symbol* message)
|
||||
{
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
@ -44,7 +44,7 @@ void ResolutionErrorTable::add_entry(int index, unsigned int hash,
|
||||
|
||||
// find entry in the table
|
||||
ResolutionErrorEntry* ResolutionErrorTable::find_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int cp_index)
|
||||
const constantPoolHandle& pool, int cp_index)
|
||||
{
|
||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, 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
|
||||
@ -56,15 +56,15 @@ public:
|
||||
}
|
||||
|
||||
void add_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int which, Symbol* error, Symbol* message);
|
||||
const constantPoolHandle& pool, int which, Symbol* error, Symbol* message);
|
||||
|
||||
|
||||
// find error given the constant pool and constant pool index
|
||||
ResolutionErrorEntry* find_entry(int index, unsigned int hash,
|
||||
constantPoolHandle pool, int cp_index);
|
||||
const constantPoolHandle& pool, int cp_index);
|
||||
|
||||
|
||||
unsigned int compute_hash(constantPoolHandle pool, int cp_index) {
|
||||
unsigned int compute_hash(const constantPoolHandle& pool, int cp_index) {
|
||||
return (unsigned int) pool->identity_hash() + cp_index;
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ Symbol* SymbolTable::lookup_only_unicode(const jchar* name, int utf16_length,
|
||||
}
|
||||
}
|
||||
|
||||
void SymbolTable::add(ClassLoaderData* loader_data, constantPoolHandle cp,
|
||||
void SymbolTable::add(ClassLoaderData* loader_data, const constantPoolHandle& cp,
|
||||
int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS) {
|
||||
@ -452,7 +452,7 @@ Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
|
||||
|
||||
// This version of basic_add adds symbols in batch from the constant pool
|
||||
// parsing.
|
||||
bool SymbolTable::basic_add(ClassLoaderData* loader_data, constantPoolHandle cp,
|
||||
bool SymbolTable::basic_add(ClassLoaderData* loader_data, const constantPoolHandle& cp,
|
||||
int names_count,
|
||||
const char** names, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -100,12 +100,12 @@ private:
|
||||
Symbol* basic_add(int index, u1* name, int len, unsigned int hashValue,
|
||||
bool c_heap, TRAPS);
|
||||
bool basic_add(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp, int names_count,
|
||||
const constantPoolHandle& cp, int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS);
|
||||
|
||||
static void new_symbols(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp, int names_count,
|
||||
const constantPoolHandle& cp, int names_count,
|
||||
const char** name, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues,
|
||||
TRAPS) {
|
||||
@ -170,7 +170,7 @@ public:
|
||||
static Symbol* lookup_only_unicode(const jchar* name, int len, unsigned int& hash);
|
||||
|
||||
static void add(ClassLoaderData* loader_data,
|
||||
constantPoolHandle cp, int names_count,
|
||||
const constantPoolHandle& cp, int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS);
|
||||
|
||||
|
@ -88,10 +88,10 @@ const int SystemDictionary::_primelist[_prime_array_size] = {1009,2017,4049,50
|
||||
|
||||
oop SystemDictionary::_system_loader_lock_obj = NULL;
|
||||
|
||||
Klass* SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
|
||||
InstanceKlass* SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
|
||||
= { NULL /*, NULL...*/ };
|
||||
|
||||
Klass* SystemDictionary::_box_klasses[T_VOID+1] = { NULL /*, NULL...*/ };
|
||||
InstanceKlass* SystemDictionary::_box_klasses[T_VOID+1] = { NULL /*, NULL...*/ };
|
||||
|
||||
oop SystemDictionary::_java_system_loader = NULL;
|
||||
|
||||
@ -99,7 +99,7 @@ bool SystemDictionary::_has_loadClassInternal = false;
|
||||
bool SystemDictionary::_has_checkPackageAccess = false;
|
||||
|
||||
// lazily initialized klass variables
|
||||
Klass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
|
||||
InstanceKlass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -357,7 +357,7 @@ Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
|
||||
// so we don't throw an exception here.
|
||||
// see: nsk redefclass014 & java.lang.instrument Instrument032
|
||||
if ((childk != NULL ) && (is_superclass) &&
|
||||
((quicksuperk = InstanceKlass::cast(childk)->super()) != NULL) &&
|
||||
((quicksuperk = childk->super()) != NULL) &&
|
||||
|
||||
((quicksuperk->name() == class_name) &&
|
||||
(quicksuperk->class_loader() == class_loader()))) {
|
||||
@ -1257,8 +1257,7 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
|
||||
}
|
||||
|
||||
// notify a class loaded from shared object
|
||||
ClassLoadingService::notify_class_loaded(InstanceKlass::cast(ik()),
|
||||
true /* shared class */);
|
||||
ClassLoadingService::notify_class_loaded(ik(), true /* shared class */);
|
||||
}
|
||||
return ik;
|
||||
}
|
||||
@ -1805,7 +1804,7 @@ void SystemDictionary::load_abstract_ownable_synchronizer_klass(TRAPS) {
|
||||
Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK);
|
||||
// Force a fence to prevent any read before the write completes
|
||||
OrderAccess::fence();
|
||||
_abstract_ownable_synchronizer_klass = k;
|
||||
_abstract_ownable_synchronizer_klass = InstanceKlass::cast(k);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1846,14 +1845,16 @@ bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
|
||||
int info = wk_init_info[id - FIRST_WKID];
|
||||
int sid = (info >> CEIL_LG_OPTION_LIMIT);
|
||||
Symbol* symbol = vmSymbols::symbol_at((vmSymbols::SID)sid);
|
||||
Klass** klassp = &_well_known_klasses[id];
|
||||
InstanceKlass** klassp = &_well_known_klasses[id];
|
||||
bool must_load = (init_opt < SystemDictionary::Opt);
|
||||
if ((*klassp) == NULL) {
|
||||
Klass* k;
|
||||
if (must_load) {
|
||||
(*klassp) = resolve_or_fail(symbol, true, CHECK_0); // load required class
|
||||
k = resolve_or_fail(symbol, true, CHECK_0); // load required class
|
||||
} else {
|
||||
(*klassp) = resolve_or_null(symbol, CHECK_0); // load optional klass
|
||||
k = resolve_or_null(symbol, CHECK_0); // load optional klass
|
||||
}
|
||||
(*klassp) = (k == NULL) ? NULL : InstanceKlass::cast(k);
|
||||
}
|
||||
return ((*klassp) != NULL);
|
||||
}
|
||||
@ -1966,7 +1967,8 @@ void SystemDictionary::check_constraints(int d_index, unsigned int d_hash,
|
||||
instanceKlassHandle k,
|
||||
Handle class_loader, bool defining,
|
||||
TRAPS) {
|
||||
const char *linkage_error = NULL;
|
||||
const char *linkage_error1 = NULL;
|
||||
const char *linkage_error2 = NULL;
|
||||
{
|
||||
Symbol* name = k->name();
|
||||
ClassLoaderData *loader_data = class_loader_data(class_loader);
|
||||
@ -1981,10 +1983,10 @@ void SystemDictionary::check_constraints(int d_index, unsigned int d_hash,
|
||||
// system dictionary only holds instance classes, placeholders
|
||||
// also holds array classes
|
||||
|
||||
assert(check->oop_is_instance(), "noninstance in systemdictionary");
|
||||
assert(check->is_instance_klass(), "noninstance in systemdictionary");
|
||||
if ((defining == true) || (k() != check)) {
|
||||
linkage_error = "loader (instance of %s): attempted duplicate class "
|
||||
"definition for name: \"%s\"";
|
||||
linkage_error1 = "loader (instance of ";
|
||||
linkage_error2 = "): attempted duplicate class definition for name: \"";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@ -1995,10 +1997,10 @@ void SystemDictionary::check_constraints(int d_index, unsigned int d_hash,
|
||||
assert(ph_check == NULL || ph_check == name, "invalid symbol");
|
||||
#endif
|
||||
|
||||
if (linkage_error == NULL) {
|
||||
if (linkage_error1 == NULL) {
|
||||
if (constraints()->check_or_update(k, class_loader, name) == false) {
|
||||
linkage_error = "loader constraint violation: loader (instance of %s)"
|
||||
" previously initiated loading for a different type with name \"%s\"";
|
||||
linkage_error1 = "loader constraint violation: loader (instance of ";
|
||||
linkage_error2 = ") previously initiated loading for a different type with name \"";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2006,14 +2008,14 @@ void SystemDictionary::check_constraints(int d_index, unsigned int d_hash,
|
||||
// Throw error now if needed (cannot throw while holding
|
||||
// SystemDictionary_lock because of rank ordering)
|
||||
|
||||
if (linkage_error) {
|
||||
if (linkage_error1) {
|
||||
ResourceMark rm(THREAD);
|
||||
const char* class_loader_name = loader_name(class_loader());
|
||||
char* type_name = k->name()->as_C_string();
|
||||
size_t buflen = strlen(linkage_error) + strlen(class_loader_name) +
|
||||
strlen(type_name);
|
||||
size_t buflen = strlen(linkage_error1) + strlen(class_loader_name) +
|
||||
strlen(linkage_error2) + strlen(type_name) + 2; // +2 for '"' and null byte.
|
||||
char* buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, buflen);
|
||||
jio_snprintf(buf, buflen, linkage_error, class_loader_name, type_name);
|
||||
jio_snprintf(buf, buflen, "%s%s%s%s\"", linkage_error1, class_loader_name, linkage_error2, type_name);
|
||||
THROW_MSG(vmSymbols::java_lang_LinkageError(), buf);
|
||||
}
|
||||
}
|
||||
@ -2155,7 +2157,7 @@ bool SystemDictionary::add_loader_constraint(Symbol* class_name,
|
||||
|
||||
// Add entry to resolution error table to record the error when the first
|
||||
// attempt to resolve a reference to a class has failed.
|
||||
void SystemDictionary::add_resolution_error(constantPoolHandle pool, int which,
|
||||
void SystemDictionary::add_resolution_error(const constantPoolHandle& pool, int which,
|
||||
Symbol* error, Symbol* message) {
|
||||
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
||||
int index = resolution_errors()->hash_to_index(hash);
|
||||
@ -2171,7 +2173,7 @@ void SystemDictionary::delete_resolution_error(ConstantPool* pool) {
|
||||
}
|
||||
|
||||
// Lookup resolution error table. Returns error if found, otherwise NULL.
|
||||
Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int which,
|
||||
Symbol* SystemDictionary::find_resolution_error(const constantPoolHandle& pool, int which,
|
||||
Symbol** message) {
|
||||
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
||||
int index = resolution_errors()->hash_to_index(hash);
|
||||
@ -2387,13 +2389,13 @@ methodHandle SystemDictionary::find_method_handle_invoker(Symbol* name,
|
||||
// Out of an abundance of caution, we do not include any other classes, not even for packages like java.util.
|
||||
static bool is_always_visible_class(oop mirror) {
|
||||
Klass* klass = java_lang_Class::as_Klass(mirror);
|
||||
if (klass->oop_is_objArray()) {
|
||||
if (klass->is_objArray_klass()) {
|
||||
klass = ObjArrayKlass::cast(klass)->bottom_klass(); // check element type
|
||||
}
|
||||
if (klass->oop_is_typeArray()) {
|
||||
if (klass->is_typeArray_klass()) {
|
||||
return true; // primitive array
|
||||
}
|
||||
assert(klass->oop_is_instance(), "%s", klass->external_name());
|
||||
assert(klass->is_instance_klass(), "%s", klass->external_name());
|
||||
return klass->is_public() &&
|
||||
(InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::Object_klass()) || // java.lang
|
||||
InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::MethodHandle_klass())); // java.lang.invoke
|
||||
@ -2457,9 +2459,9 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
|
||||
Klass* sel_klass = java_lang_Class::as_Klass(mirror);
|
||||
mirror = NULL; // safety
|
||||
// Emulate ConstantPool::verify_constant_pool_resolve.
|
||||
if (sel_klass->oop_is_objArray())
|
||||
if (sel_klass->is_objArray_klass())
|
||||
sel_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass();
|
||||
if (sel_klass->oop_is_instance()) {
|
||||
if (sel_klass->is_instance_klass()) {
|
||||
KlassHandle sel_kh(THREAD, sel_klass);
|
||||
LinkResolver::check_klass_accessability(accessing_klass, sel_kh, CHECK_(empty));
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ class Ticks;
|
||||
\
|
||||
do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre ) \
|
||||
do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre ) \
|
||||
do_klass(misc_Unsafe_klass, sun_misc_Unsafe, Pre ) \
|
||||
do_klass(internal_Unsafe_klass, jdk_internal_misc_Unsafe, Pre ) \
|
||||
\
|
||||
/* support for CDS */ \
|
||||
do_klass(ByteArrayInputStream_klass, java_io_ByteArrayInputStream, Pre ) \
|
||||
@ -403,15 +403,15 @@ public:
|
||||
static void initialize(TRAPS);
|
||||
|
||||
// Fast access to commonly used classes (preloaded)
|
||||
static Klass* check_klass(Klass* k) {
|
||||
static InstanceKlass* check_klass(InstanceKlass* k) {
|
||||
assert(k != NULL, "preloaded klass not initialized");
|
||||
return k;
|
||||
}
|
||||
|
||||
static Klass* check_klass_Pre( Klass* k) { return check_klass(k); }
|
||||
static Klass* check_klass_Opt( Klass* k) { return k; }
|
||||
static InstanceKlass* check_klass_Pre(InstanceKlass* k) { return check_klass(k); }
|
||||
static InstanceKlass* check_klass_Opt(InstanceKlass* k) { return k; }
|
||||
|
||||
JVMCI_ONLY(static Klass* check_klass_Jvmci(Klass* k) { return k; })
|
||||
JVMCI_ONLY(static InstanceKlass* check_klass_Jvmci(InstanceKlass* k) { return k; })
|
||||
|
||||
static bool initialize_wk_klass(WKID id, int init_opt, TRAPS);
|
||||
static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS);
|
||||
@ -422,19 +422,19 @@ public:
|
||||
|
||||
public:
|
||||
#define WK_KLASS_DECLARE(name, symbol, option) \
|
||||
static Klass* name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } \
|
||||
static Klass** name##_addr() { \
|
||||
static InstanceKlass* name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } \
|
||||
static InstanceKlass** name##_addr() { \
|
||||
return &SystemDictionary::_well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)]; \
|
||||
}
|
||||
WK_KLASSES_DO(WK_KLASS_DECLARE);
|
||||
#undef WK_KLASS_DECLARE
|
||||
|
||||
static Klass* well_known_klass(WKID id) {
|
||||
static InstanceKlass* well_known_klass(WKID id) {
|
||||
assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
|
||||
return _well_known_klasses[id];
|
||||
}
|
||||
|
||||
static Klass** well_known_klass_addr(WKID id) {
|
||||
static InstanceKlass** well_known_klass_addr(WKID id) {
|
||||
assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
|
||||
return &_well_known_klasses[id];
|
||||
}
|
||||
@ -442,7 +442,7 @@ public:
|
||||
// Local definition for direct access to the private array:
|
||||
#define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)]
|
||||
|
||||
static Klass* box_klass(BasicType t) {
|
||||
static InstanceKlass* box_klass(BasicType t) {
|
||||
assert((uint)t < T_VOID+1, "range check");
|
||||
return check_klass(_box_klasses[t]);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public:
|
||||
|
||||
// methods returning lazily loaded klasses
|
||||
// The corresponding method to load the class must be called before calling them.
|
||||
static Klass* abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); }
|
||||
static InstanceKlass* abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); }
|
||||
|
||||
static void load_abstract_ownable_synchronizer_klass(TRAPS);
|
||||
|
||||
@ -547,10 +547,10 @@ public:
|
||||
|
||||
// Record the error when the first attempt to resolve a reference from a constant
|
||||
// pool entry to a class fails.
|
||||
static void add_resolution_error(constantPoolHandle pool, int which, Symbol* error,
|
||||
static void add_resolution_error(const constantPoolHandle& pool, int which, Symbol* error,
|
||||
Symbol* message);
|
||||
static void delete_resolution_error(ConstantPool* pool);
|
||||
static Symbol* find_resolution_error(constantPoolHandle pool, int which,
|
||||
static Symbol* find_resolution_error(const constantPoolHandle& pool, int which,
|
||||
Symbol** message);
|
||||
|
||||
protected:
|
||||
@ -700,13 +700,13 @@ protected:
|
||||
TRAPS);
|
||||
|
||||
// Variables holding commonly used klasses (preloaded)
|
||||
static Klass* _well_known_klasses[];
|
||||
static InstanceKlass* _well_known_klasses[];
|
||||
|
||||
// Lazily loaded klasses
|
||||
static Klass* volatile _abstract_ownable_synchronizer_klass;
|
||||
static InstanceKlass* volatile _abstract_ownable_synchronizer_klass;
|
||||
|
||||
// table of box klasses (int_klass, etc.)
|
||||
static Klass* _box_klasses[T_VOID+1];
|
||||
static InstanceKlass* _box_klasses[T_VOID+1];
|
||||
|
||||
static oop _java_system_loader;
|
||||
|
||||
|
@ -184,7 +184,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
tty->print("Verification for %s has", klassName);
|
||||
tty->print_cr(" exception pending %s ",
|
||||
InstanceKlass::cast(PENDING_EXCEPTION->klass())->external_name());
|
||||
PENDING_EXCEPTION->klass()->external_name());
|
||||
} else if (exception_name != NULL) {
|
||||
tty->print_cr("Verification for %s failed", klassName);
|
||||
}
|
||||
@ -605,7 +605,7 @@ void ClassVerifier::verify_class(TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_method(methodHandle m, TRAPS) {
|
||||
void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
|
||||
HandleMark hm(THREAD);
|
||||
_method = m; // initialize _method
|
||||
if (VerboseVerification) {
|
||||
@ -1901,7 +1901,7 @@ void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, S
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_cp_index(
|
||||
u2 bci, constantPoolHandle cp, int index, TRAPS) {
|
||||
u2 bci, const constantPoolHandle& cp, int index, TRAPS) {
|
||||
int nconstants = cp->length();
|
||||
if ((index <= 0) || (index >= nconstants)) {
|
||||
verify_error(ErrorContext::bad_cp_index(bci, index),
|
||||
@ -1912,7 +1912,7 @@ void ClassVerifier::verify_cp_index(
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_cp_type(
|
||||
u2 bci, int index, constantPoolHandle cp, unsigned int types, TRAPS) {
|
||||
u2 bci, int index, const constantPoolHandle& cp, unsigned int types, TRAPS) {
|
||||
|
||||
// In some situations, bytecode rewriting may occur while we're verifying.
|
||||
// In this case, a constant pool cache exists and some indices refer to that
|
||||
@ -1931,7 +1931,7 @@ void ClassVerifier::verify_cp_type(
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_cp_class_type(
|
||||
u2 bci, int index, constantPoolHandle cp, TRAPS) {
|
||||
u2 bci, int index, const constantPoolHandle& cp, TRAPS) {
|
||||
verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
|
||||
constantTag tag = cp->tag_at(index);
|
||||
if (!tag.is_klass() && !tag.is_unresolved_klass()) {
|
||||
@ -2023,7 +2023,7 @@ bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
|
||||
|
||||
void ClassVerifier::verify_ldc(
|
||||
int opcode, u2 index, StackMapFrame* current_frame,
|
||||
constantPoolHandle cp, u2 bci, TRAPS) {
|
||||
const constantPoolHandle& cp, u2 bci, TRAPS) {
|
||||
verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
|
||||
constantTag tag = cp->tag_at(index);
|
||||
unsigned int types;
|
||||
@ -2165,7 +2165,7 @@ bool ClassVerifier::name_in_supers(
|
||||
|
||||
void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs,
|
||||
StackMapFrame* current_frame,
|
||||
constantPoolHandle cp,
|
||||
const constantPoolHandle& cp,
|
||||
bool allow_arrays,
|
||||
TRAPS) {
|
||||
u2 index = bcs->get_index_u2();
|
||||
@ -2477,7 +2477,7 @@ bool ClassVerifier::ends_in_athrow(u4 start_bc_offset) {
|
||||
void ClassVerifier::verify_invoke_init(
|
||||
RawBytecodeStream* bcs, u2 ref_class_index, VerificationType ref_class_type,
|
||||
StackMapFrame* current_frame, u4 code_length, bool in_try_block,
|
||||
bool *this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table,
|
||||
bool *this_uninit, const constantPoolHandle& cp, StackMapTable* stackmap_table,
|
||||
TRAPS) {
|
||||
u2 bci = bcs->bci();
|
||||
VerificationType type = current_frame->pop_stack(
|
||||
@ -2613,7 +2613,7 @@ bool ClassVerifier::is_same_or_direct_interface(
|
||||
void ClassVerifier::verify_invoke_instructions(
|
||||
RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame,
|
||||
bool in_try_block, bool *this_uninit, VerificationType return_type,
|
||||
constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS) {
|
||||
const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS) {
|
||||
// Make sure the constant pool item is the right type
|
||||
u2 index = bcs->get_index_u2();
|
||||
Bytecodes::Code opcode = bcs->raw_code();
|
||||
@ -2878,7 +2878,7 @@ VerificationType ClassVerifier::get_newarray_type(
|
||||
}
|
||||
|
||||
void ClassVerifier::verify_anewarray(
|
||||
u2 bci, u2 index, constantPoolHandle cp,
|
||||
u2 bci, u2 index, const constantPoolHandle& cp,
|
||||
StackMapFrame* current_frame, TRAPS) {
|
||||
verify_cp_class_type(bci, index, cp, CHECK_VERIFY(this));
|
||||
current_frame->pop_stack(
|
||||
|
@ -262,14 +262,14 @@ class ClassVerifier : public StackObj {
|
||||
|
||||
ErrorContext _error_context; // contains information about an error
|
||||
|
||||
void verify_method(methodHandle method, TRAPS);
|
||||
void verify_method(const methodHandle& method, TRAPS);
|
||||
char* generate_code_data(methodHandle m, u4 code_length, TRAPS);
|
||||
void verify_exception_handler_table(u4 code_length, char* code_data,
|
||||
int& min, int& max, TRAPS);
|
||||
void verify_local_variable_table(u4 code_length, char* code_data, TRAPS);
|
||||
|
||||
VerificationType cp_ref_index_to_type(
|
||||
int index, constantPoolHandle cp, TRAPS) {
|
||||
int index, const constantPoolHandle& cp, TRAPS) {
|
||||
return cp_index_to_type(cp->klass_ref_index_at(index), cp, THREAD);
|
||||
}
|
||||
|
||||
@ -277,10 +277,10 @@ class ClassVerifier : public StackObj {
|
||||
instanceKlassHandle this_class, Klass* target_class,
|
||||
Symbol* field_name, Symbol* field_sig, bool is_method);
|
||||
|
||||
void verify_cp_index(u2 bci, constantPoolHandle cp, int index, TRAPS);
|
||||
void verify_cp_type(u2 bci, int index, constantPoolHandle cp,
|
||||
void verify_cp_index(u2 bci, const constantPoolHandle& cp, int index, TRAPS);
|
||||
void verify_cp_type(u2 bci, int index, const constantPoolHandle& cp,
|
||||
unsigned int types, TRAPS);
|
||||
void verify_cp_class_type(u2 bci, int index, constantPoolHandle cp, TRAPS);
|
||||
void verify_cp_class_type(u2 bci, int index, const constantPoolHandle& cp, TRAPS);
|
||||
|
||||
u2 verify_stackmap_table(
|
||||
u2 stackmap_index, u2 bci, StackMapFrame* current_frame,
|
||||
@ -292,7 +292,7 @@ class ClassVerifier : public StackObj {
|
||||
|
||||
void verify_ldc(
|
||||
int opcode, u2 index, StackMapFrame *current_frame,
|
||||
constantPoolHandle cp, u2 bci, TRAPS);
|
||||
const constantPoolHandle& cp, u2 bci, TRAPS);
|
||||
|
||||
void verify_switch(
|
||||
RawBytecodeStream* bcs, u4 code_length, char* code_data,
|
||||
@ -300,12 +300,12 @@ class ClassVerifier : public StackObj {
|
||||
|
||||
void verify_field_instructions(
|
||||
RawBytecodeStream* bcs, StackMapFrame* current_frame,
|
||||
constantPoolHandle cp, bool allow_arrays, TRAPS);
|
||||
const constantPoolHandle& cp, bool allow_arrays, TRAPS);
|
||||
|
||||
void verify_invoke_init(
|
||||
RawBytecodeStream* bcs, u2 ref_index, VerificationType ref_class_type,
|
||||
StackMapFrame* current_frame, u4 code_length, bool in_try_block,
|
||||
bool* this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table,
|
||||
bool* this_uninit, const constantPoolHandle& cp, StackMapTable* stackmap_table,
|
||||
TRAPS);
|
||||
|
||||
// Used by ends_in_athrow() to push all handlers that contain bci onto the
|
||||
@ -322,10 +322,10 @@ class ClassVerifier : public StackObj {
|
||||
void verify_invoke_instructions(
|
||||
RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame,
|
||||
bool in_try_block, bool* this_uninit, VerificationType return_type,
|
||||
constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS);
|
||||
const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS);
|
||||
|
||||
VerificationType get_newarray_type(u2 index, u2 bci, TRAPS);
|
||||
void verify_anewarray(u2 bci, u2 index, constantPoolHandle cp,
|
||||
void verify_anewarray(u2 bci, u2 index, const constantPoolHandle& cp,
|
||||
StackMapFrame* current_frame, TRAPS);
|
||||
void verify_return_value(
|
||||
VerificationType return_type, VerificationType type, u2 offset,
|
||||
@ -406,7 +406,7 @@ class ClassVerifier : public StackObj {
|
||||
int change_sig_to_verificationType(
|
||||
SignatureStream* sig_type, VerificationType* inference_type, TRAPS);
|
||||
|
||||
VerificationType cp_index_to_type(int index, constantPoolHandle cp, TRAPS) {
|
||||
VerificationType cp_index_to_type(int index, const constantPoolHandle& cp, TRAPS) {
|
||||
return VerificationType::reference_type(cp->klass_name_at(index));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -417,7 +417,7 @@ int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) {
|
||||
}
|
||||
}
|
||||
|
||||
bool vmIntrinsics::is_disabled_by_flags(methodHandle method, methodHandle compilation_context) {
|
||||
bool vmIntrinsics::is_disabled_by_flags(const methodHandle& method, const methodHandle& compilation_context) {
|
||||
vmIntrinsics::ID id = method->intrinsic_id();
|
||||
assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
|
||||
|
||||
|
@ -938,24 +938,25 @@
|
||||
do_intrinsic(_updateByteBufferAdler32, java_util_zip_Adler32, updateByteBuffer_A_name, updateByteBuffer_signature, F_SN) \
|
||||
do_name( updateByteBuffer_A_name, "updateByteBuffer") \
|
||||
\
|
||||
/* support for sun.misc.Unsafe */ \
|
||||
do_class(sun_misc_Unsafe, "sun/misc/Unsafe") \
|
||||
/* support for Unsafe */ \
|
||||
do_class(sun_misc_Unsafe, "sun/misc/Unsafe") \
|
||||
do_class(jdk_internal_misc_Unsafe, "jdk/internal/misc/Unsafe") \
|
||||
\
|
||||
do_intrinsic(_allocateInstance, sun_misc_Unsafe, allocateInstance_name, allocateInstance_signature, F_RN) \
|
||||
do_name( allocateInstance_name, "allocateInstance") \
|
||||
do_signature(allocateInstance_signature, "(Ljava/lang/Class;)Ljava/lang/Object;") \
|
||||
do_intrinsic(_copyMemory, sun_misc_Unsafe, copyMemory_name, copyMemory_signature, F_RN) \
|
||||
do_name( copyMemory_name, "copyMemory") \
|
||||
do_signature(copyMemory_signature, "(Ljava/lang/Object;JLjava/lang/Object;JJ)V") \
|
||||
do_intrinsic(_loadFence, sun_misc_Unsafe, loadFence_name, loadFence_signature, F_RN) \
|
||||
do_name( loadFence_name, "loadFence") \
|
||||
do_alias( loadFence_signature, void_method_signature) \
|
||||
do_intrinsic(_storeFence, sun_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \
|
||||
do_name( storeFence_name, "storeFence") \
|
||||
do_alias( storeFence_signature, void_method_signature) \
|
||||
do_intrinsic(_fullFence, sun_misc_Unsafe, fullFence_name, fullFence_signature, F_RN) \
|
||||
do_name( fullFence_name, "fullFence") \
|
||||
do_alias( fullFence_signature, void_method_signature) \
|
||||
do_intrinsic(_allocateInstance, jdk_internal_misc_Unsafe, allocateInstance_name, allocateInstance_signature, F_RN) \
|
||||
do_name( allocateInstance_name, "allocateInstance") \
|
||||
do_signature(allocateInstance_signature, "(Ljava/lang/Class;)Ljava/lang/Object;") \
|
||||
do_intrinsic(_copyMemory, jdk_internal_misc_Unsafe, copyMemory_name, copyMemory_signature, F_RN) \
|
||||
do_name( copyMemory_name, "copyMemory") \
|
||||
do_signature(copyMemory_signature, "(Ljava/lang/Object;JLjava/lang/Object;JJ)V") \
|
||||
do_intrinsic(_loadFence, jdk_internal_misc_Unsafe, loadFence_name, loadFence_signature, F_RN) \
|
||||
do_name( loadFence_name, "loadFence") \
|
||||
do_alias( loadFence_signature, void_method_signature) \
|
||||
do_intrinsic(_storeFence, jdk_internal_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \
|
||||
do_name( storeFence_name, "storeFence") \
|
||||
do_alias( storeFence_signature, void_method_signature) \
|
||||
do_intrinsic(_fullFence, jdk_internal_misc_Unsafe, fullFence_name, fullFence_signature, F_RN) \
|
||||
do_name( fullFence_name, "fullFence") \
|
||||
do_alias( fullFence_signature, void_method_signature) \
|
||||
\
|
||||
/* Custom branch frequencies profiling support for JSR292 */ \
|
||||
do_class(java_lang_invoke_MethodHandleImpl, "java/lang/invoke/MethodHandleImpl") \
|
||||
@ -996,24 +997,24 @@
|
||||
do_name(getFloat_name,"getFloat") do_name(putFloat_name,"putFloat") \
|
||||
do_name(getDouble_name,"getDouble") do_name(putDouble_name,"putDouble") \
|
||||
\
|
||||
do_intrinsic(_getObject, sun_misc_Unsafe, getObject_name, getObject_signature, F_RN) \
|
||||
do_intrinsic(_getBoolean, sun_misc_Unsafe, getBoolean_name, getBoolean_signature, F_RN) \
|
||||
do_intrinsic(_getByte, sun_misc_Unsafe, getByte_name, getByte_signature, F_RN) \
|
||||
do_intrinsic(_getShort, sun_misc_Unsafe, getShort_name, getShort_signature, F_RN) \
|
||||
do_intrinsic(_getChar, sun_misc_Unsafe, getChar_name, getChar_signature, F_RN) \
|
||||
do_intrinsic(_getInt, sun_misc_Unsafe, getInt_name, getInt_signature, F_RN) \
|
||||
do_intrinsic(_getLong, sun_misc_Unsafe, getLong_name, getLong_signature, F_RN) \
|
||||
do_intrinsic(_getFloat, sun_misc_Unsafe, getFloat_name, getFloat_signature, F_RN) \
|
||||
do_intrinsic(_getDouble, sun_misc_Unsafe, getDouble_name, getDouble_signature, F_RN) \
|
||||
do_intrinsic(_putObject, sun_misc_Unsafe, putObject_name, putObject_signature, F_RN) \
|
||||
do_intrinsic(_putBoolean, sun_misc_Unsafe, putBoolean_name, putBoolean_signature, F_RN) \
|
||||
do_intrinsic(_putByte, sun_misc_Unsafe, putByte_name, putByte_signature, F_RN) \
|
||||
do_intrinsic(_putShort, sun_misc_Unsafe, putShort_name, putShort_signature, F_RN) \
|
||||
do_intrinsic(_putChar, sun_misc_Unsafe, putChar_name, putChar_signature, F_RN) \
|
||||
do_intrinsic(_putInt, sun_misc_Unsafe, putInt_name, putInt_signature, F_RN) \
|
||||
do_intrinsic(_putLong, sun_misc_Unsafe, putLong_name, putLong_signature, F_RN) \
|
||||
do_intrinsic(_putFloat, sun_misc_Unsafe, putFloat_name, putFloat_signature, F_RN) \
|
||||
do_intrinsic(_putDouble, sun_misc_Unsafe, putDouble_name, putDouble_signature, F_RN) \
|
||||
do_intrinsic(_getObject, jdk_internal_misc_Unsafe, getObject_name, getObject_signature, F_RN) \
|
||||
do_intrinsic(_getBoolean, jdk_internal_misc_Unsafe, getBoolean_name, getBoolean_signature, F_RN) \
|
||||
do_intrinsic(_getByte, jdk_internal_misc_Unsafe, getByte_name, getByte_signature, F_RN) \
|
||||
do_intrinsic(_getShort, jdk_internal_misc_Unsafe, getShort_name, getShort_signature, F_RN) \
|
||||
do_intrinsic(_getChar, jdk_internal_misc_Unsafe, getChar_name, getChar_signature, F_RN) \
|
||||
do_intrinsic(_getInt, jdk_internal_misc_Unsafe, getInt_name, getInt_signature, F_RN) \
|
||||
do_intrinsic(_getLong, jdk_internal_misc_Unsafe, getLong_name, getLong_signature, F_RN) \
|
||||
do_intrinsic(_getFloat, jdk_internal_misc_Unsafe, getFloat_name, getFloat_signature, F_RN) \
|
||||
do_intrinsic(_getDouble, jdk_internal_misc_Unsafe, getDouble_name, getDouble_signature, F_RN) \
|
||||
do_intrinsic(_putObject, jdk_internal_misc_Unsafe, putObject_name, putObject_signature, F_RN) \
|
||||
do_intrinsic(_putBoolean, jdk_internal_misc_Unsafe, putBoolean_name, putBoolean_signature, F_RN) \
|
||||
do_intrinsic(_putByte, jdk_internal_misc_Unsafe, putByte_name, putByte_signature, F_RN) \
|
||||
do_intrinsic(_putShort, jdk_internal_misc_Unsafe, putShort_name, putShort_signature, F_RN) \
|
||||
do_intrinsic(_putChar, jdk_internal_misc_Unsafe, putChar_name, putChar_signature, F_RN) \
|
||||
do_intrinsic(_putInt, jdk_internal_misc_Unsafe, putInt_name, putInt_signature, F_RN) \
|
||||
do_intrinsic(_putLong, jdk_internal_misc_Unsafe, putLong_name, putLong_signature, F_RN) \
|
||||
do_intrinsic(_putFloat, jdk_internal_misc_Unsafe, putFloat_name, putFloat_signature, F_RN) \
|
||||
do_intrinsic(_putDouble, jdk_internal_misc_Unsafe, putDouble_name, putDouble_signature, F_RN) \
|
||||
\
|
||||
do_name(getObjectVolatile_name,"getObjectVolatile") do_name(putObjectVolatile_name,"putObjectVolatile") \
|
||||
do_name(getBooleanVolatile_name,"getBooleanVolatile") do_name(putBooleanVolatile_name,"putBooleanVolatile") \
|
||||
@ -1025,38 +1026,38 @@
|
||||
do_name(getFloatVolatile_name,"getFloatVolatile") do_name(putFloatVolatile_name,"putFloatVolatile") \
|
||||
do_name(getDoubleVolatile_name,"getDoubleVolatile") do_name(putDoubleVolatile_name,"putDoubleVolatile") \
|
||||
\
|
||||
do_intrinsic(_getObjectVolatile, sun_misc_Unsafe, getObjectVolatile_name, getObject_signature, F_RN) \
|
||||
do_intrinsic(_getBooleanVolatile, sun_misc_Unsafe, getBooleanVolatile_name, getBoolean_signature, F_RN) \
|
||||
do_intrinsic(_getByteVolatile, sun_misc_Unsafe, getByteVolatile_name, getByte_signature, F_RN) \
|
||||
do_intrinsic(_getShortVolatile, sun_misc_Unsafe, getShortVolatile_name, getShort_signature, F_RN) \
|
||||
do_intrinsic(_getCharVolatile, sun_misc_Unsafe, getCharVolatile_name, getChar_signature, F_RN) \
|
||||
do_intrinsic(_getIntVolatile, sun_misc_Unsafe, getIntVolatile_name, getInt_signature, F_RN) \
|
||||
do_intrinsic(_getLongVolatile, sun_misc_Unsafe, getLongVolatile_name, getLong_signature, F_RN) \
|
||||
do_intrinsic(_getFloatVolatile, sun_misc_Unsafe, getFloatVolatile_name, getFloat_signature, F_RN) \
|
||||
do_intrinsic(_getDoubleVolatile, sun_misc_Unsafe, getDoubleVolatile_name, getDouble_signature, F_RN) \
|
||||
do_intrinsic(_putObjectVolatile, sun_misc_Unsafe, putObjectVolatile_name, putObject_signature, F_RN) \
|
||||
do_intrinsic(_putBooleanVolatile, sun_misc_Unsafe, putBooleanVolatile_name, putBoolean_signature, F_RN) \
|
||||
do_intrinsic(_putByteVolatile, sun_misc_Unsafe, putByteVolatile_name, putByte_signature, F_RN) \
|
||||
do_intrinsic(_putShortVolatile, sun_misc_Unsafe, putShortVolatile_name, putShort_signature, F_RN) \
|
||||
do_intrinsic(_putCharVolatile, sun_misc_Unsafe, putCharVolatile_name, putChar_signature, F_RN) \
|
||||
do_intrinsic(_putIntVolatile, sun_misc_Unsafe, putIntVolatile_name, putInt_signature, F_RN) \
|
||||
do_intrinsic(_putLongVolatile, sun_misc_Unsafe, putLongVolatile_name, putLong_signature, F_RN) \
|
||||
do_intrinsic(_putFloatVolatile, sun_misc_Unsafe, putFloatVolatile_name, putFloat_signature, F_RN) \
|
||||
do_intrinsic(_putDoubleVolatile, sun_misc_Unsafe, putDoubleVolatile_name, putDouble_signature, F_RN) \
|
||||
do_intrinsic(_getObjectVolatile, jdk_internal_misc_Unsafe, getObjectVolatile_name, getObject_signature, F_RN) \
|
||||
do_intrinsic(_getBooleanVolatile, jdk_internal_misc_Unsafe, getBooleanVolatile_name, getBoolean_signature, F_RN) \
|
||||
do_intrinsic(_getByteVolatile, jdk_internal_misc_Unsafe, getByteVolatile_name, getByte_signature, F_RN) \
|
||||
do_intrinsic(_getShortVolatile, jdk_internal_misc_Unsafe, getShortVolatile_name, getShort_signature, F_RN) \
|
||||
do_intrinsic(_getCharVolatile, jdk_internal_misc_Unsafe, getCharVolatile_name, getChar_signature, F_RN) \
|
||||
do_intrinsic(_getIntVolatile, jdk_internal_misc_Unsafe, getIntVolatile_name, getInt_signature, F_RN) \
|
||||
do_intrinsic(_getLongVolatile, jdk_internal_misc_Unsafe, getLongVolatile_name, getLong_signature, F_RN) \
|
||||
do_intrinsic(_getFloatVolatile, jdk_internal_misc_Unsafe, getFloatVolatile_name, getFloat_signature, F_RN) \
|
||||
do_intrinsic(_getDoubleVolatile, jdk_internal_misc_Unsafe, getDoubleVolatile_name, getDouble_signature, F_RN) \
|
||||
do_intrinsic(_putObjectVolatile, jdk_internal_misc_Unsafe, putObjectVolatile_name, putObject_signature, F_RN) \
|
||||
do_intrinsic(_putBooleanVolatile, jdk_internal_misc_Unsafe, putBooleanVolatile_name, putBoolean_signature, F_RN) \
|
||||
do_intrinsic(_putByteVolatile, jdk_internal_misc_Unsafe, putByteVolatile_name, putByte_signature, F_RN) \
|
||||
do_intrinsic(_putShortVolatile, jdk_internal_misc_Unsafe, putShortVolatile_name, putShort_signature, F_RN) \
|
||||
do_intrinsic(_putCharVolatile, jdk_internal_misc_Unsafe, putCharVolatile_name, putChar_signature, F_RN) \
|
||||
do_intrinsic(_putIntVolatile, jdk_internal_misc_Unsafe, putIntVolatile_name, putInt_signature, F_RN) \
|
||||
do_intrinsic(_putLongVolatile, jdk_internal_misc_Unsafe, putLongVolatile_name, putLong_signature, F_RN) \
|
||||
do_intrinsic(_putFloatVolatile, jdk_internal_misc_Unsafe, putFloatVolatile_name, putFloat_signature, F_RN) \
|
||||
do_intrinsic(_putDoubleVolatile, jdk_internal_misc_Unsafe, putDoubleVolatile_name, putDouble_signature, F_RN) \
|
||||
\
|
||||
do_name(getShortUnaligned_name,"getShortUnaligned") do_name(putShortUnaligned_name,"putShortUnaligned") \
|
||||
do_name(getCharUnaligned_name,"getCharUnaligned") do_name(putCharUnaligned_name,"putCharUnaligned") \
|
||||
do_name(getIntUnaligned_name,"getIntUnaligned") do_name(putIntUnaligned_name,"putIntUnaligned") \
|
||||
do_name(getLongUnaligned_name,"getLongUnaligned") do_name(putLongUnaligned_name,"putLongUnaligned") \
|
||||
\
|
||||
do_intrinsic(_getShortUnaligned, sun_misc_Unsafe, getShortUnaligned_name, getShort_signature, F_R) \
|
||||
do_intrinsic(_getCharUnaligned, sun_misc_Unsafe, getCharUnaligned_name, getChar_signature, F_R) \
|
||||
do_intrinsic(_getIntUnaligned, sun_misc_Unsafe, getIntUnaligned_name, getInt_signature, F_R) \
|
||||
do_intrinsic(_getLongUnaligned, sun_misc_Unsafe, getLongUnaligned_name, getLong_signature, F_R) \
|
||||
do_intrinsic(_putShortUnaligned, sun_misc_Unsafe, putShortUnaligned_name, putShort_signature, F_R) \
|
||||
do_intrinsic(_putCharUnaligned, sun_misc_Unsafe, putCharUnaligned_name, putChar_signature, F_R) \
|
||||
do_intrinsic(_putIntUnaligned, sun_misc_Unsafe, putIntUnaligned_name, putInt_signature, F_R) \
|
||||
do_intrinsic(_putLongUnaligned, sun_misc_Unsafe, putLongUnaligned_name, putLong_signature, F_R) \
|
||||
do_intrinsic(_getShortUnaligned, jdk_internal_misc_Unsafe, getShortUnaligned_name, getShort_signature, F_R) \
|
||||
do_intrinsic(_getCharUnaligned, jdk_internal_misc_Unsafe, getCharUnaligned_name, getChar_signature, F_R) \
|
||||
do_intrinsic(_getIntUnaligned, jdk_internal_misc_Unsafe, getIntUnaligned_name, getInt_signature, F_R) \
|
||||
do_intrinsic(_getLongUnaligned, jdk_internal_misc_Unsafe, getLongUnaligned_name, getLong_signature, F_R) \
|
||||
do_intrinsic(_putShortUnaligned, jdk_internal_misc_Unsafe, putShortUnaligned_name, putShort_signature, F_R) \
|
||||
do_intrinsic(_putCharUnaligned, jdk_internal_misc_Unsafe, putCharUnaligned_name, putChar_signature, F_R) \
|
||||
do_intrinsic(_putIntUnaligned, jdk_internal_misc_Unsafe, putIntUnaligned_name, putInt_signature, F_R) \
|
||||
do_intrinsic(_putLongUnaligned, jdk_internal_misc_Unsafe, putLongUnaligned_name, putLong_signature, F_R) \
|
||||
\
|
||||
/* %%% these are redundant except perhaps for getAddress, but Unsafe has native methods for them */ \
|
||||
do_signature(getByte_raw_signature, "(J)B") \
|
||||
@ -1078,66 +1079,67 @@
|
||||
do_name( getAddress_name, "getAddress") \
|
||||
do_name( putAddress_name, "putAddress") \
|
||||
\
|
||||
do_intrinsic(_getByte_raw, sun_misc_Unsafe, getByte_name, getByte_raw_signature, F_RN) \
|
||||
do_intrinsic(_getShort_raw, sun_misc_Unsafe, getShort_name, getShort_raw_signature, F_RN) \
|
||||
do_intrinsic(_getChar_raw, sun_misc_Unsafe, getChar_name, getChar_raw_signature, F_RN) \
|
||||
do_intrinsic(_getInt_raw, sun_misc_Unsafe, getInt_name, long_int_signature, F_RN) \
|
||||
do_intrinsic(_getLong_raw, sun_misc_Unsafe, getLong_name, getLong_raw_signature, F_RN) \
|
||||
do_intrinsic(_getFloat_raw, sun_misc_Unsafe, getFloat_name, getFloat_raw_signature, F_RN) \
|
||||
do_intrinsic(_getDouble_raw, sun_misc_Unsafe, getDouble_name, getDouble_raw_signature, F_RN) \
|
||||
do_intrinsic(_getAddress_raw, sun_misc_Unsafe, getAddress_name, getAddress_raw_signature, F_RN) \
|
||||
do_intrinsic(_putByte_raw, sun_misc_Unsafe, putByte_name, putByte_raw_signature, F_RN) \
|
||||
do_intrinsic(_putShort_raw, sun_misc_Unsafe, putShort_name, putShort_raw_signature, F_RN) \
|
||||
do_intrinsic(_putChar_raw, sun_misc_Unsafe, putChar_name, putChar_raw_signature, F_RN) \
|
||||
do_intrinsic(_putInt_raw, sun_misc_Unsafe, putInt_name, putInt_raw_signature, F_RN) \
|
||||
do_intrinsic(_putLong_raw, sun_misc_Unsafe, putLong_name, putLong_raw_signature, F_RN) \
|
||||
do_intrinsic(_putFloat_raw, sun_misc_Unsafe, putFloat_name, putFloat_raw_signature, F_RN) \
|
||||
do_intrinsic(_putDouble_raw, sun_misc_Unsafe, putDouble_name, putDouble_raw_signature, F_RN) \
|
||||
do_intrinsic(_putAddress_raw, sun_misc_Unsafe, putAddress_name, putAddress_raw_signature, F_RN) \
|
||||
do_intrinsic(_getByte_raw, jdk_internal_misc_Unsafe, getByte_name, getByte_raw_signature, F_R) \
|
||||
do_intrinsic(_getShort_raw, jdk_internal_misc_Unsafe, getShort_name, getShort_raw_signature, F_R) \
|
||||
do_intrinsic(_getChar_raw, jdk_internal_misc_Unsafe, getChar_name, getChar_raw_signature, F_R) \
|
||||
do_intrinsic(_getInt_raw, jdk_internal_misc_Unsafe, getInt_name, long_int_signature, F_R) \
|
||||
do_intrinsic(_getLong_raw, jdk_internal_misc_Unsafe, getLong_name, getLong_raw_signature, F_R) \
|
||||
do_intrinsic(_getFloat_raw, jdk_internal_misc_Unsafe, getFloat_name, getFloat_raw_signature, F_R) \
|
||||
do_intrinsic(_getDouble_raw, jdk_internal_misc_Unsafe, getDouble_name, getDouble_raw_signature, F_R) \
|
||||
do_intrinsic(_getAddress_raw, jdk_internal_misc_Unsafe, getAddress_name, getAddress_raw_signature, F_R) \
|
||||
do_intrinsic(_putByte_raw, jdk_internal_misc_Unsafe, putByte_name, putByte_raw_signature, F_R) \
|
||||
do_intrinsic(_putShort_raw, jdk_internal_misc_Unsafe, putShort_name, putShort_raw_signature, F_R) \
|
||||
do_intrinsic(_putChar_raw, jdk_internal_misc_Unsafe, putChar_name, putChar_raw_signature, F_R) \
|
||||
do_intrinsic(_putInt_raw, jdk_internal_misc_Unsafe, putInt_name, putInt_raw_signature, F_R) \
|
||||
do_intrinsic(_putLong_raw, jdk_internal_misc_Unsafe, putLong_name, putLong_raw_signature, F_R) \
|
||||
do_intrinsic(_putFloat_raw, jdk_internal_misc_Unsafe, putFloat_name, putFloat_raw_signature, F_R) \
|
||||
do_intrinsic(_putDouble_raw, jdk_internal_misc_Unsafe, putDouble_name, putDouble_raw_signature, F_R) \
|
||||
do_intrinsic(_putAddress_raw, jdk_internal_misc_Unsafe, putAddress_name, putAddress_raw_signature, F_R) \
|
||||
\
|
||||
do_intrinsic(_compareAndSwapObject, sun_misc_Unsafe, compareAndSwapObject_name, compareAndSwapObject_signature, F_RN) \
|
||||
do_name( compareAndSwapObject_name, "compareAndSwapObject") \
|
||||
do_signature(compareAndSwapObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
|
||||
do_intrinsic(_compareAndSwapLong, sun_misc_Unsafe, compareAndSwapLong_name, compareAndSwapLong_signature, F_RN) \
|
||||
do_name( compareAndSwapLong_name, "compareAndSwapLong") \
|
||||
do_signature(compareAndSwapLong_signature, "(Ljava/lang/Object;JJJ)Z") \
|
||||
do_intrinsic(_compareAndSwapInt, sun_misc_Unsafe, compareAndSwapInt_name, compareAndSwapInt_signature, F_RN) \
|
||||
do_name( compareAndSwapInt_name, "compareAndSwapInt") \
|
||||
do_signature(compareAndSwapInt_signature, "(Ljava/lang/Object;JII)Z") \
|
||||
do_intrinsic(_putOrderedObject, sun_misc_Unsafe, putOrderedObject_name, putOrderedObject_signature, F_RN) \
|
||||
do_name( putOrderedObject_name, "putOrderedObject") \
|
||||
do_alias( putOrderedObject_signature, /*(LObject;JLObject;)V*/ putObject_signature) \
|
||||
do_intrinsic(_putOrderedLong, sun_misc_Unsafe, putOrderedLong_name, putOrderedLong_signature, F_RN) \
|
||||
do_name( putOrderedLong_name, "putOrderedLong") \
|
||||
do_alias( putOrderedLong_signature, /*(Ljava/lang/Object;JJ)V*/ putLong_signature) \
|
||||
do_intrinsic(_putOrderedInt, sun_misc_Unsafe, putOrderedInt_name, putOrderedInt_signature, F_RN) \
|
||||
do_name( putOrderedInt_name, "putOrderedInt") \
|
||||
do_alias( putOrderedInt_signature, /*(Ljava/lang/Object;JI)V*/ putInt_signature) \
|
||||
do_intrinsic(_compareAndSwapObject, jdk_internal_misc_Unsafe, compareAndSwapObject_name, compareAndSwapObject_signature, F_R) \
|
||||
do_name( compareAndSwapObject_name, "compareAndSwapObject") \
|
||||
do_signature(compareAndSwapObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \
|
||||
do_intrinsic(_compareAndSwapLong, jdk_internal_misc_Unsafe, compareAndSwapLong_name, compareAndSwapLong_signature, F_R) \
|
||||
do_name( compareAndSwapLong_name, "compareAndSwapLong") \
|
||||
do_signature(compareAndSwapLong_signature, "(Ljava/lang/Object;JJJ)Z") \
|
||||
do_intrinsic(_compareAndSwapInt, jdk_internal_misc_Unsafe, compareAndSwapInt_name, compareAndSwapInt_signature, F_R) \
|
||||
do_name( compareAndSwapInt_name, "compareAndSwapInt") \
|
||||
do_signature(compareAndSwapInt_signature, "(Ljava/lang/Object;JII)Z") \
|
||||
do_intrinsic(_putOrderedObject, jdk_internal_misc_Unsafe, putOrderedObject_name, putOrderedObject_signature, F_R) \
|
||||
do_name( putOrderedObject_name, "putOrderedObject") \
|
||||
do_alias( putOrderedObject_signature, /*(LObject;JLObject;)V*/ putObject_signature) \
|
||||
do_intrinsic(_putOrderedLong, jdk_internal_misc_Unsafe, putOrderedLong_name, putOrderedLong_signature, F_R) \
|
||||
do_name( putOrderedLong_name, "putOrderedLong") \
|
||||
do_alias( putOrderedLong_signature, /*(Ljava/lang/Object;JJ)V*/ putLong_signature) \
|
||||
do_intrinsic(_putOrderedInt, jdk_internal_misc_Unsafe, putOrderedInt_name, putOrderedInt_signature, F_R) \
|
||||
do_name( putOrderedInt_name, "putOrderedInt") \
|
||||
do_alias( putOrderedInt_signature, /*(Ljava/lang/Object;JI)V*/ putInt_signature) \
|
||||
\
|
||||
do_intrinsic(_getAndAddInt, sun_misc_Unsafe, getAndAddInt_name, getAndAddInt_signature, F_R) \
|
||||
do_name( getAndAddInt_name, "getAndAddInt") \
|
||||
do_signature(getAndAddInt_signature, "(Ljava/lang/Object;JI)I" ) \
|
||||
do_intrinsic(_getAndAddLong, sun_misc_Unsafe, getAndAddLong_name, getAndAddLong_signature, F_R) \
|
||||
do_name( getAndAddLong_name, "getAndAddLong") \
|
||||
do_signature(getAndAddLong_signature, "(Ljava/lang/Object;JJ)J" ) \
|
||||
do_intrinsic(_getAndSetInt, sun_misc_Unsafe, getAndSetInt_name, getAndSetInt_signature, F_R) \
|
||||
do_name( getAndSetInt_name, "getAndSetInt") \
|
||||
do_alias( getAndSetInt_signature, /*"(Ljava/lang/Object;JI)I"*/ getAndAddInt_signature) \
|
||||
do_intrinsic(_getAndSetLong, sun_misc_Unsafe, getAndSetLong_name, getAndSetLong_signature, F_R) \
|
||||
do_name( getAndSetLong_name, "getAndSetLong") \
|
||||
do_alias( getAndSetLong_signature, /*"(Ljava/lang/Object;JJ)J"*/ getAndAddLong_signature) \
|
||||
do_intrinsic(_getAndSetObject, sun_misc_Unsafe, getAndSetObject_name, getAndSetObject_signature, F_R)\
|
||||
do_name( getAndSetObject_name, "getAndSetObject") \
|
||||
do_signature(getAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \
|
||||
\
|
||||
/* (2) Bytecode intrinsics */ \
|
||||
\
|
||||
do_intrinsic(_park, sun_misc_Unsafe, park_name, park_signature, F_RN) \
|
||||
do_name( park_name, "park") \
|
||||
do_signature(park_signature, "(ZJ)V") \
|
||||
do_intrinsic(_unpark, sun_misc_Unsafe, unpark_name, unpark_signature, F_RN) \
|
||||
do_name( unpark_name, "unpark") \
|
||||
do_alias( unpark_signature, /*(LObject;)V*/ object_void_signature) \
|
||||
do_intrinsic(_getAndAddInt, jdk_internal_misc_Unsafe, getAndAddInt_name, getAndAddInt_signature, F_R) \
|
||||
do_name( getAndAddInt_name, "getAndAddInt") \
|
||||
do_signature(getAndAddInt_signature, "(Ljava/lang/Object;JI)I" ) \
|
||||
do_intrinsic(_getAndAddLong, jdk_internal_misc_Unsafe, getAndAddLong_name, getAndAddLong_signature, F_R) \
|
||||
do_name( getAndAddLong_name, "getAndAddLong") \
|
||||
do_signature(getAndAddLong_signature, "(Ljava/lang/Object;JJ)J" ) \
|
||||
do_intrinsic(_getAndSetInt, jdk_internal_misc_Unsafe, getAndSetInt_name, getAndSetInt_signature, F_R) \
|
||||
do_name( getAndSetInt_name, "getAndSetInt") \
|
||||
do_alias( getAndSetInt_signature, /*"(Ljava/lang/Object;JI)I"*/ getAndAddInt_signature) \
|
||||
do_intrinsic(_getAndSetLong, jdk_internal_misc_Unsafe, getAndSetLong_name, getAndSetLong_signature, F_R) \
|
||||
do_name( getAndSetLong_name, "getAndSetLong") \
|
||||
do_alias( getAndSetLong_signature, /*"(Ljava/lang/Object;JJ)J"*/ getAndAddLong_signature) \
|
||||
do_intrinsic(_getAndSetObject, jdk_internal_misc_Unsafe, getAndSetObject_name, getAndSetObject_signature, F_R)\
|
||||
do_name( getAndSetObject_name, "getAndSetObject") \
|
||||
do_signature(getAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \
|
||||
\
|
||||
/* (2) Bytecode intrinsics */ \
|
||||
\
|
||||
do_intrinsic(_park, jdk_internal_misc_Unsafe, park_name, park_signature, F_R) \
|
||||
do_name( park_name, "park") \
|
||||
do_signature(park_signature, "(ZJ)V") \
|
||||
do_intrinsic(_unpark, jdk_internal_misc_Unsafe, unpark_name, unpark_signature, F_R) \
|
||||
do_name( unpark_name, "unpark") \
|
||||
do_alias( unpark_signature, /*(LObject;)V*/ object_void_signature) \
|
||||
\
|
||||
do_intrinsic(_StringBuilder_void, java_lang_StringBuilder, object_initializer_name, void_method_signature, F_R) \
|
||||
do_intrinsic(_StringBuilder_int, java_lang_StringBuilder, object_initializer_name, int_void_signature, F_R) \
|
||||
do_intrinsic(_StringBuilder_String, java_lang_StringBuilder, object_initializer_name, string_void_signature, F_R) \
|
||||
@ -1402,7 +1404,7 @@ public:
|
||||
|
||||
// Returns true if a compiler intrinsic is disabled by command-line flags
|
||||
// and false otherwise.
|
||||
static bool is_disabled_by_flags(methodHandle method, methodHandle compilation_context);
|
||||
static bool is_disabled_by_flags(const methodHandle& method, const methodHandle& compilation_context);
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -462,7 +462,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
// is_optimized: Compiler has generated an optimized call (i.e., no inline
|
||||
// cache) static_bound: The call can be static bound (i.e, no need to use
|
||||
// inline cache)
|
||||
void CompiledIC::compute_monomorphic_entry(methodHandle method,
|
||||
void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
|
||||
KlassHandle receiver_klass,
|
||||
bool is_optimized,
|
||||
bool static_bound,
|
||||
@ -594,7 +594,7 @@ void CompiledStaticCall::set(const StaticCallInfo& info) {
|
||||
|
||||
// Compute settings for a CompiledStaticCall. Since we might have to set
|
||||
// the stub when calling to the interpreter, we need to return arguments.
|
||||
void CompiledStaticCall::compute_entry(methodHandle m, StaticCallInfo& info) {
|
||||
void CompiledStaticCall::compute_entry(const methodHandle& m, StaticCallInfo& info) {
|
||||
nmethod* m_code = m->code();
|
||||
info._callee = m;
|
||||
if (m_code != NULL && m_code->is_in_use()) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, 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
|
||||
@ -222,7 +222,7 @@ class CompiledIC: public ResourceObj {
|
||||
// allocation in the code cache fails.
|
||||
bool set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS);
|
||||
|
||||
static void compute_monomorphic_entry(methodHandle method, KlassHandle receiver_klass,
|
||||
static void compute_monomorphic_entry(const methodHandle& method, KlassHandle receiver_klass,
|
||||
bool is_optimized, bool static_bound, CompiledICInfo& info, TRAPS);
|
||||
|
||||
// Location
|
||||
@ -324,7 +324,7 @@ class CompiledStaticCall: public NativeCall {
|
||||
void set(const StaticCallInfo& info);
|
||||
|
||||
// Compute entry point given a method
|
||||
static void compute_entry(methodHandle m, StaticCallInfo& info);
|
||||
static void compute_entry(const methodHandle& m, StaticCallInfo& info);
|
||||
|
||||
// Stub support
|
||||
address find_stub();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -324,7 +324,7 @@ int DebugInformationRecorder::find_sharable_decode_offset(int stream_offset) {
|
||||
// must call add_safepoint before: it sets PcDesc and this routine uses
|
||||
// the last PcDesc set
|
||||
void DebugInformationRecorder::describe_scope(int pc_offset,
|
||||
methodHandle methodH,
|
||||
const methodHandle& methodH,
|
||||
ciMethod* method,
|
||||
int bci,
|
||||
bool reexecute,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -98,7 +98,7 @@ class DebugInformationRecorder: public ResourceObj {
|
||||
// by add_non_safepoint, and the locals, expressions, and monitors
|
||||
// must all be null.
|
||||
void describe_scope(int pc_offset,
|
||||
methodHandle methodH,
|
||||
const methodHandle& methodH,
|
||||
ciMethod* method,
|
||||
int bci,
|
||||
bool reexecute,
|
||||
|
@ -151,7 +151,7 @@ void Dependencies::assert_has_no_finalizable_subclasses(Klass* ctxk) {
|
||||
}
|
||||
|
||||
void Dependencies::assert_leaf_type(Klass* ctxk) {
|
||||
if (ctxk->oop_is_array()) {
|
||||
if (ctxk->is_array_klass()) {
|
||||
// As a special case, support this assertion on an array type,
|
||||
// which reduces to an assertion on its element type.
|
||||
// Note that this cannot be done with assertions that
|
||||
@ -1084,10 +1084,10 @@ class ClassHierarchyWalker {
|
||||
return true; // Must punt the assertion to true.
|
||||
Klass* k = ctxk;
|
||||
Method* lm = k->lookup_method(m->name(), m->signature());
|
||||
if (lm == NULL && k->oop_is_instance()) {
|
||||
if (lm == NULL && k->is_instance_klass()) {
|
||||
// It might be an interface method
|
||||
lm = ((InstanceKlass*)k)->lookup_method_in_ordered_interfaces(m->name(),
|
||||
m->signature());
|
||||
lm = InstanceKlass::cast(k)->lookup_method_in_ordered_interfaces(m->name(),
|
||||
m->signature());
|
||||
}
|
||||
if (lm == m)
|
||||
// Method m is inherited into ctxk.
|
||||
@ -1135,7 +1135,7 @@ class ClassHierarchyWalker {
|
||||
bool is_witness(Klass* k) {
|
||||
if (doing_subtype_search()) {
|
||||
return Dependencies::is_concrete_klass(k);
|
||||
} else if (!k->oop_is_instance()) {
|
||||
} else if (!k->is_instance_klass()) {
|
||||
return false; // no methods to find in an array type
|
||||
} else {
|
||||
// Search class hierarchy first.
|
||||
@ -1840,20 +1840,20 @@ void DepChange::print() {
|
||||
Klass* k = str.klass();
|
||||
switch (str.change_type()) {
|
||||
case Change_new_type:
|
||||
tty->print_cr(" dependee = %s", InstanceKlass::cast(k)->external_name());
|
||||
tty->print_cr(" dependee = %s", k->external_name());
|
||||
break;
|
||||
case Change_new_sub:
|
||||
if (!WizardMode) {
|
||||
++nsup;
|
||||
} else {
|
||||
tty->print_cr(" context super = %s", InstanceKlass::cast(k)->external_name());
|
||||
tty->print_cr(" context super = %s", k->external_name());
|
||||
}
|
||||
break;
|
||||
case Change_new_impl:
|
||||
if (!WizardMode) {
|
||||
++nint;
|
||||
} else {
|
||||
tty->print_cr(" context interface = %s", InstanceKlass::cast(k)->external_name());
|
||||
tty->print_cr(" context interface = %s", k->external_name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1885,7 +1885,7 @@ bool DepChange::ContextStream::next() {
|
||||
case Change_new_sub:
|
||||
// 6598190: brackets workaround Sun Studio C++ compiler bug 6629277
|
||||
{
|
||||
_klass = InstanceKlass::cast(_klass)->super();
|
||||
_klass = _klass->super();
|
||||
if (_klass != NULL) {
|
||||
return true;
|
||||
}
|
||||
@ -1931,7 +1931,7 @@ KlassDepChange::~KlassDepChange() {
|
||||
}
|
||||
|
||||
bool KlassDepChange::involves_context(Klass* k) {
|
||||
if (k == NULL || !k->oop_is_instance()) {
|
||||
if (k == NULL || !k->is_instance_klass()) {
|
||||
return false;
|
||||
}
|
||||
InstanceKlass* ik = InstanceKlass::cast(k);
|
||||
|
@ -351,7 +351,7 @@ class Dependencies: public ResourceObj {
|
||||
#if INCLUDE_JVMCI
|
||||
private:
|
||||
static void check_ctxk(Klass* ctxk) {
|
||||
assert(ctxk->oop_is_instance(), "java types only");
|
||||
assert(ctxk->is_instance_klass(), "java types only");
|
||||
}
|
||||
static void check_ctxk_abstract(Klass* ctxk) {
|
||||
check_ctxk(ctxk);
|
||||
|
@ -558,7 +558,7 @@ void nmethod::init_defaults() {
|
||||
#endif
|
||||
}
|
||||
|
||||
nmethod* nmethod::new_native_nmethod(methodHandle method,
|
||||
nmethod* nmethod::new_native_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
CodeBuffer *code_buffer,
|
||||
int vep_offset,
|
||||
@ -596,7 +596,7 @@ nmethod* nmethod::new_native_nmethod(methodHandle method,
|
||||
return nm;
|
||||
}
|
||||
|
||||
nmethod* nmethod::new_nmethod(methodHandle method,
|
||||
nmethod* nmethod::new_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
int entry_bci,
|
||||
CodeOffsets* offsets,
|
||||
@ -1628,7 +1628,11 @@ void nmethod::flush_dependencies(BoolObjectClosure* is_alive) {
|
||||
// During GC the is_alive closure is non-NULL, and is used to
|
||||
// determine liveness of dependees that need to be updated.
|
||||
if (is_alive == NULL || klass->is_loader_alive(is_alive)) {
|
||||
InstanceKlass::cast(klass)->remove_dependent_nmethod(this);
|
||||
// The GC defers deletion of this entry, since there might be multiple threads
|
||||
// iterating over the _dependencies graph. Other call paths are single-threaded
|
||||
// and may delete it immediately.
|
||||
bool delete_immediately = is_alive == NULL;
|
||||
InstanceKlass::cast(klass)->remove_dependent_nmethod(this, delete_immediately);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3017,7 +3021,7 @@ void nmethod::print_dependencies() {
|
||||
deps.print_dependency();
|
||||
Klass* ctxk = deps.context_type();
|
||||
if (ctxk != NULL) {
|
||||
if (ctxk->oop_is_instance() && ((InstanceKlass*)ctxk)->is_dependent_nmethod(this)) {
|
||||
if (ctxk->is_instance_klass() && InstanceKlass::cast(ctxk)->is_dependent_nmethod(this)) {
|
||||
tty->print_cr(" [nmethod<=klass]%s", ctxk->external_name());
|
||||
}
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ class nmethod : public CodeBlob {
|
||||
|
||||
public:
|
||||
// create nmethod with entry_bci
|
||||
static nmethod* new_nmethod(methodHandle method,
|
||||
static nmethod* new_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
int entry_bci,
|
||||
CodeOffsets* offsets,
|
||||
@ -327,7 +327,7 @@ class nmethod : public CodeBlob {
|
||||
#endif
|
||||
);
|
||||
|
||||
static nmethod* new_native_nmethod(methodHandle method,
|
||||
static nmethod* new_native_nmethod(const methodHandle& method,
|
||||
int compile_id,
|
||||
CodeBuffer *code_buffer,
|
||||
int vep_offset,
|
||||
|
@ -110,7 +110,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// Missing feature tests
|
||||
virtual bool supports_native() { return true; }
|
||||
virtual bool supports_osr () { return true; }
|
||||
virtual bool can_compile_method(methodHandle method) { return true; }
|
||||
virtual bool can_compile_method(const methodHandle& method) { return true; }
|
||||
|
||||
// Determine if the current compiler provides an intrinsic
|
||||
// for method 'method'. An intrinsic is available if:
|
||||
@ -141,7 +141,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// disable intrinsics on a per-method basis. In cases (2) and (3) the
|
||||
// compilation context is aClass::aMethod and java.lang.ref.Reference::get,
|
||||
// respectively.
|
||||
virtual bool is_intrinsic_available(methodHandle method, methodHandle compilation_context) {
|
||||
virtual bool is_intrinsic_available(const methodHandle& method, const methodHandle& compilation_context) {
|
||||
return is_intrinsic_supported(method) &&
|
||||
!vmIntrinsics::is_disabled_by_flags(method, compilation_context);
|
||||
}
|
||||
@ -154,7 +154,7 @@ class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||
// by default no intrinsics are supported by a compiler except
|
||||
// the ones listed in the method. Overriding methods should conform
|
||||
// to this behavior.
|
||||
virtual bool is_intrinsic_supported(methodHandle method) {
|
||||
virtual bool is_intrinsic_supported(const methodHandle& method) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -777,10 +777,10 @@ void CompileBroker::mark_on_stack() {
|
||||
// CompileBroker::compile_method
|
||||
//
|
||||
// Request compilation of a method.
|
||||
void CompileBroker::compile_method_base(methodHandle method,
|
||||
void CompileBroker::compile_method_base(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
Thread* thread) {
|
||||
@ -790,7 +790,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
||||
}
|
||||
|
||||
guarantee(!method->is_abstract(), "cannot compile abstract methods");
|
||||
assert(method->method_holder()->oop_is_instance(),
|
||||
assert(method->method_holder()->is_instance_klass(),
|
||||
"sanity check");
|
||||
assert(!method->method_holder()->is_not_initialized(),
|
||||
"method holder must be initialized");
|
||||
@ -980,12 +980,12 @@ void CompileBroker::compile_method_base(methodHandle method,
|
||||
}
|
||||
|
||||
|
||||
nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
||||
nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method, int hot_count,
|
||||
const methodHandle& hot_method, int hot_count,
|
||||
const char* comment, Thread* THREAD) {
|
||||
// make sure arguments make sense
|
||||
assert(method->method_holder()->oop_is_instance(), "not an instance method");
|
||||
assert(method->method_holder()->is_instance_klass(), "not an instance method");
|
||||
assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
|
||||
assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
|
||||
assert(!method->method_holder()->is_not_initialized(), "method holder must be initialized");
|
||||
@ -1121,7 +1121,7 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
||||
// CompileBroker::compilation_is_complete
|
||||
//
|
||||
// See if compilation of this method is already complete.
|
||||
bool CompileBroker::compilation_is_complete(methodHandle method,
|
||||
bool CompileBroker::compilation_is_complete(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level) {
|
||||
bool is_osr = (osr_bci != standard_entry_bci);
|
||||
@ -1154,7 +1154,7 @@ bool CompileBroker::compilation_is_complete(methodHandle method,
|
||||
* versa). This can be remedied by a full queue search to disambiguate
|
||||
* cases. If it is deemed profitable, this may be done.
|
||||
*/
|
||||
bool CompileBroker::compilation_is_in_queue(methodHandle method) {
|
||||
bool CompileBroker::compilation_is_in_queue(const methodHandle& method) {
|
||||
return method->queued_for_compilation();
|
||||
}
|
||||
|
||||
@ -1162,7 +1162,7 @@ bool CompileBroker::compilation_is_in_queue(methodHandle method) {
|
||||
// CompileBroker::compilation_is_prohibited
|
||||
//
|
||||
// See if this compilation is not allowed.
|
||||
bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level) {
|
||||
bool CompileBroker::compilation_is_prohibited(const methodHandle& method, int osr_bci, int comp_level) {
|
||||
bool is_native = method->is_native();
|
||||
// Some compilers may not support the compilation of natives.
|
||||
AbstractCompiler *comp = compiler(comp_level);
|
||||
@ -1205,7 +1205,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
|
||||
* and the ID is not within the specified range, the method is not compiled and 0 is returned.
|
||||
* The function also allows to generate separate compilation IDs for OSR compilations.
|
||||
*/
|
||||
int CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
|
||||
int CompileBroker::assign_compile_id(const methodHandle& method, int osr_bci) {
|
||||
#ifdef ASSERT
|
||||
bool is_osr = (osr_bci != standard_entry_bci);
|
||||
int id;
|
||||
@ -1240,7 +1240,7 @@ int CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
|
||||
// CompileBroker::assign_compile_id_unlocked
|
||||
//
|
||||
// Public wrapper for assign_compile_id that acquires the needed locks
|
||||
uint CompileBroker::assign_compile_id_unlocked(Thread* thread, methodHandle method, int osr_bci) {
|
||||
uint CompileBroker::assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci) {
|
||||
MutexLocker locker(MethodCompileQueue_lock, thread);
|
||||
return assign_compile_id(method, osr_bci);
|
||||
}
|
||||
@ -1257,7 +1257,7 @@ bool CompileBroker::is_compile_blocking() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// CompileBroker::preload_classes
|
||||
void CompileBroker::preload_classes(methodHandle method, TRAPS) {
|
||||
void CompileBroker::preload_classes(const methodHandle& method, TRAPS) {
|
||||
// Move this code over from c1_Compiler.cpp
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
@ -1270,10 +1270,10 @@ void CompileBroker::preload_classes(methodHandle method, TRAPS) {
|
||||
// compilation. Add this task to the queue.
|
||||
CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
|
||||
int compile_id,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
bool blocking) {
|
||||
@ -1866,7 +1866,7 @@ void CompileBroker::handle_full_code_cache(int code_blob_type) {
|
||||
// CompileBroker::set_last_compile
|
||||
//
|
||||
// Record this compilation for debugging purposes.
|
||||
void CompileBroker::set_last_compile(CompilerThread* thread, methodHandle method, bool is_osr, int comp_level) {
|
||||
void CompileBroker::set_last_compile(CompilerThread* thread, const methodHandle& method, bool is_osr, int comp_level) {
|
||||
ResourceMark rm;
|
||||
char* method_name = method->name()->as_C_string();
|
||||
strncpy(_last_method_compiled, method_name, CompileBroker::name_buffer_length);
|
||||
@ -1952,7 +1952,7 @@ void CompileBroker::pop_jni_handle_block() {
|
||||
// CompileBroker::check_break_at
|
||||
//
|
||||
// Should the compilation break at the current compilation.
|
||||
bool CompileBroker::check_break_at(methodHandle method, int compile_id, bool is_osr) {
|
||||
bool CompileBroker::check_break_at(const methodHandle& method, int compile_id, bool is_osr) {
|
||||
if (CICountOSR && is_osr && (compile_id == CIBreakAtOSR)) {
|
||||
return true;
|
||||
} else if( CompilerOracle::should_break_at(method) ) { // break when compiling
|
||||
|
@ -144,7 +144,7 @@ class CompileBroker: AllStatic {
|
||||
|
||||
// Compile type Information for print_last_compile() and CompilerCounters
|
||||
enum { no_compile, normal_compile, osr_compile, native_compile };
|
||||
static int assign_compile_id (methodHandle method, int osr_bci);
|
||||
static int assign_compile_id (const methodHandle& method, int osr_bci);
|
||||
|
||||
|
||||
private:
|
||||
@ -217,17 +217,17 @@ class CompileBroker: AllStatic {
|
||||
|
||||
static JavaThread* make_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, AbstractCompiler* comp, bool compiler_thread, TRAPS);
|
||||
static void init_compiler_sweeper_threads(int c1_compiler_count, int c2_compiler_count);
|
||||
static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level);
|
||||
static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
|
||||
static bool compilation_is_complete (const methodHandle& method, int osr_bci, int comp_level);
|
||||
static bool compilation_is_prohibited(const methodHandle& method, int osr_bci, int comp_level);
|
||||
static bool is_compile_blocking();
|
||||
static void preload_classes (methodHandle method, TRAPS);
|
||||
static void preload_classes (const methodHandle& method, TRAPS);
|
||||
|
||||
static CompileTask* create_compile_task(CompileQueue* queue,
|
||||
int compile_id,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
bool blocking);
|
||||
@ -235,16 +235,16 @@ class CompileBroker: AllStatic {
|
||||
|
||||
static void invoke_compiler_on_method(CompileTask* task);
|
||||
static void post_compile(CompilerThread* thread, CompileTask* task, EventCompilation& event, bool success, ciEnv* ci_env);
|
||||
static void set_last_compile(CompilerThread *thread, methodHandle method, bool is_osr, int comp_level);
|
||||
static void set_last_compile(CompilerThread *thread, const methodHandle& method, bool is_osr, int comp_level);
|
||||
static void push_jni_handle_block();
|
||||
static void pop_jni_handle_block();
|
||||
static bool check_break_at(methodHandle method, int compile_id, bool is_osr);
|
||||
static bool check_break_at(const methodHandle& method, int compile_id, bool is_osr);
|
||||
static void collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task);
|
||||
|
||||
static void compile_method_base(methodHandle method,
|
||||
static void compile_method_base(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
Thread* thread);
|
||||
@ -265,7 +265,7 @@ class CompileBroker: AllStatic {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool compilation_is_in_queue(methodHandle method);
|
||||
static bool compilation_is_in_queue(const methodHandle& method);
|
||||
static void print_compile_queues(outputStream* st);
|
||||
static int queue_size(int comp_level) {
|
||||
CompileQueue *q = compile_queue(comp_level);
|
||||
@ -273,15 +273,15 @@ class CompileBroker: AllStatic {
|
||||
}
|
||||
static void compilation_init();
|
||||
static void init_compiler_thread_log();
|
||||
static nmethod* compile_method(methodHandle method,
|
||||
static nmethod* compile_method(const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment, Thread* thread);
|
||||
|
||||
// Acquire any needed locks and assign a compile id
|
||||
static uint assign_compile_id_unlocked(Thread* thread, methodHandle method, int osr_bci);
|
||||
static uint assign_compile_id_unlocked(Thread* thread, const methodHandle& method, int osr_bci);
|
||||
|
||||
static void compiler_thread_loop();
|
||||
static uint get_compilation_id() { return _compilation_id; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -75,10 +75,10 @@ void CompileTask::free(CompileTask* task) {
|
||||
|
||||
|
||||
void CompileTask::initialize(int compile_id,
|
||||
methodHandle method,
|
||||
const methodHandle& method,
|
||||
int osr_bci,
|
||||
int comp_level,
|
||||
methodHandle hot_method,
|
||||
const methodHandle& hot_method,
|
||||
int hot_count,
|
||||
const char* comment,
|
||||
bool is_blocking) {
|
||||
|
@ -71,8 +71,8 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
||||
_lock = new Monitor(Mutex::nonleaf+2, "CompileTaskLock");
|
||||
}
|
||||
|
||||
void initialize(int compile_id, methodHandle method, int osr_bci, int comp_level,
|
||||
methodHandle hot_method, int hot_count, const char* comment,
|
||||
void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level,
|
||||
const methodHandle& hot_method, int hot_count, const char* comment,
|
||||
bool is_blocking);
|
||||
|
||||
static CompileTask* allocate();
|
||||
|
@ -313,7 +313,7 @@ static void add_predicate(OracleCommand command, BasicMatcher* bm) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool CompilerOracle::has_option_value(methodHandle method, const char* option, T& value) {
|
||||
bool CompilerOracle::has_option_value(const methodHandle& method, const char* option, T& value) {
|
||||
if (option_list != NULL) {
|
||||
TypedMethodOptionMatcher* m = option_list->match(method, option, get_type_for<T>());
|
||||
if (m != NULL) {
|
||||
@ -325,19 +325,19 @@ bool CompilerOracle::has_option_value(methodHandle method, const char* option, T
|
||||
}
|
||||
|
||||
// Explicit instantiation for all OptionTypes supported.
|
||||
template bool CompilerOracle::has_option_value<intx>(methodHandle method, const char* option, intx& value);
|
||||
template bool CompilerOracle::has_option_value<uintx>(methodHandle method, const char* option, uintx& value);
|
||||
template bool CompilerOracle::has_option_value<bool>(methodHandle method, const char* option, bool& value);
|
||||
template bool CompilerOracle::has_option_value<ccstr>(methodHandle method, const char* option, ccstr& value);
|
||||
template bool CompilerOracle::has_option_value<double>(methodHandle method, const char* option, double& value);
|
||||
template bool CompilerOracle::has_option_value<intx>(const methodHandle& method, const char* option, intx& value);
|
||||
template bool CompilerOracle::has_option_value<uintx>(const methodHandle& method, const char* option, uintx& value);
|
||||
template bool CompilerOracle::has_option_value<bool>(const methodHandle& method, const char* option, bool& value);
|
||||
template bool CompilerOracle::has_option_value<ccstr>(const methodHandle& method, const char* option, ccstr& value);
|
||||
template bool CompilerOracle::has_option_value<double>(const methodHandle& method, const char* option, double& value);
|
||||
|
||||
bool CompilerOracle::has_option_string(methodHandle method, const char* option) {
|
||||
bool CompilerOracle::has_option_string(const methodHandle& method, const char* option) {
|
||||
bool value = false;
|
||||
has_option_value(method, option, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_exclude(methodHandle method, bool& quietly) {
|
||||
bool CompilerOracle::should_exclude(const methodHandle& method, bool& quietly) {
|
||||
quietly = true;
|
||||
if (lists[ExcludeCommand] != NULL) {
|
||||
if (lists[ExcludeCommand]->match(method)) {
|
||||
@ -352,17 +352,17 @@ bool CompilerOracle::should_exclude(methodHandle method, bool& quietly) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_inline(methodHandle method) {
|
||||
bool CompilerOracle::should_inline(const methodHandle& method) {
|
||||
return (check_predicate(InlineCommand, method));
|
||||
}
|
||||
|
||||
// Check both DontInlineCommand and ExcludeCommand here
|
||||
// - consistent behavior for all compilers
|
||||
bool CompilerOracle::should_not_inline(methodHandle method) {
|
||||
bool CompilerOracle::should_not_inline(const methodHandle& method) {
|
||||
return check_predicate(DontInlineCommand, method) || check_predicate(ExcludeCommand, method);
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_print(methodHandle method) {
|
||||
bool CompilerOracle::should_print(const methodHandle& method) {
|
||||
return check_predicate(PrintCommand, method);
|
||||
}
|
||||
|
||||
@ -370,13 +370,13 @@ bool CompilerOracle::should_print_methods() {
|
||||
return lists[PrintCommand] != NULL;
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_log(methodHandle method) {
|
||||
bool CompilerOracle::should_log(const methodHandle& method) {
|
||||
if (!LogCompilation) return false;
|
||||
if (lists[LogCommand] == NULL) return true; // by default, log all
|
||||
return (check_predicate(LogCommand, method));
|
||||
}
|
||||
|
||||
bool CompilerOracle::should_break_at(methodHandle method) {
|
||||
bool CompilerOracle::should_break_at(const methodHandle& method) {
|
||||
return check_predicate(BreakCommand, method);
|
||||
}
|
||||
|
||||
@ -756,7 +756,7 @@ void CompilerOracle::append_comment_to_file(const char* message) {
|
||||
stream.cr();
|
||||
}
|
||||
|
||||
void CompilerOracle::append_exclude_to_file(methodHandle method) {
|
||||
void CompilerOracle::append_exclude_to_file(const methodHandle& method) {
|
||||
assert(has_command_file(), "command file must be specified");
|
||||
fileStream stream(fopen(cc_file(), "at"));
|
||||
stream.print("exclude ");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, 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
|
||||
@ -46,30 +46,30 @@ class CompilerOracle : AllStatic {
|
||||
static void parse_from_file();
|
||||
|
||||
// Tells whether we to exclude compilation of method
|
||||
static bool should_exclude(methodHandle method, bool& quietly);
|
||||
static bool should_exclude(const methodHandle& method, bool& quietly);
|
||||
|
||||
// Tells whether we want to inline this method
|
||||
static bool should_inline(methodHandle method);
|
||||
static bool should_inline(const methodHandle& method);
|
||||
|
||||
// Tells whether we want to disallow inlining of this method
|
||||
static bool should_not_inline(methodHandle method);
|
||||
static bool should_not_inline(const methodHandle& method);
|
||||
|
||||
// Tells whether we should print the assembly for this method
|
||||
static bool should_print(methodHandle method);
|
||||
static bool should_print(const methodHandle& method);
|
||||
|
||||
// Tells whether we should log the compilation data for this method
|
||||
static bool should_log(methodHandle method);
|
||||
static bool should_log(const methodHandle& method);
|
||||
|
||||
// Tells whether to break when compiling method
|
||||
static bool should_break_at(methodHandle method);
|
||||
static bool should_break_at(const methodHandle& method);
|
||||
|
||||
// Check to see if this method has option set for it
|
||||
static bool has_option_string(methodHandle method, const char * option);
|
||||
static bool has_option_string(const methodHandle& method, const char * option);
|
||||
|
||||
// Check if method has option and value set. If yes, overwrite value and return true,
|
||||
// otherwise leave value unchanged and return false.
|
||||
template<typename T>
|
||||
static bool has_option_value(methodHandle method, const char* option, T& value);
|
||||
static bool has_option_value(const methodHandle& method, const char* option, T& value);
|
||||
|
||||
// Reads from string instead of file
|
||||
static void parse_from_string(const char* command_string, void (*parser)(char*));
|
||||
@ -79,7 +79,7 @@ class CompilerOracle : AllStatic {
|
||||
|
||||
// For updating the oracle file
|
||||
static void append_comment_to_file(const char* message);
|
||||
static void append_exclude_to_file(methodHandle method);
|
||||
static void append_exclude_to_file(const methodHandle& method);
|
||||
|
||||
// Tells whether there are any methods to print for print_method_statistics()
|
||||
static bool should_print_methods();
|
||||
|
@ -86,6 +86,12 @@ bool Disassembler::load_library() {
|
||||
os::jvm_path(buf, sizeof(buf));
|
||||
int jvm_offset = -1;
|
||||
int lib_offset = -1;
|
||||
#ifdef STATIC_BUILD
|
||||
char* p = strrchr(buf, '/');
|
||||
*p = '\0';
|
||||
strcat(p, "/lib/");
|
||||
lib_offset = jvm_offset = strlen(buf);
|
||||
#else
|
||||
{
|
||||
// Match "jvm[^/]*" in jvm_path.
|
||||
const char* base = buf;
|
||||
@ -94,6 +100,7 @@ bool Disassembler::load_library() {
|
||||
p = strstr(p ? p : base, "jvm");
|
||||
if (p != NULL) jvm_offset = p - base;
|
||||
}
|
||||
#endif
|
||||
// Find the disassembler shared library.
|
||||
// Search for several paths derived from libjvm, in this order:
|
||||
// 1. <home>/jre/lib/<arch>/<vm>/libhsdis-<arch>.so (for compatibility)
|
||||
|
@ -306,7 +306,7 @@ void MethodMatcher::parse_method_pattern(char*& line, const char*& error_msg, Me
|
||||
}
|
||||
}
|
||||
|
||||
bool MethodMatcher::matches(methodHandle method) const {
|
||||
bool MethodMatcher::matches(const methodHandle& method) const {
|
||||
Symbol* class_name = method->method_holder()->name();
|
||||
Symbol* method_name = method->name();
|
||||
Symbol* signature = method->signature();
|
||||
|
@ -60,7 +60,7 @@ class MethodMatcher : public CHeapObj<mtCompiler> {
|
||||
void init(Symbol* class_name, Mode class_mode, Symbol* method_name, Mode method_mode, Symbol* signature);
|
||||
static void parse_method_pattern(char*& line, const char*& error_msg, MethodMatcher* m);
|
||||
static void print_symbol(outputStream* st, Symbol* h, Mode mode);
|
||||
bool matches(methodHandle method) const;
|
||||
bool matches(const methodHandle& method) const;
|
||||
void print_base(outputStream* st);
|
||||
|
||||
private:
|
||||
@ -101,7 +101,7 @@ public:
|
||||
return bm;
|
||||
}
|
||||
|
||||
bool match(methodHandle method) {
|
||||
bool match(const methodHandle& method) {
|
||||
for (BasicMatcher* current = this; current != NULL; current = current->next()) {
|
||||
if (current->matches(method)) {
|
||||
return true;
|
||||
|
@ -73,8 +73,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
OopMapValue () { set_value(0); set_content_reg(VMRegImpl::Bad()); }
|
||||
OopMapValue (VMReg reg, oop_types t) { set_reg_type(reg,t); }
|
||||
OopMapValue (VMReg reg, oop_types t, VMReg reg2) { set_reg_type(reg,t); set_content_reg(reg2); }
|
||||
OopMapValue (VMReg reg, oop_types t) { set_reg_type(reg, t); set_content_reg(VMRegImpl::Bad()); }
|
||||
OopMapValue (VMReg reg, oop_types t, VMReg reg2) { set_reg_type(reg, t); set_content_reg(reg2); }
|
||||
OopMapValue (CompressedReadStream* stream) { read_from(stream); }
|
||||
|
||||
// Archiving
|
||||
@ -87,7 +87,7 @@ public:
|
||||
|
||||
void read_from(CompressedReadStream* stream) {
|
||||
set_value(stream->read_int());
|
||||
if(is_callee_saved() || is_derived_oop()) {
|
||||
if (is_callee_saved() || is_derived_oop()) {
|
||||
set_content_reg(VMRegImpl::as_VMReg(stream->read_int(), true));
|
||||
}
|
||||
}
|
||||
|
@ -73,11 +73,7 @@ void CompactibleFreeListSpace::set_cms_values() {
|
||||
}
|
||||
|
||||
// Constructor
|
||||
CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
|
||||
MemRegion mr, bool use_adaptive_freelists,
|
||||
FreeBlockDictionary<FreeChunk>::DictionaryChoice dictionaryChoice) :
|
||||
_dictionaryChoice(dictionaryChoice),
|
||||
_adaptive_freelists(use_adaptive_freelists),
|
||||
CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, MemRegion mr) :
|
||||
_bt(bs, mr),
|
||||
// free list locks are in the range of values taken by _lockRank
|
||||
// This range currently is [_leaf+2, _leaf+3]
|
||||
@ -100,48 +96,17 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
|
||||
"FreeChunk is larger than expected");
|
||||
_bt.set_space(this);
|
||||
initialize(mr, SpaceDecorator::Clear, SpaceDecorator::Mangle);
|
||||
// We have all of "mr", all of which we place in the dictionary
|
||||
// as one big chunk. We'll need to decide here which of several
|
||||
// possible alternative dictionary implementations to use. For
|
||||
// now the choice is easy, since we have only one working
|
||||
// implementation, namely, the simple binary tree (splaying
|
||||
// temporarily disabled).
|
||||
switch (dictionaryChoice) {
|
||||
case FreeBlockDictionary<FreeChunk>::dictionaryBinaryTree:
|
||||
_dictionary = new AFLBinaryTreeDictionary(mr);
|
||||
break;
|
||||
case FreeBlockDictionary<FreeChunk>::dictionarySplayTree:
|
||||
case FreeBlockDictionary<FreeChunk>::dictionarySkipList:
|
||||
default:
|
||||
warning("dictionaryChoice: selected option not understood; using"
|
||||
" default BinaryTreeDictionary implementation instead.");
|
||||
}
|
||||
|
||||
_dictionary = new AFLBinaryTreeDictionary(mr);
|
||||
|
||||
assert(_dictionary != NULL, "CMS dictionary initialization");
|
||||
// The indexed free lists are initially all empty and are lazily
|
||||
// filled in on demand. Initialize the array elements to NULL.
|
||||
initializeIndexedFreeListArray();
|
||||
|
||||
// Not using adaptive free lists assumes that allocation is first
|
||||
// from the linAB's. Also a cms perm gen which can be compacted
|
||||
// has to have the klass's klassKlass allocated at a lower
|
||||
// address in the heap than the klass so that the klassKlass is
|
||||
// moved to its new location before the klass is moved.
|
||||
// Set the _refillSize for the linear allocation blocks
|
||||
if (!use_adaptive_freelists) {
|
||||
FreeChunk* fc = _dictionary->get_chunk(mr.word_size(),
|
||||
FreeBlockDictionary<FreeChunk>::atLeast);
|
||||
// The small linAB initially has all the space and will allocate
|
||||
// a chunk of any size.
|
||||
HeapWord* addr = (HeapWord*) fc;
|
||||
_smallLinearAllocBlock.set(addr, fc->size() ,
|
||||
1024*SmallForLinearAlloc, fc->size());
|
||||
// Note that _unallocated_block is not updated here.
|
||||
// Allocations from the linear allocation block should
|
||||
// update it.
|
||||
} else {
|
||||
_smallLinearAllocBlock.set(0, 0, 1024*SmallForLinearAlloc,
|
||||
SmallForLinearAlloc);
|
||||
}
|
||||
_smallLinearAllocBlock.set(0, 0, 1024*SmallForLinearAlloc,
|
||||
SmallForLinearAlloc);
|
||||
|
||||
// CMSIndexedFreeListReplenish should be at least 1
|
||||
CMSIndexedFreeListReplenish = MAX2((uintx)1, CMSIndexedFreeListReplenish);
|
||||
_promoInfo.setSpace(this);
|
||||
@ -297,22 +262,7 @@ void CompactibleFreeListSpace::reset_after_compaction() {
|
||||
MemRegion mr(compaction_top(), end());
|
||||
reset(mr);
|
||||
// Now refill the linear allocation block(s) if possible.
|
||||
if (_adaptive_freelists) {
|
||||
refillLinearAllocBlocksIfNeeded();
|
||||
} else {
|
||||
// Place as much of mr in the linAB as we can get,
|
||||
// provided it was big enough to go into the dictionary.
|
||||
FreeChunk* fc = dictionary()->find_largest_dict();
|
||||
if (fc != NULL) {
|
||||
assert(fc->size() == mr.word_size(),
|
||||
"Why was the chunk broken up?");
|
||||
removeChunkFromDictionary(fc);
|
||||
HeapWord* addr = (HeapWord*) fc;
|
||||
_smallLinearAllocBlock.set(addr, fc->size() ,
|
||||
1024*SmallForLinearAlloc, fc->size());
|
||||
// Note that _unallocated_block is not updated here.
|
||||
}
|
||||
}
|
||||
refillLinearAllocBlocksIfNeeded();
|
||||
}
|
||||
|
||||
// Walks the entire dictionary, returning a coterminal
|
||||
@ -445,8 +395,7 @@ void CompactibleFreeListSpace::print_on(outputStream* st) const {
|
||||
|
||||
// dump_memory_block(_smallLinearAllocBlock->_ptr, 128);
|
||||
|
||||
st->print_cr(" _fitStrategy = %s, _adaptive_freelists = %s",
|
||||
_fitStrategy?"true":"false", _adaptive_freelists?"true":"false");
|
||||
st->print_cr(" _fitStrategy = %s", BOOL_TO_STR(_fitStrategy));
|
||||
}
|
||||
|
||||
void CompactibleFreeListSpace::print_indexed_free_lists(outputStream* st)
|
||||
@ -617,23 +566,9 @@ void CompactibleFreeListSpace::set_end(HeapWord* value) {
|
||||
// Now, take this new chunk and add it to the free blocks.
|
||||
// Note that the BOT has not yet been updated for this block.
|
||||
size_t newFcSize = pointer_delta(value, prevEnd);
|
||||
// XXX This is REALLY UGLY and should be fixed up. XXX
|
||||
if (!_adaptive_freelists && _smallLinearAllocBlock._ptr == NULL) {
|
||||
// Mark the boundary of the new block in BOT
|
||||
_bt.mark_block(prevEnd, value);
|
||||
// put it all in the linAB
|
||||
MutexLockerEx x(parDictionaryAllocLock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
_smallLinearAllocBlock._ptr = prevEnd;
|
||||
_smallLinearAllocBlock._word_size = newFcSize;
|
||||
repairLinearAllocBlock(&_smallLinearAllocBlock);
|
||||
// Births of chunks put into a LinAB are not recorded. Births
|
||||
// of chunks as they are allocated out of a LinAB are.
|
||||
} else {
|
||||
// Add the block to the free lists, if possible coalescing it
|
||||
// with the last free block, and update the BOT and census data.
|
||||
addChunkToFreeListsAtEndRecordingStats(prevEnd, newFcSize);
|
||||
}
|
||||
// Add the block to the free lists, if possible coalescing it
|
||||
// with the last free block, and update the BOT and census data.
|
||||
addChunkToFreeListsAtEndRecordingStats(prevEnd, newFcSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1177,11 +1112,7 @@ HeapWord* CompactibleFreeListSpace::allocate(size_t size) {
|
||||
assert(size == adjustObjectSize(size),
|
||||
"use adjustObjectSize() before calling into allocate()");
|
||||
|
||||
if (_adaptive_freelists) {
|
||||
res = allocate_adaptive_freelists(size);
|
||||
} else { // non-adaptive free lists
|
||||
res = allocate_non_adaptive_freelists(size);
|
||||
}
|
||||
res = allocate_adaptive_freelists(size);
|
||||
|
||||
if (res != NULL) {
|
||||
// check that res does lie in this space!
|
||||
@ -1203,27 +1134,6 @@ HeapWord* CompactibleFreeListSpace::allocate(size_t size) {
|
||||
return res;
|
||||
}
|
||||
|
||||
HeapWord* CompactibleFreeListSpace::allocate_non_adaptive_freelists(size_t size) {
|
||||
HeapWord* res = NULL;
|
||||
// try and use linear allocation for smaller blocks
|
||||
if (size < _smallLinearAllocBlock._allocation_size_limit) {
|
||||
// if successful, the following also adjusts block offset table
|
||||
res = getChunkFromSmallLinearAllocBlock(size);
|
||||
}
|
||||
// Else triage to indexed lists for smaller sizes
|
||||
if (res == NULL) {
|
||||
if (size < SmallForDictionary) {
|
||||
res = (HeapWord*) getChunkFromIndexedFreeList(size);
|
||||
} else {
|
||||
// else get it from the big dictionary; if even this doesn't
|
||||
// work we are out of luck.
|
||||
res = (HeapWord*)getChunkFromDictionaryExact(size);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
HeapWord* CompactibleFreeListSpace::allocate_adaptive_freelists(size_t size) {
|
||||
assert_lock_strong(freelistLock());
|
||||
HeapWord* res = NULL;
|
||||
@ -1281,9 +1191,6 @@ size_t CompactibleFreeListSpace::expansionSpaceRequired(size_t obj_size) const {
|
||||
// bigLAB or a smallLAB plus refilling a PromotionInfo object. MinChunkSize
|
||||
// is added because the dictionary may over-allocate to avoid fragmentation.
|
||||
size_t space = obj_size;
|
||||
if (!_adaptive_freelists) {
|
||||
space = MAX2(space, _smallLinearAllocBlock._refillSize);
|
||||
}
|
||||
space += _promoInfo.refillSize() + 2 * MinChunkSize;
|
||||
return space;
|
||||
}
|
||||
@ -1698,11 +1605,7 @@ CompactibleFreeListSpace::returnChunkToFreeList(FreeChunk* fc) {
|
||||
size_t size = fc->size();
|
||||
_bt.verify_single_block((HeapWord*) fc, size);
|
||||
_bt.verify_not_unallocated((HeapWord*) fc, size);
|
||||
if (_adaptive_freelists) {
|
||||
_indexedFreeList[size].return_chunk_at_tail(fc);
|
||||
} else {
|
||||
_indexedFreeList[size].return_chunk_at_head(fc);
|
||||
}
|
||||
_indexedFreeList[size].return_chunk_at_tail(fc);
|
||||
#ifndef PRODUCT
|
||||
if (CMSCollector::abstract_state() != CMSCollector::Sweeping) {
|
||||
_indexedFreeList[size].verify_stats();
|
||||
@ -1931,10 +1834,6 @@ CompactibleFreeListSpace::gc_prologue() {
|
||||
void
|
||||
CompactibleFreeListSpace::gc_epilogue() {
|
||||
assert_locked();
|
||||
if (PrintGCDetails && Verbose && !_adaptive_freelists) {
|
||||
if (_smallLinearAllocBlock._word_size == 0)
|
||||
warning("CompactibleFreeListSpace(epilogue):: Linear allocation failure");
|
||||
}
|
||||
assert(_promoInfo.noPromotions(), "_promoInfo inconsistency");
|
||||
_promoInfo.stopTrackingPromotions();
|
||||
repairLinearAllocationBlocks();
|
||||
@ -2060,13 +1959,6 @@ CompactibleFreeListSpace::refillLinearAllocBlock(LinearAllocBlock* blk) {
|
||||
}
|
||||
}
|
||||
|
||||
// Support for concurrent collection policy decisions.
|
||||
bool CompactibleFreeListSpace::should_concurrent_collect() const {
|
||||
// In the future we might want to add in fragmentation stats --
|
||||
// including erosion of the "mountain" into this decision as well.
|
||||
return !adaptive_freelists() && linearAllocationWouldFail();
|
||||
}
|
||||
|
||||
// Support for compaction
|
||||
void CompactibleFreeListSpace::prepare_for_compaction(CompactPoint* cp) {
|
||||
scan_and_forward(this, cp);
|
||||
|
@ -138,15 +138,13 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||
// Linear allocation blocks
|
||||
LinearAllocBlock _smallLinearAllocBlock;
|
||||
|
||||
FreeBlockDictionary<FreeChunk>::DictionaryChoice _dictionaryChoice;
|
||||
AFLBinaryTreeDictionary* _dictionary; // Pointer to dictionary for large size blocks
|
||||
|
||||
// Indexed array for small size blocks
|
||||
AdaptiveFreeList<FreeChunk> _indexedFreeList[IndexSetSize];
|
||||
|
||||
// Allocation strategy
|
||||
bool _fitStrategy; // Use best fit strategy
|
||||
bool _adaptive_freelists; // Use adaptive freelists
|
||||
bool _fitStrategy; // Use best fit strategy
|
||||
|
||||
// This is an address close to the largest free chunk in the heap.
|
||||
// It is currently assumed to be at the end of the heap. Free
|
||||
@ -204,10 +202,6 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||
// strategy that attempts to keep the needed number of chunks in each
|
||||
// indexed free lists.
|
||||
HeapWord* allocate_adaptive_freelists(size_t size);
|
||||
// Allocate from the linear allocation buffers first. This allocation
|
||||
// strategy assumes maximal coalescing can maintain chunks large enough
|
||||
// to be used as linear allocation buffers.
|
||||
HeapWord* allocate_non_adaptive_freelists(size_t size);
|
||||
|
||||
// Gets a chunk from the linear allocation block (LinAB). If there
|
||||
// is not enough space in the LinAB, refills it.
|
||||
@ -333,9 +327,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
CompactibleFreeListSpace(BlockOffsetSharedArray* bs, MemRegion mr,
|
||||
bool use_adaptive_freelists,
|
||||
FreeBlockDictionary<FreeChunk>::DictionaryChoice);
|
||||
CompactibleFreeListSpace(BlockOffsetSharedArray* bs, MemRegion mr);
|
||||
// Accessors
|
||||
bool bestFitFirst() { return _fitStrategy == FreeBlockBestFitFirst; }
|
||||
FreeBlockDictionary<FreeChunk>* dictionary() const { return _dictionary; }
|
||||
@ -349,8 +341,6 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||
// chunk exists, return NULL.
|
||||
FreeChunk* find_chunk_at_end();
|
||||
|
||||
bool adaptive_freelists() const { return _adaptive_freelists; }
|
||||
|
||||
void set_collector(CMSCollector* collector) { _collector = collector; }
|
||||
|
||||
// Support for parallelization of rescan and marking.
|
||||
@ -536,9 +526,6 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||
void addChunkAndRepairOffsetTable(HeapWord* chunk, size_t size,
|
||||
bool coalesced);
|
||||
|
||||
// Support for decisions regarding concurrent collection policy.
|
||||
bool should_concurrent_collect() const;
|
||||
|
||||
// Support for compaction.
|
||||
void prepare_for_compaction(CompactPoint* cp);
|
||||
void adjust_pointers();
|
||||
|
@ -190,9 +190,7 @@ class CMSParGCThreadState: public CHeapObj<mtGC> {
|
||||
};
|
||||
|
||||
ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
|
||||
ReservedSpace rs, size_t initial_byte_size,
|
||||
CardTableRS* ct, bool use_adaptive_freelists,
|
||||
FreeBlockDictionary<FreeChunk>::DictionaryChoice dictionaryChoice) :
|
||||
ReservedSpace rs, size_t initial_byte_size, CardTableRS* ct) :
|
||||
CardGeneration(rs, initial_byte_size, ct),
|
||||
_dilatation_factor(((double)MinChunkSize)/((double)(CollectedHeap::min_fill_size()))),
|
||||
_did_compact(false)
|
||||
@ -208,9 +206,7 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
|
||||
_numWordsAllocated = 0;
|
||||
)
|
||||
|
||||
_cmsSpace = new CompactibleFreeListSpace(_bts, MemRegion(bottom, end),
|
||||
use_adaptive_freelists,
|
||||
dictionaryChoice);
|
||||
_cmsSpace = new CompactibleFreeListSpace(_bts, MemRegion(bottom, end));
|
||||
NOT_PRODUCT(debug_cms_space = _cmsSpace;)
|
||||
_cmsSpace->_old_gen = this;
|
||||
|
||||
@ -1312,13 +1308,6 @@ bool ConcurrentMarkSweepGeneration::should_concurrent_collect() const {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (_cmsSpace->should_concurrent_collect()) {
|
||||
if (PrintGCDetails && Verbose) {
|
||||
gclog_or_tty->print(" %s: collect because cmsSpace says so ",
|
||||
short_name());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1766,9 +1755,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) {
|
||||
MutexLockerEx hl(Heap_lock, safepoint_check);
|
||||
FreelistLocker fll(this);
|
||||
MutexLockerEx x(CGC_lock, safepoint_check);
|
||||
if (_foregroundGCIsActive || !UseAsyncConcMarkSweepGC) {
|
||||
// The foreground collector is active or we're
|
||||
// not using asynchronous collections. Skip this
|
||||
if (_foregroundGCIsActive) {
|
||||
// The foreground collector is. Skip this
|
||||
// background collection.
|
||||
assert(!_foregroundGCShouldWait, "Should be clear");
|
||||
return;
|
||||
@ -1795,7 +1783,7 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) {
|
||||
}
|
||||
|
||||
// Used for PrintGC
|
||||
size_t prev_used;
|
||||
size_t prev_used = 0;
|
||||
if (PrintGC && Verbose) {
|
||||
prev_used = _cmsGen->used();
|
||||
}
|
||||
@ -5214,9 +5202,8 @@ void CMSCollector::do_remark_non_parallel() {
|
||||
|
||||
verify_work_stacks_empty();
|
||||
// Restore evacuated mark words, if any, used for overflow list links
|
||||
if (!CMSOverflowEarlyRestoration) {
|
||||
restore_preserved_marks_if_any();
|
||||
}
|
||||
restore_preserved_marks_if_any();
|
||||
|
||||
verify_overflow_empty();
|
||||
}
|
||||
|
||||
@ -6186,17 +6173,8 @@ void MarkRefsIntoAndScanClosure::do_oop(oop obj) {
|
||||
assert(_mark_stack->isEmpty(), "post-condition (eager drainage)");
|
||||
assert(_collector->overflow_list_is_empty(),
|
||||
"overflow list was drained above");
|
||||
// We could restore evacuated mark words, if any, used for
|
||||
// overflow list links here because the overflow list is
|
||||
// provably empty here. That would reduce the maximum
|
||||
// size requirements for preserved_{oop,mark}_stack.
|
||||
// But we'll just postpone it until we are all done
|
||||
// so we can just stream through.
|
||||
if (!_concurrent_precleaning && CMSOverflowEarlyRestoration) {
|
||||
_collector->restore_preserved_marks_if_any();
|
||||
assert(_collector->no_preserved_marks(), "No preserved marks");
|
||||
}
|
||||
assert(!CMSOverflowEarlyRestoration || _collector->no_preserved_marks(),
|
||||
|
||||
assert(_collector->no_preserved_marks(),
|
||||
"All preserved marks should have been restored above");
|
||||
}
|
||||
}
|
||||
@ -7372,14 +7350,6 @@ void SweepClosure::initialize_free_range(HeapWord* freeFinger,
|
||||
|
||||
set_freeFinger(freeFinger);
|
||||
set_freeRangeInFreeLists(freeRangeInFreeLists);
|
||||
if (CMSTestInFreeList) {
|
||||
if (freeRangeInFreeLists) {
|
||||
FreeChunk* fc = (FreeChunk*) freeFinger;
|
||||
assert(fc->is_free(), "A chunk on the free list should be free.");
|
||||
assert(fc->size() > 0, "Free range should have a size");
|
||||
assert(_sp->verify_chunk_in_free_list(fc), "Chunk is not in free lists");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Note that the sweeper runs concurrently with mutators. Thus,
|
||||
@ -7532,12 +7502,7 @@ size_t SweepClosure::do_blk_careful(HeapWord* addr) {
|
||||
|
||||
void SweepClosure::do_already_free_chunk(FreeChunk* fc) {
|
||||
const size_t size = fc->size();
|
||||
// Chunks that cannot be coalesced are not in the
|
||||
// free lists.
|
||||
if (CMSTestInFreeList && !fc->cantCoalesce()) {
|
||||
assert(_sp->verify_chunk_in_free_list(fc),
|
||||
"free chunk should be in free lists");
|
||||
}
|
||||
|
||||
// a chunk that is already free, should not have been
|
||||
// marked in the bit map
|
||||
HeapWord* const addr = (HeapWord*) fc;
|
||||
@ -7550,57 +7515,8 @@ void SweepClosure::do_already_free_chunk(FreeChunk* fc) {
|
||||
// See the definition of cantCoalesce().
|
||||
if (!fc->cantCoalesce()) {
|
||||
// This chunk can potentially be coalesced.
|
||||
if (_sp->adaptive_freelists()) {
|
||||
// All the work is done in
|
||||
do_post_free_or_garbage_chunk(fc, size);
|
||||
} else { // Not adaptive free lists
|
||||
// this is a free chunk that can potentially be coalesced by the sweeper;
|
||||
if (!inFreeRange()) {
|
||||
// if the next chunk is a free block that can't be coalesced
|
||||
// it doesn't make sense to remove this chunk from the free lists
|
||||
FreeChunk* nextChunk = (FreeChunk*)(addr + size);
|
||||
assert((HeapWord*)nextChunk <= _sp->end(), "Chunk size out of bounds?");
|
||||
if ((HeapWord*)nextChunk < _sp->end() && // There is another free chunk to the right ...
|
||||
nextChunk->is_free() && // ... which is free...
|
||||
nextChunk->cantCoalesce()) { // ... but can't be coalesced
|
||||
// nothing to do
|
||||
} else {
|
||||
// Potentially the start of a new free range:
|
||||
// Don't eagerly remove it from the free lists.
|
||||
// No need to remove it if it will just be put
|
||||
// back again. (Also from a pragmatic point of view
|
||||
// if it is a free block in a region that is beyond
|
||||
// any allocated blocks, an assertion will fail)
|
||||
// Remember the start of a free run.
|
||||
initialize_free_range(addr, true);
|
||||
// end - can coalesce with next chunk
|
||||
}
|
||||
} else {
|
||||
// the midst of a free range, we are coalescing
|
||||
print_free_block_coalesced(fc);
|
||||
if (CMSTraceSweeper) {
|
||||
gclog_or_tty->print(" -- pick up free block " PTR_FORMAT " (" SIZE_FORMAT ")\n", p2i(fc), size);
|
||||
}
|
||||
// remove it from the free lists
|
||||
_sp->removeFreeChunkFromFreeLists(fc);
|
||||
set_lastFreeRangeCoalesced(true);
|
||||
// If the chunk is being coalesced and the current free range is
|
||||
// in the free lists, remove the current free range so that it
|
||||
// will be returned to the free lists in its entirety - all
|
||||
// the coalesced pieces included.
|
||||
if (freeRangeInFreeLists()) {
|
||||
FreeChunk* ffc = (FreeChunk*) freeFinger();
|
||||
assert(ffc->size() == pointer_delta(addr, freeFinger()),
|
||||
"Size of free range is inconsistent with chunk size.");
|
||||
if (CMSTestInFreeList) {
|
||||
assert(_sp->verify_chunk_in_free_list(ffc),
|
||||
"free range is not in free lists");
|
||||
}
|
||||
_sp->removeFreeChunkFromFreeLists(ffc);
|
||||
set_freeRangeInFreeLists(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
// All the work is done in
|
||||
do_post_free_or_garbage_chunk(fc, size);
|
||||
// Note that if the chunk is not coalescable (the else arm
|
||||
// below), we unconditionally flush, without needing to do
|
||||
// a "lookahead," as we do below.
|
||||
@ -7626,46 +7542,11 @@ size_t SweepClosure::do_garbage_chunk(FreeChunk* fc) {
|
||||
HeapWord* const addr = (HeapWord*) fc;
|
||||
const size_t size = CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size());
|
||||
|
||||
if (_sp->adaptive_freelists()) {
|
||||
// Verify that the bit map has no bits marked between
|
||||
// addr and purported end of just dead object.
|
||||
_bitMap->verifyNoOneBitsInRange(addr + 1, addr + size);
|
||||
// Verify that the bit map has no bits marked between
|
||||
// addr and purported end of just dead object.
|
||||
_bitMap->verifyNoOneBitsInRange(addr + 1, addr + size);
|
||||
do_post_free_or_garbage_chunk(fc, size);
|
||||
|
||||
do_post_free_or_garbage_chunk(fc, size);
|
||||
} else {
|
||||
if (!inFreeRange()) {
|
||||
// start of a new free range
|
||||
assert(size > 0, "A free range should have a size");
|
||||
initialize_free_range(addr, false);
|
||||
} else {
|
||||
// this will be swept up when we hit the end of the
|
||||
// free range
|
||||
if (CMSTraceSweeper) {
|
||||
gclog_or_tty->print(" -- pick up garbage " PTR_FORMAT " (" SIZE_FORMAT ")\n", p2i(fc), size);
|
||||
}
|
||||
// If the chunk is being coalesced and the current free range is
|
||||
// in the free lists, remove the current free range so that it
|
||||
// will be returned to the free lists in its entirety - all
|
||||
// the coalesced pieces included.
|
||||
if (freeRangeInFreeLists()) {
|
||||
FreeChunk* ffc = (FreeChunk*)freeFinger();
|
||||
assert(ffc->size() == pointer_delta(addr, freeFinger()),
|
||||
"Size of free range is inconsistent with chunk size.");
|
||||
if (CMSTestInFreeList) {
|
||||
assert(_sp->verify_chunk_in_free_list(ffc),
|
||||
"free range is not in free lists");
|
||||
}
|
||||
_sp->removeFreeChunkFromFreeLists(ffc);
|
||||
set_freeRangeInFreeLists(false);
|
||||
}
|
||||
set_lastFreeRangeCoalesced(true);
|
||||
}
|
||||
// this will be swept up when we hit the end of the free range
|
||||
|
||||
// Verify that the bit map has no bits marked between
|
||||
// addr and purported end of just dead object.
|
||||
_bitMap->verifyNoOneBitsInRange(addr + 1, addr + size);
|
||||
}
|
||||
assert(_limit >= addr + size,
|
||||
"A freshly garbage chunk can't possibly straddle over _limit");
|
||||
if (inFreeRange()) lookahead_and_flush(fc, size);
|
||||
@ -7727,11 +7608,7 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
|
||||
// do_post_free_or_garbage_chunk() should only be called in the case
|
||||
// of the adaptive free list allocator.
|
||||
const bool fcInFreeLists = fc->is_free();
|
||||
assert(_sp->adaptive_freelists(), "Should only be used in this case.");
|
||||
assert((HeapWord*)fc <= _limit, "sweep invariant");
|
||||
if (CMSTestInFreeList && fcInFreeLists) {
|
||||
assert(_sp->verify_chunk_in_free_list(fc), "free chunk is not in free lists");
|
||||
}
|
||||
|
||||
if (CMSTraceSweeper) {
|
||||
gclog_or_tty->print_cr(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize);
|
||||
@ -7739,7 +7616,7 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
|
||||
|
||||
HeapWord* const fc_addr = (HeapWord*) fc;
|
||||
|
||||
bool coalesce;
|
||||
bool coalesce = false;
|
||||
const size_t left = pointer_delta(fc_addr, freeFinger());
|
||||
const size_t right = chunkSize;
|
||||
switch (FLSCoalescePolicy) {
|
||||
@ -7784,10 +7661,6 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
|
||||
FreeChunk* const ffc = (FreeChunk*)freeFinger();
|
||||
assert(ffc->size() == pointer_delta(fc_addr, freeFinger()),
|
||||
"Size of free range is inconsistent with chunk size.");
|
||||
if (CMSTestInFreeList) {
|
||||
assert(_sp->verify_chunk_in_free_list(ffc),
|
||||
"Chunk is not in free lists");
|
||||
}
|
||||
_sp->coalDeath(ffc->size());
|
||||
_sp->removeFreeChunkFromFreeLists(ffc);
|
||||
set_freeRangeInFreeLists(false);
|
||||
@ -7856,12 +7729,6 @@ void SweepClosure::flush_cur_free_chunk(HeapWord* chunk, size_t size) {
|
||||
assert(size > 0,
|
||||
"A zero sized chunk cannot be added to the free lists.");
|
||||
if (!freeRangeInFreeLists()) {
|
||||
if (CMSTestInFreeList) {
|
||||
FreeChunk* fc = (FreeChunk*) chunk;
|
||||
fc->set_size(size);
|
||||
assert(!_sp->verify_chunk_in_free_list(fc),
|
||||
"chunk should not be in free lists yet");
|
||||
}
|
||||
if (CMSTraceSweeper) {
|
||||
gclog_or_tty->print_cr(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists",
|
||||
p2i(chunk), size);
|
||||
|
@ -1076,10 +1076,7 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
||||
void assert_correct_size_change_locking();
|
||||
|
||||
public:
|
||||
ConcurrentMarkSweepGeneration(ReservedSpace rs, size_t initial_byte_size,
|
||||
CardTableRS* ct,
|
||||
bool use_adaptive_freelists,
|
||||
FreeBlockDictionary<FreeChunk>::DictionaryChoice);
|
||||
ConcurrentMarkSweepGeneration(ReservedSpace rs, size_t initial_byte_size, CardTableRS* ct);
|
||||
|
||||
// Accessors
|
||||
CMSCollector* collector() const { return _collector; }
|
||||
@ -1121,12 +1118,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
||||
// over-rides
|
||||
MemRegion used_region_at_save_marks() const;
|
||||
|
||||
// Does a "full" (forced) collection invoked on this generation collect
|
||||
// the young generation as well?
|
||||
virtual bool full_collects_young_generation() const {
|
||||
return !ScavengeBeforeFullGC;
|
||||
}
|
||||
|
||||
// Adjust quantities in the generation affected by
|
||||
// the compaction.
|
||||
void reset_after_compaction();
|
||||
|
@ -79,9 +79,6 @@ class ConcurrentMarkSweepThread: public ConcurrentGCThread {
|
||||
static void makeSurrogateLockerThread(TRAPS);
|
||||
static SurrogateLockerThread* slt() { return _slt; }
|
||||
|
||||
// Tester
|
||||
bool is_ConcurrentGC_thread() const { return true; }
|
||||
|
||||
static void threads_do(ThreadClosure* tc);
|
||||
|
||||
// Printing
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user