This commit is contained in:
Bharadwaj Yadavalli 2013-04-19 03:13:04 -04:00
commit b32dc11760
98 changed files with 2070 additions and 1859 deletions

View file

@ -85,15 +85,15 @@ else
endif endif
# Typical C1/C2 targets made available with this Makefile # Typical C1/C2 targets made available with this Makefile
C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1 C1_VM_TARGETS=product1 fastdebug1 optimized1 debug1
C2_VM_TARGETS=product fastdebug optimized jvmg C2_VM_TARGETS=product fastdebug optimized debug
ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero debugzero
SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark debugshark
MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 jvmgminimal1 MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 debugminimal1
COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product
COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug
COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 docs export_debug COMMON_VM_DEBUG_TARGETS=debug debug1 docs export_debug
# JDK directory list # JDK directory list
JDK_DIRS=bin include jre lib demo JDK_DIRS=bin include jre lib demo
@ -103,13 +103,13 @@ all: all_product all_fastdebug
ifeq ($(JVM_VARIANT_MINIMAL1),true) ifeq ($(JVM_VARIANT_MINIMAL1),true)
all_product: productminimal1 all_product: productminimal1
all_fastdebug: fastdebugminimal1 all_fastdebug: fastdebugminimal1
all_debug: jvmgminimal1 all_debug: debugminimal1
endif endif
ifdef BUILD_CLIENT_ONLY ifdef BUILD_CLIENT_ONLY
all_product: product1 docs export_product all_product: product1 docs export_product
all_fastdebug: fastdebug1 docs export_fastdebug all_fastdebug: fastdebug1 docs export_fastdebug
all_debug: jvmg1 docs export_debug all_debug: debug1 docs export_debug
else else
ifeq ($(MACOSX_UNIVERSAL),true) ifeq ($(MACOSX_UNIVERSAL),true)
all_product: universal_product all_product: universal_product
@ -127,13 +127,13 @@ all_optimized: optimized optimized1 docs export_optimized
allzero: all_productzero all_fastdebugzero allzero: all_productzero all_fastdebugzero
all_productzero: productzero docs export_product all_productzero: productzero docs export_product
all_fastdebugzero: fastdebugzero docs export_fastdebug all_fastdebugzero: fastdebugzero docs export_fastdebug
all_debugzero: jvmgzero docs export_debug all_debugzero: debugzero docs export_debug
all_optimizedzero: optimizedzero docs export_optimized all_optimizedzero: optimizedzero docs export_optimized
allshark: all_productshark all_fastdebugshark allshark: all_productshark all_fastdebugshark
all_productshark: productshark docs export_product all_productshark: productshark docs export_product
all_fastdebugshark: fastdebugshark docs export_fastdebug all_fastdebugshark: fastdebugshark docs export_fastdebug
all_debugshark: jvmgshark docs export_debug all_debugshark: debugshark docs export_debug
all_optimizedshark: optimizedshark docs export_optimized all_optimizedshark: optimizedshark docs export_optimized
# Do everything # Do everything
@ -260,7 +260,7 @@ export_fastdebug:
EXPORT_SUBDIR=/$(@:export_%=%) \ EXPORT_SUBDIR=/$(@:export_%=%) \
generic_export generic_export
export_debug: export_debug:
$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=${VM_DEBUG} \ $(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
EXPORT_SUBDIR=/$(@:export_%=%) \ EXPORT_SUBDIR=/$(@:export_%=%) \
generic_export generic_export
export_optimized: export_optimized:
@ -281,96 +281,46 @@ export_fastdebug_jdk::
ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \ ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
generic_export generic_export
export_debug_jdk:: export_debug_jdk::
$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) VM_SUBDIR=${VM_DEBUG} \ $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) VM_SUBDIR=$(@:export_%_jdk=%) \
ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \ ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
generic_export generic_export
# Export file copy rules # Export file copy rules
XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
DOCS_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_docs DOCS_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_docs
C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1 C1_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1/$(VM_SUBDIR)
C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2 C2_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2/$(VM_SUBDIR)
ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1/$(VM_SUBDIR)
SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark ZERO_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_zero/$(VM_SUBDIR)
C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR) SHARK_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_shark/$(VM_SUBDIR)
C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
MINIMAL1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1
MINIMAL1_DIR=$(MINIMAL1_BASE_DIR)/$(VM_SUBDIR)
# Server (C2)
ifeq ($(JVM_VARIANT_SERVER), true) ifeq ($(JVM_VARIANT_SERVER), true)
MISC_DIR=$(C2_DIR) # Common
GEN_DIR=$(C2_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_CLIENT), true)
MISC_DIR=$(C1_DIR)
GEN_DIR=$(C1_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
MISC_DIR=$(SHARK_DIR)
GEN_DIR=$(SHARK_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_ZERO), true)
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
endif
ifeq ($(JVM_VARIANT_MINIMAL1), true)
MISC_DIR=$(MINIMAL1_DIR)
GEN_DIR=$(MINIMAL1_BASE_DIR)/generated
endif
# Bin files (windows)
ifeq ($(OSNAME),windows)
# Get jvm.lib
$(EXPORT_LIB_DIR)/%.lib: $(MISC_DIR)/%.lib
$(install-file)
# Other libraries (like SA)
$(EXPORT_JRE_BIN_DIR)/%.diz: $(MISC_DIR)/%.diz
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.map: $(MISC_DIR)/%.map
$(install-file)
# Client files always come from C1 area
$(EXPORT_CLIENT_DIR)/%.diz: $(C1_DIR)/%.diz
$(install-file)
$(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll
$(install-file)
$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
$(install-file)
$(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map
$(install-file)
# Server files always come from C2 area
$(EXPORT_SERVER_DIR)/%.diz: $(C2_DIR)/%.diz $(EXPORT_SERVER_DIR)/%.diz: $(C2_DIR)/%.diz
$(install-file) $(install-file)
$(EXPORT_LIB_DIR)/%.jar: $(C2_DIR)/../generated/%.jar
$(install-file)
$(EXPORT_INCLUDE_DIR)/%: $(C2_DIR)/../generated/jvmtifiles/%
$(install-file)
# Windows
$(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll $(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll
$(install-file) $(install-file)
$(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb $(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb
$(install-file) $(install-file)
$(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map $(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map
$(install-file) $(install-file)
endif $(EXPORT_LIB_DIR)/%.lib: $(C2_DIR)/%.lib
# Minimal JVM files always come from minimal area
$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
$(install-file) $(install-file)
$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll $(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_DIR)/%.diz
$(install-file) $(install-file)
$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb $(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_DIR)/%.dll
$(install-file) $(install-file)
$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map $(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_DIR)/%.pdb
$(install-file) $(install-file)
$(EXPORT_JRE_BIN_DIR)/%.map: $(C2_DIR)/%.map
# Shared Library $(install-file)
ifneq ($(OSNAME),windows) # Unix
ifeq ($(JVM_VARIANT_SERVER), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file) $(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
@ -385,12 +335,37 @@ ifneq ($(OSNAME),windows)
$(install-file) $(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_DIR)/%.diz $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_DIR)/%.diz
$(install-file) $(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(C2_DIR)/%.diz
$(install-file)
$(EXPORT_SERVER_DIR)/64/%.diz: $(C2_DIR)/%.diz $(EXPORT_SERVER_DIR)/64/%.diz: $(C2_DIR)/%.diz
$(install-file) $(install-file)
endif endif
# Client (C1)
ifeq ($(JVM_VARIANT_CLIENT), true) ifeq ($(JVM_VARIANT_CLIENT), true)
# Common
$(EXPORT_CLIENT_DIR)/%.diz: $(C1_DIR)/%.diz
$(install-file)
$(EXPORT_LIB_DIR)/%.jar: $(C1_DIR)/../generated/%.jar
$(install-file)
$(EXPORT_INCLUDE_DIR)/%: $(C1_DIR)/../generated/jvmtifiles/%
$(install-file)
# Windows
$(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll
$(install-file)
$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
$(install-file)
$(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map
$(install-file)
$(EXPORT_LIB_DIR)/%.lib: $(C1_DIR)/%.lib
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_DIR)/%.diz
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_DIR)/%.dll
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_DIR)/%.pdb
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.map: $(C1_DIR)/%.map
$(install-file)
# Unix
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file) $(install-file)
$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) $(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
@ -405,40 +380,37 @@ ifneq ($(OSNAME),windows)
$(install-file) $(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_DIR)/%.diz $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_DIR)/%.diz
$(install-file) $(install-file)
$(EXPORT_CLIENT_DIR)/%.diz: $(C1_DIR)/%.diz
$(install-file)
$(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_DIR)/%.diz $(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_DIR)/%.diz
$(install-file) $(install-file)
endif endif
ifeq ($(JVM_VARIANT_ZEROSHARK), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) # Minimal1
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_DIR)/%.debuginfo
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_DIR)/%.diz
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_DIR)/%.diz
$(install-file)
endif
ifeq ($(JVM_VARIANT_ZERO), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_DIR)/%.diz
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_DIR)/%.diz
$(install-file)
endif
ifeq ($(JVM_VARIANT_MINIMAL1), true) ifeq ($(JVM_VARIANT_MINIMAL1), true)
# Common
$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
$(install-file)
$(EXPORT_LIB_DIR)/%.jar: $(MINIMAL1_DIR)/../generated/%.jar
$(install-file)
$(EXPORT_INCLUDE_DIR)/%: $(MINIMAL1_DIR)/../generated/jvmtifiles/%
$(install-file)
# Windows
$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll
$(install-file)
$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb
$(install-file)
$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map
$(install-file)
$(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_DIR)/%.lib
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb
$(install-file)
$(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_DIR)/%.map
$(install-file)
# Unix
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file) $(install-file)
$(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) $(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
@ -453,20 +425,53 @@ ifneq ($(OSNAME),windows)
$(install-file) $(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
$(install-file) $(install-file)
$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
$(install-file)
$(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz
$(install-file) $(install-file)
endif endif
# Zero
ifeq ($(JVM_VARIANT_ZERO), true)
# Common
$(EXPORT_LIB_DIR)/%.jar: $(ZERO_DIR)/../generated/%.jar
$(install-file)
$(EXPORT_INCLUDE_DIR)/%: $(ZERO_DIR)/../generated/jvmtifiles/%
$(install-file)
# Unix
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_DIR)/%.diz
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_DIR)/%.diz
$(install-file)
endif endif
# Jar file (sa-jdi.jar) # Shark
$(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar ifeq ($(JVM_VARIANT_ZEROSHARK), true)
# Common
$(EXPORT_LIB_DIR)/%.jar: $(SHARK_DIR)/../generated/%.jar
$(install-file) $(install-file)
$(EXPORT_INCLUDE_DIR)/%: $(SHARK_DIR)/../generated/jvmtifiles/%
# Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h, jfr.h)
$(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
$(install-file) $(install-file)
# Unix
$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_DIR)/%.debuginfo
$(install-file)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_DIR)/%.diz
$(install-file)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
$(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_DIR)/%.diz
$(install-file)
endif
$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/% $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
$(install-file) $(install-file)
@ -541,11 +546,11 @@ generic_test:
@$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help
# C2 test targets # C2 test targets
test_product test_optimized test_fastdebug test_jvmg: test_product test_optimized test_fastdebug test_debug:
@$(MAKE) generic_test ALTJVM_DIR="$(C2_DIR)/$(@:test_%=%)" @$(MAKE) generic_test ALTJVM_DIR="$(C2_DIR)/$(@:test_%=%)"
# C1 test targets # C1 test targets
test_product1 test_optimized1 test_fastdebug1 test_jvmg1: test_product1 test_optimized1 test_fastdebug1 test_debug1:
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
@$(MAKE) generic_test ALTJVM_DIR="$(C1_DIR)/$(@:test_%1=%)" @$(MAKE) generic_test ALTJVM_DIR="$(C1_DIR)/$(@:test_%1=%)"
else else
@ -553,15 +558,15 @@ test_product1 test_optimized1 test_fastdebug1 test_jvmg1:
endif endif
# Zero test targets # Zero test targets
test_productzero test_optimizedzero test_fastdebugzero test_jvmgzero: test_productzero test_optimizedzero test_fastdebugzero test_debugzero:
@$(MAKE) generic_test ALTJVM_DIR="$(ZERO_DIR)/$(@:test_%zero=%)" @$(MAKE) generic_test ALTJVM_DIR="$(ZERO_DIR)/$(@:test_%zero=%)"
# Shark test targets # Shark test targets
test_productshark test_optimizedshark test_fastdebugshark test_jvmgshark: test_productshark test_optimizedshark test_fastdebugshark test_debugshark:
@$(MAKE) generic_test ALTJVM_DIR="$(SHARK_DIR)/$(@:test_%shark=%)" @$(MAKE) generic_test ALTJVM_DIR="$(SHARK_DIR)/$(@:test_%shark=%)"
# Minimal1 test targets # Minimal1 test targets
test_productminimal1 test_optimizedminimal1 test_fastdebugminimal1 test_jvmgminimal1: test_productminimal1 test_optimizedminimal1 test_fastdebugminimal1 test_debugminimal1:
@$(MAKE) generic_test ALTJVM_DIR="$(MINIMAL1_DIR)/$(@:test_%minimal1=%)" @$(MAKE) generic_test ALTJVM_DIR="$(MINIMAL1_DIR)/$(@:test_%minimal1=%)"
@ -637,7 +642,7 @@ target_help:
@$(ECHO) "world: Same as: all create_jdk" @$(ECHO) "world: Same as: all create_jdk"
@$(ECHO) "all_product: Same as: product product1 export_product" @$(ECHO) "all_product: Same as: product product1 export_product"
@$(ECHO) "all_fastdebug: Same as: fastdebug fastdebug1 export_fastdebug" @$(ECHO) "all_fastdebug: Same as: fastdebug fastdebug1 export_fastdebug"
@$(ECHO) "all_debug: Same as: jvmg jvmg1 export_debug" @$(ECHO) "all_debug: Same as: debug debug1 export_debug"
@$(ECHO) "all_optimized: Same as: optimized optimized1 export_optimized" @$(ECHO) "all_optimized: Same as: optimized optimized1 export_optimized"
@$(ECHO) "clean: Clean all areas" @$(ECHO) "clean: Clean all areas"
@$(ECHO) "export_product: Export product files to EXPORT_PATH" @$(ECHO) "export_product: Export product files to EXPORT_PATH"
@ -741,6 +746,23 @@ include $(GAMMADIR)/make/$(OSNAME)/makefiles/universal.gmk
endif endif
endif endif
# Compatibility for transition to new naming
warn_jvmg_deprecated:
echo "Warning: The jvmg target has been replaced with debug"
echo "Warning: Please update your usage"
jvmg: warn_jvmg_deprecated debug
jvmg1: warn_jvmg_deprecated debug1
jvmgminimal1: warn_jvmg_deprecated debugminimal1
jvmgcore: warn_jvmg_deprecated debugcore
jvmgzero: warn_jvmg_deprecated debugzero
jvmgshark: warn_jvmg_deprecated debugshark
# JPRT rule to build this workspace # JPRT rule to build this workspace
include $(GAMMADIR)/make/jprt.gmk include $(GAMMADIR)/make/jprt.gmk

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -142,55 +142,43 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# #
# debug compiler2 <os>_<arch>_compiler2/debug # debug compiler2 <os>_<arch>_compiler2/debug
# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug # fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
# jvmg compiler2 <os>_<arch>_compiler2/jvmg
# optimized compiler2 <os>_<arch>_compiler2/optimized # optimized compiler2 <os>_<arch>_compiler2/optimized
# profiled compiler2 <os>_<arch>_compiler2/profiled
# product compiler2 <os>_<arch>_compiler2/product # product compiler2 <os>_<arch>_compiler2/product
# #
# debug1 compiler1 <os>_<arch>_compiler1/debug # debug1 compiler1 <os>_<arch>_compiler1/debug
# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug # fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
# optimized1 compiler1 <os>_<arch>_compiler1/optimized # optimized1 compiler1 <os>_<arch>_compiler1/optimized
# profiled1 compiler1 <os>_<arch>_compiler1/profiled
# product1 compiler1 <os>_<arch>_compiler1/product # product1 compiler1 <os>_<arch>_compiler1/product
# #
# debugcore core <os>_<arch>_core/debug # debugcore core <os>_<arch>_core/debug
# fastdebugcore core <os>_<arch>_core/fastdebug # fastdebugcore core <os>_<arch>_core/fastdebug
# jvmgcore core <os>_<arch>_core/jvmg
# optimizedcore core <os>_<arch>_core/optimized # optimizedcore core <os>_<arch>_core/optimized
# profiledcore core <os>_<arch>_core/profiled
# productcore core <os>_<arch>_core/product # productcore core <os>_<arch>_core/product
# #
# debugzero zero <os>_<arch>_zero/debug # debugzero zero <os>_<arch>_zero/debug
# fastdebugzero zero <os>_<arch>_zero/fastdebug # fastdebugzero zero <os>_<arch>_zero/fastdebug
# jvmgzero zero <os>_<arch>_zero/jvmg
# optimizedzero zero <os>_<arch>_zero/optimized # optimizedzero zero <os>_<arch>_zero/optimized
# profiledzero zero <os>_<arch>_zero/profiled
# productzero zero <os>_<arch>_zero/product # productzero zero <os>_<arch>_zero/product
# #
# debugshark shark <os>_<arch>_shark/debug # debugshark shark <os>_<arch>_shark/debug
# fastdebugshark shark <os>_<arch>_shark/fastdebug # fastdebugshark shark <os>_<arch>_shark/fastdebug
# jvmgshark shark <os>_<arch>_shark/jvmg
# optimizedshark shark <os>_<arch>_shark/optimized # optimizedshark shark <os>_<arch>_shark/optimized
# profiledshark shark <os>_<arch>_shark/profiled
# productshark shark <os>_<arch>_shark/product # productshark shark <os>_<arch>_shark/product
# #
# fastdebugminimal1 minimal1 <os>_<arch>_minimal1/fastdebug # fastdebugminimal1 minimal1 <os>_<arch>_minimal1/fastdebug
# jvmgminimal1 minimal1 <os>_<arch>_minimal1/jvmg # debugminimal1 minimal1 <os>_<arch>_minimal1/debug
# productminimal1 minimal1 <os>_<arch>_minimal1/product # productminimal1 minimal1 <os>_<arch>_minimal1/product
# #
# What you get with each target: # What you get with each target:
# #
# debug* - "thin" libjvm - debug info linked into the gamma launcher # debug* - debug compile with asserts enabled
# fastdebug* - optimized compile, but with asserts enabled # fastdebug* - optimized compile, but with asserts enabled
# jvmg* - "fat" libjvm - debug info linked into libjvm.so
# optimized* - optimized compile, no asserts # optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT # product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
# This target list needs to be coordinated with the usage message # This target list needs to be coordinated with the usage message
# in the build.sh script: # in the build.sh script:
TARGETS = debug jvmg fastdebug optimized profiled product TARGETS = debug fastdebug optimized product
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
@ -354,15 +342,29 @@ docs: checks
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
# Synonyms for win32-like targets. # Synonyms for win32-like targets.
compiler2: jvmg product compiler2: debug product
compiler1: jvmg1 product1 compiler1: debug1 product1
core: jvmgcore productcore core: debugcore productcore
zero: jvmgzero productzero zero: debugzero productzero
shark: jvmgshark productshark shark: debugshark productshark
warn_jvmg_deprecated:
echo "Warning: The jvmg target has been replaced with debug"
echo "Warning: Please update your usage"
jvmg: warn_jvmg_deprecated debug
jvmg1: warn_jvmg_deprecated debug1
jvmgcore: warn_jvmg_deprecated debugcore
jvmgzero: warn_jvmg_deprecated debugzero
jvmgshark: warn_jvmg_deprecated debugshark
clean_docs: clean_docs:
rm -rf $(SUBDIR_DOCS) rm -rf $(SUBDIR_DOCS)

View file

@ -122,7 +122,7 @@ SIMPLE_DIRS = \
$(PLATFORM_DIR)/generated/jvmtifiles \ $(PLATFORM_DIR)/generated/jvmtifiles \
$(PLATFORM_DIR)/generated/dtracefiles $(PLATFORM_DIR)/generated/dtracefiles
TARGETS = debug fastdebug jvmg optimized product profiled TARGETS = debug fastdebug optimized product
SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes. # For dependencies and recursive makes.
@ -279,8 +279,6 @@ flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
$(QUIETLY) ( \ $(QUIETLY) ( \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
echo; \ echo; \
[ "$(TARGET)" = profiled ] && \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
) > $@ ) > $@

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -27,17 +27,16 @@
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make # Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS) DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)) DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
CFLAGS += $(DEBUG_CFLAGS/BYFILE)
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
# Linker mapfile # Linker mapfile
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
_JUNK_ := $(shell echo -e >&2 ""\
"----------------------------------------------------------------------\n" \
"WARNING: 'make debug' is deprecated. It will be removed in the future.\n" \
"Please use 'make jvmg' to build debug JVM. \n" \
"----------------------------------------------------------------------\n")
VERSION = debug VERSION = debug
SYSDEFS += -DASSERT -DDEBUG SYSDEFS += -DASSERT
PICFLAGS = DEFAULT PICFLAGS = DEFAULT

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -146,9 +146,6 @@ else
LIBRARY_SUFFIX=so LIBRARY_SUFFIX=so
endif endif
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
VM_DEBUG=jvmg
EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so # client and server subdirectories have symbolic links to ../libjsig.so

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2012 Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -59,5 +59,5 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
VERSION = optimized VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG SYSDEFS += -DASSERT
PICFLAGS = DEFAULT PICFLAGS = DEFAULT

View file

@ -1,42 +0,0 @@
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Sets make macros for making debug version of VM
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT

View file

@ -1,30 +0,0 @@
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Sets make macros for making profiled version of Gamma VM
# (It is also optimized.)
CFLAGS += -pg
AOUT_FLAGS += -pg
LDNOMAP = true

View file

@ -187,7 +187,7 @@ Src_Dirs/ZERO := $(CORE_PATHS)
Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS) Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS)
Src_Dirs := $(Src_Dirs/$(TYPE)) Src_Dirs := $(Src_Dirs/$(TYPE))
COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\* COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*
COMPILER1_SPECIFIC_FILES := c1_\* COMPILER1_SPECIFIC_FILES := c1_\*
SHARK_SPECIFIC_FILES := shark SHARK_SPECIFIC_FILES := shark
ZERO_SPECIFIC_FILES := zero ZERO_SPECIFIC_FILES := zero

View file

@ -133,15 +133,15 @@ jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
# Standard list of jprt build targets for this source tree # Standard list of jprt build targets for this source tree
jprt.build.targets.standard= \ jprt.build.targets.standard= \
${jprt.my.solaris.sparc}-{product|fastdebug|debug}, \ ${jprt.my.solaris.sparc}-{product|fastdebug}, \
${jprt.my.solaris.sparcv9}-{product|fastdebug|debug}, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}, \
${jprt.my.solaris.i586}-{product|fastdebug|debug}, \ ${jprt.my.solaris.i586}-{product|fastdebug}, \
${jprt.my.solaris.x64}-{product|fastdebug|debug}, \ ${jprt.my.solaris.x64}-{product|fastdebug}, \
${jprt.my.linux.i586}-{product|fastdebug|debug}, \ ${jprt.my.linux.i586}-{product|fastdebug}, \
${jprt.my.linux.x64}-{product|fastdebug}, \ ${jprt.my.linux.x64}-{product|fastdebug}, \
${jprt.my.macosx.x64}-{product|fastdebug|debug}, \ ${jprt.my.macosx.x64}-{product|fastdebug}, \
${jprt.my.windows.i586}-{product|fastdebug|debug}, \ ${jprt.my.windows.i586}-{product|fastdebug}, \
${jprt.my.windows.x64}-{product|fastdebug|debug}, \ ${jprt.my.windows.x64}-{product|fastdebug}, \
${jprt.my.linux.armvh}-{product|fastdebug} ${jprt.my.linux.armvh}-{product|fastdebug}
jprt.build.targets.open= \ jprt.build.targets.open= \
@ -150,7 +150,7 @@ jprt.build.targets.open= \
${jprt.my.linux.x64}-{productOpen} ${jprt.my.linux.x64}-{productOpen}
jprt.build.targets.embedded= \ jprt.build.targets.embedded= \
${jprt.my.linux.i586}-{productEmb|fastdebugEmb|debugEmb}, \ ${jprt.my.linux.i586}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.ppc}-{productEmb|fastdebugEmb}, \ ${jprt.my.linux.ppc}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.ppcv2}-{productEmb|fastdebugEmb}, \ ${jprt.my.linux.ppcv2}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.ppcsflt}-{productEmb|fastdebugEmb}, \ ${jprt.my.linux.ppcsflt}-{productEmb|fastdebugEmb}, \
@ -174,21 +174,18 @@ jprt.my.solaris.sparc.test.targets= \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark, \
${jprt.my.solaris.sparc}-product-{c1|c2}-runThese, \ ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese, \
${jprt.my.solaris.sparc}-fastdebug-c1-runThese_Xshare, \ ${jprt.my.solaris.sparc}-fastdebug-c1-runThese_Xshare, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_default, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_CMS, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_CMS, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_G1, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_G1, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParOldGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParOldGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_default, \
${jprt.my.solaris.sparc}-{product|fastdebug}-c2-jbb_default_nontiered, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-jbb_default_nontiered, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \
${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \ ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \
@ -201,21 +198,18 @@ jprt.my.solaris.sparcv9.test.targets= \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \
${jprt.my.solaris.sparcv9}-product-c2-runThese, \ ${jprt.my.solaris.sparcv9}-product-c2-runThese, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_default, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_G1, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_G1, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParOldGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_default, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_SerialGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_SerialGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParallelGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParallelGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParNewGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParNewGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_CMS, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_CMS, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_G1, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParOldGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default_nontiered, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default_nontiered, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_SerialGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_SerialGC, \
${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_ParallelGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_ParallelGC, \
@ -229,21 +223,18 @@ jprt.my.solaris.x64.test.targets= \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \
${jprt.my.solaris.x64}-product-c2-runThese, \ ${jprt.my.solaris.x64}-product-c2-runThese, \
${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \ ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_default, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_G1, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_G1, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_default, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_CMS, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_CMS, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_G1, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_SerialGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_SerialGC, \
${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
@ -258,28 +249,24 @@ jprt.my.solaris.i586.test.targets= \
${jprt.my.solaris.i586}-product-{c1|c2}-runThese_Xcomp, \ ${jprt.my.solaris.i586}-product-{c1|c2}-runThese_Xcomp, \
${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xcomp, \ ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xcomp, \
${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xshare, \ ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xshare, \
${jprt.my.solaris.i586}-product-c1-GCBasher_default, \
${jprt.my.solaris.i586}-product-c1-GCBasher_SerialGC, \ ${jprt.my.solaris.i586}-product-c1-GCBasher_SerialGC, \
${jprt.my.solaris.i586}-product-c1-GCBasher_ParallelGC, \ ${jprt.my.solaris.i586}-product-c1-GCBasher_ParallelGC, \
${jprt.my.solaris.i586}-product-c1-GCBasher_ParNewGC, \ ${jprt.my.solaris.i586}-product-c1-GCBasher_ParNewGC, \
${jprt.my.solaris.i586}-product-c1-GCBasher_CMS, \ ${jprt.my.solaris.i586}-product-c1-GCBasher_CMS, \
${jprt.my.solaris.i586}-product-c1-GCBasher_G1, \ ${jprt.my.solaris.i586}-product-c1-GCBasher_G1, \
${jprt.my.solaris.i586}-product-c1-GCBasher_ParOldGC, \ ${jprt.my.solaris.i586}-product-c1-GCBasher_ParOldGC, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_default, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_SerialGC, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParallelGC, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParNewGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParNewGC, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_CMS, \ ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_CMS, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_G1, \ ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_G1, \
${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParOldGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParOldGC, \
${jprt.my.solaris.i586}-product-c1-GCOld_default, \
${jprt.my.solaris.i586}-product-c1-GCOld_SerialGC, \ ${jprt.my.solaris.i586}-product-c1-GCOld_SerialGC, \
${jprt.my.solaris.i586}-product-c1-GCOld_ParallelGC, \ ${jprt.my.solaris.i586}-product-c1-GCOld_ParallelGC, \
${jprt.my.solaris.i586}-product-c1-GCOld_ParNewGC, \ ${jprt.my.solaris.i586}-product-c1-GCOld_ParNewGC, \
${jprt.my.solaris.i586}-product-c1-GCOld_CMS, \ ${jprt.my.solaris.i586}-product-c1-GCOld_CMS, \
${jprt.my.solaris.i586}-product-c1-GCOld_G1, \ ${jprt.my.solaris.i586}-product-c1-GCOld_G1, \
${jprt.my.solaris.i586}-product-c1-GCOld_ParOldGC, \ ${jprt.my.solaris.i586}-product-c1-GCOld_ParOldGC, \
${jprt.my.solaris.i586}-fastdebug-c2-jbb_default, \
${jprt.my.solaris.i586}-fastdebug-c2-jbb_default_nontiered, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_default_nontiered, \
${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParallelGC, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParallelGC, \
${jprt.my.solaris.i586}-fastdebug-c2-jbb_CMS, \ ${jprt.my.solaris.i586}-fastdebug-c2-jbb_CMS, \
@ -293,21 +280,19 @@ jprt.my.linux.i586.test.targets = \
${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \ ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \
${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \ ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \
${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \ ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \
${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_default, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_G1, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_G1, \
${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParOldGC, \ ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParOldGC, \
${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_default, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_SerialGC, \
${jprt.my.linux.i586}-{product|fastdebug}-c2-jbb_default_nontiered, \ ${jprt.my.linux.i586}-{product|fastdebug}-c2-jbb_default_nontiered, \
${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \
${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \
@ -318,21 +303,18 @@ jprt.my.linux.x64.test.targets = \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_default, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_G1, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_G1, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_default, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_CMS, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_CMS, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_G1, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_G1, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_G1, \
@ -342,21 +324,18 @@ jprt.my.macosx.x64.test.targets = \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98_nontiered, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-scimark, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-scimark, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_default, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_G1, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_G1, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_default, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_CMS, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_CMS, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_G1, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_G1, \ ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_G1, \
@ -369,14 +348,12 @@ jprt.my.windows.i586.test.targets = \
${jprt.my.windows.i586}-product-{c1|c2}-runThese, \ ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \
${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \ ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \
${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \ ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \
${jprt.my.windows.i586}-product-{c1|c2}-GCOld_default, \
${jprt.my.windows.i586}-product-{c1|c2}-GCOld_SerialGC, \ ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_SerialGC, \
${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParallelGC, \ ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParallelGC, \
${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParNewGC, \ ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParNewGC, \
@ -396,14 +373,12 @@ jprt.my.windows.x64.test.targets = \
${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \
${jprt.my.windows.x64}-product-c2-runThese, \ ${jprt.my.windows.x64}-product-c2-runThese, \
${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \ ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_default, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_G1, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_G1, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_default, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
@ -419,7 +394,7 @@ jprt.my.windows.x64.test.targets = \
# Some basic "smoke" tests for OpenJDK builds # Some basic "smoke" tests for OpenJDK builds
jprt.test.targets.open = \ jprt.test.targets.open = \
${jprt.my.solaris.x64}-{productOpen|debugOpen|fastdebugOpen}-c2-jvm98, \ ${jprt.my.solaris.x64}-{productOpen|fastdebugOpen}-c2-jvm98, \
${jprt.my.solaris.i586}-{productOpen|fastdebugOpen}-c2-jvm98, \ ${jprt.my.solaris.i586}-{productOpen|fastdebugOpen}-c2-jvm98, \
${jprt.my.linux.x64}-{productOpen|fastdebugOpen}-c2-jvm98 ${jprt.my.linux.x64}-{productOpen|fastdebugOpen}-c2-jvm98

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -142,55 +142,42 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# #
# debug compiler2 <os>_<arch>_compiler2/debug # debug compiler2 <os>_<arch>_compiler2/debug
# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug # fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
# jvmg compiler2 <os>_<arch>_compiler2/jvmg
# optimized compiler2 <os>_<arch>_compiler2/optimized # optimized compiler2 <os>_<arch>_compiler2/optimized
# profiled compiler2 <os>_<arch>_compiler2/profiled
# product compiler2 <os>_<arch>_compiler2/product # product compiler2 <os>_<arch>_compiler2/product
# #
# debug1 compiler1 <os>_<arch>_compiler1/debug # debug1 compiler1 <os>_<arch>_compiler1/debug
# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug # fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
# optimized1 compiler1 <os>_<arch>_compiler1/optimized # optimized1 compiler1 <os>_<arch>_compiler1/optimized
# profiled1 compiler1 <os>_<arch>_compiler1/profiled
# product1 compiler1 <os>_<arch>_compiler1/product # product1 compiler1 <os>_<arch>_compiler1/product
# #
# debugcore core <os>_<arch>_core/debug # debugcore core <os>_<arch>_core/debug
# fastdebugcore core <os>_<arch>_core/fastdebug # fastdebugcore core <os>_<arch>_core/fastdebug
# jvmgcore core <os>_<arch>_core/jvmg
# optimizedcore core <os>_<arch>_core/optimized # optimizedcore core <os>_<arch>_core/optimized
# profiledcore core <os>_<arch>_core/profiled
# productcore core <os>_<arch>_core/product # productcore core <os>_<arch>_core/product
# #
# debugzero zero <os>_<arch>_zero/debug # debugzero zero <os>_<arch>_zero/debug
# fastdebugzero zero <os>_<arch>_zero/fastdebug # fastdebugzero zero <os>_<arch>_zero/fastdebug
# jvmgzero zero <os>_<arch>_zero/jvmg
# optimizedzero zero <os>_<arch>_zero/optimized # optimizedzero zero <os>_<arch>_zero/optimized
# profiledzero zero <os>_<arch>_zero/profiled
# productzero zero <os>_<arch>_zero/product # productzero zero <os>_<arch>_zero/product
# #
# debugshark shark <os>_<arch>_shark/debug # debugshark shark <os>_<arch>_shark/debug
# fastdebugshark shark <os>_<arch>_shark/fastdebug # fastdebugshark shark <os>_<arch>_shark/fastdebug
# jvmgshark shark <os>_<arch>_shark/jvmg
# optimizedshark shark <os>_<arch>_shark/optimized # optimizedshark shark <os>_<arch>_shark/optimized
# profiledshark shark <os>_<arch>_shark/profiled
# productshark shark <os>_<arch>_shark/product # productshark shark <os>_<arch>_shark/product
# #
# fastdebugminimal1 minimal1 <os>_<arch>_minimal1/fastdebug # fastdebugminimal1 minimal1 <os>_<arch>_minimal1/fastdebug
# jvmgminimal1 minimal1 <os>_<arch>_minimal1/jvmg
# productminimal1 minimal1 <os>_<arch>_minimal1/product # productminimal1 minimal1 <os>_<arch>_minimal1/product
# #
# What you get with each target: # What you get with each target:
# #
# debug* - "thin" libjvm - debug info linked into the gamma launcher # debug* - debug compile with asserts enabled
# fastdebug* - optimized compile, but with asserts enabled # fastdebug* - optimized compile, but with asserts enabled
# jvmg* - "fat" libjvm - debug info linked into libjvm.so
# optimized* - optimized compile, no asserts # optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT # product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
# This target list needs to be coordinated with the usage message # This target list needs to be coordinated with the usage message
# in the build.sh script: # in the build.sh script:
TARGETS = debug jvmg fastdebug optimized profiled product TARGETS = debug fastdebug optimized product
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
@ -357,15 +344,29 @@ docs: checks
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
# Synonyms for win32-like targets. # Synonyms for win32-like targets.
compiler2: jvmg product compiler2: debug product
compiler1: jvmg1 product1 compiler1: debug1 product1
core: jvmgcore productcore core: debugcore productcore
zero: jvmgzero productzero zero: debugzero productzero
shark: jvmgshark productshark shark: debugshark productshark
warn_jvmg_deprecated:
echo "Warning: The jvmg target has been replaced with debug"
echo "Warning: Please update your usage"
jvmg: warn_jvmg_deprecated debug
jvmg1: warn_jvmg_deprecated debug1
jvmgcore: warn_jvmg_deprecated debugcore
jvmgzero: warn_jvmg_deprecated debugzero
jvmgshark: warn_jvmg_deprecated debugshark
clean_docs: clean_docs:
rm -rf $(SUBDIR_DOCS) rm -rf $(SUBDIR_DOCS)

View file

@ -117,7 +117,7 @@ SIMPLE_DIRS = \
$(PLATFORM_DIR)/generated/adfiles \ $(PLATFORM_DIR)/generated/adfiles \
$(PLATFORM_DIR)/generated/jvmtifiles $(PLATFORM_DIR)/generated/jvmtifiles
TARGETS = debug fastdebug jvmg optimized product profiled TARGETS = debug fastdebug optimized product
SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes. # For dependencies and recursive makes.
@ -284,8 +284,6 @@ flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
$(QUIETLY) ( \ $(QUIETLY) ( \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
echo; \ echo; \
[ "$(TARGET)" = profiled ] && \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
) > $@ ) > $@

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -27,17 +27,16 @@
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make # Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS) DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)) DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
CFLAGS += $(DEBUG_CFLAGS/BYFILE)
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
# Linker mapfile # Linker mapfile
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
_JUNK_ := $(shell echo -e >&2 ""\
"----------------------------------------------------------------------\n" \
"WARNING: 'make debug' is deprecated. It will be removed in the future.\n" \
"Please use 'make jvmg' to build debug JVM. \n" \
"----------------------------------------------------------------------\n")
VERSION = debug VERSION = debug
SYSDEFS += -DASSERT -DDEBUG SYSDEFS += -DASSERT
PICFLAGS = DEFAULT PICFLAGS = DEFAULT

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -240,9 +240,6 @@ JDK_INCLUDE_SUBDIR=linux
# Library suffix # Library suffix
LIBRARY_SUFFIX=so LIBRARY_SUFFIX=so
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
VM_DEBUG=jvmg
EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so # client and server subdirectories have symbolic links to ../libjsig.so

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -59,5 +59,5 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
VERSION = optimized VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG SYSDEFS += -DASSERT
PICFLAGS = DEFAULT PICFLAGS = DEFAULT

View file

@ -1,42 +0,0 @@
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Sets make macros for making debug version of VM
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT

View file

@ -1,30 +0,0 @@
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Sets make macros for making profiled version of Gamma VM
# (It is also optimized.)
CFLAGS += -pg
AOUT_FLAGS += -pg
LDNOMAP = true

View file

@ -189,7 +189,7 @@ Src_Dirs/ZERO := $(CORE_PATHS)
Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS) Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS)
Src_Dirs := $(Src_Dirs/$(TYPE)) Src_Dirs := $(Src_Dirs/$(TYPE))
COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\* COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*
COMPILER1_SPECIFIC_FILES := c1_\* COMPILER1_SPECIFIC_FILES := c1_\*
SHARK_SPECIFIC_FILES := shark SHARK_SPECIFIC_FILES := shark
ZERO_SPECIFIC_FILES := zero ZERO_SPECIFIC_FILES := zero

View file

@ -120,37 +120,29 @@ endif
# #
# debug compiler2 <os>_<arch>_compiler2/debug # debug compiler2 <os>_<arch>_compiler2/debug
# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug # fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
# jvmg compiler2 <os>_<arch>_compiler2/jvmg
# optimized compiler2 <os>_<arch>_compiler2/optimized # optimized compiler2 <os>_<arch>_compiler2/optimized
# profiled compiler2 <os>_<arch>_compiler2/profiled
# product compiler2 <os>_<arch>_compiler2/product # product compiler2 <os>_<arch>_compiler2/product
# #
# debug1 compiler1 <os>_<arch>_compiler1/debug # debug1 compiler1 <os>_<arch>_compiler1/debug
# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug # fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
# optimized1 compiler1 <os>_<arch>_compiler1/optimized # optimized1 compiler1 <os>_<arch>_compiler1/optimized
# profiled1 compiler1 <os>_<arch>_compiler1/profiled
# product1 compiler1 <os>_<arch>_compiler1/product # product1 compiler1 <os>_<arch>_compiler1/product
# #
# debugcore core <os>_<arch>_core/debug # debugcore core <os>_<arch>_core/debug
# fastdebugcore core <os>_<arch>_core/fastdebug # fastdebugcore core <os>_<arch>_core/fastdebug
# jvmgcore core <os>_<arch>_core/jvmg
# optimizedcore core <os>_<arch>_core/optimized # optimizedcore core <os>_<arch>_core/optimized
# profiledcore core <os>_<arch>_core/profiled
# productcore core <os>_<arch>_core/product # productcore core <os>_<arch>_core/product
# #
# What you get with each target: # What you get with each target:
# #
# debug* - "thin" libjvm - debug info linked into the gamma launcher # debug* - debug compile with asserts enabled
# fastdebug* - optimized compile, but with asserts enabled # fastdebug* - optimized compile, but with asserts enabled
# jvmg* - "fat" libjvm - debug info linked into libjvm.so
# optimized* - optimized compile, no asserts # optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT # product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
# This target list needs to be coordinated with the usage message # This target list needs to be coordinated with the usage message
# in the build.sh script: # in the build.sh script:
TARGETS = debug jvmg fastdebug optimized profiled product TARGETS = debug fastdebug optimized product
SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS)) SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
@ -267,11 +259,21 @@ docs: checks
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
# Synonyms for win32-like targets. # Synonyms for win32-like targets.
compiler2: jvmg product compiler2: debug product
compiler1: jvmg1 product1 compiler1: debug1 product1
core: jvmgcore productcore core: debugcore productcore
warn_jvmg_deprecated:
echo "Warning: The jvmg target has been replaced with debug"
echo "Warning: Please update your usage"
jvmg: warn_jvmg_deprecated debug
jvmg1: warn_jvmg_deprecated debug1
jvmgcore: warn_jvmg_deprecated debugcore
clean_docs: clean_docs:
rm -rf $(SUBDIR_DOCS) rm -rf $(SUBDIR_DOCS)

View file

@ -110,7 +110,7 @@ SIMPLE_DIRS = \
$(PLATFORM_DIR)/generated/adfiles \ $(PLATFORM_DIR)/generated/adfiles \
$(PLATFORM_DIR)/generated/jvmtifiles $(PLATFORM_DIR)/generated/jvmtifiles
TARGETS = debug fastdebug jvmg optimized product profiled TARGETS = debug fastdebug optimized product
SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes. # For dependencies and recursive makes.
@ -274,8 +274,6 @@ flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
$(QUIETLY) ( \ $(QUIETLY) ( \
$(BUILDTREE_COMMENT); \ $(BUILDTREE_COMMENT); \
echo; \ echo; \
[ "$(TARGET)" = profiled ] && \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
) > $@ ) > $@

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -37,7 +37,11 @@ ifeq ($(COMPILER_REV_NUMERIC),508)
endif endif
endif endif
CFLAGS += $(DEBUG_CFLAGS/BYFILE) # _NMT_NOINLINE_ informs NMT that no inlining by Compiler
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
# Linker mapfiles # Linker mapfiles
MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \
@ -47,12 +51,6 @@ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \
# and mustn't be otherwise. # and mustn't be otherwise.
MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
_JUNK_ := $(shell echo >&2 ""\
"-------------------------------------------------------------------------\n" \
"WARNING: 'gnumake debug' is deprecated. It will be removed in the future.\n" \
"Please use 'gnumake jvmg' to build debug JVM. \n" \
"-------------------------------------------------------------------------\n")
VERSION = debug VERSION = debug
SYSDEFS += -DASSERT -DDEBUG SYSDEFS += -DASSERT
PICFLAGS = DEFAULT PICFLAGS = DEFAULT

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -172,9 +172,6 @@ JDK_INCLUDE_SUBDIR=solaris
# Library suffix # Library suffix
LIBRARY_SUFFIX=so LIBRARY_SUFFIX=so
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
VM_DEBUG=jvmg
EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX) # client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -123,5 +123,5 @@ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \
MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
VERSION = optimized VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG -DCHECK_UNHANDLED_OOPS SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS
PICFLAGS = DEFAULT PICFLAGS = DEFAULT

View file

@ -1,56 +0,0 @@
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Sets make macros for making debug version of VM
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
ifeq ("${Platform_compiler}", "sparcWorks")
ifeq ($(COMPILER_REV_NUMERIC),508)
# SS11 SEGV when compiling with -g and -xarch=v8, using different backend
DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0
DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0
endif
endif
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
# Linker mapfiles
MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \
$(GAMMADIR)/make/solaris/makefiles/mapfile-vers-debug
# This mapfile is only needed when compiling with dtrace support,
# and mustn't be otherwise.
MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT

View file

@ -1,44 +0,0 @@
#
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Sets make macros for making profiled version of Gamma VM
# (It is also optimized.)
CFLAGS += -pg
# On x86 Solaris 2.6, 7, and 8 if LD_LIBRARY_PATH has /usr/lib in it then
# adlc linked with -pg puts out empty header files. To avoid linking adlc
# with -pg the profile flag is split out separately and used in rules.make
PROF_AOUT_FLAGS += -pg
# To do a profiled build of the product, such as for generating the
# reordering file, set PROFILE_PRODUCT. Otherwise the reordering file will
# contain references to functions which are not defined in the PRODUCT build.
ifdef PROFILE_PRODUCT
SYSDEFS += -DPRODUCT
endif
LDNOMAP = true

View file

@ -202,7 +202,7 @@ Src_Dirs/ZERO := $(CORE_PATHS)
Src_Dirs/SHARK := $(CORE_PATHS) Src_Dirs/SHARK := $(CORE_PATHS)
Src_Dirs := $(Src_Dirs/$(TYPE)) Src_Dirs := $(Src_Dirs/$(TYPE))
COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\* COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*
COMPILER1_SPECIFIC_FILES := c1_\* COMPILER1_SPECIFIC_FILES := c1_\*
SHARK_SPECIFIC_FILES := shark SHARK_SPECIFIC_FILES := shark
ZERO_SPECIFIC_FILES := zero ZERO_SPECIFIC_FILES := zero

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -235,18 +235,14 @@ product release optimized: checks $(variantDir) $(variantDir)\local.make sanity
cd $(variantDir) cd $(variantDir)
nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH) nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product ARCH=$(ARCH)
# The debug or jvmg (all the same thing) is an optional build # The debug build is an optional build
debug jvmg: checks $(variantDir) $(variantDir)\local.make sanity debug: checks $(variantDir) $(variantDir)\local.make sanity
cd $(variantDir) cd $(variantDir)
nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH) nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=debug ARCH=$(ARCH)
fastdebug: checks $(variantDir) $(variantDir)\local.make sanity fastdebug: checks $(variantDir) $(variantDir)\local.make sanity
cd $(variantDir) cd $(variantDir)
nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH) nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=fastdebug ARCH=$(ARCH)
develop: checks $(variantDir) $(variantDir)\local.make sanity
cd $(variantDir)
nmake -nologo -f $(WorkSpace)\make\windows\makefiles\top.make BUILD_FLAVOR=product DEVELOP=1 ARCH=$(ARCH)
# target to create just the directory structure # target to create just the directory structure
tree: checks $(variantDir) $(variantDir)\local.make sanity tree: checks $(variantDir) $(variantDir)\local.make sanity
mkdir $(variantDir)\product mkdir $(variantDir)\product

View file

@ -114,7 +114,7 @@ case "${TYPE}" in
"shark") Src_Dirs="${CORE_PATHS}" ;; "shark") Src_Dirs="${CORE_PATHS}" ;;
esac esac
COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp chaitin* c2_* runtime_*" COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"
COMPILER1_SPECIFIC_FILES="c1_*" COMPILER1_SPECIFIC_FILES="c1_*"
SHARK_SPECIFIC_FILES="shark" SHARK_SPECIFIC_FILES="shark"
ZERO_SPECIFIC_FILES="zero" ZERO_SPECIFIC_FILES="zero"

View file

@ -209,8 +209,6 @@ endif
ifneq (,$(findstring MINGW,$(SYSTEM_UNAME))) ifneq (,$(findstring MINGW,$(SYSTEM_UNAME)))
USING_MINGW=true USING_MINGW=true
endif endif
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
VM_DEBUG=debug
# Windows wants particular paths due to nmake (must be after macros defined) # Windows wants particular paths due to nmake (must be after macros defined)
# It is important that gnumake invokes nmake with C:\\...\\ formated # It is important that gnumake invokes nmake with C:\\...\\ formated

View file

@ -31,11 +31,7 @@ COMMONSRC=$(WorkSpace)\src
ALTSRC=$(WorkSpace)\src\closed ALTSRC=$(WorkSpace)\src\closed
!ifdef RELEASE !ifdef RELEASE
!ifdef DEVELOP
CXX_FLAGS=$(CXX_FLAGS) /D "DEBUG"
!else
CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT" CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT"
!endif
!else !else
CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT" CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT"
!endif !endif

View file

@ -67,7 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /ML /W3 /WX /Gm /GX /Zi /Od /I "." /I "$(HotSpotWorkSpace)\src\share\vm\opto" /I "$(HotSpotWorkSpace)\src\share\vm\prims" /I "$(HotSpotWorkSpace)\src\share\vm\lookup" /I "$(HotSpotWorkSpace)\src\share\vm\interpreter" /I "$(HotSpotWorkSpace)\src\share\vm\asm" /I "$(HotSpotWorkSpace)\src\share\vm\compiler" /I "$(HotSpotWorkSpace)\src\share\vm\utilities" /I "$(HotSpotWorkSpace)\src\share\vm\code" /I "$(HotSpotWorkSpace)\src\share\vm\oops" /I "$(HotSpotWorkSpace)\src\share\vm\runtime" /I "$(HotSpotWorkSpace)\src\share\vm\memory" /I "$(HotSpotWorkSpace)\src\share\vm\libadt" /I "$(HotSpotWorkSpace)\src\cpu\i486\vm" /I "$(HotSpotWorkSpace)\src\os\win32\vm" /D "WIN32" /D "DEBUG" /D "_WINDOWS" /D "ASSERT" /Fr /FD /c # ADD CPP /nologo /ML /W3 /WX /Gm /GX /Zi /Od /I "." /I "$(HotSpotWorkSpace)\src\share\vm\opto" /I "$(HotSpotWorkSpace)\src\share\vm\prims" /I "$(HotSpotWorkSpace)\src\share\vm\lookup" /I "$(HotSpotWorkSpace)\src\share\vm\interpreter" /I "$(HotSpotWorkSpace)\src\share\vm\asm" /I "$(HotSpotWorkSpace)\src\share\vm\compiler" /I "$(HotSpotWorkSpace)\src\share\vm\utilities" /I "$(HotSpotWorkSpace)\src\share\vm\code" /I "$(HotSpotWorkSpace)\src\share\vm\oops" /I "$(HotSpotWorkSpace)\src\share\vm\runtime" /I "$(HotSpotWorkSpace)\src\share\vm\memory" /I "$(HotSpotWorkSpace)\src\share\vm\libadt" /I "$(HotSpotWorkSpace)\src\cpu\i486\vm" /I "$(HotSpotWorkSpace)\src\os\win32\vm" /D "WIN32" /D "_WINDOWS" /D "ASSERT" /Fr /FD /c
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe

View file

@ -67,7 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /ML /W3 /WX /Gm /GX /Zi /Od /I "." /I "$(HotSpotWorkSpace)\src\share\vm\opto" /I "$(HotSpotWorkSpace)\src\share\vm\prims" /I "$(HotSpotWorkSpace)\src\share\vm\lookup" /I "$(HotSpotWorkSpace)\src\share\vm\interpreter" /I "$(HotSpotWorkSpace)\src\share\vm\asm" /I "$(HotSpotWorkSpace)\src\share\vm\compiler" /I "$(HotSpotWorkSpace)\src\share\vm\utilities" /I "$(HotSpotWorkSpace)\src\share\vm\code" /I "$(HotSpotWorkSpace)\src\share\vm\oops" /I "$(HotSpotWorkSpace)\src\share\vm\runtime" /I "$(HotSpotWorkSpace)\src\share\vm\memory" /I "$(HotSpotWorkSpace)\src\share\vm\libadt" /I "$(HotSpotWorkSpace)\src\cpu\i486\vm" /I "$(HotSpotWorkSpace)\src\os\win32\vm" /D "WIN32" /D "DEBUG" /D "_WINDOWS" /D "ASSERT" /Fr /FD /c # ADD CPP /nologo /ML /W3 /WX /Gm /GX /Zi /Od /I "." /I "$(HotSpotWorkSpace)\src\share\vm\opto" /I "$(HotSpotWorkSpace)\src\share\vm\prims" /I "$(HotSpotWorkSpace)\src\share\vm\lookup" /I "$(HotSpotWorkSpace)\src\share\vm\interpreter" /I "$(HotSpotWorkSpace)\src\share\vm\asm" /I "$(HotSpotWorkSpace)\src\share\vm\compiler" /I "$(HotSpotWorkSpace)\src\share\vm\utilities" /I "$(HotSpotWorkSpace)\src\share\vm\code" /I "$(HotSpotWorkSpace)\src\share\vm\oops" /I "$(HotSpotWorkSpace)\src\share\vm\runtime" /I "$(HotSpotWorkSpace)\src\share\vm\memory" /I "$(HotSpotWorkSpace)\src\share\vm\libadt" /I "$(HotSpotWorkSpace)\src\cpu\i486\vm" /I "$(HotSpotWorkSpace)\src\os\win32\vm" /D "WIN32" /D "_WINDOWS" /D "ASSERT" /Fr /FD /c
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe

View file

@ -1000,9 +1000,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob();
assert(deopt_blob != NULL, "deoptimization blob must have been created"); assert(deopt_blob != NULL, "deoptimization blob must have been created");
restore_live_registers(sasm); restore_live_registers(sasm);
__ restore();
__ br(Assembler::always, false, Assembler::pt, deopt_blob->unpack_with_reexecution(), relocInfo::runtime_call_type); AddressLiteral dest(deopt_blob->unpack_with_reexecution());
__ delayed()->nop(); __ jump_to(dest, O0);
__ delayed()->restore();
} }
break; break;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -304,7 +304,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// The sender should positively be an nmethod or call_stub. On sparc we might in fact see something else. // The sender should positively be an nmethod or call_stub. On sparc we might in fact see something else.
// The cause of this is because at a save instruction the O7 we get is a leftover from an earlier // The cause of this is because at a save instruction the O7 we get is a leftover from an earlier
// window use. So if a runtime stub creates two frames (common in fastdebug/jvmg) then we see the // window use. So if a runtime stub creates two frames (common in fastdebug/debug) then we see the
// stale pc. So if the sender blob is not something we'd expect we have little choice but to declare // stale pc. So if the sender blob is not something we'd expect we have little choice but to declare
// the stack unwalkable. pd_get_top_frame_for_signal_handler tries to recover from this by unwinding // the stack unwalkable. pd_get_top_frame_for_signal_handler tries to recover from this by unwinding
// that initial frame and retrying. // that initial frame and retrying.

View file

@ -1,5 +1,5 @@
// //
// Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// //
// This code is free software; you can redistribute it and/or modify it // This code is free software; you can redistribute it and/or modify it
@ -8227,6 +8227,21 @@ instruct cadd_cmpLTMask( iRegI p, iRegI q, iRegI y, iRegI tmp, flagsReg ccr ) %{
ins_pipe(cadd_cmpltmask); ins_pipe(cadd_cmpltmask);
%} %}
instruct and_cmpLTMask(iRegI p, iRegI q, iRegI y, flagsReg ccr) %{
match(Set p (AndI (CmpLTMask p q) y));
effect(KILL ccr);
ins_cost(DEFAULT_COST*3);
format %{ "CMP $p,$q\n\t"
"MOV $y,$p\n\t"
"MOVge G0,$p" %}
ins_encode %{
__ cmp($p$$Register, $q$$Register);
__ mov($y$$Register, $p$$Register);
__ movcc(Assembler::greaterEqual, false, Assembler::icc, G0, $p$$Register);
%}
ins_pipe(ialu_reg_reg_ialu);
%}
//----------------------------------------------------------------- //-----------------------------------------------------------------
// Direct raw moves between float and general registers using VIS3. // Direct raw moves between float and general registers using VIS3.

View file

@ -1,5 +1,5 @@
// //
// Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// //
// This code is free software; you can redistribute it and/or modify it // This code is free software; you can redistribute it and/or modify it
@ -2317,30 +2317,6 @@ encode %{
emit_rm(cbuf, 0x3, $p$$reg, tmpReg); emit_rm(cbuf, 0x3, $p$$reg, tmpReg);
%} %}
enc_class enc_cmpLTP_mem(rRegI p, rRegI q, memory mem, eCXRegI tmp) %{ // cadd_cmpLT
int tmpReg = $tmp$$reg;
// SUB $p,$q
emit_opcode(cbuf,0x2B);
emit_rm(cbuf, 0x3, $p$$reg, $q$$reg);
// SBB $tmp,$tmp
emit_opcode(cbuf,0x1B);
emit_rm(cbuf, 0x3, tmpReg, tmpReg);
// AND $tmp,$y
cbuf.set_insts_mark(); // Mark start of opcode for reloc info in mem operand
emit_opcode(cbuf,0x23);
int reg_encoding = tmpReg;
int base = $mem$$base;
int index = $mem$$index;
int scale = $mem$$scale;
int displace = $mem$$disp;
relocInfo::relocType disp_reloc = $mem->disp_reloc();
encode_RegMem(cbuf, reg_encoding, base, index, scale, displace, disp_reloc);
// ADD $p,$tmp
emit_opcode(cbuf,0x03);
emit_rm(cbuf, 0x3, $p$$reg, tmpReg);
%}
enc_class shift_left_long( eRegL dst, eCXRegI shift ) %{ enc_class shift_left_long( eRegL dst, eCXRegI shift ) %{
// TEST shift,32 // TEST shift,32
emit_opcode(cbuf,0xF7); emit_opcode(cbuf,0xF7);
@ -8932,9 +8908,17 @@ instruct cmpLTMask( eCXRegI dst, ncxRegI p, ncxRegI q, eFlagsReg cr ) %{
"CMP $p,$q\n\t" "CMP $p,$q\n\t"
"SETlt $dst\n\t" "SETlt $dst\n\t"
"NEG $dst" %} "NEG $dst" %}
ins_encode( OpcRegReg(0x33,dst,dst), ins_encode %{
OpcRegReg(0x3B,p,q), Register Rp = $p$$Register;
setLT_reg(dst), neg_reg(dst) ); Register Rq = $q$$Register;
Register Rd = $dst$$Register;
Label done;
__ xorl(Rd, Rd);
__ cmpl(Rp, Rq);
__ setb(Assembler::less, Rd);
__ negl(Rd);
%}
ins_pipe(pipe_slow); ins_pipe(pipe_slow);
%} %}
@ -8943,39 +8927,64 @@ instruct cmpLTMask0( rRegI dst, immI0 zero, eFlagsReg cr ) %{
effect(DEF dst, KILL cr); effect(DEF dst, KILL cr);
ins_cost(100); ins_cost(100);
format %{ "SAR $dst,31" %} format %{ "SAR $dst,31\t# cmpLTMask0" %}
opcode(0xC1, 0x7); /* C1 /7 ib */ ins_encode %{
ins_encode( RegOpcImm( dst, 0x1F ) ); __ sarl($dst$$Register, 31);
%}
ins_pipe(ialu_reg); ins_pipe(ialu_reg);
%} %}
/* better to save a register than avoid a branch */
instruct cadd_cmpLTMask( ncxRegI p, ncxRegI q, ncxRegI y, eCXRegI tmp, eFlagsReg cr ) %{ instruct cadd_cmpLTMask(rRegI p, rRegI q, rRegI y, eFlagsReg cr) %{
match(Set p (AddI (AndI (CmpLTMask p q) y) (SubI p q))); match(Set p (AddI (AndI (CmpLTMask p q) y) (SubI p q)));
effect( KILL tmp, KILL cr ); effect(KILL cr);
ins_cost(400); ins_cost(400);
// annoyingly, $tmp has no edges so you cant ask for it in format %{ "SUB $p,$q\t# cadd_cmpLTMask\n\t"
// any format or encoding "JGE done\n\t"
format %{ "SUB $p,$q\n\t" "ADD $p,$y\n"
"SBB ECX,ECX\n\t" "done: " %}
"AND ECX,$y\n\t" ins_encode %{
"ADD $p,ECX" %} Register Rp = $p$$Register;
ins_encode( enc_cmpLTP(p,q,y,tmp) ); Register Rq = $q$$Register;
Register Ry = $y$$Register;
Label done;
__ subl(Rp, Rq);
__ jccb(Assembler::greaterEqual, done);
__ addl(Rp, Ry);
__ bind(done);
%}
ins_pipe(pipe_cmplt);
%}
/* better to save a register than avoid a branch */
instruct and_cmpLTMask(rRegI p, rRegI q, rRegI y, eFlagsReg cr) %{
match(Set y (AndI (CmpLTMask p q) y));
effect(KILL cr);
ins_cost(300);
format %{ "CMPL $p, $q\t# and_cmpLTMask\n\t"
"JLT done\n\t"
"XORL $y, $y\n"
"done: " %}
ins_encode %{
Register Rp = $p$$Register;
Register Rq = $q$$Register;
Register Ry = $y$$Register;
Label done;
__ cmpl(Rp, Rq);
__ jccb(Assembler::less, done);
__ xorl(Ry, Ry);
__ bind(done);
%}
ins_pipe(pipe_cmplt); ins_pipe(pipe_cmplt);
%} %}
/* If I enable this, I encourage spilling in the inner loop of compress. /* If I enable this, I encourage spilling in the inner loop of compress.
instruct cadd_cmpLTMask_mem(ncxRegI p, ncxRegI q, memory y, eCXRegI tmp, eFlagsReg cr) %{ instruct cadd_cmpLTMask_mem(ncxRegI p, ncxRegI q, memory y, eCXRegI tmp, eFlagsReg cr) %{
match(Set p (AddI (AndI (CmpLTMask p q) (LoadI y)) (SubI p q))); match(Set p (AddI (AndI (CmpLTMask p q) (LoadI y)) (SubI p q)));
effect( USE_KILL tmp, KILL cr );
ins_cost(400);
format %{ "SUB $p,$q\n\t"
"SBB ECX,ECX\n\t"
"AND ECX,$y\n\t"
"ADD $p,ECX" %}
ins_encode( enc_cmpLTP_mem(p,q,y,tmp) );
%}
*/ */
//----------Long Instructions------------------------------------------------ //----------Long Instructions------------------------------------------------

View file

@ -1,5 +1,5 @@
// //
// Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// //
// This code is free software; you can redistribute it and/or modify it // This code is free software; you can redistribute it and/or modify it
@ -9434,7 +9434,7 @@ instruct cmpLTMask(rRegI dst, rRegI p, rRegI q, rFlagsReg cr)
match(Set dst (CmpLTMask p q)); match(Set dst (CmpLTMask p q));
effect(KILL cr); effect(KILL cr);
ins_cost(400); // XXX ins_cost(400);
format %{ "cmpl $p, $q\t# cmpLTMask\n\t" format %{ "cmpl $p, $q\t# cmpLTMask\n\t"
"setlt $dst\n\t" "setlt $dst\n\t"
"movzbl $dst, $dst\n\t" "movzbl $dst, $dst\n\t"
@ -9452,37 +9452,63 @@ instruct cmpLTMask0(rRegI dst, immI0 zero, rFlagsReg cr)
match(Set dst (CmpLTMask dst zero)); match(Set dst (CmpLTMask dst zero));
effect(KILL cr); effect(KILL cr);
ins_cost(100); // XXX ins_cost(100);
format %{ "sarl $dst, #31\t# cmpLTMask0" %} format %{ "sarl $dst, #31\t# cmpLTMask0" %}
opcode(0xC1, 0x7); /* C1 /7 ib */ ins_encode %{
ins_encode(reg_opc_imm(dst, 0x1F)); __ sarl($dst$$Register, 31);
%}
ins_pipe(ialu_reg); ins_pipe(ialu_reg);
%} %}
/* Better to save a register than avoid a branch */
instruct cadd_cmpLTMask(rRegI p, rRegI q, rRegI y, rRegI tmp, rFlagsReg cr) instruct cadd_cmpLTMask(rRegI p, rRegI q, rRegI y, rFlagsReg cr)
%{ %{
match(Set p (AddI (AndI (CmpLTMask p q) y) (SubI p q))); match(Set p (AddI (AndI (CmpLTMask p q) y) (SubI p q)));
effect(TEMP tmp, KILL cr); effect(KILL cr);
ins_cost(300);
ins_cost(400); // XXX format %{ "subl $p,$q\t# cadd_cmpLTMask\n\t"
format %{ "subl $p, $q\t# cadd_cmpLTMask1\n\t" "jge done\n\t"
"sbbl $tmp, $tmp\n\t" "addl $p,$y\n"
"andl $tmp, $y\n\t" "done: " %}
"addl $p, $tmp" %}
ins_encode %{ ins_encode %{
Register Rp = $p$$Register; Register Rp = $p$$Register;
Register Rq = $q$$Register; Register Rq = $q$$Register;
Register Ry = $y$$Register; Register Ry = $y$$Register;
Register Rt = $tmp$$Register; Label done;
__ subl(Rp, Rq); __ subl(Rp, Rq);
__ sbbl(Rt, Rt); __ jccb(Assembler::greaterEqual, done);
__ andl(Rt, Ry); __ addl(Rp, Ry);
__ addl(Rp, Rt); __ bind(done);
%} %}
ins_pipe(pipe_cmplt); ins_pipe(pipe_cmplt);
%} %}
/* Better to save a register than avoid a branch */
instruct and_cmpLTMask(rRegI p, rRegI q, rRegI y, rFlagsReg cr)
%{
match(Set y (AndI (CmpLTMask p q) y));
effect(KILL cr);
ins_cost(300);
format %{ "cmpl $p, $q\t# and_cmpLTMask\n\t"
"jlt done\n\t"
"xorl $y, $y\n"
"done: " %}
ins_encode %{
Register Rp = $p$$Register;
Register Rq = $q$$Register;
Register Ry = $y$$Register;
Label done;
__ cmpl(Rp, Rq);
__ jccb(Assembler::less, done);
__ xorl(Ry, Ry);
__ bind(done);
%}
ins_pipe(pipe_cmplt);
%}
//---------- FP Instructions------------------------------------------------ //---------- FP Instructions------------------------------------------------
instruct cmpF_cc_reg(rFlagsRegU cr, regF src1, regF src2) instruct cmpF_cc_reg(rFlagsRegU cr, regF src1, regF src2)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -60,7 +60,7 @@
#define PR_MODEL_LP64 2 #define PR_MODEL_LP64 2
#ifdef COMPILER1 #ifdef COMPILER1
#if defined(DEBUG) || defined(FASTDEBUG) #ifdef ASSERT
/* /*
* To avoid the most part of potential link errors * To avoid the most part of potential link errors
@ -84,7 +84,7 @@ address StubRoutines::_call_stub_return_address = NULL;
StubQueue* AbstractInterpreter::_code = NULL; StubQueue* AbstractInterpreter::_code = NULL;
#endif /* defined(DEBUG) || defined(FASTDEBUG) */ #endif /* ASSERT */
#endif /* COMPILER1 */ #endif /* COMPILER1 */
#define GEN_OFFS(Type,Name) \ #define GEN_OFFS(Type,Name) \

View file

@ -1,42 +0,0 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "opto/chaitin.hpp"
#include "opto/machnode.hpp"
void PhaseRegAlloc::pd_preallocate_hook() {
// no action
}
#ifdef ASSERT
void PhaseRegAlloc::pd_postallocate_verify_hook() {
// no action
}
#endif
// Reconciliation History
// chaitin_solaris.cpp 1.7 99/07/12 23:54:22
// End

View file

@ -1,42 +0,0 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "opto/chaitin.hpp"
#include "opto/machnode.hpp"
void PhaseRegAlloc::pd_preallocate_hook() {
// no action
}
#ifdef ASSERT
void PhaseRegAlloc::pd_postallocate_verify_hook() {
// no action
}
#endif
// Reconciliation History
// chaitin_solaris.cpp 1.7 99/07/12 23:54:22
// End

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -55,14 +55,14 @@
#include "utilities/accessFlags.hpp" #include "utilities/accessFlags.hpp"
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#ifdef COMPILER1 #ifdef COMPILER1
#if defined(DEBUG) || defined(FASTDEBUG) #ifdef ASSERT
/* /*
* To avoid the most part of potential link errors * To avoid the most part of potential link errors
* we link this program with -z nodefs . * we link this program with -z nodefs .
* *
* But for 'debug1' and 'fastdebug1' we still have to provide * But for 'debug1' and 'fastdebug1' we still have to provide
* a particular workaround for the following symbols bellow. * a particular workaround for the following symbols below.
* It will be good to find out a generic way in the future. * It will be good to find out a generic way in the future.
*/ */
@ -79,7 +79,7 @@ address StubRoutines::_call_stub_return_address = NULL;
StubQueue* AbstractInterpreter::_code = NULL; StubQueue* AbstractInterpreter::_code = NULL;
#endif /* defined(DEBUG) || defined(FASTDEBUG) */ #endif /* ASSERT */
#endif /* COMPILER1 */ #endif /* COMPILER1 */
#define GEN_OFFS(Type,Name) \ #define GEN_OFFS(Type,Name) \

View file

@ -1,46 +0,0 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "opto/chaitin.hpp"
#include "opto/machnode.hpp"
void PhaseRegAlloc::pd_preallocate_hook() {
// no action
}
#ifdef ASSERT
void PhaseRegAlloc::pd_postallocate_verify_hook() {
// no action
}
#endif
//Reconciliation History
// 1.1 99/02/12 15:35:26 chaitin_win32.cpp
// 1.2 99/02/18 15:38:56 chaitin_win32.cpp
// 1.4 99/03/09 10:37:48 chaitin_win32.cpp
// 1.6 99/03/25 11:07:44 chaitin_win32.cpp
// 1.8 99/06/22 16:38:58 chaitin_win32.cpp
//End

View file

@ -1,78 +0,0 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "opto/chaitin.hpp"
#include "opto/machnode.hpp"
// Disallow the use of the frame pointer (EBP) for implicit null exceptions
// on win95/98. If we do not do this, the OS gets confused and gives a stack
// error.
void PhaseRegAlloc::pd_preallocate_hook() {
#ifndef _WIN64
if (ImplicitNullChecks && !os::win32::is_nt()) {
for (uint block_num=1; block_num<_cfg._num_blocks; block_num++) {
Block *block = _cfg._blocks[block_num];
Node *block_end = block->end();
if (block_end->is_MachNullCheck() &&
block_end->as_Mach()->ideal_Opcode() != Op_Con) {
// The last instruction in the block is an implicit null check.
// Fix its input so that it does not load into the frame pointer.
_matcher.pd_implicit_null_fixup(block_end->in(1)->as_Mach(),
block_end->as_MachNullCheck()->_vidx);
}
}
}
#else
// WIN64==itanium on XP
#endif
}
#ifdef ASSERT
// Verify that no implicit null check uses the frame pointer (EBP) as
// its register on win95/98. Use of the frame pointer in an implicit
// null check confuses the OS, yielding a stack error.
void PhaseRegAlloc::pd_postallocate_verify_hook() {
#ifndef _WIN64
if (ImplicitNullChecks && !os::win32::is_nt()) {
for (uint block_num=1; block_num<_cfg._num_blocks; block_num++) {
Block *block = _cfg._blocks[block_num];
Node *block_end = block->_nodes[block->_nodes.size()-1];
if (block_end->is_MachNullCheck() && block_end->as_Mach()->ideal_Opcode() != Op_Con) {
// The last instruction in the block is an implicit
// null check. Verify that this instruction does not
// use the frame pointer.
int reg = get_reg_first(block_end->in(1)->in(block_end->as_MachNullCheck()->_vidx));
assert(reg != EBP_num,
"implicit null check using frame pointer on win95/98");
}
}
}
#else
// WIN64==itanium on XP
#endif
}
#endif

View file

@ -4238,9 +4238,6 @@ char * os::native_path(char *path) {
path[3] = '\0'; path[3] = '\0';
} }
#ifdef DEBUG
jio_fprintf(stderr, "sysNativePath: %s\n", path);
#endif DEBUG
return path; return path;
} }

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -116,7 +116,6 @@ OUTFLAGS += -o $@
else #Windows else #Windows
OS = windows OS = windows
CC = gcc CC = gcc
#CPPFLAGS += /D"WIN32" /D"_WINDOWS" /D"DEBUG" /D"NDEBUG"
CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi- CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
CFLAGS += LIBARCH=\"$(LIBARCH)\" CFLAGS += LIBARCH=\"$(LIBARCH)\"
DLDFLAGS += /dll /subsystem:windows /incremental:no \ DLDFLAGS += /dll /subsystem:windows /incremental:no \

View file

@ -938,5 +938,7 @@ void Canonicalizer::do_ProfileCall(ProfileCall* x) {}
void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {} void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {}
void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {} void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {}
void Canonicalizer::do_RangeCheckPredicate(RangeCheckPredicate* x) {} void Canonicalizer::do_RangeCheckPredicate(RangeCheckPredicate* x) {}
#ifdef ASSERT
void Canonicalizer::do_Assert(Assert* x) {} void Canonicalizer::do_Assert(Assert* x) {}
#endif
void Canonicalizer::do_MemBar(MemBar* x) {} void Canonicalizer::do_MemBar(MemBar* x) {}

View file

@ -108,7 +108,9 @@ class Canonicalizer: InstructionVisitor {
virtual void do_RuntimeCall (RuntimeCall* x); virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x); virtual void do_MemBar (MemBar* x);
virtual void do_RangeCheckPredicate(RangeCheckPredicate* x); virtual void do_RangeCheckPredicate(RangeCheckPredicate* x);
#ifdef ASSERT
virtual void do_Assert (Assert* x); virtual void do_Assert (Assert* x);
#endif
}; };
#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP #endif // SHARE_VM_C1_C1_CANONICALIZER_HPP

View file

@ -111,7 +111,9 @@ class ProfileInvoke;
class RuntimeCall; class RuntimeCall;
class MemBar; class MemBar;
class RangeCheckPredicate; class RangeCheckPredicate;
#ifdef ASSERT
class Assert; class Assert;
#endif
// A Value is a reference to the instruction creating the value // A Value is a reference to the instruction creating the value
typedef Instruction* Value; typedef Instruction* Value;

View file

@ -871,12 +871,14 @@ void InstructionPrinter::do_RangeCheckPredicate(RangeCheckPredicate* x) {
} }
} }
#ifdef ASSERT
void InstructionPrinter::do_Assert(Assert* x) { void InstructionPrinter::do_Assert(Assert* x) {
output()->print("assert "); output()->print("assert ");
print_value(x->x()); print_value(x->x());
output()->print(" %s ", cond_name(x->cond())); output()->print(" %s ", cond_name(x->cond()));
print_value(x->y()); print_value(x->y());
} }
#endif
void InstructionPrinter::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { void InstructionPrinter::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {
print_unsafe_object_op(x, "UnsafePrefetchWrite"); print_unsafe_object_op(x, "UnsafePrefetchWrite");

View file

@ -136,7 +136,9 @@ class InstructionPrinter: public InstructionVisitor {
virtual void do_RuntimeCall (RuntimeCall* x); virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x); virtual void do_MemBar (MemBar* x);
virtual void do_RangeCheckPredicate(RangeCheckPredicate* x); virtual void do_RangeCheckPredicate(RangeCheckPredicate* x);
#ifdef ASSERT
virtual void do_Assert (Assert* x); virtual void do_Assert (Assert* x);
#endif
}; };
#endif // PRODUCT #endif // PRODUCT

View file

@ -1778,7 +1778,9 @@ const char * LIR_Op::name() const {
// LIR_OpProfileCall // LIR_OpProfileCall
case lir_profile_call: s = "profile_call"; break; case lir_profile_call: s = "profile_call"; break;
// LIR_OpAssert // LIR_OpAssert
#ifdef ASSERT
case lir_assert: s = "assert"; break; case lir_assert: s = "assert"; break;
#endif
case lir_none: ShouldNotReachHere();break; case lir_none: ShouldNotReachHere();break;
default: s = "illegal_op"; break; default: s = "illegal_op"; break;
} }
@ -2025,12 +2027,14 @@ void LIR_OpLock::print_instr(outputStream* out) const {
out->print("[lbl:0x%x]", stub()->entry()); out->print("[lbl:0x%x]", stub()->entry());
} }
#ifdef ASSERT
void LIR_OpAssert::print_instr(outputStream* out) const { void LIR_OpAssert::print_instr(outputStream* out) const {
print_condition(out, condition()); out->print(" "); print_condition(out, condition()); out->print(" ");
in_opr1()->print(out); out->print(" "); in_opr1()->print(out); out->print(" ");
in_opr2()->print(out); out->print(", \""); in_opr2()->print(out); out->print(", \"");
out->print(msg()); out->print("\""); out->print(msg()); out->print("\"");
} }
#endif
void LIR_OpDelay::print_instr(outputStream* out) const { void LIR_OpDelay::print_instr(outputStream* out) const {

View file

@ -881,8 +881,9 @@ class LIR_OpLock;
class LIR_OpTypeCheck; class LIR_OpTypeCheck;
class LIR_OpCompareAndSwap; class LIR_OpCompareAndSwap;
class LIR_OpProfileCall; class LIR_OpProfileCall;
#ifdef ASSERT
class LIR_OpAssert; class LIR_OpAssert;
#endif
// LIR operation codes // LIR operation codes
enum LIR_Code { enum LIR_Code {
@ -1139,7 +1140,9 @@ class LIR_Op: public CompilationResourceObj {
virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; }
virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; } virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; }
virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; } virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; }
#ifdef ASSERT
virtual LIR_OpAssert* as_OpAssert() { return NULL; } virtual LIR_OpAssert* as_OpAssert() { return NULL; }
#endif
virtual void verify() const {} virtual void verify() const {}
}; };

View file

@ -3104,8 +3104,8 @@ void LIRGenerator::do_RuntimeCall(RuntimeCall* x) {
} }
} }
void LIRGenerator::do_Assert(Assert *x) {
#ifdef ASSERT #ifdef ASSERT
void LIRGenerator::do_Assert(Assert *x) {
ValueTag tag = x->x()->type()->tag(); ValueTag tag = x->x()->type()->tag();
If::Condition cond = x->cond(); If::Condition cond = x->cond();
@ -3125,9 +3125,8 @@ void LIRGenerator::do_Assert(Assert *x) {
LIR_Opr right = yin->result(); LIR_Opr right = yin->result();
__ lir_assert(lir_cond(x->cond()), left, right, x->message(), true); __ lir_assert(lir_cond(x->cond()), left, right, x->message(), true);
#endif
} }
#endif
void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) { void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) {

View file

@ -537,7 +537,9 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
virtual void do_RuntimeCall (RuntimeCall* x); virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x); virtual void do_MemBar (MemBar* x);
virtual void do_RangeCheckPredicate(RangeCheckPredicate* x); virtual void do_RangeCheckPredicate(RangeCheckPredicate* x);
#ifdef ASSERT
virtual void do_Assert (Assert* x); virtual void do_Assert (Assert* x);
#endif
}; };

View file

@ -535,7 +535,9 @@ public:
void do_RuntimeCall (RuntimeCall* x); void do_RuntimeCall (RuntimeCall* x);
void do_MemBar (MemBar* x); void do_MemBar (MemBar* x);
void do_RangeCheckPredicate(RangeCheckPredicate* x); void do_RangeCheckPredicate(RangeCheckPredicate* x);
#ifdef ASSERT
void do_Assert (Assert* x); void do_Assert (Assert* x);
#endif
}; };
@ -718,8 +720,9 @@ void NullCheckVisitor::do_ProfileInvoke (ProfileInvoke* x) {}
void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {} void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {}
void NullCheckVisitor::do_MemBar (MemBar* x) {} void NullCheckVisitor::do_MemBar (MemBar* x) {}
void NullCheckVisitor::do_RangeCheckPredicate(RangeCheckPredicate* x) {} void NullCheckVisitor::do_RangeCheckPredicate(RangeCheckPredicate* x) {}
#ifdef ASSERT
void NullCheckVisitor::do_Assert (Assert* x) {} void NullCheckVisitor::do_Assert (Assert* x) {}
#endif
void NullCheckEliminator::visit(Value* p) { void NullCheckEliminator::visit(Value* p) {
assert(*p != NULL, "should not find NULL instructions"); assert(*p != NULL, "should not find NULL instructions");

View file

@ -166,7 +166,9 @@ public:
void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ }; void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ };
void do_MemBar (MemBar* x) { /* nothing to do */ }; void do_MemBar (MemBar* x) { /* nothing to do */ };
void do_RangeCheckPredicate(RangeCheckPredicate* x) { /* nothing to do */ }; void do_RangeCheckPredicate(RangeCheckPredicate* x) { /* nothing to do */ };
#ifdef ASSERT
void do_Assert (Assert* x) { /* nothing to do */ }; void do_Assert (Assert* x) { /* nothing to do */ };
#endif
}; };
#ifdef ASSERT #ifdef ASSERT

View file

@ -207,7 +207,9 @@ class ValueNumberingVisitor: public InstructionVisitor {
void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ }; void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ };
void do_MemBar (MemBar* x) { /* nothing to do */ }; void do_MemBar (MemBar* x) { /* nothing to do */ };
void do_RangeCheckPredicate(RangeCheckPredicate* x) { /* nothing to do */ }; void do_RangeCheckPredicate(RangeCheckPredicate* x) { /* nothing to do */ };
#ifdef ASSERT
void do_Assert (Assert* x) { /* nothing to do */ }; void do_Assert (Assert* x) { /* nothing to do */ };
#endif
}; };

View file

@ -1274,13 +1274,16 @@ void ClassLoader::compile_the_world() {
Handle system_class_loader (THREAD, SystemDictionary::java_system_loader()); Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
// Iterate over all bootstrap class path entries // Iterate over all bootstrap class path entries
ClassPathEntry* e = _first_entry; ClassPathEntry* e = _first_entry;
jlong start = os::javaTimeMillis();
while (e != NULL) { while (e != NULL) {
// We stop at rt.jar, unless it is the first bootstrap path entry // We stop at rt.jar, unless it is the first bootstrap path entry
if (e->is_rt_jar() && e != _first_entry) break; if (e->is_rt_jar() && e != _first_entry) break;
e->compile_the_world(system_class_loader, CATCH); e->compile_the_world(system_class_loader, CATCH);
e = e->next(); e = e->next();
} }
tty->print_cr("CompileTheWorld : Done"); jlong end = os::javaTimeMillis();
tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)",
_compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
{ {
// Print statistics as if before normal exit: // Print statistics as if before normal exit:
extern void print_statistics(); extern void print_statistics();
@ -1289,7 +1292,8 @@ void ClassLoader::compile_the_world() {
vm_exit(0); vm_exit(0);
} }
int ClassLoader::_compile_the_world_counter = 0; int ClassLoader::_compile_the_world_class_counter = 0;
int ClassLoader::_compile_the_world_method_counter = 0;
static int _codecache_sweep_counter = 0; static int _codecache_sweep_counter = 0;
// Filter out all exceptions except OOMs // Filter out all exceptions except OOMs
@ -1311,8 +1315,8 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
// If the file has a period after removing .class, it's not really a // If the file has a period after removing .class, it's not really a
// valid class file. The class loader will check everything else. // valid class file. The class loader will check everything else.
if (strchr(buffer, '.') == NULL) { if (strchr(buffer, '.') == NULL) {
_compile_the_world_counter++; _compile_the_world_class_counter++;
if (_compile_the_world_counter > CompileTheWorldStopAt) return; if (_compile_the_world_class_counter > CompileTheWorldStopAt) return;
// Construct name without extension // Construct name without extension
TempNewSymbol sym = SymbolTable::new_symbol(buffer, CHECK); TempNewSymbol sym = SymbolTable::new_symbol(buffer, CHECK);
@ -1329,16 +1333,16 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
// If something went wrong in preloading we just ignore it // If something went wrong in preloading we just ignore it
clear_pending_exception_if_not_oom(CHECK); clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_counter, buffer); tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_class_counter, buffer);
} }
} }
if (_compile_the_world_counter >= CompileTheWorldStartAt) { if (_compile_the_world_class_counter >= CompileTheWorldStartAt) {
if (k.is_null() || exception_occurred) { if (k.is_null() || exception_occurred) {
// If something went wrong (e.g. ExceptionInInitializerError) we skip this class // If something went wrong (e.g. ExceptionInInitializerError) we skip this class
tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_counter, buffer); tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_class_counter, buffer);
} else { } else {
tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_counter, buffer); tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_class_counter, buffer);
// Preload all classes to get around uncommon traps // Preload all classes to get around uncommon traps
// Iterate over all methods in class // Iterate over all methods in class
for (int n = 0; n < k->methods()->length(); n++) { for (int n = 0; n < k->methods()->length(); n++) {
@ -1356,7 +1360,9 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
methodHandle(), 0, "CTW", THREAD); methodHandle(), 0, "CTW", THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
clear_pending_exception_if_not_oom(CHECK); clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name()->as_C_string());
} else {
_compile_the_world_method_counter++;
} }
if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) { if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) {
// Clobber the first compile and force second tier compilation // Clobber the first compile and force second tier compilation
@ -1370,7 +1376,9 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
methodHandle(), 0, "CTW", THREAD); methodHandle(), 0, "CTW", THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
clear_pending_exception_if_not_oom(CHECK); clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string()); tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name()->as_C_string());
} else {
_compile_the_world_method_counter++;
} }
} }
} }

View file

@ -340,11 +340,12 @@ class ClassLoader: AllStatic {
// Force compilation of all methods in all classes in bootstrap class path (stress test) // Force compilation of all methods in all classes in bootstrap class path (stress test)
#ifndef PRODUCT #ifndef PRODUCT
private: private:
static int _compile_the_world_counter; static int _compile_the_world_class_counter;
static int _compile_the_world_method_counter;
public: public:
static void compile_the_world(); static void compile_the_world();
static void compile_the_world_in(char* name, Handle loader, TRAPS); static void compile_the_world_in(char* name, Handle loader, TRAPS);
static int compile_the_world_counter() { return _compile_the_world_counter; } static int compile_the_world_counter() { return _compile_the_world_class_counter; }
#endif //PRODUCT #endif //PRODUCT
}; };

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -175,14 +175,14 @@ class StackMapFrame : public ResourceObj {
ErrorContext* ctx, TRAPS) const; ErrorContext* ctx, TRAPS) const;
inline void set_mark() { inline void set_mark() {
#ifdef DEBUG #ifdef ASSERT
// Put bogus type to indicate it's no longer valid. // Put bogus type to indicate it's no longer valid.
if (_stack_mark != -1) { if (_stack_mark != -1) {
for (int i = _stack_mark - 1; i >= _stack_size; --i) { for (int i = _stack_mark - 1; i >= _stack_size; --i) {
_stack[i] = VerificationType::bogus_type(); _stack[i] = VerificationType::bogus_type();
} }
} }
#endif // def DEBUG #endif // def ASSERT
_stack_mark = _stack_size; _stack_mark = _stack_size;
} }

View file

@ -348,14 +348,14 @@ RuntimeStub* RuntimeStub::new_runtime_stub(const char* stub_name,
void* RuntimeStub::operator new(size_t s, unsigned size) { void* RuntimeStub::operator new(size_t s, unsigned size) {
void* p = CodeCache::allocate(size); void* p = CodeCache::allocate(size, true);
if (!p) fatal("Initial size of CodeCache is too small"); if (!p) fatal("Initial size of CodeCache is too small");
return p; return p;
} }
// operator new shared by all singletons: // operator new shared by all singletons:
void* SingletonBlob::operator new(size_t s, unsigned size) { void* SingletonBlob::operator new(size_t s, unsigned size) {
void* p = CodeCache::allocate(size); void* p = CodeCache::allocate(size, true);
if (!p) fatal("Initial size of CodeCache is too small"); if (!p) fatal("Initial size of CodeCache is too small");
return p; return p;
} }

View file

@ -172,7 +172,7 @@ nmethod* CodeCache::next_nmethod (CodeBlob* cb) {
static size_t maxCodeCacheUsed = 0; static size_t maxCodeCacheUsed = 0;
CodeBlob* CodeCache::allocate(int size) { CodeBlob* CodeCache::allocate(int size, bool is_critical) {
// Do not seize the CodeCache lock here--if the caller has not // Do not seize the CodeCache lock here--if the caller has not
// already done so, we are going to lose bigtime, since the code // already done so, we are going to lose bigtime, since the code
// cache will contain a garbage CodeBlob until the caller can // cache will contain a garbage CodeBlob until the caller can
@ -183,7 +183,7 @@ CodeBlob* CodeCache::allocate(int size) {
CodeBlob* cb = NULL; CodeBlob* cb = NULL;
_number_of_blobs++; _number_of_blobs++;
while (true) { while (true) {
cb = (CodeBlob*)_heap->allocate(size); cb = (CodeBlob*)_heap->allocate(size, is_critical);
if (cb != NULL) break; if (cb != NULL) break;
if (!_heap->expand_by(CodeCacheExpansionSize)) { if (!_heap->expand_by(CodeCacheExpansionSize)) {
// Expansion failed // Expansion failed
@ -192,8 +192,8 @@ CodeBlob* CodeCache::allocate(int size) {
if (PrintCodeCacheExtension) { if (PrintCodeCacheExtension) {
ResourceMark rm; ResourceMark rm;
tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)", tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
(intptr_t)_heap->begin(), (intptr_t)_heap->end(), (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(),
(address)_heap->end() - (address)_heap->begin()); (address)_heap->high() - (address)_heap->low_boundary());
} }
} }
maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() - maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() -
@ -608,13 +608,13 @@ void CodeCache::verify_oops() {
address CodeCache::first_address() { address CodeCache::first_address() {
assert_locked_or_safepoint(CodeCache_lock); assert_locked_or_safepoint(CodeCache_lock);
return (address)_heap->begin(); return (address)_heap->low_boundary();
} }
address CodeCache::last_address() { address CodeCache::last_address() {
assert_locked_or_safepoint(CodeCache_lock); assert_locked_or_safepoint(CodeCache_lock);
return (address)_heap->end(); return (address)_heap->high();
} }
@ -996,10 +996,9 @@ void CodeCache::print() {
void CodeCache::print_summary(outputStream* st, bool detailed) { void CodeCache::print_summary(outputStream* st, bool detailed) {
size_t total = (_heap->high_boundary() - _heap->low_boundary()); size_t total = (_heap->high_boundary() - _heap->low_boundary());
st->print_cr("CodeCache: size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT st->print_cr("CodeCache: size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT
"Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb",
"Kb max_free_chunk=" SIZE_FORMAT "Kb",
total/K, (total - unallocated_capacity())/K, total/K, (total - unallocated_capacity())/K,
maxCodeCacheUsed/K, unallocated_capacity()/K, largest_free_block()/K); maxCodeCacheUsed/K, unallocated_capacity()/K);
if (detailed) { if (detailed) {
st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]", st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
@ -1018,19 +1017,8 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
void CodeCache::log_state(outputStream* st) { void CodeCache::log_state(outputStream* st) {
st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'" st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
" adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'" " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
" largest_free_block='" SIZE_FORMAT "'",
nof_blobs(), nof_nmethods(), nof_adapters(), nof_blobs(), nof_nmethods(), nof_adapters(),
unallocated_capacity(), largest_free_block()); unallocated_capacity());
} }
size_t CodeCache::largest_free_block() {
// This is called both with and without CodeCache_lock held so
// handle both cases.
if (CodeCache_lock->owned_by_self()) {
return _heap->largest_free_block();
} else {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
return _heap->largest_free_block();
}
}

View file

@ -70,7 +70,7 @@ class CodeCache : AllStatic {
static void initialize(); static void initialize();
// Allocation/administration // Allocation/administration
static CodeBlob* allocate(int size); // allocates a new CodeBlob static CodeBlob* allocate(int size, bool is_critical = false); // allocates a new CodeBlob
static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled
static int alignment_unit(); // guaranteed alignment of all CodeBlobs static int alignment_unit(); // guaranteed alignment of all CodeBlobs
static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header) static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
@ -156,19 +156,13 @@ class CodeCache : AllStatic {
static address low_bound() { return (address) _heap->low_boundary(); } static address low_bound() { return (address) _heap->low_boundary(); }
static address high_bound() { return (address) _heap->high_boundary(); } static address high_bound() { return (address) _heap->high_boundary(); }
static bool has_space(int size) {
// Always leave some room in the CodeCache for I2C/C2I adapters
return largest_free_block() > (CodeCacheMinimumFreeSpace + size);
}
// Profiling // Profiling
static address first_address(); // first address used for CodeBlobs static address first_address(); // first address used for CodeBlobs
static address last_address(); // last address used for CodeBlobs static address last_address(); // last address used for CodeBlobs
static size_t capacity() { return _heap->capacity(); } static size_t capacity() { return _heap->capacity(); }
static size_t max_capacity() { return _heap->max_capacity(); } static size_t max_capacity() { return _heap->max_capacity(); }
static size_t unallocated_capacity() { return _heap->unallocated_capacity(); } static size_t unallocated_capacity() { return _heap->unallocated_capacity(); }
static size_t largest_free_block(); static bool needs_flushing() { return unallocated_capacity() < CodeCacheFlushingMinimumFreeSpace; }
static bool needs_flushing() { return largest_free_block() < CodeCacheFlushingMinimumFreeSpace; }
static bool needs_cache_clean() { return _needs_cache_clean; } static bool needs_cache_clean() { return _needs_cache_clean; }
static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; } static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; }

View file

@ -501,7 +501,6 @@ nmethod* nmethod::new_native_nmethod(methodHandle method,
{ {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
int native_nmethod_size = allocation_size(code_buffer, sizeof(nmethod)); int native_nmethod_size = allocation_size(code_buffer, sizeof(nmethod));
if (CodeCache::has_space(native_nmethod_size)) {
CodeOffsets offsets; CodeOffsets offsets;
offsets.set_value(CodeOffsets::Verified_Entry, vep_offset); offsets.set_value(CodeOffsets::Verified_Entry, vep_offset);
offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); offsets.set_value(CodeOffsets::Frame_Complete, frame_complete);
@ -511,7 +510,7 @@ nmethod* nmethod::new_native_nmethod(methodHandle method,
basic_lock_owner_sp_offset, basic_lock_owner_sp_offset,
basic_lock_sp_offset, oop_maps); basic_lock_sp_offset, oop_maps);
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm));
if (PrintAssembly && nm != NULL) if (PrintAssembly && nm != NULL) {
Disassembler::decode(nm); Disassembler::decode(nm);
} }
} }
@ -538,7 +537,6 @@ nmethod* nmethod::new_dtrace_nmethod(methodHandle method,
{ {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
int nmethod_size = allocation_size(code_buffer, sizeof(nmethod)); int nmethod_size = allocation_size(code_buffer, sizeof(nmethod));
if (CodeCache::has_space(nmethod_size)) {
CodeOffsets offsets; CodeOffsets offsets;
offsets.set_value(CodeOffsets::Verified_Entry, vep_offset); offsets.set_value(CodeOffsets::Verified_Entry, vep_offset);
offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset); offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset);
@ -548,7 +546,7 @@ nmethod* nmethod::new_dtrace_nmethod(methodHandle method,
&offsets, code_buffer, frame_size); &offsets, code_buffer, frame_size);
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm));
if (PrintAssembly && nm != NULL) if (PrintAssembly && nm != NULL) {
Disassembler::decode(nm); Disassembler::decode(nm);
} }
} }
@ -591,7 +589,7 @@ nmethod* nmethod::new_nmethod(methodHandle method,
+ round_to(handler_table->size_in_bytes(), oopSize) + round_to(handler_table->size_in_bytes(), oopSize)
+ round_to(nul_chk_table->size_in_bytes(), oopSize) + round_to(nul_chk_table->size_in_bytes(), oopSize)
+ round_to(debug_info->data_size() , oopSize); + round_to(debug_info->data_size() , oopSize);
if (CodeCache::has_space(nmethod_size)) {
nm = new (nmethod_size) nm = new (nmethod_size)
nmethod(method(), nmethod_size, compile_id, entry_bci, offsets, nmethod(method(), nmethod_size, compile_id, entry_bci, offsets,
orig_pc_offset, debug_info, dependencies, code_buffer, frame_size, orig_pc_offset, debug_info, dependencies, code_buffer, frame_size,
@ -600,7 +598,7 @@ nmethod* nmethod::new_nmethod(methodHandle method,
nul_chk_table, nul_chk_table,
compiler, compiler,
comp_level); comp_level);
}
if (nm != NULL) { if (nm != NULL) {
// To make dependency checking during class loading fast, record // To make dependency checking during class loading fast, record
// the nmethod dependencies in the classes it is dependent on. // the nmethod dependencies in the classes it is dependent on.
@ -612,16 +610,19 @@ nmethod* nmethod::new_nmethod(methodHandle method,
// classes the slow way is too slow. // classes the slow way is too slow.
for (Dependencies::DepStream deps(nm); deps.next(); ) { for (Dependencies::DepStream deps(nm); deps.next(); ) {
Klass* klass = deps.context_type(); Klass* klass = deps.context_type();
if (klass == NULL) continue; // ignore things like evol_method if (klass == NULL) {
continue; // ignore things like evol_method
}
// record this nmethod as dependent on this klass // record this nmethod as dependent on this klass
InstanceKlass::cast(klass)->add_dependent_nmethod(nm); InstanceKlass::cast(klass)->add_dependent_nmethod(nm);
} }
} }
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm));
if (PrintAssembly && nm != NULL) if (PrintAssembly && nm != NULL) {
Disassembler::decode(nm); Disassembler::decode(nm);
} }
}
// verify nmethod // verify nmethod
debug_only(if (nm) nm->verify();) // might block debug_only(if (nm) nm->verify();) // might block
@ -798,13 +799,11 @@ nmethod::nmethod(
} }
#endif // def HAVE_DTRACE_H #endif // def HAVE_DTRACE_H
void* nmethod::operator new(size_t size, int nmethod_size) { void* nmethod::operator new(size_t size, int nmethod_size) throw () {
void* alloc = CodeCache::allocate(nmethod_size); // Not critical, may return null if there is too little continuous memory
guarantee(alloc != NULL, "CodeCache should have enough space"); return CodeCache::allocate(nmethod_size);
return alloc;
} }
nmethod::nmethod( nmethod::nmethod(
Method* method, Method* method,
int nmethod_size, int nmethod_size,

View file

@ -1581,7 +1581,7 @@ void CompileBroker::compiler_thread_loop() {
// We need this HandleMark to avoid leaking VM handles. // We need this HandleMark to avoid leaking VM handles.
HandleMark hm(thread); HandleMark hm(thread);
if (CodeCache::largest_free_block() < CodeCacheMinimumFreeSpace) { if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) {
// the code cache is really full // the code cache is really full
handle_full_code_cache(); handle_full_code_cache();
} else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) { } else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) {

View file

@ -6921,7 +6921,7 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m(
size = CompactibleFreeListSpace::adjustObjectSize( size = CompactibleFreeListSpace::adjustObjectSize(
p->oop_iterate(_scanningClosure)); p->oop_iterate(_scanningClosure));
} }
#ifdef DEBUG #ifdef ASSERT
size_t direct_size = size_t direct_size =
CompactibleFreeListSpace::adjustObjectSize(p->size()); CompactibleFreeListSpace::adjustObjectSize(p->size());
assert(size == direct_size, "Inconsistency in size"); assert(size == direct_size, "Inconsistency in size");
@ -6933,7 +6933,7 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m(
assert(_bitMap->isMarked(addr+size-1), assert(_bitMap->isMarked(addr+size-1),
"inconsistent Printezis mark"); "inconsistent Printezis mark");
} }
#endif // DEBUG #endif // ASSERT
} else { } else {
// an unitialized object // an unitialized object
assert(_bitMap->isMarked(addr+1), "missing Printezis mark?"); assert(_bitMap->isMarked(addr+1), "missing Printezis mark?");
@ -7075,14 +7075,14 @@ bool ScanMarkedObjectsAgainClosure::do_object_bm(oop p, MemRegion mr) {
HeapWord* addr = (HeapWord*)p; HeapWord* addr = (HeapWord*)p;
assert(_span.contains(addr), "we are scanning the CMS generation"); assert(_span.contains(addr), "we are scanning the CMS generation");
bool is_obj_array = false; bool is_obj_array = false;
#ifdef DEBUG #ifdef ASSERT
if (!_parallel) { if (!_parallel) {
assert(_mark_stack->isEmpty(), "pre-condition (eager drainage)"); assert(_mark_stack->isEmpty(), "pre-condition (eager drainage)");
assert(_collector->overflow_list_is_empty(), assert(_collector->overflow_list_is_empty(),
"overflow list should be empty"); "overflow list should be empty");
} }
#endif // DEBUG #endif // ASSERT
if (_bit_map->isMarked(addr)) { if (_bit_map->isMarked(addr)) {
// Obj arrays are precisely marked, non-arrays are not; // Obj arrays are precisely marked, non-arrays are not;
// so we scan objArrays precisely and non-arrays in their // so we scan objArrays precisely and non-arrays in their
@ -7102,14 +7102,14 @@ bool ScanMarkedObjectsAgainClosure::do_object_bm(oop p, MemRegion mr) {
} }
} }
} }
#ifdef DEBUG #ifdef ASSERT
if (!_parallel) { if (!_parallel) {
assert(_mark_stack->isEmpty(), "post-condition (eager drainage)"); assert(_mark_stack->isEmpty(), "post-condition (eager drainage)");
assert(_collector->overflow_list_is_empty(), assert(_collector->overflow_list_is_empty(),
"overflow list should be empty"); "overflow list should be empty");
} }
#endif // DEBUG #endif // ASSERT
return is_obj_array; return is_obj_array;
} }
@ -8320,7 +8320,7 @@ size_t SweepClosure::do_live_chunk(FreeChunk* fc) {
assert(size == CompactibleFreeListSpace::adjustObjectSize(size), assert(size == CompactibleFreeListSpace::adjustObjectSize(size),
"alignment problem"); "alignment problem");
#ifdef DEBUG #ifdef ASSERT
if (oop(addr)->klass_or_null() != NULL) { if (oop(addr)->klass_or_null() != NULL) {
// Ignore mark word because we are running concurrent with mutators // Ignore mark word because we are running concurrent with mutators
assert(oop(addr)->is_oop(true), "live block should be an oop"); assert(oop(addr)->is_oop(true), "live block should be an oop");

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -178,7 +178,7 @@ const bool NMT_track_callsite = false;
#endif // INCLUDE_NMT #endif // INCLUDE_NMT
// debug build does not inline // debug build does not inline
#if defined(_DEBUG_) #if defined(_NMT_NOINLINE_)
#define CURRENT_PC (NMT_track_callsite ? os::get_caller_pc(1) : 0) #define CURRENT_PC (NMT_track_callsite ? os::get_caller_pc(1) : 0)
#define CALLER_PC (NMT_track_callsite ? os::get_caller_pc(2) : 0) #define CALLER_PC (NMT_track_callsite ? os::get_caller_pc(2) : 0)
#define CALLER_CALLER_PC (NMT_track_callsite ? os::get_caller_pc(3) : 0) #define CALLER_CALLER_PC (NMT_track_callsite ? os::get_caller_pc(3) : 0)

View file

@ -42,7 +42,7 @@ CodeHeap::CodeHeap() {
_log2_segment_size = 0; _log2_segment_size = 0;
_next_segment = 0; _next_segment = 0;
_freelist = NULL; _freelist = NULL;
_free_segments = 0; _freelist_segments = 0;
} }
@ -115,8 +115,8 @@ bool CodeHeap::reserve(size_t reserved_size, size_t committed_size,
} }
on_code_mapping(_memory.low(), _memory.committed_size()); on_code_mapping(_memory.low(), _memory.committed_size());
_number_of_committed_segments = number_of_segments(_memory.committed_size()); _number_of_committed_segments = size_to_segments(_memory.committed_size());
_number_of_reserved_segments = number_of_segments(_memory.reserved_size()); _number_of_reserved_segments = size_to_segments(_memory.reserved_size());
assert(_number_of_reserved_segments >= _number_of_committed_segments, "just checking"); assert(_number_of_reserved_segments >= _number_of_committed_segments, "just checking");
// reserve space for _segmap // reserve space for _segmap
@ -149,8 +149,8 @@ bool CodeHeap::expand_by(size_t size) {
if (!_memory.expand_by(dm)) return false; if (!_memory.expand_by(dm)) return false;
on_code_mapping(base, dm); on_code_mapping(base, dm);
size_t i = _number_of_committed_segments; size_t i = _number_of_committed_segments;
_number_of_committed_segments = number_of_segments(_memory.committed_size()); _number_of_committed_segments = size_to_segments(_memory.committed_size());
assert(_number_of_reserved_segments == number_of_segments(_memory.reserved_size()), "number of reserved segments should not change"); assert(_number_of_reserved_segments == size_to_segments(_memory.reserved_size()), "number of reserved segments should not change");
assert(_number_of_reserved_segments >= _number_of_committed_segments, "just checking"); assert(_number_of_reserved_segments >= _number_of_committed_segments, "just checking");
// expand _segmap space // expand _segmap space
size_t ds = align_to_page_size(_number_of_committed_segments) - _segmap.committed_size(); size_t ds = align_to_page_size(_number_of_committed_segments) - _segmap.committed_size();
@ -176,33 +176,44 @@ void CodeHeap::clear() {
} }
void* CodeHeap::allocate(size_t size) { void* CodeHeap::allocate(size_t instance_size, bool is_critical) {
size_t length = number_of_segments(size + sizeof(HeapBlock)); size_t number_of_segments = size_to_segments(instance_size + sizeof(HeapBlock));
assert(length *_segment_size >= sizeof(FreeBlock), "not enough room for FreeList"); assert(segments_to_size(number_of_segments) >= sizeof(FreeBlock), "not enough room for FreeList");
// First check if we can satify request from freelist // First check if we can satify request from freelist
debug_only(verify()); debug_only(verify());
HeapBlock* block = search_freelist(length); HeapBlock* block = search_freelist(number_of_segments, is_critical);
debug_only(if (VerifyCodeCacheOften) verify()); debug_only(if (VerifyCodeCacheOften) verify());
if (block != NULL) { if (block != NULL) {
assert(block->length() >= length && block->length() < length + CodeCacheMinBlockLength, "sanity check"); assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check");
assert(!block->free(), "must be marked free"); assert(!block->free(), "must be marked free");
#ifdef ASSERT #ifdef ASSERT
memset((void *)block->allocated_space(), badCodeHeapNewVal, size); memset((void *)block->allocated_space(), badCodeHeapNewVal, instance_size);
#endif #endif
return block->allocated_space(); return block->allocated_space();
} }
if (length < CodeCacheMinBlockLength) { // Ensure minimum size for allocation to the heap.
length = CodeCacheMinBlockLength; if (number_of_segments < CodeCacheMinBlockLength) {
number_of_segments = CodeCacheMinBlockLength;
} }
if (_next_segment + length <= _number_of_committed_segments) {
mark_segmap_as_used(_next_segment, _next_segment + length); if (!is_critical) {
// Make sure the allocation fits in the unallocated heap without using
// the CodeCacheMimimumFreeSpace that is reserved for critical allocations.
if (segments_to_size(number_of_segments) > (heap_unallocated_capacity() - CodeCacheMinimumFreeSpace)) {
// Fail allocation
return NULL;
}
}
if (_next_segment + number_of_segments <= _number_of_committed_segments) {
mark_segmap_as_used(_next_segment, _next_segment + number_of_segments);
HeapBlock* b = block_at(_next_segment); HeapBlock* b = block_at(_next_segment);
b->initialize(length); b->initialize(number_of_segments);
_next_segment += length; _next_segment += number_of_segments;
#ifdef ASSERT #ifdef ASSERT
memset((void *)b->allocated_space(), badCodeHeapNewVal, size); memset((void *)b->allocated_space(), badCodeHeapNewVal, instance_size);
#endif #endif
return b->allocated_space(); return b->allocated_space();
} else { } else {
@ -219,7 +230,7 @@ void CodeHeap::deallocate(void* p) {
#ifdef ASSERT #ifdef ASSERT
memset((void *)b->allocated_space(), memset((void *)b->allocated_space(),
badCodeHeapFreeVal, badCodeHeapFreeVal,
size(b->length()) - sizeof(HeapBlock)); segments_to_size(b->length()) - sizeof(HeapBlock));
#endif #endif
add_to_freelist(b); add_to_freelist(b);
@ -299,32 +310,14 @@ size_t CodeHeap::max_capacity() const {
} }
size_t CodeHeap::allocated_capacity() const { size_t CodeHeap::allocated_capacity() const {
// Start with the committed size in _memory; // size of used heap - size on freelist
size_t l = _memory.committed_size(); return segments_to_size(_next_segment - _freelist_segments);
// Subtract the committed, but unused, segments
l -= size(_number_of_committed_segments - _next_segment);
// Subtract the size of the freelist
l -= size(_free_segments);
return l;
} }
size_t CodeHeap::largest_free_block() const { // Returns size of the unallocated heap block
// First check unused space excluding free blocks. size_t CodeHeap::heap_unallocated_capacity() const {
size_t free_sz = size(_free_segments); // Total number of segments - number currently used
size_t unused = max_capacity() - allocated_capacity() - free_sz; return segments_to_size(_number_of_reserved_segments - _next_segment);
if (unused >= free_sz)
return unused;
// Now check largest free block.
size_t len = 0;
for (FreeBlock* b = _freelist; b != NULL; b = b->link()) {
if (b->length() > len)
len = b->length();
}
return MAX2(unused, size(len));
} }
// Free list management // Free list management
@ -365,7 +358,7 @@ void CodeHeap::add_to_freelist(HeapBlock *a) {
assert(b != _freelist, "cannot be removed twice"); assert(b != _freelist, "cannot be removed twice");
// Mark as free and update free space count // Mark as free and update free space count
_free_segments += b->length(); _freelist_segments += b->length();
b->set_free(); b->set_free();
// First element in list? // First element in list?
@ -400,7 +393,7 @@ void CodeHeap::add_to_freelist(HeapBlock *a) {
// Search freelist for an entry on the list with the best fit // Search freelist for an entry on the list with the best fit
// Return NULL if no one was found // Return NULL if no one was found
FreeBlock* CodeHeap::search_freelist(size_t length) { FreeBlock* CodeHeap::search_freelist(size_t length, bool is_critical) {
FreeBlock *best_block = NULL; FreeBlock *best_block = NULL;
FreeBlock *best_prev = NULL; FreeBlock *best_prev = NULL;
size_t best_length = 0; size_t best_length = 0;
@ -411,6 +404,16 @@ FreeBlock* CodeHeap::search_freelist(size_t length) {
while(cur != NULL) { while(cur != NULL) {
size_t l = cur->length(); size_t l = cur->length();
if (l >= length && (best_block == NULL || best_length > l)) { if (l >= length && (best_block == NULL || best_length > l)) {
// Non critical allocations are not allowed to use the last part of the code heap.
if (!is_critical) {
// Make sure the end of the allocation doesn't cross into the last part of the code heap
if (((size_t)cur + length) > ((size_t)high_boundary() - CodeCacheMinimumFreeSpace)) {
// the freelist is sorted by address - if one fails, all consecutive will also fail.
break;
}
}
// Remember best block, its previous element, and its length // Remember best block, its previous element, and its length
best_block = cur; best_block = cur;
best_prev = prev; best_prev = prev;
@ -452,7 +455,7 @@ FreeBlock* CodeHeap::search_freelist(size_t length) {
} }
best_block->set_used(); best_block->set_used();
_free_segments -= length; _freelist_segments -= length;
return best_block; return best_block;
} }
@ -478,7 +481,7 @@ void CodeHeap::verify() {
} }
// Verify that freelist contains the right amount of free space // Verify that freelist contains the right amount of free space
// guarantee(len == _free_segments, "wrong freelist"); // guarantee(len == _freelist_segments, "wrong freelist");
// Verify that the number of free blocks is not out of hand. // Verify that the number of free blocks is not out of hand.
static int free_block_threshold = 10000; static int free_block_threshold = 10000;

View file

@ -91,11 +91,11 @@ class CodeHeap : public CHeapObj<mtCode> {
size_t _next_segment; size_t _next_segment;
FreeBlock* _freelist; FreeBlock* _freelist;
size_t _free_segments; // No. of segments in freelist size_t _freelist_segments; // No. of segments in freelist
// Helper functions // Helper functions
size_t number_of_segments(size_t size) const { return (size + _segment_size - 1) >> _log2_segment_size; } size_t size_to_segments(size_t size) const { return (size + _segment_size - 1) >> _log2_segment_size; }
size_t size(size_t number_of_segments) const { return number_of_segments << _log2_segment_size; } size_t segments_to_size(size_t number_of_segments) const { return number_of_segments << _log2_segment_size; }
size_t segment_for(void* p) const { return ((char*)p - _memory.low()) >> _log2_segment_size; } size_t segment_for(void* p) const { return ((char*)p - _memory.low()) >> _log2_segment_size; }
HeapBlock* block_at(size_t i) const { return (HeapBlock*)(_memory.low() + (i << _log2_segment_size)); } HeapBlock* block_at(size_t i) const { return (HeapBlock*)(_memory.low() + (i << _log2_segment_size)); }
@ -110,7 +110,7 @@ class CodeHeap : public CHeapObj<mtCode> {
// Toplevel freelist management // Toplevel freelist management
void add_to_freelist(HeapBlock *b); void add_to_freelist(HeapBlock *b);
FreeBlock* search_freelist(size_t length); FreeBlock* search_freelist(size_t length, bool is_critical);
// Iteration helpers // Iteration helpers
void* next_free(HeapBlock* b) const; void* next_free(HeapBlock* b) const;
@ -132,23 +132,20 @@ class CodeHeap : public CHeapObj<mtCode> {
void clear(); // clears all heap contents void clear(); // clears all heap contents
// Memory allocation // Memory allocation
void* allocate (size_t size); // allocates a block of size or returns NULL void* allocate (size_t size, bool is_critical); // allocates a block of size or returns NULL
void deallocate(void* p); // deallocates a block void deallocate(void* p); // deallocates a block
// Attributes // Attributes
void* begin() const { return _memory.low (); } char* low_boundary() const { return _memory.low_boundary (); }
void* end() const { return _memory.high(); } char* high() const { return _memory.high(); }
bool contains(void* p) const { return begin() <= p && p < end(); } char* high_boundary() const { return _memory.high_boundary(); }
bool contains(const void* p) const { return low_boundary() <= p && p < high(); }
void* find_start(void* p) const; // returns the block containing p or NULL void* find_start(void* p) const; // returns the block containing p or NULL
size_t alignment_unit() const; // alignment of any block size_t alignment_unit() const; // alignment of any block
size_t alignment_offset() const; // offset of first byte of any block, within the enclosing alignment unit size_t alignment_offset() const; // offset of first byte of any block, within the enclosing alignment unit
static size_t header_size(); // returns the header size for each heap block static size_t header_size(); // returns the header size for each heap block
// Returns reserved area high and low addresses
char *low_boundary() const { return _memory.low_boundary (); }
char *high() const { return _memory.high(); }
char *high_boundary() const { return _memory.high_boundary(); }
// Iteration // Iteration
// returns the first block or NULL // returns the first block or NULL
@ -161,8 +158,11 @@ class CodeHeap : public CHeapObj<mtCode> {
size_t max_capacity() const; size_t max_capacity() const;
size_t allocated_capacity() const; size_t allocated_capacity() const;
size_t unallocated_capacity() const { return max_capacity() - allocated_capacity(); } size_t unallocated_capacity() const { return max_capacity() - allocated_capacity(); }
size_t largest_free_block() const;
private:
size_t heap_unallocated_capacity() const;
public:
// Debugging // Debugging
void verify(); void verify();
void print() PRODUCT_RETURN; void print() PRODUCT_RETURN;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1306,10 +1306,11 @@ static Node* is_cond_add(PhaseGVN *phase, PhiNode *phi, int true_path) {
return NULL; return NULL;
Node *x = n2; Node *x = n2;
Node *y = n1->in(1); Node *y = NULL;
if( n2 == n1->in(1) ) { if( x == n1->in(1) ) {
y = n1->in(2); y = n1->in(2);
} else if( n2 == n1->in(1) ) { } else if( x == n1->in(2) ) {
y = n1->in(1);
} else return NULL; } else return NULL;
// Not so profitable if compare and add are constants // Not so profitable if compare and add are constants

View file

@ -145,6 +145,72 @@ void LRG_List::extend( uint nidx, uint lidx ) {
#define NUMBUCKS 3 #define NUMBUCKS 3
// Straight out of Tarjan's union-find algorithm
uint LiveRangeMap::find_compress(uint lrg) {
uint cur = lrg;
uint next = _uf_map[cur];
while (next != cur) { // Scan chain of equivalences
assert( next < cur, "always union smaller");
cur = next; // until find a fixed-point
next = _uf_map[cur];
}
// Core of union-find algorithm: update chain of
// equivalences to be equal to the root.
while (lrg != next) {
uint tmp = _uf_map[lrg];
_uf_map.map(lrg, next);
lrg = tmp;
}
return lrg;
}
// Reset the Union-Find map to identity
void LiveRangeMap::reset_uf_map(uint max_lrg_id) {
_max_lrg_id= max_lrg_id;
// Force the Union-Find mapping to be at least this large
_uf_map.extend(_max_lrg_id, 0);
// Initialize it to be the ID mapping.
for (uint i = 0; i < _max_lrg_id; ++i) {
_uf_map.map(i, i);
}
}
// Make all Nodes map directly to their final live range; no need for
// the Union-Find mapping after this call.
void LiveRangeMap::compress_uf_map_for_nodes() {
// For all Nodes, compress mapping
uint unique = _names.Size();
for (uint i = 0; i < unique; ++i) {
uint lrg = _names[i];
uint compressed_lrg = find(lrg);
if (lrg != compressed_lrg) {
_names.map(i, compressed_lrg);
}
}
}
// Like Find above, but no path compress, so bad asymptotic behavior
uint LiveRangeMap::find_const(uint lrg) const {
if (!lrg) {
return lrg; // Ignore the zero LRG
}
// Off the end? This happens during debugging dumps when you got
// brand new live ranges but have not told the allocator yet.
if (lrg >= _max_lrg_id) {
return lrg;
}
uint next = _uf_map[lrg];
while (next != lrg) { // Scan chain of equivalences
assert(next < lrg, "always union smaller");
lrg = next; // until find a fixed-point
next = _uf_map[lrg];
}
return next;
}
//------------------------------Chaitin---------------------------------------- //------------------------------Chaitin----------------------------------------
PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher) PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
: PhaseRegAlloc(unique, cfg, matcher, : PhaseRegAlloc(unique, cfg, matcher,
@ -153,13 +219,13 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
#else #else
NULL NULL
#endif #endif
), )
_names(unique), _uf_map(unique), , _lrg_map(unique)
_maxlrg(0), _live(0), , _live(0)
_spilled_once(Thread::current()->resource_area()), , _spilled_once(Thread::current()->resource_area())
_spilled_twice(Thread::current()->resource_area()), , _spilled_twice(Thread::current()->resource_area())
_lo_degree(0), _lo_stk_degree(0), _hi_degree(0), _simplified(0), , _lo_degree(0), _lo_stk_degree(0), _hi_degree(0), _simplified(0)
_oldphi(unique) , _oldphi(unique)
#ifndef PRODUCT #ifndef PRODUCT
, _trace_spilling(TraceSpilling || C->method_has_option("TraceSpilling")) , _trace_spilling(TraceSpilling || C->method_has_option("TraceSpilling"))
#endif #endif
@ -168,7 +234,6 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
_high_frequency_lrg = MIN2(float(OPTO_LRG_HIGH_FREQ), _cfg._outer_loop_freq); _high_frequency_lrg = MIN2(float(OPTO_LRG_HIGH_FREQ), _cfg._outer_loop_freq);
uint i,j;
// Build a list of basic blocks, sorted by frequency // Build a list of basic blocks, sorted by frequency
_blks = NEW_RESOURCE_ARRAY( Block *, _cfg._num_blocks ); _blks = NEW_RESOURCE_ARRAY( Block *, _cfg._num_blocks );
// Experiment with sorting strategies to speed compilation // Experiment with sorting strategies to speed compilation
@ -176,19 +241,19 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
Block **buckets[NUMBUCKS]; // Array of buckets Block **buckets[NUMBUCKS]; // Array of buckets
uint buckcnt[NUMBUCKS]; // Array of bucket counters uint buckcnt[NUMBUCKS]; // Array of bucket counters
double buckval[NUMBUCKS]; // Array of bucket value cutoffs double buckval[NUMBUCKS]; // Array of bucket value cutoffs
for( i = 0; i < NUMBUCKS; i++ ) { for (uint i = 0; i < NUMBUCKS; i++) {
buckets[i] = NEW_RESOURCE_ARRAY(Block *, _cfg._num_blocks); buckets[i] = NEW_RESOURCE_ARRAY(Block *, _cfg._num_blocks);
buckcnt[i] = 0; buckcnt[i] = 0;
// Bump by three orders of magnitude each time // Bump by three orders of magnitude each time
cutoff *= 0.001; cutoff *= 0.001;
buckval[i] = cutoff; buckval[i] = cutoff;
for( j = 0; j < _cfg._num_blocks; j++ ) { for (uint j = 0; j < _cfg._num_blocks; j++) {
buckets[i][j] = NULL; buckets[i][j] = NULL;
} }
} }
// Sort blocks into buckets // Sort blocks into buckets
for( i = 0; i < _cfg._num_blocks; i++ ) { for (uint i = 0; i < _cfg._num_blocks; i++) {
for( j = 0; j < NUMBUCKS; j++ ) { for (uint j = 0; j < NUMBUCKS; j++) {
if ((j == NUMBUCKS - 1) || (_cfg._blocks[i]->_freq > buckval[j])) { if ((j == NUMBUCKS - 1) || (_cfg._blocks[i]->_freq > buckval[j])) {
// Assign block to end of list for appropriate bucket // Assign block to end of list for appropriate bucket
buckets[j][buckcnt[j]++] = _cfg._blocks[i]; buckets[j][buckcnt[j]++] = _cfg._blocks[i];
@ -198,8 +263,8 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
} }
// Dump buckets into final block array // Dump buckets into final block array
uint blkcnt = 0; uint blkcnt = 0;
for( i = 0; i < NUMBUCKS; i++ ) { for (uint i = 0; i < NUMBUCKS; i++) {
for( j = 0; j < buckcnt[i]; j++ ) { for (uint j = 0; j < buckcnt[i]; j++) {
_blks[blkcnt++] = buckets[i][j]; _blks[blkcnt++] = buckets[i][j];
} }
} }
@ -207,6 +272,77 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
assert(blkcnt == _cfg._num_blocks, "Block array not totally filled"); assert(blkcnt == _cfg._num_blocks, "Block array not totally filled");
} }
//------------------------------Union------------------------------------------
// union 2 sets together.
void PhaseChaitin::Union( const Node *src_n, const Node *dst_n ) {
uint src = _lrg_map.find(src_n);
uint dst = _lrg_map.find(dst_n);
assert(src, "");
assert(dst, "");
assert(src < _lrg_map.max_lrg_id(), "oob");
assert(dst < _lrg_map.max_lrg_id(), "oob");
assert(src < dst, "always union smaller");
_lrg_map.uf_map(dst, src);
}
//------------------------------new_lrg----------------------------------------
void PhaseChaitin::new_lrg(const Node *x, uint lrg) {
// Make the Node->LRG mapping
_lrg_map.extend(x->_idx,lrg);
// Make the Union-Find mapping an identity function
_lrg_map.uf_extend(lrg, lrg);
}
bool PhaseChaitin::clone_projs_shared(Block *b, uint idx, Node *con, Node *copy, uint max_lrg_id) {
Block *bcon = _cfg._bbs[con->_idx];
uint cindex = bcon->find_node(con);
Node *con_next = bcon->_nodes[cindex+1];
if (con_next->in(0) != con || !con_next->is_MachProj()) {
return false; // No MachProj's follow
}
// Copy kills after the cloned constant
Node *kills = con_next->clone();
kills->set_req(0, copy);
b->_nodes.insert(idx, kills);
_cfg._bbs.map(kills->_idx, b);
new_lrg(kills, max_lrg_id);
return true;
}
//------------------------------compact----------------------------------------
// Renumber the live ranges to compact them. Makes the IFG smaller.
void PhaseChaitin::compact() {
// Current the _uf_map contains a series of short chains which are headed
// by a self-cycle. All the chains run from big numbers to little numbers.
// The Find() call chases the chains & shortens them for the next Find call.
// We are going to change this structure slightly. Numbers above a moving
// wave 'i' are unchanged. Numbers below 'j' point directly to their
// compacted live range with no further chaining. There are no chains or
// cycles below 'i', so the Find call no longer works.
uint j=1;
uint i;
for (i = 1; i < _lrg_map.max_lrg_id(); i++) {
uint lr = _lrg_map.uf_live_range_id(i);
// Ignore unallocated live ranges
if (!lr) {
continue;
}
assert(lr <= i, "");
_lrg_map.uf_map(i, ( lr == i ) ? j++ : _lrg_map.uf_live_range_id(lr));
}
// Now change the Node->LR mapping to reflect the compacted names
uint unique = _lrg_map.size();
for (i = 0; i < unique; i++) {
uint lrg_id = _lrg_map.live_range_id(i);
_lrg_map.map(i, _lrg_map.uf_live_range_id(lrg_id));
}
// Reset the Union-Find mapping
_lrg_map.reset_uf_map(j);
}
void PhaseChaitin::Register_Allocate() { void PhaseChaitin::Register_Allocate() {
// Above the OLD FP (and in registers) are the incoming arguments. Stack // Above the OLD FP (and in registers) are the incoming arguments. Stack
@ -231,14 +367,12 @@ void PhaseChaitin::Register_Allocate() {
// all copy-related live ranges low and then using the max copy-related // all copy-related live ranges low and then using the max copy-related
// live range as a cut-off for LIVE and the IFG. In other words, I can // live range as a cut-off for LIVE and the IFG. In other words, I can
// build a subset of LIVE and IFG just for copies. // build a subset of LIVE and IFG just for copies.
PhaseLive live(_cfg,_names,&live_arena); PhaseLive live(_cfg, _lrg_map.names(), &live_arena);
// Need IFG for coalescing and coloring // Need IFG for coalescing and coloring
PhaseIFG ifg(&live_arena); PhaseIFG ifg(&live_arena);
_ifg = &ifg; _ifg = &ifg;
if (C->unique() > _names.Size()) _names.extend(C->unique()-1, 0);
// Come out of SSA world to the Named world. Assign (virtual) registers to // Come out of SSA world to the Named world. Assign (virtual) registers to
// Nodes. Use the same register for all inputs and the output of PhiNodes // Nodes. Use the same register for all inputs and the output of PhiNodes
// - effectively ending SSA form. This requires either coalescing live // - effectively ending SSA form. This requires either coalescing live
@ -258,9 +392,9 @@ void PhaseChaitin::Register_Allocate() {
_live = NULL; // Mark live as being not available _live = NULL; // Mark live as being not available
rm.reset_to_mark(); // Reclaim working storage rm.reset_to_mark(); // Reclaim working storage
IndexSet::reset_memory(C, &live_arena); IndexSet::reset_memory(C, &live_arena);
ifg.init(_maxlrg); // Empty IFG ifg.init(_lrg_map.max_lrg_id()); // Empty IFG
gather_lrg_masks( false ); // Collect LRG masks gather_lrg_masks( false ); // Collect LRG masks
live.compute( _maxlrg ); // Compute liveness live.compute(_lrg_map.max_lrg_id()); // Compute liveness
_live = &live; // Mark LIVE as being available _live = &live; // Mark LIVE as being available
} }
@ -276,9 +410,9 @@ void PhaseChaitin::Register_Allocate() {
_live = NULL; _live = NULL;
rm.reset_to_mark(); // Reclaim working storage rm.reset_to_mark(); // Reclaim working storage
IndexSet::reset_memory(C, &live_arena); IndexSet::reset_memory(C, &live_arena);
ifg.init(_maxlrg); ifg.init(_lrg_map.max_lrg_id());
gather_lrg_masks(false); gather_lrg_masks(false);
live.compute( _maxlrg ); live.compute(_lrg_map.max_lrg_id());
_live = &live; _live = &live;
} }
// Create the interference graph using virtual copies // Create the interference graph using virtual copies
@ -310,9 +444,9 @@ void PhaseChaitin::Register_Allocate() {
_live = NULL; _live = NULL;
rm.reset_to_mark(); // Reclaim working storage rm.reset_to_mark(); // Reclaim working storage
IndexSet::reset_memory(C, &live_arena); IndexSet::reset_memory(C, &live_arena);
ifg.init(_maxlrg); ifg.init(_lrg_map.max_lrg_id());
gather_lrg_masks( true ); gather_lrg_masks( true );
live.compute( _maxlrg ); live.compute(_lrg_map.max_lrg_id());
_live = &live; _live = &live;
} }
@ -321,15 +455,23 @@ void PhaseChaitin::Register_Allocate() {
must_spill = build_ifg_physical(&live_arena); must_spill = build_ifg_physical(&live_arena);
// If we have a guaranteed spill, might as well spill now // If we have a guaranteed spill, might as well spill now
if (must_spill) { if (must_spill) {
if( !_maxlrg ) return; if(!_lrg_map.max_lrg_id()) {
return;
}
// Bail out if unique gets too large (ie - unique > MaxNodeLimit) // Bail out if unique gets too large (ie - unique > MaxNodeLimit)
C->check_node_count(10*must_spill, "out of nodes before split"); C->check_node_count(10*must_spill, "out of nodes before split");
if (C->failing()) return; if (C->failing()) {
_maxlrg = Split(_maxlrg, &split_arena); // Split spilling LRG everywhere return;
}
uint new_max_lrg_id = Split(_lrg_map.max_lrg_id(), &split_arena); // Split spilling LRG everywhere
_lrg_map.set_max_lrg_id(new_max_lrg_id);
// Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor) // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor)
// or we failed to split // or we failed to split
C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after physical split"); C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after physical split");
if (C->failing()) return; if (C->failing()) {
return;
}
NOT_PRODUCT(C->verify_graph_edges();) NOT_PRODUCT(C->verify_graph_edges();)
@ -340,9 +482,9 @@ void PhaseChaitin::Register_Allocate() {
_live = NULL; _live = NULL;
rm.reset_to_mark(); // Reclaim working storage rm.reset_to_mark(); // Reclaim working storage
IndexSet::reset_memory(C, &live_arena); IndexSet::reset_memory(C, &live_arena);
ifg.init(_maxlrg); // Build a new interference graph ifg.init(_lrg_map.max_lrg_id()); // Build a new interference graph
gather_lrg_masks( true ); // Collect intersect mask gather_lrg_masks( true ); // Collect intersect mask
live.compute( _maxlrg ); // Compute LIVE live.compute(_lrg_map.max_lrg_id()); // Compute LIVE
_live = &live; _live = &live;
} }
build_ifg_physical(&live_arena); build_ifg_physical(&live_arena);
@ -356,7 +498,7 @@ void PhaseChaitin::Register_Allocate() {
// This cutoff can be larger than below since it is only done once. // This cutoff can be larger than below since it is only done once.
coalesce.coalesce_driver(); coalesce.coalesce_driver();
} }
compress_uf_map_for_nodes(); _lrg_map.compress_uf_map_for_nodes();
#ifdef ASSERT #ifdef ASSERT
verify(&live_arena, true); verify(&live_arena, true);
@ -390,11 +532,16 @@ void PhaseChaitin::Register_Allocate() {
} }
} }
if( !_maxlrg ) return; if (!_lrg_map.max_lrg_id()) {
_maxlrg = Split(_maxlrg, &split_arena); // Split spilling LRG everywhere return;
}
uint new_max_lrg_id = Split(_lrg_map.max_lrg_id(), &split_arena); // Split spilling LRG everywhere
_lrg_map.set_max_lrg_id(new_max_lrg_id);
// Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor) // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor)
C->check_node_count(2 * NodeLimitFudgeFactor, "out of nodes after split"); C->check_node_count(2 * NodeLimitFudgeFactor, "out of nodes after split");
if (C->failing()) return; if (C->failing()) {
return;
}
compact(); // Compact LRGs; return new lower max lrg compact(); // Compact LRGs; return new lower max lrg
@ -404,12 +551,12 @@ void PhaseChaitin::Register_Allocate() {
_live = NULL; _live = NULL;
rm.reset_to_mark(); // Reclaim working storage rm.reset_to_mark(); // Reclaim working storage
IndexSet::reset_memory(C, &live_arena); IndexSet::reset_memory(C, &live_arena);
ifg.init(_maxlrg); ifg.init(_lrg_map.max_lrg_id());
// Create LiveRanGe array. // Create LiveRanGe array.
// Intersect register masks for all USEs and DEFs // Intersect register masks for all USEs and DEFs
gather_lrg_masks(true); gather_lrg_masks(true);
live.compute( _maxlrg ); live.compute(_lrg_map.max_lrg_id());
_live = &live; _live = &live;
} }
must_spill = build_ifg_physical(&live_arena); must_spill = build_ifg_physical(&live_arena);
@ -423,7 +570,7 @@ void PhaseChaitin::Register_Allocate() {
// Check for few live ranges determines how aggressive coalesce is. // Check for few live ranges determines how aggressive coalesce is.
coalesce.coalesce_driver(); coalesce.coalesce_driver();
} }
compress_uf_map_for_nodes(); _lrg_map.compress_uf_map_for_nodes();
#ifdef ASSERT #ifdef ASSERT
verify(&live_arena, true); verify(&live_arena, true);
#endif #endif
@ -452,9 +599,12 @@ void PhaseChaitin::Register_Allocate() {
// max_reg is past the largest *register* used. // max_reg is past the largest *register* used.
// Convert that to a frame_slot number. // Convert that to a frame_slot number.
if( _max_reg <= _matcher._new_SP ) if (_max_reg <= _matcher._new_SP) {
_framesize = C->out_preserve_stack_slots(); _framesize = C->out_preserve_stack_slots();
else _framesize = _max_reg -_matcher._new_SP; }
else {
_framesize = _max_reg -_matcher._new_SP;
}
assert((int)(_matcher._new_SP+_framesize) >= (int)_matcher._out_arg_limit, "framesize must be large enough"); assert((int)(_matcher._new_SP+_framesize) >= (int)_matcher._out_arg_limit, "framesize must be large enough");
// This frame must preserve the required fp alignment // This frame must preserve the required fp alignment
@ -462,8 +612,9 @@ void PhaseChaitin::Register_Allocate() {
assert( _framesize >= 0 && _framesize <= 1000000, "sanity check" ); assert( _framesize >= 0 && _framesize <= 1000000, "sanity check" );
#ifndef PRODUCT #ifndef PRODUCT
_total_framesize += _framesize; _total_framesize += _framesize;
if( (int)_framesize > _max_framesize ) if ((int)_framesize > _max_framesize) {
_max_framesize = _framesize; _max_framesize = _framesize;
}
#endif #endif
// Convert CISC spills // Convert CISC spills
@ -475,15 +626,17 @@ void PhaseChaitin::Register_Allocate() {
log->elem("regalloc attempts='%d' success='%d'", _trip_cnt, !C->failing()); log->elem("regalloc attempts='%d' success='%d'", _trip_cnt, !C->failing());
} }
if (C->failing()) return; if (C->failing()) {
return;
}
NOT_PRODUCT(C->verify_graph_edges();) NOT_PRODUCT(C->verify_graph_edges();)
// Move important info out of the live_arena to longer lasting storage. // Move important info out of the live_arena to longer lasting storage.
alloc_node_regs(_names.Size()); alloc_node_regs(_lrg_map.size());
for (uint i=0; i < _names.Size(); i++) { for (uint i=0; i < _lrg_map.size(); i++) {
if (_names[i]) { // Live range associated with Node? if (_lrg_map.live_range_id(i)) { // Live range associated with Node?
LRG &lrg = lrgs(_names[i]); LRG &lrg = lrgs(_lrg_map.live_range_id(i));
if (!lrg.alive()) { if (!lrg.alive()) {
set_bad(i); set_bad(i);
} else if (lrg.num_regs() == 1) { } else if (lrg.num_regs() == 1) {
@ -537,11 +690,11 @@ void PhaseChaitin::de_ssa() {
Node *n = b->_nodes[j]; Node *n = b->_nodes[j];
// Pre-color to the zero live range, or pick virtual register // Pre-color to the zero live range, or pick virtual register
const RegMask &rm = n->out_RegMask(); const RegMask &rm = n->out_RegMask();
_names.map( n->_idx, rm.is_NotEmpty() ? lr_counter++ : 0 ); _lrg_map.map(n->_idx, rm.is_NotEmpty() ? lr_counter++ : 0);
} }
} }
// Reset the Union-Find mapping to be identity // Reset the Union-Find mapping to be identity
reset_uf_map(lr_counter); _lrg_map.reset_uf_map(lr_counter);
} }
@ -551,7 +704,7 @@ void PhaseChaitin::de_ssa() {
void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) { void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
// Nail down the frame pointer live range // Nail down the frame pointer live range
uint fp_lrg = n2lidx(_cfg._root->in(1)->in(TypeFunc::FramePtr)); uint fp_lrg = _lrg_map.live_range_id(_cfg._root->in(1)->in(TypeFunc::FramePtr));
lrgs(fp_lrg)._cost += 1e12; // Cost is infinite lrgs(fp_lrg)._cost += 1e12; // Cost is infinite
// For all blocks // For all blocks
@ -566,14 +719,14 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
uint idx = n->is_Copy(); uint idx = n->is_Copy();
// Get virtual register number, same as LiveRanGe index // Get virtual register number, same as LiveRanGe index
uint vreg = n2lidx(n); uint vreg = _lrg_map.live_range_id(n);
LRG &lrg = lrgs(vreg); LRG &lrg = lrgs(vreg);
if( vreg ) { // No vreg means un-allocable (e.g. memory) if( vreg ) { // No vreg means un-allocable (e.g. memory)
// Collect has-copy bit // Collect has-copy bit
if( idx ) { if( idx ) {
lrg._has_copy = 1; lrg._has_copy = 1;
uint clidx = n2lidx(n->in(idx)); uint clidx = _lrg_map.live_range_id(n->in(idx));
LRG &copy_src = lrgs(clidx); LRG &copy_src = lrgs(clidx);
copy_src._has_copy = 1; copy_src._has_copy = 1;
} }
@ -773,8 +926,10 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
} }
// Prepare register mask for each input // Prepare register mask for each input
for( uint k = input_edge_start; k < cnt; k++ ) { for( uint k = input_edge_start; k < cnt; k++ ) {
uint vreg = n2lidx(n->in(k)); uint vreg = _lrg_map.live_range_id(n->in(k));
if( !vreg ) continue; if (!vreg) {
continue;
}
// If this instruction is CISC Spillable, add the flags // If this instruction is CISC Spillable, add the flags
// bit to its appropriate input // bit to its appropriate input
@ -857,7 +1012,7 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
} // end for all blocks } // end for all blocks
// Final per-liverange setup // Final per-liverange setup
for (uint i2=0; i2<_maxlrg; i2++) { for (uint i2 = 0; i2 < _lrg_map.max_lrg_id(); i2++) {
LRG &lrg = lrgs(i2); LRG &lrg = lrgs(i2);
assert(!lrg._is_vector || !lrg._fat_proj, "sanity"); assert(!lrg._is_vector || !lrg._fat_proj, "sanity");
if (lrg.num_regs() > 1 && !lrg._fat_proj) { if (lrg.num_regs() > 1 && !lrg._fat_proj) {
@ -879,7 +1034,7 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
// The bit is checked in Simplify. // The bit is checked in Simplify.
void PhaseChaitin::set_was_low() { void PhaseChaitin::set_was_low() {
#ifdef ASSERT #ifdef ASSERT
for( uint i = 1; i < _maxlrg; i++ ) { for (uint i = 1; i < _lrg_map.max_lrg_id(); i++) {
int size = lrgs(i).num_regs(); int size = lrgs(i).num_regs();
uint old_was_lo = lrgs(i)._was_lo; uint old_was_lo = lrgs(i)._was_lo;
lrgs(i)._was_lo = 0; lrgs(i)._was_lo = 0;
@ -913,7 +1068,7 @@ void PhaseChaitin::set_was_low() {
// Compute cost/area ratio, in case we spill. Build the lo-degree list. // Compute cost/area ratio, in case we spill. Build the lo-degree list.
void PhaseChaitin::cache_lrg_info( ) { void PhaseChaitin::cache_lrg_info( ) {
for( uint i = 1; i < _maxlrg; i++ ) { for (uint i = 1; i < _lrg_map.max_lrg_id(); i++) {
LRG &lrg = lrgs(i); LRG &lrg = lrgs(i);
// Check for being of low degree: means we can be trivially colored. // Check for being of low degree: means we can be trivially colored.
@ -949,7 +1104,7 @@ void PhaseChaitin::Pre_Simplify( ) {
// Warm up the lo-degree no-copy list // Warm up the lo-degree no-copy list
int lo_no_copy = 0; int lo_no_copy = 0;
for( uint i = 1; i < _maxlrg; i++ ) { for (uint i = 1; i < _lrg_map.max_lrg_id(); i++) {
if ((lrgs(i).lo_degree() && !lrgs(i)._has_copy) || if ((lrgs(i).lo_degree() && !lrgs(i)._has_copy) ||
!lrgs(i).alive() || !lrgs(i).alive() ||
lrgs(i)._must_spill) { lrgs(i)._must_spill) {
@ -1163,7 +1318,7 @@ static bool is_legal_reg(LRG &lrg, OptoReg::Name reg, int chunk) {
OptoReg::Name PhaseChaitin::bias_color( LRG &lrg, int chunk ) { OptoReg::Name PhaseChaitin::bias_color( LRG &lrg, int chunk ) {
// Check for "at_risk" LRG's // Check for "at_risk" LRG's
uint risk_lrg = Find(lrg._risk_bias); uint risk_lrg = _lrg_map.find(lrg._risk_bias);
if( risk_lrg != 0 ) { if( risk_lrg != 0 ) {
// Walk the colored neighbors of the "at_risk" candidate // Walk the colored neighbors of the "at_risk" candidate
// Choose a color which is both legal and already taken by a neighbor // Choose a color which is both legal and already taken by a neighbor
@ -1179,7 +1334,7 @@ OptoReg::Name PhaseChaitin::bias_color( LRG &lrg, int chunk ) {
} }
} }
uint copy_lrg = Find(lrg._copy_bias); uint copy_lrg = _lrg_map.find(lrg._copy_bias);
if( copy_lrg != 0 ) { if( copy_lrg != 0 ) {
// If he has a color, // If he has a color,
if( !(*(_ifg->_yanked))[copy_lrg] ) { if( !(*(_ifg->_yanked))[copy_lrg] ) {
@ -1423,10 +1578,10 @@ uint PhaseChaitin::Select( ) {
void PhaseChaitin::copy_was_spilled( Node *src, Node *dst ) { void PhaseChaitin::copy_was_spilled( Node *src, Node *dst ) {
if( _spilled_once.test(src->_idx) ) { if( _spilled_once.test(src->_idx) ) {
_spilled_once.set(dst->_idx); _spilled_once.set(dst->_idx);
lrgs(Find(dst))._was_spilled1 = 1; lrgs(_lrg_map.find(dst))._was_spilled1 = 1;
if( _spilled_twice.test(src->_idx) ) { if( _spilled_twice.test(src->_idx) ) {
_spilled_twice.set(dst->_idx); _spilled_twice.set(dst->_idx);
lrgs(Find(dst))._was_spilled2 = 1; lrgs(_lrg_map.find(dst))._was_spilled2 = 1;
} }
} }
} }
@ -1471,7 +1626,7 @@ void PhaseChaitin::fixup_spills() {
MachNode *mach = n->as_Mach(); MachNode *mach = n->as_Mach();
inp = mach->operand_index(inp); inp = mach->operand_index(inp);
Node *src = n->in(inp); // Value to load or store Node *src = n->in(inp); // Value to load or store
LRG &lrg_cisc = lrgs( Find_const(src) ); LRG &lrg_cisc = lrgs(_lrg_map.find_const(src));
OptoReg::Name src_reg = lrg_cisc.reg(); OptoReg::Name src_reg = lrg_cisc.reg();
// Doubles record the HIGH register of an adjacent pair. // Doubles record the HIGH register of an adjacent pair.
src_reg = OptoReg::add(src_reg,1-lrg_cisc.num_regs()); src_reg = OptoReg::add(src_reg,1-lrg_cisc.num_regs());
@ -1554,9 +1709,9 @@ Node *PhaseChaitin::find_base_for_derived( Node **derived_base_map, Node *derive
Block *startb = _cfg._bbs[C->top()->_idx]; Block *startb = _cfg._bbs[C->top()->_idx];
startb->_nodes.insert(startb->find_node(C->top()), base ); startb->_nodes.insert(startb->find_node(C->top()), base );
_cfg._bbs.map( base->_idx, startb ); _cfg._bbs.map( base->_idx, startb );
assert (n2lidx(base) == 0, "should not have LRG yet"); assert(_lrg_map.live_range_id(base) == 0, "should not have LRG yet");
} }
if (n2lidx(base) == 0) { if (_lrg_map.live_range_id(base) == 0) {
new_lrg(base, maxlrg++); new_lrg(base, maxlrg++);
} }
assert(base->in(0) == _cfg._root && assert(base->in(0) == _cfg._root &&
@ -1631,7 +1786,7 @@ Node *PhaseChaitin::find_base_for_derived( Node **derived_base_map, Node *derive
// required edge set. // required edge set.
bool PhaseChaitin::stretch_base_pointer_live_ranges(ResourceArea *a) { bool PhaseChaitin::stretch_base_pointer_live_ranges(ResourceArea *a) {
int must_recompute_live = false; int must_recompute_live = false;
uint maxlrg = _maxlrg; uint maxlrg = _lrg_map.max_lrg_id();
Node **derived_base_map = (Node**)a->Amalloc(sizeof(Node*)*C->unique()); Node **derived_base_map = (Node**)a->Amalloc(sizeof(Node*)*C->unique());
memset( derived_base_map, 0, sizeof(Node*)*C->unique() ); memset( derived_base_map, 0, sizeof(Node*)*C->unique() );
@ -1669,15 +1824,18 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges( ResourceArea *a ) {
} }
// Get value being defined // Get value being defined
uint lidx = n2lidx(n); uint lidx = _lrg_map.live_range_id(n);
if( lidx && lidx < _maxlrg /* Ignore the occasional brand-new live range */) { // Ignore the occasional brand-new live range
if (lidx && lidx < _lrg_map.max_lrg_id()) {
// Remove from live-out set // Remove from live-out set
liveout.remove(lidx); liveout.remove(lidx);
// Copies do not define a new value and so do not interfere. // Copies do not define a new value and so do not interfere.
// Remove the copies source from the liveout set before interfering. // Remove the copies source from the liveout set before interfering.
uint idx = n->is_Copy(); uint idx = n->is_Copy();
if( idx ) liveout.remove( n2lidx(n->in(idx)) ); if (idx) {
liveout.remove(_lrg_map.live_range_id(n->in(idx)));
}
} }
// Found a safepoint? // Found a safepoint?
@ -1696,7 +1854,7 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges( ResourceArea *a ) {
// If its an OOP with a non-zero offset, then it is derived. // If its an OOP with a non-zero offset, then it is derived.
if( tj && tj->_offset != 0 && tj->isa_oop_ptr() ) { if( tj && tj->_offset != 0 && tj->isa_oop_ptr() ) {
Node *base = find_base_for_derived(derived_base_map, derived, maxlrg); Node *base = find_base_for_derived(derived_base_map, derived, maxlrg);
assert( base->_idx < _names.Size(), "" ); assert(base->_idx < _lrg_map.size(), "");
// Add reaching DEFs of derived pointer and base pointer as a // Add reaching DEFs of derived pointer and base pointer as a
// pair of inputs // pair of inputs
n->add_req(derived); n->add_req(derived);
@ -1706,9 +1864,9 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges( ResourceArea *a ) {
// Since I'm working on the SSA form, live-ness amounts to // Since I'm working on the SSA form, live-ness amounts to
// reaching def's. So if I find the base's live range then // reaching def's. So if I find the base's live range then
// I know the base's def reaches here. // I know the base's def reaches here.
if( (n2lidx(base) >= _maxlrg ||// (Brand new base (hence not live) or if ((_lrg_map.live_range_id(base) >= _lrg_map.max_lrg_id() || // (Brand new base (hence not live) or
!liveout.member( n2lidx(base) ) ) && // not live) AND !liveout.member(_lrg_map.live_range_id(base))) && // not live) AND
(n2lidx(base) > 0) && // not a constant (_lrg_map.live_range_id(base) > 0) && // not a constant
_cfg._bbs[base->_idx] != b) { // base not def'd in blk) _cfg._bbs[base->_idx] != b) { // base not def'd in blk)
// Base pointer is not currently live. Since I stretched // Base pointer is not currently live. Since I stretched
// the base pointer to here and it crosses basic-block // the base pointer to here and it crosses basic-block
@ -1723,21 +1881,23 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges( ResourceArea *a ) {
// Make all inputs live // Make all inputs live
if (!n->is_Phi()) { // Phi function uses come from prior block if (!n->is_Phi()) { // Phi function uses come from prior block
for (uint k = 1; k < n->req(); k++) { for (uint k = 1; k < n->req(); k++) {
uint lidx = n2lidx(n->in(k)); uint lidx = _lrg_map.live_range_id(n->in(k));
if( lidx < _maxlrg ) if (lidx < _lrg_map.max_lrg_id()) {
liveout.insert(lidx); liveout.insert(lidx);
} }
} }
}
} // End of forall instructions in block } // End of forall instructions in block
liveout.clear(); // Free the memory used by liveout. liveout.clear(); // Free the memory used by liveout.
} // End of forall blocks } // End of forall blocks
_maxlrg = maxlrg; _lrg_map.set_max_lrg_id(maxlrg);
// If I created a new live range I need to recompute live // If I created a new live range I need to recompute live
if( maxlrg != _ifg->_maxlrg ) if (maxlrg != _ifg->_maxlrg) {
must_recompute_live = true; must_recompute_live = true;
}
return must_recompute_live != 0; return must_recompute_live != 0;
} }
@ -1745,14 +1905,15 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges( ResourceArea *a ) {
//------------------------------add_reference---------------------------------- //------------------------------add_reference----------------------------------
// Extend the node to LRG mapping // Extend the node to LRG mapping
void PhaseChaitin::add_reference(const Node *node, const Node *old_node) { void PhaseChaitin::add_reference(const Node *node, const Node *old_node) {
_names.extend( node->_idx, n2lidx(old_node) ); _lrg_map.extend(node->_idx, _lrg_map.live_range_id(old_node));
} }
//------------------------------dump------------------------------------------- //------------------------------dump-------------------------------------------
#ifndef PRODUCT #ifndef PRODUCT
void PhaseChaitin::dump(const Node *n) const { void PhaseChaitin::dump(const Node *n) const {
uint r = (n->_idx < _names.Size() ) ? Find_const(n) : 0; uint r = (n->_idx < _lrg_map.size()) ? _lrg_map.find_const(n) : 0;
tty->print("L%d",r); tty->print("L%d",r);
if (r && n->Opcode() != Op_Phi) { if (r && n->Opcode() != Op_Phi) {
if( _node_regs ) { // Got a post-allocation copy of allocation? if( _node_regs ) { // Got a post-allocation copy of allocation?
@ -1777,9 +1938,11 @@ void PhaseChaitin::dump( const Node *n ) const {
uint k; uint k;
for (k = 0; k < n->req(); k++) { for (k = 0; k < n->req(); k++) {
Node *m = n->in(k); Node *m = n->in(k);
if( !m ) tty->print("_ "); if (!m) {
tty->print("_ ");
}
else { else {
uint r = (m->_idx < _names.Size() ) ? Find_const(m) : 0; uint r = (m->_idx < _lrg_map.size()) ? _lrg_map.find_const(m) : 0;
tty->print("L%d",r); tty->print("L%d",r);
// Data MultiNode's can have projections with no real registers. // Data MultiNode's can have projections with no real registers.
// Don't die while dumping them. // Don't die while dumping them.
@ -1810,8 +1973,10 @@ void PhaseChaitin::dump( const Node *n ) const {
if( k < n->len() && n->in(k) ) tty->print("| "); if( k < n->len() && n->in(k) ) tty->print("| ");
for( ; k < n->len(); k++ ) { for( ; k < n->len(); k++ ) {
Node *m = n->in(k); Node *m = n->in(k);
if( !m ) break; if(!m) {
uint r = (m->_idx < _names.Size() ) ? Find_const(m) : 0; break;
}
uint r = (m->_idx < _lrg_map.size()) ? _lrg_map.find_const(m) : 0;
tty->print("L%d",r); tty->print("L%d",r);
tty->print("/N%d ",m->_idx); tty->print("/N%d ",m->_idx);
} }
@ -1839,7 +2004,7 @@ void PhaseChaitin::dump( const Block * b ) const {
tty->print("{"); tty->print("{");
uint i; uint i;
while ((i = elements.next()) != 0) { while ((i = elements.next()) != 0) {
tty->print("L%d ", Find_const(i)); tty->print("L%d ", _lrg_map.find_const(i));
} }
tty->print_cr("}"); tty->print_cr("}");
} }
@ -1863,10 +2028,14 @@ void PhaseChaitin::dump() const {
// Dump LRG array // Dump LRG array
tty->print("--- Live RanGe Array ---\n"); tty->print("--- Live RanGe Array ---\n");
for(uint i2 = 1; i2 < _maxlrg; i2++ ) { for (uint i2 = 1; i2 < _lrg_map.max_lrg_id(); i2++) {
tty->print("L%d: ",i2); tty->print("L%d: ",i2);
if( i2 < _ifg->_maxlrg ) lrgs(i2).dump( ); if (i2 < _ifg->_maxlrg) {
else tty->print_cr("new LRG"); lrgs(i2).dump();
}
else {
tty->print_cr("new LRG");
}
} }
tty->print_cr(""); tty->print_cr("");
@ -1939,7 +2108,7 @@ char *PhaseChaitin::dump_register( const Node *n, char *buf ) const {
// Post allocation, use direct mappings, no LRG info available // Post allocation, use direct mappings, no LRG info available
print_reg( get_reg_first(n), this, buf ); print_reg( get_reg_first(n), this, buf );
} else { } else {
uint lidx = Find_const(n); // Grab LRG number uint lidx = _lrg_map.find_const(n); // Grab LRG number
if( !_ifg ) { if( !_ifg ) {
sprintf(buf,"L%d",lidx); // No register binding yet sprintf(buf,"L%d",lidx); // No register binding yet
} else if( !lidx ) { // Special, not allocated value } else if( !lidx ) { // Special, not allocated value
@ -1968,7 +2137,7 @@ void PhaseChaitin::dump_for_spill_split_recycle() const {
if( WizardMode && (PrintCompilation || PrintOpto) ) { if( WizardMode && (PrintCompilation || PrintOpto) ) {
// Display which live ranges need to be split and the allocator's state // Display which live ranges need to be split and the allocator's state
tty->print_cr("Graph-Coloring Iteration %d will split the following live ranges", _trip_cnt); tty->print_cr("Graph-Coloring Iteration %d will split the following live ranges", _trip_cnt);
for( uint bidx = 1; bidx < _maxlrg; bidx++ ) { for (uint bidx = 1; bidx < _lrg_map.max_lrg_id(); bidx++) {
if( lrgs(bidx).alive() && lrgs(bidx).reg() >= LRG::SPILL_REG ) { if( lrgs(bidx).alive() && lrgs(bidx).reg() >= LRG::SPILL_REG ) {
tty->print("L%d: ", bidx); tty->print("L%d: ", bidx);
lrgs(bidx).dump(); lrgs(bidx).dump();
@ -2100,13 +2269,16 @@ void PhaseChaitin::dump_lrg( uint lidx, bool defs_only ) const {
tty->print_cr("---dump of L%d---",lidx); tty->print_cr("---dump of L%d---",lidx);
if (_ifg) { if (_ifg) {
if( lidx >= _maxlrg ) { if (lidx >= _lrg_map.max_lrg_id()) {
tty->print("Attempt to print live range index beyond max live range.\n"); tty->print("Attempt to print live range index beyond max live range.\n");
return; return;
} }
tty->print("L%d: ",lidx); tty->print("L%d: ",lidx);
if( lidx < _ifg->_maxlrg ) lrgs(lidx).dump( ); if (lidx < _ifg->_maxlrg) {
else tty->print_cr("new LRG"); lrgs(lidx).dump();
} else {
tty->print_cr("new LRG");
}
} }
if( _ifg && lidx < _ifg->_maxlrg) { if( _ifg && lidx < _ifg->_maxlrg) {
tty->print("Neighbors: %d - ", _ifg->neighbor_cnt(lidx)); tty->print("Neighbors: %d - ", _ifg->neighbor_cnt(lidx));
@ -2121,7 +2293,7 @@ void PhaseChaitin::dump_lrg( uint lidx, bool defs_only ) const {
// For all instructions // For all instructions
for( uint j = 0; j < b->_nodes.size(); j++ ) { for( uint j = 0; j < b->_nodes.size(); j++ ) {
Node *n = b->_nodes[j]; Node *n = b->_nodes[j];
if( Find_const(n) == lidx ) { if (_lrg_map.find_const(n) == lidx) {
if (!dump_once++) { if (!dump_once++) {
tty->cr(); tty->cr();
b->dump_head( &_cfg._bbs ); b->dump_head( &_cfg._bbs );
@ -2133,8 +2305,10 @@ void PhaseChaitin::dump_lrg( uint lidx, bool defs_only ) const {
uint cnt = n->req(); uint cnt = n->req();
for( uint k = 1; k < cnt; k++ ) { for( uint k = 1; k < cnt; k++ ) {
Node *m = n->in(k); Node *m = n->in(k);
if (!m) continue; // be robust in the dumper if (!m) {
if( Find_const(m) == lidx ) { continue; // be robust in the dumper
}
if (_lrg_map.find_const(m) == lidx) {
if (!dump_once++) { if (!dump_once++) {
tty->cr(); tty->cr();
b->dump_head(&_cfg._bbs); b->dump_head(&_cfg._bbs);

View file

@ -265,18 +265,118 @@ public:
int effective_degree( uint lidx ) const; int effective_degree( uint lidx ) const;
}; };
// TEMPORARILY REPLACED WITH COMMAND LINE FLAG // The LiveRangeMap class is responsible for storing node to live range id mapping.
// Each node is mapped to a live range id (a virtual register). Nodes that are
// not considered for register allocation are given live range id 0.
class LiveRangeMap VALUE_OBJ_CLASS_SPEC {
//// !!!!! Magic Constants need to move into ad file private:
#ifdef SPARC
//#define FLOAT_PRESSURE 30 /* SFLT_REG_mask.Size() - 1 */ uint _max_lrg_id;
//#define INT_PRESSURE 23 /* NOTEMP_I_REG_mask.Size() - 1 */
#define FLOAT_INCREMENT(regs) regs // Union-find map. Declared as a short for speed.
#else // Indexed by live-range number, it returns the compacted live-range number
//#define FLOAT_PRESSURE 6 LRG_List _uf_map;
//#define INT_PRESSURE 6
#define FLOAT_INCREMENT(regs) 1 // Map from Nodes to live ranges
#endif LRG_List _names;
// Straight out of Tarjan's union-find algorithm
uint find_compress(const Node *node) {
uint lrg_id = find_compress(_names[node->_idx]);
_names.map(node->_idx, lrg_id);
return lrg_id;
}
uint find_compress(uint lrg);
public:
const LRG_List& names() {
return _names;
}
uint max_lrg_id() const {
return _max_lrg_id;
}
void set_max_lrg_id(uint max_lrg_id) {
_max_lrg_id = max_lrg_id;
}
uint size() const {
return _names.Size();
}
uint live_range_id(uint idx) const {
return _names[idx];
}
uint live_range_id(const Node *node) const {
return _names[node->_idx];
}
uint uf_live_range_id(uint lrg_id) const {
return _uf_map[lrg_id];
}
void map(uint idx, uint lrg_id) {
_names.map(idx, lrg_id);
}
void uf_map(uint dst_lrg_id, uint src_lrg_id) {
_uf_map.map(dst_lrg_id, src_lrg_id);
}
void extend(uint idx, uint lrg_id) {
_names.extend(idx, lrg_id);
}
void uf_extend(uint dst_lrg_id, uint src_lrg_id) {
_uf_map.extend(dst_lrg_id, src_lrg_id);
}
LiveRangeMap(uint unique)
: _names(unique)
, _uf_map(unique)
, _max_lrg_id(0) {}
uint find_id( const Node *n ) {
uint retval = live_range_id(n);
assert(retval == find(n),"Invalid node to lidx mapping");
return retval;
}
// Reset the Union-Find map to identity
void reset_uf_map(uint max_lrg_id);
// Make all Nodes map directly to their final live range; no need for
// the Union-Find mapping after this call.
void compress_uf_map_for_nodes();
uint find(uint lidx) {
uint uf_lidx = _uf_map[lidx];
return (uf_lidx == lidx) ? uf_lidx : find_compress(lidx);
}
// Convert a Node into a Live Range Index - a lidx
uint find(const Node *node) {
uint lidx = live_range_id(node);
uint uf_lidx = _uf_map[lidx];
return (uf_lidx == lidx) ? uf_lidx : find_compress(node);
}
// Like Find above, but no path compress, so bad asymptotic behavior
uint find_const(uint lrg) const;
// Like Find above, but no path compress, so bad asymptotic behavior
uint find_const(const Node *node) const {
if(node->_idx >= _names.Size()) {
return 0; // not mapped, usual for debug dump
}
return find_const(_names[node->_idx]);
}
};
//------------------------------Chaitin---------------------------------------- //------------------------------Chaitin----------------------------------------
// Briggs-Chaitin style allocation, mostly. // Briggs-Chaitin style allocation, mostly.
@ -286,7 +386,6 @@ class PhaseChaitin : public PhaseRegAlloc {
int _trip_cnt; int _trip_cnt;
int _alternate; int _alternate;
uint _maxlrg; // Max live range number
LRG &lrgs(uint idx) const { return _ifg->lrgs(idx); } LRG &lrgs(uint idx) const { return _ifg->lrgs(idx); }
PhaseLive *_live; // Liveness, used in the interference graph PhaseLive *_live; // Liveness, used in the interference graph
PhaseIFG *_ifg; // Interference graph (for original chunk) PhaseIFG *_ifg; // Interference graph (for original chunk)
@ -294,16 +393,6 @@ class PhaseChaitin : public PhaseRegAlloc {
VectorSet _spilled_once; // Nodes that have been spilled VectorSet _spilled_once; // Nodes that have been spilled
VectorSet _spilled_twice; // Nodes that have been spilled twice VectorSet _spilled_twice; // Nodes that have been spilled twice
LRG_List _names; // Map from Nodes to Live RanGes
// Union-find map. Declared as a short for speed.
// Indexed by live-range number, it returns the compacted live-range number
LRG_List _uf_map;
// Reset the Union-Find map to identity
void reset_uf_map( uint maxlrg );
// Remove the need for the Union-Find mapping
void compress_uf_map_for_nodes( );
// Combine the Live Range Indices for these 2 Nodes into a single live // Combine the Live Range Indices for these 2 Nodes into a single live
// range. Future requests for any Node in either live range will // range. Future requests for any Node in either live range will
// return the live range index for the combined live range. // return the live range index for the combined live range.
@ -322,7 +411,34 @@ class PhaseChaitin : public PhaseRegAlloc {
// Helper functions for Split() // Helper functions for Split()
uint split_DEF( Node *def, Block *b, int loc, uint max, Node **Reachblock, Node **debug_defs, GrowableArray<uint> splits, int slidx ); uint split_DEF( Node *def, Block *b, int loc, uint max, Node **Reachblock, Node **debug_defs, GrowableArray<uint> splits, int slidx );
uint split_USE( Node *def, Block *b, Node *use, uint useidx, uint max, bool def_down, bool cisc_sp, GrowableArray<uint> splits, int slidx ); uint split_USE( Node *def, Block *b, Node *use, uint useidx, uint max, bool def_down, bool cisc_sp, GrowableArray<uint> splits, int slidx );
int clone_projs( Block *b, uint idx, Node *con, Node *copy, uint &maxlrg );
bool clone_projs(Block *b, uint idx, Node *con, Node *copy, LiveRangeMap &lrg_map) {
bool found_projs = clone_projs_shared(b, idx, con, copy, lrg_map.max_lrg_id());
if(found_projs) {
uint max_lrg_id = lrg_map.max_lrg_id();
lrg_map.set_max_lrg_id(max_lrg_id + 1);
}
return found_projs;
}
//------------------------------clone_projs------------------------------------
// After cloning some rematerialized instruction, clone any MachProj's that
// follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants
// use G3 as an address temp.
bool clone_projs(Block *b, uint idx, Node *con, Node *copy, uint &max_lrg_id) {
bool found_projs = clone_projs_shared(b, idx, con, copy, max_lrg_id);
if(found_projs) {
max_lrg_id++;
}
return found_projs;
}
bool clone_projs_shared(Block *b, uint idx, Node *con, Node *copy, uint max_lrg_id);
Node *split_Rematerialize(Node *def, Block *b, uint insidx, uint &maxlrg, GrowableArray<uint> splits, Node *split_Rematerialize(Node *def, Block *b, uint insidx, uint &maxlrg, GrowableArray<uint> splits,
int slidx, uint *lrg2reach, Node **Reachblock, bool walkThru); int slidx, uint *lrg2reach, Node **Reachblock, bool walkThru);
// True if lidx is used before any real register is def'd in the block // True if lidx is used before any real register is def'd in the block
@ -349,20 +465,11 @@ public:
PhaseChaitin( uint unique, PhaseCFG &cfg, Matcher &matcher ); PhaseChaitin( uint unique, PhaseCFG &cfg, Matcher &matcher );
~PhaseChaitin() {} ~PhaseChaitin() {}
// Convert a Node into a Live Range Index - a lidx LiveRangeMap _lrg_map;
uint Find( const Node *n ) {
uint lidx = n2lidx(n);
uint uf_lidx = _uf_map[lidx];
return (uf_lidx == lidx) ? uf_lidx : Find_compress(n);
}
uint Find_const( uint lrg ) const;
uint Find_const( const Node *n ) const;
// Do all the real work of allocate // Do all the real work of allocate
void Register_Allocate(); void Register_Allocate();
uint n2lidx( const Node *n ) const { return _names[n->_idx]; }
float high_frequency_lrg() const { return _high_frequency_lrg; } float high_frequency_lrg() const { return _high_frequency_lrg; }
#ifndef PRODUCT #ifndef PRODUCT
@ -374,18 +481,6 @@ private:
// all inputs to a PhiNode, effectively coalescing live ranges. Insert // all inputs to a PhiNode, effectively coalescing live ranges. Insert
// copies as needed. // copies as needed.
void de_ssa(); void de_ssa();
uint Find_compress( const Node *n );
uint Find( uint lidx ) {
uint uf_lidx = _uf_map[lidx];
return (uf_lidx == lidx) ? uf_lidx : Find_compress(lidx);
}
uint Find_compress( uint lidx );
uint Find_id( const Node *n ) {
uint retval = n2lidx(n);
assert(retval == Find(n),"Invalid node to lidx mapping");
return retval;
}
// Add edge between reg and everything in the vector. // Add edge between reg and everything in the vector.
// Same as _ifg->add_vector(reg,live) EXCEPT use the RegMask // Same as _ifg->add_vector(reg,live) EXCEPT use the RegMask

View file

@ -34,160 +34,12 @@
#include "opto/matcher.hpp" #include "opto/matcher.hpp"
#include "opto/regmask.hpp" #include "opto/regmask.hpp"
//=============================================================================
//------------------------------reset_uf_map-----------------------------------
void PhaseChaitin::reset_uf_map( uint maxlrg ) {
_maxlrg = maxlrg;
// Force the Union-Find mapping to be at least this large
_uf_map.extend(_maxlrg,0);
// Initialize it to be the ID mapping.
for( uint i=0; i<_maxlrg; i++ )
_uf_map.map(i,i);
}
//------------------------------compress_uf_map--------------------------------
// Make all Nodes map directly to their final live range; no need for
// the Union-Find mapping after this call.
void PhaseChaitin::compress_uf_map_for_nodes( ) {
// For all Nodes, compress mapping
uint unique = _names.Size();
for( uint i=0; i<unique; i++ ) {
uint lrg = _names[i];
uint compressed_lrg = Find(lrg);
if( lrg != compressed_lrg )
_names.map(i,compressed_lrg);
}
}
//------------------------------Find-------------------------------------------
// Straight out of Tarjan's union-find algorithm
uint PhaseChaitin::Find_compress( uint lrg ) {
uint cur = lrg;
uint next = _uf_map[cur];
while( next != cur ) { // Scan chain of equivalences
assert( next < cur, "always union smaller" );
cur = next; // until find a fixed-point
next = _uf_map[cur];
}
// Core of union-find algorithm: update chain of
// equivalences to be equal to the root.
while( lrg != next ) {
uint tmp = _uf_map[lrg];
_uf_map.map(lrg, next);
lrg = tmp;
}
return lrg;
}
//------------------------------Find-------------------------------------------
// Straight out of Tarjan's union-find algorithm
uint PhaseChaitin::Find_compress( const Node *n ) {
uint lrg = Find_compress(_names[n->_idx]);
_names.map(n->_idx,lrg);
return lrg;
}
//------------------------------Find_const-------------------------------------
// Like Find above, but no path compress, so bad asymptotic behavior
uint PhaseChaitin::Find_const( uint lrg ) const {
if( !lrg ) return lrg; // Ignore the zero LRG
// Off the end? This happens during debugging dumps when you got
// brand new live ranges but have not told the allocator yet.
if( lrg >= _maxlrg ) return lrg;
uint next = _uf_map[lrg];
while( next != lrg ) { // Scan chain of equivalences
assert( next < lrg, "always union smaller" );
lrg = next; // until find a fixed-point
next = _uf_map[lrg];
}
return next;
}
//------------------------------Find-------------------------------------------
// Like Find above, but no path compress, so bad asymptotic behavior
uint PhaseChaitin::Find_const( const Node *n ) const {
if( n->_idx >= _names.Size() ) return 0; // not mapped, usual for debug dump
return Find_const( _names[n->_idx] );
}
//------------------------------Union------------------------------------------
// union 2 sets together.
void PhaseChaitin::Union( const Node *src_n, const Node *dst_n ) {
uint src = Find(src_n);
uint dst = Find(dst_n);
assert( src, "" );
assert( dst, "" );
assert( src < _maxlrg, "oob" );
assert( dst < _maxlrg, "oob" );
assert( src < dst, "always union smaller" );
_uf_map.map(dst,src);
}
//------------------------------new_lrg----------------------------------------
void PhaseChaitin::new_lrg( const Node *x, uint lrg ) {
// Make the Node->LRG mapping
_names.extend(x->_idx,lrg);
// Make the Union-Find mapping an identity function
_uf_map.extend(lrg,lrg);
}
//------------------------------clone_projs------------------------------------
// After cloning some rematerialized instruction, clone any MachProj's that
// follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants
// use G3 as an address temp.
int PhaseChaitin::clone_projs( Block *b, uint idx, Node *con, Node *copy, uint &maxlrg ) {
Block *bcon = _cfg._bbs[con->_idx];
uint cindex = bcon->find_node(con);
Node *con_next = bcon->_nodes[cindex+1];
if( con_next->in(0) != con || !con_next->is_MachProj() )
return false; // No MachProj's follow
// Copy kills after the cloned constant
Node *kills = con_next->clone();
kills->set_req( 0, copy );
b->_nodes.insert( idx, kills );
_cfg._bbs.map( kills->_idx, b );
new_lrg( kills, maxlrg++ );
return true;
}
//------------------------------compact----------------------------------------
// Renumber the live ranges to compact them. Makes the IFG smaller.
void PhaseChaitin::compact() {
// Current the _uf_map contains a series of short chains which are headed
// by a self-cycle. All the chains run from big numbers to little numbers.
// The Find() call chases the chains & shortens them for the next Find call.
// We are going to change this structure slightly. Numbers above a moving
// wave 'i' are unchanged. Numbers below 'j' point directly to their
// compacted live range with no further chaining. There are no chains or
// cycles below 'i', so the Find call no longer works.
uint j=1;
uint i;
for( i=1; i < _maxlrg; i++ ) {
uint lr = _uf_map[i];
// Ignore unallocated live ranges
if( !lr ) continue;
assert( lr <= i, "" );
_uf_map.map(i, ( lr == i ) ? j++ : _uf_map[lr]);
}
if( false ) // PrintOptoCompactLiveRanges
printf("Compacted %d LRs from %d\n",i-j,i);
// Now change the Node->LR mapping to reflect the compacted names
uint unique = _names.Size();
for( i=0; i<unique; i++ )
_names.map(i,_uf_map[_names[i]]);
// Reset the Union-Find mapping
reset_uf_map(j);
}
//============================================================================= //=============================================================================
//------------------------------Dump------------------------------------------- //------------------------------Dump-------------------------------------------
#ifndef PRODUCT #ifndef PRODUCT
void PhaseCoalesce::dump(Node *n) const { void PhaseCoalesce::dump(Node *n) const {
// Being a const function means I cannot use 'Find' // Being a const function means I cannot use 'Find'
uint r = _phc.Find(n); uint r = _phc._lrg_map.find(n);
tty->print("L%d/N%d ",r,n->_idx); tty->print("L%d/N%d ",r,n->_idx);
} }
@ -236,8 +88,8 @@ void PhaseCoalesce::dump() const {
//------------------------------combine_these_two------------------------------ //------------------------------combine_these_two------------------------------
// Combine the live ranges def'd by these 2 Nodes. N2 is an input to N1. // Combine the live ranges def'd by these 2 Nodes. N2 is an input to N1.
void PhaseCoalesce::combine_these_two(Node *n1, Node *n2) { void PhaseCoalesce::combine_these_two(Node *n1, Node *n2) {
uint lr1 = _phc.Find(n1); uint lr1 = _phc._lrg_map.find(n1);
uint lr2 = _phc.Find(n2); uint lr2 = _phc._lrg_map.find(n2);
if( lr1 != lr2 && // Different live ranges already AND if( lr1 != lr2 && // Different live ranges already AND
!_phc._ifg->test_edge_sq( lr1, lr2 ) ) { // Do not interfere !_phc._ifg->test_edge_sq( lr1, lr2 ) ) { // Do not interfere
LRG *lrg1 = &_phc.lrgs(lr1); LRG *lrg1 = &_phc.lrgs(lr1);
@ -310,10 +162,14 @@ void PhaseAggressiveCoalesce::insert_copy_with_overlap( Block *b, Node *copy, ui
Node *n = b->_nodes[i]; Node *n = b->_nodes[i];
// Check for end of virtual copies; this is also the end of the // Check for end of virtual copies; this is also the end of the
// parallel renaming effort. // parallel renaming effort.
if( n->_idx < _unique ) break; if (n->_idx < _unique) {
break;
}
uint idx = n->is_Copy(); uint idx = n->is_Copy();
assert( idx || n->is_Con() || n->is_MachProj(), "Only copies during parallel renaming" ); assert( idx || n->is_Con() || n->is_MachProj(), "Only copies during parallel renaming" );
if( idx && _phc.Find(n->in(idx)) == dst_name ) break; if (idx && _phc._lrg_map.find(n->in(idx)) == dst_name) {
break;
}
i--; i--;
} }
uint last_use_idx = i; uint last_use_idx = i;
@ -328,9 +184,11 @@ void PhaseAggressiveCoalesce::insert_copy_with_overlap( Block *b, Node *copy, ui
Node *n = b->_nodes[i]; Node *n = b->_nodes[i];
// Check for end of virtual copies; this is also the end of the // Check for end of virtual copies; this is also the end of the
// parallel renaming effort. // parallel renaming effort.
if( n->_idx < _unique ) break; if (n->_idx < _unique) {
break;
}
assert( n->is_Copy() || n->is_Con() || n->is_MachProj(), "Only copies during parallel renaming" ); assert( n->is_Copy() || n->is_Con() || n->is_MachProj(), "Only copies during parallel renaming" );
if( _phc.Find(n) == src_name ) { if (_phc._lrg_map.find(n) == src_name) {
kill_src_idx = i; kill_src_idx = i;
break; break;
} }
@ -341,7 +199,10 @@ void PhaseAggressiveCoalesce::insert_copy_with_overlap( Block *b, Node *copy, ui
// Need to break a cycle with a temp // Need to break a cycle with a temp
uint idx = copy->is_Copy(); uint idx = copy->is_Copy();
Node *tmp = copy->clone(); Node *tmp = copy->clone();
_phc.new_lrg(tmp,_phc._maxlrg++); uint max_lrg_id = _phc._lrg_map.max_lrg_id();
_phc.new_lrg(tmp, max_lrg_id);
_phc._lrg_map.set_max_lrg_id(max_lrg_id + 1);
// Insert new temp between copy and source // Insert new temp between copy and source
tmp ->set_req(idx,copy->in(idx)); tmp ->set_req(idx,copy->in(idx));
copy->set_req(idx,tmp); copy->set_req(idx,tmp);
@ -359,10 +220,10 @@ void PhaseAggressiveCoalesce::insert_copy_with_overlap( Block *b, Node *copy, ui
void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) { void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
// We do LRGs compressing and fix a liveout data only here since the other // We do LRGs compressing and fix a liveout data only here since the other
// place in Split() is guarded by the assert which we never hit. // place in Split() is guarded by the assert which we never hit.
_phc.compress_uf_map_for_nodes(); _phc._lrg_map.compress_uf_map_for_nodes();
// Fix block's liveout data for compressed live ranges. // Fix block's liveout data for compressed live ranges.
for(uint lrg = 1; lrg < _phc._maxlrg; lrg++ ) { for (uint lrg = 1; lrg < _phc._lrg_map.max_lrg_id(); lrg++) {
uint compressed_lrg = _phc.Find(lrg); uint compressed_lrg = _phc._lrg_map.find(lrg);
if (lrg != compressed_lrg) { if (lrg != compressed_lrg) {
for (uint bidx = 0; bidx < _phc._cfg._num_blocks; bidx++) { for (uint bidx = 0; bidx < _phc._cfg._num_blocks; bidx++) {
IndexSet *liveout = _phc._live->live(_phc._cfg._blocks[bidx]); IndexSet *liveout = _phc._live->live(_phc._cfg._blocks[bidx]);
@ -392,16 +253,17 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
uint cidx = copy->is_Copy(); uint cidx = copy->is_Copy();
if( cidx ) { if( cidx ) {
Node *def = copy->in(cidx); Node *def = copy->in(cidx);
if( _phc.Find(copy) == _phc.Find(def) ) if (_phc._lrg_map.find(copy) == _phc._lrg_map.find(def)) {
n->set_req(k, def); n->set_req(k, def);
} }
} }
}
// Remove any explicit copies that get coalesced. // Remove any explicit copies that get coalesced.
uint cidx = n->is_Copy(); uint cidx = n->is_Copy();
if( cidx ) { if( cidx ) {
Node *def = n->in(cidx); Node *def = n->in(cidx);
if( _phc.Find(n) == _phc.Find(def) ) { if (_phc._lrg_map.find(n) == _phc._lrg_map.find(def)) {
n->replace_by(def); n->replace_by(def);
n->set_req(cidx,NULL); n->set_req(cidx,NULL);
b->_nodes.remove(l); b->_nodes.remove(l);
@ -412,13 +274,15 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
if (n->is_Phi()) { if (n->is_Phi()) {
// Get the chosen name for the Phi // Get the chosen name for the Phi
uint phi_name = _phc.Find( n ); uint phi_name = _phc._lrg_map.find(n);
// Ignore the pre-allocated specials // Ignore the pre-allocated specials
if( !phi_name ) continue; if (!phi_name) {
continue;
}
// Check for mismatch inputs to Phi // Check for mismatch inputs to Phi
for (uint j = 1; j < cnt; j++) { for (uint j = 1; j < cnt; j++) {
Node *m = n->in(j); Node *m = n->in(j);
uint src_name = _phc.Find(m); uint src_name = _phc._lrg_map.find(m);
if (src_name != phi_name) { if (src_name != phi_name) {
Block *pred = _phc._cfg._bbs[b->pred(j)->_idx]; Block *pred = _phc._cfg._bbs[b->pred(j)->_idx];
Node *copy; Node *copy;
@ -430,7 +294,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
// Insert the copy in the predecessor basic block // Insert the copy in the predecessor basic block
pred->add_inst(copy); pred->add_inst(copy);
// Copy any flags as well // Copy any flags as well
_phc.clone_projs( pred, pred->end_idx(), m, copy, _phc._maxlrg ); _phc.clone_projs(pred, pred->end_idx(), m, copy, _phc._lrg_map);
} else { } else {
const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()]; const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()];
copy = new (C) MachSpillCopyNode(m, *rm, *rm); copy = new (C) MachSpillCopyNode(m, *rm, *rm);
@ -441,7 +305,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
n->set_req(j, copy); n->set_req(j, copy);
_phc._cfg._bbs.map( copy->_idx, pred ); _phc._cfg._bbs.map( copy->_idx, pred );
// Extend ("register allocate") the names array for the copy. // Extend ("register allocate") the names array for the copy.
_phc._names.extend( copy->_idx, phi_name ); _phc._lrg_map.extend(copy->_idx, phi_name);
} // End of if Phi names do not match } // End of if Phi names do not match
} // End of for all inputs to Phi } // End of for all inputs to Phi
} else { // End of if Phi } else { // End of if Phi
@ -450,11 +314,11 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
uint idx; uint idx;
if( n->is_Mach() && (idx=n->as_Mach()->two_adr()) ) { if( n->is_Mach() && (idx=n->as_Mach()->two_adr()) ) {
// Get the chosen name for the Node // Get the chosen name for the Node
uint name = _phc.Find( n ); uint name = _phc._lrg_map.find(n);
assert (name, "no 2-address specials"); assert (name, "no 2-address specials");
// Check for name mis-match on the 2-address input // Check for name mis-match on the 2-address input
Node *m = n->in(idx); Node *m = n->in(idx);
if( _phc.Find(m) != name ) { if (_phc._lrg_map.find(m) != name) {
Node *copy; Node *copy;
assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach"); assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach");
// At this point it is unsafe to extend live ranges (6550579). // At this point it is unsafe to extend live ranges (6550579).
@ -464,8 +328,9 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
copy = m->clone(); copy = m->clone();
// Insert the copy in the basic block, just before us // Insert the copy in the basic block, just before us
b->_nodes.insert(l++, copy); b->_nodes.insert(l++, copy);
if( _phc.clone_projs( b, l, m, copy, _phc._maxlrg ) ) if(_phc.clone_projs(b, l, m, copy, _phc._lrg_map)) {
l++; l++;
}
} else { } else {
const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()]; const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()];
copy = new (C) MachSpillCopyNode(m, *rm, *rm); copy = new (C) MachSpillCopyNode(m, *rm, *rm);
@ -475,7 +340,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
// Insert the copy in the use-def chain // Insert the copy in the use-def chain
n->set_req(idx, copy); n->set_req(idx, copy);
// Extend ("register allocate") the names array for the copy. // Extend ("register allocate") the names array for the copy.
_phc._names.extend( copy->_idx, name ); _phc._lrg_map.extend(copy->_idx, name);
_phc._cfg._bbs.map( copy->_idx, b ); _phc._cfg._bbs.map( copy->_idx, b );
} }
@ -490,9 +355,11 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
for(uint inpidx = debug_start; inpidx < debug_end; inpidx++) { for(uint inpidx = debug_start; inpidx < debug_end; inpidx++) {
// Do not split monitors; they are only needed for debug table // Do not split monitors; they are only needed for debug table
// entries and need no code. // entries and need no code.
if( jvms->is_monitor_use(inpidx) ) continue; if (jvms->is_monitor_use(inpidx)) {
continue;
}
Node *inp = n->in(inpidx); Node *inp = n->in(inpidx);
uint nidx = _phc.n2lidx(inp); uint nidx = _phc._lrg_map.live_range_id(inp);
LRG &lrg = lrgs(nidx); LRG &lrg = lrgs(nidx);
// If this lrg has a high frequency use/def // If this lrg has a high frequency use/def
@ -519,7 +386,9 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
// Insert the copy in the basic block, just before us // Insert the copy in the basic block, just before us
b->_nodes.insert( l++, copy ); b->_nodes.insert( l++, copy );
// Extend ("register allocate") the names array for the copy. // Extend ("register allocate") the names array for the copy.
_phc.new_lrg( copy, _phc._maxlrg++ ); uint max_lrg_id = _phc._lrg_map.max_lrg_id();
_phc.new_lrg(copy, max_lrg_id);
_phc._lrg_map.set_max_lrg_id(max_lrg_id + 1);
_phc._cfg._bbs.map(copy->_idx, b); _phc._cfg._bbs.map(copy->_idx, b);
//tty->print_cr("Split a debug use in Aggressive Coalesce"); //tty->print_cr("Split a debug use in Aggressive Coalesce");
} // End of if high frequency use/def } // End of if high frequency use/def
@ -593,7 +462,7 @@ void PhaseAggressiveCoalesce::coalesce( Block *b ) {
//============================================================================= //=============================================================================
//------------------------------PhaseConservativeCoalesce---------------------- //------------------------------PhaseConservativeCoalesce----------------------
PhaseConservativeCoalesce::PhaseConservativeCoalesce(PhaseChaitin &chaitin) : PhaseCoalesce(chaitin) { PhaseConservativeCoalesce::PhaseConservativeCoalesce(PhaseChaitin &chaitin) : PhaseCoalesce(chaitin) {
_ulr.initialize(_phc._maxlrg); _ulr.initialize(_phc._lrg_map.max_lrg_id());
} }
//------------------------------verify----------------------------------------- //------------------------------verify-----------------------------------------
@ -673,10 +542,14 @@ uint PhaseConservativeCoalesce::compute_separating_interferences(Node *dst_copy,
// Else work back one in copy chain // Else work back one in copy chain
prev_copy = prev_copy->in(prev_copy->is_Copy()); prev_copy = prev_copy->in(prev_copy->is_Copy());
} else { // Else collect interferences } else { // Else collect interferences
uint lidx = _phc.Find(x); uint lidx = _phc._lrg_map.find(x);
// Found another def of live-range being stretched? // Found another def of live-range being stretched?
if( lidx == lr1 ) return max_juint; if(lidx == lr1) {
if( lidx == lr2 ) return max_juint; return max_juint;
}
if(lidx == lr2) {
return max_juint;
}
// If we attempt to coalesce across a bound def // If we attempt to coalesce across a bound def
if( lrgs(lidx).is_bound() ) { if( lrgs(lidx).is_bound() ) {
@ -753,26 +626,36 @@ static void record_bias( const PhaseIFG *ifg, int lr1, int lr2 ) {
// Compute the compatible register masks. // Compute the compatible register masks.
bool PhaseConservativeCoalesce::copy_copy(Node *dst_copy, Node *src_copy, Block *b, uint bindex) { bool PhaseConservativeCoalesce::copy_copy(Node *dst_copy, Node *src_copy, Block *b, uint bindex) {
if( !dst_copy->is_SpillCopy() ) return false; if (!dst_copy->is_SpillCopy()) {
if( !src_copy->is_SpillCopy() ) return false; return false;
}
if (!src_copy->is_SpillCopy()) {
return false;
}
Node *src_def = src_copy->in(src_copy->is_Copy()); Node *src_def = src_copy->in(src_copy->is_Copy());
uint lr1 = _phc.Find(dst_copy); uint lr1 = _phc._lrg_map.find(dst_copy);
uint lr2 = _phc.Find(src_def ); uint lr2 = _phc._lrg_map.find(src_def);
// Same live ranges already? // Same live ranges already?
if( lr1 == lr2 ) return false; if (lr1 == lr2) {
return false;
}
// Interfere? // Interfere?
if( _phc._ifg->test_edge_sq( lr1, lr2 ) ) return false; if (_phc._ifg->test_edge_sq(lr1, lr2)) {
return false;
}
// Not an oop->int cast; oop->oop, int->int, AND int->oop are OK. // Not an oop->int cast; oop->oop, int->int, AND int->oop are OK.
if( !lrgs(lr1)._is_oop && lrgs(lr2)._is_oop ) // not an oop->int cast if (!lrgs(lr1)._is_oop && lrgs(lr2)._is_oop) { // not an oop->int cast
return false; return false;
}
// Coalescing between an aligned live range and a mis-aligned live range? // Coalescing between an aligned live range and a mis-aligned live range?
// No, no! Alignment changes how we count degree. // No, no! Alignment changes how we count degree.
if( lrgs(lr1)._fat_proj != lrgs(lr2)._fat_proj ) if (lrgs(lr1)._fat_proj != lrgs(lr2)._fat_proj) {
return false; return false;
}
// Sort; use smaller live-range number // Sort; use smaller live-range number
Node *lr1_node = dst_copy; Node *lr1_node = dst_copy;
@ -916,17 +799,5 @@ void PhaseConservativeCoalesce::coalesce( Block *b ) {
PhaseChaitin::_conserv_coalesce++; // Collect stats on success PhaseChaitin::_conserv_coalesce++; // Collect stats on success
continue; continue;
} }
/* do not attempt pairs. About 1/2 of all pairs can be removed by
post-alloc. The other set are too few to bother.
Node *copy2 = copy1->in(idx1);
uint idx2 = copy2->is_Copy();
if( !idx2 ) continue;
if( copy_copy(copy1,copy2,b,i) ) {
i--; // Retry, same location in block
PhaseChaitin::_conserv_coalesce_pair++; // Collect stats on success
continue;
}
*/
} }
} }

View file

@ -41,7 +41,9 @@ protected:
public: public:
// Coalesce copies // Coalesce copies
PhaseCoalesce( PhaseChaitin &chaitin ) : Phase(Coalesce), _phc(chaitin) { } PhaseCoalesce(PhaseChaitin &phc)
: Phase(Coalesce)
, _phc(phc) {}
virtual void verify() = 0; virtual void verify() = 0;

View file

@ -2131,18 +2131,15 @@ void Compile::Code_Gen() {
_regalloc = &regalloc; _regalloc = &regalloc;
{ {
TracePhase t2("regalloc", &_t_registerAllocation, true); TracePhase t2("regalloc", &_t_registerAllocation, true);
// Perform any platform dependent preallocation actions. This is used,
// for example, to avoid taking an implicit null pointer exception
// using the frame pointer on win95.
_regalloc->pd_preallocate_hook();
// Perform register allocation. After Chaitin, use-def chains are // Perform register allocation. After Chaitin, use-def chains are
// no longer accurate (at spill code) and so must be ignored. // no longer accurate (at spill code) and so must be ignored.
// Node->LRG->reg mappings are still accurate. // Node->LRG->reg mappings are still accurate.
_regalloc->Register_Allocate(); _regalloc->Register_Allocate();
// Bail out if the allocator builds too many nodes // Bail out if the allocator builds too many nodes
if (failing()) return; if (failing()) {
return;
}
} }
// Prior to register allocation we kept empty basic blocks in case the // Prior to register allocation we kept empty basic blocks in case the
@ -2160,9 +2157,6 @@ void Compile::Code_Gen() {
cfg.fixup_flow(); cfg.fixup_flow();
} }
// Perform any platform dependent postallocation verifications.
debug_only( _regalloc->pd_postallocate_verify_hook(); )
// Apply peephole optimizations // Apply peephole optimizations
if( OptoPeephole ) { if( OptoPeephole ) {
NOT_PRODUCT( TracePhase t2("peephole", &_t_peephole, TimeCompiler); ) NOT_PRODUCT( TracePhase t2("peephole", &_t_peephole, TimeCompiler); )

View file

@ -616,7 +616,7 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) {
buffer[0] = 0; buffer[0] = 0;
_chaitin->dump_register(node, buffer); _chaitin->dump_register(node, buffer);
print_prop("reg", buffer); print_prop("reg", buffer);
print_prop("lrg", _chaitin->n2lidx(node)); print_prop("lrg", _chaitin->_lrg_map.live_range_id(node));
} }
node->_in_dump_cnt--; node->_in_dump_cnt--;

View file

@ -287,14 +287,13 @@ void PhaseIFG::verify( const PhaseChaitin *pc ) const {
uint last = 0; uint last = 0;
while ((idx = elements.next()) != 0) { while ((idx = elements.next()) != 0) {
assert(idx != i, "Must have empty diagonal"); assert(idx != i, "Must have empty diagonal");
assert( pc->Find_const(idx) == idx, "Must not need Find" ); assert(pc->_lrg_map.find_const(idx) == idx, "Must not need Find");
assert(_adjs[idx].member(i), "IFG not square"); assert(_adjs[idx].member(i), "IFG not square");
assert(!(*_yanked)[idx], "No yanked neighbors"); assert(!(*_yanked)[idx], "No yanked neighbors");
assert(last < idx, "not sorted increasing"); assert(last < idx, "not sorted increasing");
last = idx; last = idx;
} }
assert( !lrgs(i)._degree_valid || assert(!lrgs(i)._degree_valid || effective_degree(i) == lrgs(i).degree(), "degree is valid but wrong");
effective_degree(i) == lrgs(i).degree(), "degree is valid but wrong" );
} }
} }
#endif #endif
@ -342,7 +341,7 @@ void PhaseChaitin::build_ifg_virtual( ) {
Node *n = b->_nodes[j-1]; Node *n = b->_nodes[j-1];
// Get value being defined // Get value being defined
uint r = n2lidx(n); uint r = _lrg_map.live_range_id(n);
// Some special values do not allocate // Some special values do not allocate
if (r) { if (r) {
@ -353,7 +352,9 @@ void PhaseChaitin::build_ifg_virtual( ) {
// Copies do not define a new value and so do not interfere. // Copies do not define a new value and so do not interfere.
// Remove the copies source from the liveout set before interfering. // Remove the copies source from the liveout set before interfering.
uint idx = n->is_Copy(); uint idx = n->is_Copy();
if( idx ) liveout->remove( n2lidx(n->in(idx)) ); if (idx) {
liveout->remove(_lrg_map.live_range_id(n->in(idx)));
}
// Interfere with everything live // Interfere with everything live
interfere_with_live(r, liveout); interfere_with_live(r, liveout);
@ -361,8 +362,9 @@ void PhaseChaitin::build_ifg_virtual( ) {
// Make all inputs live // Make all inputs live
if (!n->is_Phi()) { // Phi function uses come from prior block if (!n->is_Phi()) { // Phi function uses come from prior block
for( uint k = 1; k < n->req(); k++ ) for(uint k = 1; k < n->req(); k++) {
liveout->insert( n2lidx(n->in(k)) ); liveout->insert(_lrg_map.live_range_id(n->in(k)));
}
} }
// 2-address instructions always have the defined value live // 2-address instructions always have the defined value live
@ -394,13 +396,14 @@ void PhaseChaitin::build_ifg_virtual( ) {
n->set_req( 2, tmp ); n->set_req( 2, tmp );
} }
// Defined value interferes with all inputs // Defined value interferes with all inputs
uint lidx = n2lidx(n->in(idx)); uint lidx = _lrg_map.live_range_id(n->in(idx));
for (uint k = 1; k < n->req(); k++) { for (uint k = 1; k < n->req(); k++) {
uint kidx = n2lidx(n->in(k)); uint kidx = _lrg_map.live_range_id(n->in(k));
if( kidx != lidx ) if (kidx != lidx) {
_ifg->add_edge(r, kidx); _ifg->add_edge(r, kidx);
} }
} }
}
} // End of forall instructions in block } // End of forall instructions in block
} // End of forall blocks } // End of forall blocks
} }
@ -542,7 +545,7 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
Node *n = b->_nodes[j - 1]; Node *n = b->_nodes[j - 1];
// Get value being defined // Get value being defined
uint r = n2lidx(n); uint r = _lrg_map.live_range_id(n);
// Some special values do not allocate // Some special values do not allocate
if(r) { if(r) {
@ -556,9 +559,11 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
Node *def = n->in(0); Node *def = n->in(0);
if( !n->is_Proj() || if( !n->is_Proj() ||
// Could also be a flags-projection of a dead ADD or such. // Could also be a flags-projection of a dead ADD or such.
(n2lidx(def) && !liveout.member(n2lidx(def)) ) ) { (_lrg_map.live_range_id(def) && !liveout.member(_lrg_map.live_range_id(def)))) {
b->_nodes.remove(j - 1); b->_nodes.remove(j - 1);
if( lrgs(r)._def == n ) lrgs(r)._def = 0; if (lrgs(r)._def == n) {
lrgs(r)._def = 0;
}
n->disconnect_inputs(NULL, C); n->disconnect_inputs(NULL, C);
_cfg._bbs.map(n->_idx,NULL); _cfg._bbs.map(n->_idx,NULL);
n->replace_by(C->top()); n->replace_by(C->top());
@ -637,7 +642,7 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
// Remove the copies source from the liveout set before interfering. // Remove the copies source from the liveout set before interfering.
uint idx = n->is_Copy(); uint idx = n->is_Copy();
if (idx) { if (idx) {
uint x = n2lidx(n->in(idx)); uint x = _lrg_map.live_range_id(n->in(idx));
if (liveout.remove(x)) { if (liveout.remove(x)) {
lrgs(x)._area -= cost; lrgs(x)._area -= cost;
// Adjust register pressure. // Adjust register pressure.
@ -729,14 +734,17 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
// memory update effect. // memory update effect.
for (uint k = ((n->Opcode() == Op_SCMemProj) ? 0:1); k < n->req(); k++) { for (uint k = ((n->Opcode() == Op_SCMemProj) ? 0:1); k < n->req(); k++) {
Node *def = n->in(k); Node *def = n->in(k);
uint x = n2lidx(def); uint x = _lrg_map.live_range_id(def);
if( !x ) continue; if (!x) {
continue;
}
LRG &lrg = lrgs(x); LRG &lrg = lrgs(x);
// No use-side cost for spilling debug info // No use-side cost for spilling debug info
if( k < debug_start ) if (k < debug_start) {
// A USE costs twice block frequency (once for the Load, once // A USE costs twice block frequency (once for the Load, once
// for a Load-delay). Rematerialized uses only cost once. // for a Load-delay). Rematerialized uses only cost once.
lrg._cost += (def->rematerialize() ? b->_freq : (b->_freq + b->_freq)); lrg._cost += (def->rematerialize() ? b->_freq : (b->_freq + b->_freq));
}
// It is live now // It is live now
if (liveout.insert(x)) { if (liveout.insert(x)) {
// Newly live things assumed live from here to top of block // Newly live things assumed live from here to top of block

View file

@ -44,7 +44,7 @@
// block is put on the worklist. // block is put on the worklist.
// The locally live-in stuff is computed once and added to predecessor // The locally live-in stuff is computed once and added to predecessor
// live-out sets. This separate compilation is done in the outer loop below. // live-out sets. This separate compilation is done in the outer loop below.
PhaseLive::PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena ) : Phase(LIVE), _cfg(cfg), _names(names), _arena(arena), _live(0) { PhaseLive::PhaseLive( const PhaseCFG &cfg, const LRG_List &names, Arena *arena ) : Phase(LIVE), _cfg(cfg), _names(names), _arena(arena), _live(0) {
} }
void PhaseLive::compute(uint maxlrg) { void PhaseLive::compute(uint maxlrg) {

View file

@ -80,7 +80,7 @@ class PhaseLive : public Phase {
Block_List *_worklist; // Worklist for iterative solution Block_List *_worklist; // Worklist for iterative solution
const PhaseCFG &_cfg; // Basic blocks const PhaseCFG &_cfg; // Basic blocks
LRG_List &_names; // Mapping from Nodes to live ranges const LRG_List &_names; // Mapping from Nodes to live ranges
uint _maxlrg; // Largest live-range number uint _maxlrg; // Largest live-range number
Arena *_arena; Arena *_arena;
@ -91,7 +91,7 @@ class PhaseLive : public Phase {
void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ); void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass );
public: public:
PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena ); PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena);
~PhaseLive() {} ~PhaseLive() {}
// Compute liveness info // Compute liveness info
void compute(uint maxlrg); void compute(uint maxlrg);

View file

@ -1044,21 +1044,6 @@ void NonSafepointEmitter::emit_non_safepoint() {
debug_info->end_non_safepoint(pc_offset); debug_info->end_non_safepoint(pc_offset);
} }
// helper for fill_buffer bailout logic
static void turn_off_compiler(Compile* C) {
if (CodeCache::largest_free_block() >= CodeCacheMinimumFreeSpace*10) {
// Do not turn off compilation if a single giant method has
// blown the code cache size.
C->record_failure("excessive request to CodeCache");
} else {
// Let CompilerBroker disable further compilations.
C->record_failure("CodeCache is full");
}
}
//------------------------------init_buffer------------------------------------ //------------------------------init_buffer------------------------------------
CodeBuffer* Compile::init_buffer(uint* blk_starts) { CodeBuffer* Compile::init_buffer(uint* blk_starts) {
@ -1158,7 +1143,7 @@ CodeBuffer* Compile::init_buffer(uint* blk_starts) {
// Have we run out of code space? // Have we run out of code space?
if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
turn_off_compiler(this); C->record_failure("CodeCache is full");
return NULL; return NULL;
} }
// Configure the code buffer. // Configure the code buffer.
@ -1476,7 +1461,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
// Verify that there is sufficient space remaining // Verify that there is sufficient space remaining
cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size); cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size);
if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
turn_off_compiler(this); C->record_failure("CodeCache is full");
return; return;
} }
@ -1633,7 +1618,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
// One last check for failed CodeBuffer::expand: // One last check for failed CodeBuffer::expand:
if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
turn_off_compiler(this); C->record_failure("CodeCache is full");
return; return;
} }

View file

@ -56,7 +56,7 @@ bool PhaseChaitin::may_be_copy_of_callee( Node *def ) const {
int i; int i;
for( i=0; i < limit; i++ ) { for( i=0; i < limit; i++ ) {
if( def->is_Proj() && def->in(0)->is_Start() && if( def->is_Proj() && def->in(0)->is_Start() &&
_matcher.is_save_on_entry(lrgs(n2lidx(def)).reg()) ) _matcher.is_save_on_entry(lrgs(_lrg_map.live_range_id(def)).reg()))
return true; // Direct use of callee-save proj return true; // Direct use of callee-save proj
if( def->is_Copy() ) // Copies carry value through if( def->is_Copy() ) // Copies carry value through
def = def->in(def->is_Copy()); def = def->in(def->is_Copy());
@ -83,7 +83,7 @@ int PhaseChaitin::yank( Node *old, Block *current_block, Node_List *value, Node_
// Count 1 if deleting an instruction from the current block // Count 1 if deleting an instruction from the current block
if( oldb == current_block ) blk_adjust++; if( oldb == current_block ) blk_adjust++;
_cfg._bbs.map(old->_idx,NULL); _cfg._bbs.map(old->_idx,NULL);
OptoReg::Name old_reg = lrgs(n2lidx(old)).reg(); OptoReg::Name old_reg = lrgs(_lrg_map.live_range_id(old)).reg();
if( regnd && (*regnd)[old_reg]==old ) { // Instruction is currently available? if( regnd && (*regnd)[old_reg]==old ) { // Instruction is currently available?
value->map(old_reg,NULL); // Yank from value/regnd maps value->map(old_reg,NULL); // Yank from value/regnd maps
regnd->map(old_reg,NULL); // This register's value is now unknown regnd->map(old_reg,NULL); // This register's value is now unknown
@ -164,7 +164,7 @@ int PhaseChaitin::use_prior_register( Node *n, uint idx, Node *def, Block *curre
// Not every pair of physical registers are assignment compatible, // Not every pair of physical registers are assignment compatible,
// e.g. on sparc floating point registers are not assignable to integer // e.g. on sparc floating point registers are not assignable to integer
// registers. // registers.
const LRG &def_lrg = lrgs(n2lidx(def)); const LRG &def_lrg = lrgs(_lrg_map.live_range_id(def));
OptoReg::Name def_reg = def_lrg.reg(); OptoReg::Name def_reg = def_lrg.reg();
const RegMask &use_mask = n->in_RegMask(idx); const RegMask &use_mask = n->in_RegMask(idx);
bool can_use = ( RegMask::can_represent(def_reg) ? (use_mask.Member(def_reg) != 0) bool can_use = ( RegMask::can_represent(def_reg) ? (use_mask.Member(def_reg) != 0)
@ -209,11 +209,12 @@ int PhaseChaitin::use_prior_register( Node *n, uint idx, Node *def, Block *curre
// Skip through any number of copies (that don't mod oop-i-ness) // Skip through any number of copies (that don't mod oop-i-ness)
Node *PhaseChaitin::skip_copies( Node *c ) { Node *PhaseChaitin::skip_copies( Node *c ) {
int idx = c->is_Copy(); int idx = c->is_Copy();
uint is_oop = lrgs(n2lidx(c))._is_oop; uint is_oop = lrgs(_lrg_map.live_range_id(c))._is_oop;
while (idx != 0) { while (idx != 0) {
guarantee(c->in(idx) != NULL, "must not resurrect dead copy"); guarantee(c->in(idx) != NULL, "must not resurrect dead copy");
if (lrgs(n2lidx(c->in(idx)))._is_oop != is_oop) if (lrgs(_lrg_map.live_range_id(c->in(idx)))._is_oop != is_oop) {
break; // casting copy, not the same value break; // casting copy, not the same value
}
c = c->in(idx); c = c->in(idx);
idx = c->is_Copy(); idx = c->is_Copy();
} }
@ -225,7 +226,7 @@ Node *PhaseChaitin::skip_copies( Node *c ) {
int PhaseChaitin::elide_copy( Node *n, int k, Block *current_block, Node_List &value, Node_List &regnd, bool can_change_regs ) { int PhaseChaitin::elide_copy( Node *n, int k, Block *current_block, Node_List &value, Node_List &regnd, bool can_change_regs ) {
int blk_adjust = 0; int blk_adjust = 0;
uint nk_idx = n2lidx(n->in(k)); uint nk_idx = _lrg_map.live_range_id(n->in(k));
OptoReg::Name nk_reg = lrgs(nk_idx).reg(); OptoReg::Name nk_reg = lrgs(nk_idx).reg();
// Remove obvious same-register copies // Remove obvious same-register copies
@ -234,9 +235,13 @@ int PhaseChaitin::elide_copy( Node *n, int k, Block *current_block, Node_List &v
while( (idx=x->is_Copy()) != 0 ) { while( (idx=x->is_Copy()) != 0 ) {
Node *copy = x->in(idx); Node *copy = x->in(idx);
guarantee(copy != NULL, "must not resurrect dead copy"); guarantee(copy != NULL, "must not resurrect dead copy");
if( lrgs(n2lidx(copy)).reg() != nk_reg ) break; if(lrgs(_lrg_map.live_range_id(copy)).reg() != nk_reg) {
break;
}
blk_adjust += use_prior_register(n,k,copy,current_block,value,regnd); blk_adjust += use_prior_register(n,k,copy,current_block,value,regnd);
if( n->in(k) != copy ) break; // Failed for some cutout? if (n->in(k) != copy) {
break; // Failed for some cutout?
}
x = copy; // Progress, try again x = copy; // Progress, try again
} }
@ -256,7 +261,7 @@ int PhaseChaitin::elide_copy( Node *n, int k, Block *current_block, Node_List &v
if (val == x && nk_idx != 0 && if (val == x && nk_idx != 0 &&
regnd[nk_reg] != NULL && regnd[nk_reg] != x && regnd[nk_reg] != NULL && regnd[nk_reg] != x &&
n2lidx(x) == n2lidx(regnd[nk_reg])) { _lrg_map.live_range_id(x) == _lrg_map.live_range_id(regnd[nk_reg])) {
// When rematerialzing nodes and stretching lifetimes, the // When rematerialzing nodes and stretching lifetimes, the
// allocator will reuse the original def for multidef LRG instead // allocator will reuse the original def for multidef LRG instead
// of the current reaching def because it can't know it's safe to // of the current reaching def because it can't know it's safe to
@ -270,7 +275,7 @@ int PhaseChaitin::elide_copy( Node *n, int k, Block *current_block, Node_List &v
if (val == x) return blk_adjust; // No progress? if (val == x) return blk_adjust; // No progress?
int n_regs = RegMask::num_registers(val->ideal_reg()); int n_regs = RegMask::num_registers(val->ideal_reg());
uint val_idx = n2lidx(val); uint val_idx = _lrg_map.live_range_id(val);
OptoReg::Name val_reg = lrgs(val_idx).reg(); OptoReg::Name val_reg = lrgs(val_idx).reg();
// See if it happens to already be in the correct register! // See if it happens to already be in the correct register!
@ -499,8 +504,8 @@ void PhaseChaitin::post_allocate_copy_removal() {
for( j = 1; j < phi_dex; j++ ) { for( j = 1; j < phi_dex; j++ ) {
uint k; uint k;
Node *phi = b->_nodes[j]; Node *phi = b->_nodes[j];
uint pidx = n2lidx(phi); uint pidx = _lrg_map.live_range_id(phi);
OptoReg::Name preg = lrgs(n2lidx(phi)).reg(); OptoReg::Name preg = lrgs(_lrg_map.live_range_id(phi)).reg();
// Remove copies remaining on edges. Check for junk phi. // Remove copies remaining on edges. Check for junk phi.
Node *u = NULL; Node *u = NULL;
@ -558,7 +563,7 @@ void PhaseChaitin::post_allocate_copy_removal() {
for (k = 1; k < n->req(); k++) { for (k = 1; k < n->req(); k++) {
Node *def = n->in(k); // n->in(k) is a USE; def is the DEF for this USE Node *def = n->in(k); // n->in(k) is a USE; def is the DEF for this USE
guarantee(def != NULL, "no disconnected nodes at this point"); guarantee(def != NULL, "no disconnected nodes at this point");
uint useidx = n2lidx(def); // useidx is the live range index for this USE uint useidx = _lrg_map.live_range_id(def); // useidx is the live range index for this USE
if( useidx ) { if( useidx ) {
OptoReg::Name ureg = lrgs(useidx).reg(); OptoReg::Name ureg = lrgs(useidx).reg();
@ -566,7 +571,7 @@ void PhaseChaitin::post_allocate_copy_removal() {
int idx; // Skip occasional useless copy int idx; // Skip occasional useless copy
while( (idx=def->is_Copy()) != 0 && while( (idx=def->is_Copy()) != 0 &&
def->in(idx) != NULL && // NULL should not happen def->in(idx) != NULL && // NULL should not happen
ureg == lrgs(n2lidx(def->in(idx))).reg() ) ureg == lrgs(_lrg_map.live_range_id(def->in(idx))).reg())
def = def->in(idx); def = def->in(idx);
Node *valdef = skip_copies(def); // tighten up val through non-useless copies Node *valdef = skip_copies(def); // tighten up val through non-useless copies
value.map(ureg,valdef); // record improved reaching-def info value.map(ureg,valdef); // record improved reaching-def info
@ -594,8 +599,10 @@ void PhaseChaitin::post_allocate_copy_removal() {
j -= elide_copy( n, k, b, value, regnd, two_adr!=k ); j -= elide_copy( n, k, b, value, regnd, two_adr!=k );
// Unallocated Nodes define no registers // Unallocated Nodes define no registers
uint lidx = n2lidx(n); uint lidx = _lrg_map.live_range_id(n);
if( !lidx ) continue; if (!lidx) {
continue;
}
// Update the register defined by this instruction // Update the register defined by this instruction
OptoReg::Name nreg = lrgs(lidx).reg(); OptoReg::Name nreg = lrgs(lidx).reg();

View file

@ -318,9 +318,13 @@ Node *PhaseChaitin::split_Rematerialize( Node *def, Block *b, uint insidx, uint
for( uint i = 1; i < def->req(); i++ ) { for( uint i = 1; i < def->req(); i++ ) {
Node *in = def->in(i); Node *in = def->in(i);
// Check for single-def (LRG cannot redefined) // Check for single-def (LRG cannot redefined)
uint lidx = n2lidx(in); uint lidx = _lrg_map.live_range_id(in);
if( lidx >= _maxlrg ) continue; // Value is a recent spill-copy if (lidx >= _lrg_map.max_lrg_id()) {
if (lrgs(lidx).is_singledef()) continue; continue; // Value is a recent spill-copy
}
if (lrgs(lidx).is_singledef()) {
continue;
}
Block *b_def = _cfg._bbs[def->_idx]; Block *b_def = _cfg._bbs[def->_idx];
int idx_def = b_def->find_node(def); int idx_def = b_def->find_node(def);
@ -344,26 +348,28 @@ Node *PhaseChaitin::split_Rematerialize( Node *def, Block *b, uint insidx, uint
if( spill->req() > 1 ) { if( spill->req() > 1 ) {
for( uint i = 1; i < spill->req(); i++ ) { for( uint i = 1; i < spill->req(); i++ ) {
Node *in = spill->in(i); Node *in = spill->in(i);
uint lidx = Find_id(in); uint lidx = _lrg_map.find_id(in);
// Walk backwards thru spill copy node intermediates // Walk backwards thru spill copy node intermediates
if (walkThru) { if (walkThru) {
while ( in->is_SpillCopy() && lidx >= _maxlrg ) { while (in->is_SpillCopy() && lidx >= _lrg_map.max_lrg_id()) {
in = in->in(1); in = in->in(1);
lidx = Find_id(in); lidx = _lrg_map.find_id(in);
} }
if (lidx < _maxlrg && lrgs(lidx).is_multidef()) { if (lidx < _lrg_map.max_lrg_id() && lrgs(lidx).is_multidef()) {
// walkThru found a multidef LRG, which is unsafe to use, so // walkThru found a multidef LRG, which is unsafe to use, so
// just keep the original def used in the clone. // just keep the original def used in the clone.
in = spill->in(i); in = spill->in(i);
lidx = Find_id(in); lidx = _lrg_map.find_id(in);
} }
} }
if( lidx < _maxlrg && lrgs(lidx).reg() >= LRG::SPILL_REG ) { if (lidx < _lrg_map.max_lrg_id() && lrgs(lidx).reg() >= LRG::SPILL_REG) {
Node *rdef = Reachblock[lrg2reach[lidx]]; Node *rdef = Reachblock[lrg2reach[lidx]];
if( rdef ) spill->set_req(i,rdef); if (rdef) {
spill->set_req(i, rdef);
}
} }
} }
} }
@ -424,17 +430,25 @@ bool PhaseChaitin::is_high_pressure( Block *b, LRG *lrg, uint insidx ) {
//------------------------------prompt_use--------------------------------- //------------------------------prompt_use---------------------------------
// True if lidx is used before any real register is def'd in the block // True if lidx is used before any real register is def'd in the block
bool PhaseChaitin::prompt_use( Block *b, uint lidx ) { bool PhaseChaitin::prompt_use( Block *b, uint lidx ) {
if( lrgs(lidx)._was_spilled2 ) return false; if (lrgs(lidx)._was_spilled2) {
return false;
}
// Scan block for 1st use. // Scan block for 1st use.
for( uint i = 1; i <= b->end_idx(); i++ ) { for( uint i = 1; i <= b->end_idx(); i++ ) {
Node *n = b->_nodes[i]; Node *n = b->_nodes[i];
// Ignore PHI use, these can be up or down // Ignore PHI use, these can be up or down
if( n->is_Phi() ) continue; if (n->is_Phi()) {
for( uint j = 1; j < n->req(); j++ ) continue;
if( Find_id(n->in(j)) == lidx ) }
for (uint j = 1; j < n->req(); j++) {
if (_lrg_map.find_id(n->in(j)) == lidx) {
return true; // Found 1st use! return true; // Found 1st use!
if( n->out_RegMask().is_NotEmpty() ) return false; }
}
if (n->out_RegMask().is_NotEmpty()) {
return false;
}
} }
return false; return false;
} }
@ -464,22 +478,22 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
bool u1, u2, u3; bool u1, u2, u3;
Block *b, *pred; Block *b, *pred;
PhiNode *phi; PhiNode *phi;
GrowableArray<uint> lidxs(split_arena, _maxlrg, 0, 0); GrowableArray<uint> lidxs(split_arena, maxlrg, 0, 0);
// Array of counters to count splits per live range // Array of counters to count splits per live range
GrowableArray<uint> splits(split_arena, _maxlrg, 0, 0); GrowableArray<uint> splits(split_arena, maxlrg, 0, 0);
#define NEW_SPLIT_ARRAY(type, size)\ #define NEW_SPLIT_ARRAY(type, size)\
(type*) split_arena->allocate_bytes((size) * sizeof(type)) (type*) split_arena->allocate_bytes((size) * sizeof(type))
//----------Setup Code---------- //----------Setup Code----------
// Create a convenient mapping from lrg numbers to reaches/leaves indices // Create a convenient mapping from lrg numbers to reaches/leaves indices
uint *lrg2reach = NEW_SPLIT_ARRAY( uint, _maxlrg ); uint *lrg2reach = NEW_SPLIT_ARRAY(uint, maxlrg);
// Keep track of DEFS & Phis for later passes // Keep track of DEFS & Phis for later passes
defs = new Node_List(); defs = new Node_List();
phis = new Node_List(); phis = new Node_List();
// Gather info on which LRG's are spilling, and build maps // Gather info on which LRG's are spilling, and build maps
for( bidx = 1; bidx < _maxlrg; bidx++ ) { for (bidx = 1; bidx < maxlrg; bidx++) {
if (lrgs(bidx).alive() && lrgs(bidx).reg() >= LRG::SPILL_REG) { if (lrgs(bidx).alive() && lrgs(bidx).reg() >= LRG::SPILL_REG) {
assert(!lrgs(bidx).mask().is_AllStack(),"AllStack should color"); assert(!lrgs(bidx).mask().is_AllStack(),"AllStack should color");
lrg2reach[bidx] = spill_cnt; lrg2reach[bidx] = spill_cnt;
@ -629,7 +643,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
break; break;
} }
// must be looking at a phi // must be looking at a phi
if( Find_id(n1) == lidxs.at(slidx) ) { if (_lrg_map.find_id(n1) == lidxs.at(slidx)) {
// found the necessary phi // found the necessary phi
needs_phi = false; needs_phi = false;
has_phi = true; has_phi = true;
@ -654,8 +668,8 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
insert_proj(b, insidx++, phi, maxlrg++); insert_proj(b, insidx++, phi, maxlrg++);
non_phi++; non_phi++;
// Reset new phi's mapping to be the spilling live range // Reset new phi's mapping to be the spilling live range
_names.map(phi->_idx, lidx); _lrg_map.map(phi->_idx, lidx);
assert(Find_id(phi) == lidx,"Bad update on Union-Find mapping"); assert(_lrg_map.find_id(phi) == lidx, "Bad update on Union-Find mapping");
} // end if not found correct phi } // end if not found correct phi
// Here you have either found or created the Phi, so record it // Here you have either found or created the Phi, so record it
assert(phi != NULL,"Must have a Phi Node here"); assert(phi != NULL,"Must have a Phi Node here");
@ -721,12 +735,12 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
for( insidx = 1; insidx <= b->end_idx(); insidx++ ) { for( insidx = 1; insidx <= b->end_idx(); insidx++ ) {
Node *n = b->_nodes[insidx]; Node *n = b->_nodes[insidx];
// Find the defining Node's live range index // Find the defining Node's live range index
uint defidx = Find_id(n); uint defidx = _lrg_map.find_id(n);
uint cnt = n->req(); uint cnt = n->req();
if (n->is_Phi()) { if (n->is_Phi()) {
// Skip phi nodes after removing dead copies. // Skip phi nodes after removing dead copies.
if( defidx < _maxlrg ) { if (defidx < _lrg_map.max_lrg_id()) {
// Check for useless Phis. These appear if we spill, then // Check for useless Phis. These appear if we spill, then
// coalesce away copies. Dont touch Phis in spilling live // coalesce away copies. Dont touch Phis in spilling live
// ranges; they are busy getting modifed in this pass. // ranges; they are busy getting modifed in this pass.
@ -745,7 +759,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
} }
assert( u, "at least 1 valid input expected" ); assert( u, "at least 1 valid input expected" );
if (i >= cnt) { // Found one unique input if (i >= cnt) { // Found one unique input
assert(Find_id(n) == Find_id(u), "should be the same lrg"); assert(_lrg_map.find_id(n) == _lrg_map.find_id(u), "should be the same lrg");
n->replace_by(u); // Then replace with unique input n->replace_by(u); // Then replace with unique input
n->disconnect_inputs(NULL, C); n->disconnect_inputs(NULL, C);
b->_nodes.remove(insidx); b->_nodes.remove(insidx);
@ -793,16 +807,24 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
while( insert_point > 0 ) { while( insert_point > 0 ) {
Node *n = b->_nodes[insert_point]; Node *n = b->_nodes[insert_point];
// Hit top of block? Quit going backwards // Hit top of block? Quit going backwards
if( n->is_Phi() ) break; if (n->is_Phi()) {
break;
}
// Found a def? Better split after it. // Found a def? Better split after it.
if( n2lidx(n) == lidx ) break; if (_lrg_map.live_range_id(n) == lidx) {
break;
}
// Look for a use // Look for a use
uint i; uint i;
for( i = 1; i < n->req(); i++ ) for( i = 1; i < n->req(); i++ ) {
if( n2lidx(n->in(i)) == lidx ) if (_lrg_map.live_range_id(n->in(i)) == lidx) {
break; break;
}
}
// Found a use? Better split after it. // Found a use? Better split after it.
if( i < n->req() ) break; if (i < n->req()) {
break;
}
insert_point--; insert_point--;
} }
uint orig_eidx = b->end_idx(); uint orig_eidx = b->end_idx();
@ -812,9 +834,10 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
return 0; return 0;
} }
// Spill of NULL check mem op goes into the following block. // Spill of NULL check mem op goes into the following block.
if (b->end_idx() > orig_eidx) if (b->end_idx() > orig_eidx) {
insidx++; insidx++;
} }
}
// This is a new DEF, so update UP // This is a new DEF, so update UP
UPblock[slidx] = false; UPblock[slidx] = false;
#ifndef PRODUCT #ifndef PRODUCT
@ -832,13 +855,13 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
} // end if crossing HRP Boundry } // end if crossing HRP Boundry
// If the LRG index is oob, then this is a new spillcopy, skip it. // If the LRG index is oob, then this is a new spillcopy, skip it.
if( defidx >= _maxlrg ) { if (defidx >= _lrg_map.max_lrg_id()) {
continue; continue;
} }
LRG &deflrg = lrgs(defidx); LRG &deflrg = lrgs(defidx);
uint copyidx = n->is_Copy(); uint copyidx = n->is_Copy();
// Remove coalesced copy from CFG // Remove coalesced copy from CFG
if( copyidx && defidx == n2lidx(n->in(copyidx)) ) { if (copyidx && defidx == _lrg_map.live_range_id(n->in(copyidx))) {
n->replace_by( n->in(copyidx) ); n->replace_by( n->in(copyidx) );
n->set_req( copyidx, NULL ); n->set_req( copyidx, NULL );
b->_nodes.remove(insidx--); b->_nodes.remove(insidx--);
@ -868,9 +891,9 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
continue; // skip derived_debug added below continue; // skip derived_debug added below
} }
// Get lidx of input // Get lidx of input
uint useidx = Find_id(n->in(inpidx)); uint useidx = _lrg_map.find_id(n->in(inpidx));
// Not a brand-new split, and it is a spill use // Not a brand-new split, and it is a spill use
if( useidx < _maxlrg && lrgs(useidx).reg() >= LRG::SPILL_REG ) { if (useidx < _lrg_map.max_lrg_id() && lrgs(useidx).reg() >= LRG::SPILL_REG) {
// Check for valid reaching DEF // Check for valid reaching DEF
slidx = lrg2reach[useidx]; slidx = lrg2reach[useidx];
Node *def = Reachblock[slidx]; Node *def = Reachblock[slidx];
@ -886,7 +909,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
if (def == NULL || C->check_node_count(NodeLimitFudgeFactor, out_of_nodes)) { if (def == NULL || C->check_node_count(NodeLimitFudgeFactor, out_of_nodes)) {
return 0; return 0;
} }
_names.extend(def->_idx,0); _lrg_map.extend(def->_idx, 0);
_cfg._bbs.map(def->_idx,b); _cfg._bbs.map(def->_idx,b);
n->set_req(inpidx, def); n->set_req(inpidx, def);
continue; continue;
@ -1188,8 +1211,8 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
// to copies about to be spilled; they will be Split shortly. // to copies about to be spilled; they will be Split shortly.
if (copyidx) { if (copyidx) {
Node *use = n->in(copyidx); Node *use = n->in(copyidx);
uint useidx = Find_id(use); uint useidx = _lrg_map.find_id(use);
if( useidx < _maxlrg && // This is not a new split if (useidx < _lrg_map.max_lrg_id() && // This is not a new split
OptoReg::is_stack(deflrg.reg()) && OptoReg::is_stack(deflrg.reg()) &&
deflrg.reg() < LRG::SPILL_REG ) { // And DEF is from stack deflrg.reg() < LRG::SPILL_REG ) { // And DEF is from stack
LRG &uselrg = lrgs(useidx); LRG &uselrg = lrgs(useidx);
@ -1228,7 +1251,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
uint member; uint member;
IndexSetIterator isi(liveout); IndexSetIterator isi(liveout);
while ((member = isi.next()) != 0) { while ((member = isi.next()) != 0) {
assert(defidx != Find_const(member), "Live out member has not been compressed"); assert(defidx != _lrg_map.find_const(member), "Live out member has not been compressed");
} }
#endif #endif
Reachblock[slidx] = NULL; Reachblock[slidx] = NULL;
@ -1261,7 +1284,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
assert(phi->is_Phi(),"This list must only contain Phi Nodes"); assert(phi->is_Phi(),"This list must only contain Phi Nodes");
Block *b = _cfg._bbs[phi->_idx]; Block *b = _cfg._bbs[phi->_idx];
// Grab the live range number // Grab the live range number
uint lidx = Find_id(phi); uint lidx = _lrg_map.find_id(phi);
uint slidx = lrg2reach[lidx]; uint slidx = lrg2reach[lidx];
// Update node to lidx map // Update node to lidx map
new_lrg(phi, maxlrg++); new_lrg(phi, maxlrg++);
@ -1296,11 +1319,13 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
int insert = pred->end_idx(); int insert = pred->end_idx();
while (insert >= 1 && while (insert >= 1 &&
pred->_nodes[insert - 1]->is_SpillCopy() && pred->_nodes[insert - 1]->is_SpillCopy() &&
Find(pred->_nodes[insert - 1]) >= lrgs_before_phi_split) { _lrg_map.find(pred->_nodes[insert - 1]) >= lrgs_before_phi_split) {
insert--; insert--;
} }
def = split_Rematerialize(def, pred, insert, maxlrg, splits, slidx, lrg2reach, Reachblock, false); def = split_Rematerialize(def, pred, insert, maxlrg, splits, slidx, lrg2reach, Reachblock, false);
if( !def ) return 0; // Bail out if (!def) {
return 0; // Bail out
}
} }
// Update the Phi's input edge array // Update the Phi's input edge array
phi->set_req(i,def); phi->set_req(i,def);
@ -1316,7 +1341,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
} // End for all inputs to the Phi } // End for all inputs to the Phi
} // End for all Phi Nodes } // End for all Phi Nodes
// Update _maxlrg to save Union asserts // Update _maxlrg to save Union asserts
_maxlrg = maxlrg; _lrg_map.set_max_lrg_id(maxlrg);
//----------PASS 3---------- //----------PASS 3----------
@ -1328,13 +1353,15 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
for( uint i = 1; i < phi->req(); i++ ) { for( uint i = 1; i < phi->req(); i++ ) {
// Grab the input node // Grab the input node
Node *n = phi->in(i); Node *n = phi->in(i);
assert( n, "" ); assert(n, "node should exist");
uint lidx = Find(n); uint lidx = _lrg_map.find(n);
uint pidx = Find(phi); uint pidx = _lrg_map.find(phi);
if( lidx < pidx ) if (lidx < pidx) {
Union(n, phi); Union(n, phi);
else if( lidx > pidx ) }
else if(lidx > pidx) {
Union(phi, n); Union(phi, n);
}
} // End for all inputs to the Phi Node } // End for all inputs to the Phi Node
} // End for all Phi Nodes } // End for all Phi Nodes
// Now union all two address instructions // Now union all two address instructions
@ -1343,14 +1370,16 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
n1 = defs->at(insidx); n1 = defs->at(insidx);
// Set new lidx for DEF & handle 2-addr instructions // Set new lidx for DEF & handle 2-addr instructions
if (n1->is_Mach() && ((twoidx = n1->as_Mach()->two_adr()) != 0)) { if (n1->is_Mach() && ((twoidx = n1->as_Mach()->two_adr()) != 0)) {
assert( Find(n1->in(twoidx)) < maxlrg,"Assigning bad live range index"); assert(_lrg_map.find(n1->in(twoidx)) < maxlrg,"Assigning bad live range index");
// Union the input and output live ranges // Union the input and output live ranges
uint lr1 = Find(n1); uint lr1 = _lrg_map.find(n1);
uint lr2 = Find(n1->in(twoidx)); uint lr2 = _lrg_map.find(n1->in(twoidx));
if( lr1 < lr2 ) if (lr1 < lr2) {
Union(n1, n1->in(twoidx)); Union(n1, n1->in(twoidx));
else if( lr1 > lr2 ) }
else if (lr1 > lr2) {
Union(n1->in(twoidx), n1); Union(n1->in(twoidx), n1);
}
} // End if two address } // End if two address
} // End for all defs } // End for all defs
// DEBUG // DEBUG
@ -1360,8 +1389,8 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
b = _cfg._blocks[bidx]; b = _cfg._blocks[bidx];
for (insidx = 0; insidx <= b->end_idx(); insidx++) { for (insidx = 0; insidx <= b->end_idx(); insidx++) {
Node *n = b->_nodes[insidx]; Node *n = b->_nodes[insidx];
uint defidx = Find(n); uint defidx = _lrg_map.find(n);
assert(defidx < _maxlrg,"Bad live range index in Split"); assert(defidx < _lrg_map.max_lrg_id(), "Bad live range index in Split");
assert(defidx < maxlrg,"Bad live range index in Split"); assert(defidx < maxlrg,"Bad live range index in Split");
} }
} }

View file

@ -122,15 +122,6 @@ public:
return Matcher::_regEncode[first]; return Matcher::_regEncode[first];
} }
// Platform dependent hook for actions prior to allocation
void pd_preallocate_hook();
#ifdef ASSERT
// Platform dependent hook for verification after allocation. Will
// only get called when compiling with asserts.
void pd_postallocate_verify_hook();
#endif
#ifndef PRODUCT #ifndef PRODUCT
static int _total_framesize; static int _total_framesize;
static int _max_framesize; static int _max_framesize;

View file

@ -237,10 +237,10 @@ WB_ENTRY(jint, WB_GetMethodCompilationLevel(JNIEnv* env, jobject o, jobject meth
WB_END WB_END
WB_ENTRY(void, WB_MakeMethodNotCompilable(JNIEnv* env, jobject o, jobject method)) WB_ENTRY(void, WB_MakeMethodNotCompilable(JNIEnv* env, jobject o, jobject method, jint comp_level))
jmethodID jmid = reflected_method_to_jmid(thread, env, method); jmethodID jmid = reflected_method_to_jmid(thread, env, method);
methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid));
mh->set_not_compilable(); mh->set_not_compilable(comp_level, true /* report */, "WhiteBox");
WB_END WB_END
WB_ENTRY(jboolean, WB_TestSetDontInlineMethod(JNIEnv* env, jobject o, jobject method, jboolean value)) WB_ENTRY(jboolean, WB_TestSetDontInlineMethod(JNIEnv* env, jobject o, jobject method, jboolean value))
@ -401,28 +401,28 @@ static JNINativeMethod methods[] = {
{CC"NMTWaitForDataMerge", CC"()Z", (void*)&WB_NMTWaitForDataMerge}, {CC"NMTWaitForDataMerge", CC"()Z", (void*)&WB_NMTWaitForDataMerge},
#endif // INCLUDE_NMT #endif // INCLUDE_NMT
{CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll }, {CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll },
{CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Method;)I", {CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Executable;)I",
(void*)&WB_DeoptimizeMethod }, (void*)&WB_DeoptimizeMethod },
{CC"isMethodCompiled", CC"(Ljava/lang/reflect/Method;)Z", {CC"isMethodCompiled", CC"(Ljava/lang/reflect/Executable;)Z",
(void*)&WB_IsMethodCompiled }, (void*)&WB_IsMethodCompiled },
{CC"isMethodCompilable", CC"(Ljava/lang/reflect/Method;I)Z", {CC"isMethodCompilable", CC"(Ljava/lang/reflect/Executable;I)Z",
(void*)&WB_IsMethodCompilable}, (void*)&WB_IsMethodCompilable},
{CC"isMethodQueuedForCompilation", {CC"isMethodQueuedForCompilation",
CC"(Ljava/lang/reflect/Method;)Z", (void*)&WB_IsMethodQueuedForCompilation}, CC"(Ljava/lang/reflect/Executable;)Z", (void*)&WB_IsMethodQueuedForCompilation},
{CC"makeMethodNotCompilable", {CC"makeMethodNotCompilable",
CC"(Ljava/lang/reflect/Method;)V", (void*)&WB_MakeMethodNotCompilable}, CC"(Ljava/lang/reflect/Executable;I)V", (void*)&WB_MakeMethodNotCompilable},
{CC"testSetDontInlineMethod", {CC"testSetDontInlineMethod",
CC"(Ljava/lang/reflect/Method;Z)Z", (void*)&WB_TestSetDontInlineMethod}, CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetDontInlineMethod},
{CC"getMethodCompilationLevel", {CC"getMethodCompilationLevel",
CC"(Ljava/lang/reflect/Method;)I", (void*)&WB_GetMethodCompilationLevel}, CC"(Ljava/lang/reflect/Executable;)I", (void*)&WB_GetMethodCompilationLevel},
{CC"getCompileQueuesSize", {CC"getCompileQueuesSize",
CC"()I", (void*)&WB_GetCompileQueuesSize}, CC"()I", (void*)&WB_GetCompileQueuesSize},
{CC"testSetForceInlineMethod", {CC"testSetForceInlineMethod",
CC"(Ljava/lang/reflect/Method;Z)Z", (void*)&WB_TestSetForceInlineMethod}, CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetForceInlineMethod},
{CC"enqueueMethodForCompilation", {CC"enqueueMethodForCompilation",
CC"(Ljava/lang/reflect/Method;I)Z", (void*)&WB_EnqueueMethodForCompilation}, CC"(Ljava/lang/reflect/Executable;I)Z", (void*)&WB_EnqueueMethodForCompilation},
{CC"clearMethodState", {CC"clearMethodState",
CC"(Ljava/lang/reflect/Method;)V", (void*)&WB_ClearMethodState}, CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState},
{CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable }, {CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable },
{CC"fullGC", CC"()V", (void*)&WB_FullGC }, {CC"fullGC", CC"()V", (void*)&WB_FullGC },
}; };

View file

@ -1117,7 +1117,6 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
c2_nonstatic_field(PhaseChaitin, _lo_stk_degree, uint) \ c2_nonstatic_field(PhaseChaitin, _lo_stk_degree, uint) \
c2_nonstatic_field(PhaseChaitin, _hi_degree, uint) \ c2_nonstatic_field(PhaseChaitin, _hi_degree, uint) \
c2_nonstatic_field(PhaseChaitin, _simplified, uint) \ c2_nonstatic_field(PhaseChaitin, _simplified, uint) \
c2_nonstatic_field(PhaseChaitin, _maxlrg, uint) \
\ \
c2_nonstatic_field(Block, _nodes, Node_List) \ c2_nonstatic_field(Block, _nodes, Node_List) \
c2_nonstatic_field(Block, _succs, Block_Array) \ c2_nonstatic_field(Block, _succs, Block_Array) \

View file

@ -123,7 +123,7 @@ VM_Operation* VMOperationQueue::queue_drain(int prio) {
_queue[prio]->set_next(_queue[prio]); _queue[prio]->set_next(_queue[prio]);
_queue[prio]->set_prev(_queue[prio]); _queue[prio]->set_prev(_queue[prio]);
assert(queue_empty(prio), "drain corrupted queue"); assert(queue_empty(prio), "drain corrupted queue");
#ifdef DEBUG #ifdef ASSERT
int len = 0; int len = 0;
VM_Operation* cur; VM_Operation* cur;
for(cur = r; cur != NULL; cur=cur->next()) len++; for(cur = r; cur != NULL; cur=cur->next()) len++;

View file

@ -162,7 +162,9 @@ clean:
# jtreg tests # jtreg tests
# Expect JT_HOME to be set for jtreg tests. (home for jtreg) # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ifndef JT_HOME
JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
endif
ifdef JPRT_JTREG_HOME ifdef JPRT_JTREG_HOME
JT_HOME = $(JPRT_JTREG_HOME) JT_HOME = $(JPRT_JTREG_HOME)
endif endif

View file

@ -0,0 +1,107 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @test
* @bug 6443505
* @summary Some cases for CmpLTMask missed; also wrong code.
*
* @run main/othervm -Xcomp -XX:CompileOnly="Test6443505.compiled" Test6443505
*/
public class Test6443505 {
public static void main(String[] args) throws InterruptedException {
test(Integer.MIN_VALUE, 0);
test(0, Integer.MIN_VALUE);
test(Integer.MIN_VALUE, -1);
test(-1, Integer.MIN_VALUE);
test(Integer.MIN_VALUE, 1);
test(1, Integer.MIN_VALUE);
test(Integer.MAX_VALUE, 0);
test(0, Integer.MAX_VALUE);
test(Integer.MAX_VALUE, -1);
test(-1, Integer.MAX_VALUE);
test(Integer.MAX_VALUE, 1);
test(1, Integer.MAX_VALUE);
test(Integer.MIN_VALUE, Integer.MAX_VALUE);
test(Integer.MAX_VALUE, Integer.MIN_VALUE);
test(1, -1);
test(1, 0);
test(1, 1);
test(-1, -1);
test(-1, 0);
test(-1, 1);
test(0, -1);
test(0, 0);
test(0, 1);
}
public static void test(int a, int b) throws InterruptedException {
int C = compiled(4, a, b);
int I = interpreted(4, a, b);
if (C != I) {
System.err.println("#1 C = " + C + ", I = " + I);
System.err.println("#1 C != I, FAIL");
System.exit(97);
}
C = compiled(a, b, q, 4);
I = interpreted(a, b, q, 4);
if (C != I) {
System.err.println("#2 C = " + C + ", I = " + I);
System.err.println("#2 C != I, FAIL");
System.exit(97);
}
}
static int q = 4;
// If improperly compiled, uses carry/borrow bit, which is wrong.
// with -XX:+PrintOptoAssembly, look for cadd_cmpLTMask
static int compiled(int p, int x, int y) {
return (x < y) ? q + (x - y) : (x - y);
}
// interpreted reference
static int interpreted(int p, int x, int y) {
return (x < y) ? q + (x - y) : (x - y);
}
// Test new code with a range of cases
// with -XX:+PrintOptoAssembly, look for and_cmpLTMask
static int compiled(int x, int y, int q, int p) {
return (x < y) ? p + q : q;
}
// interpreted reference
static int interpreted(int x, int y, int q, int p) {
return (x < y) ? p + q : q;
}
}

View file

@ -27,42 +27,61 @@
* @build ClearMethodStateTest * @build ClearMethodStateTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ClearMethodStateTest * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ClearMethodStateTest
* @summary testing of WB::clearMethodState()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class ClearMethodStateTest extends CompilerWhiteBoxTest { public class ClearMethodStateTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// to prevent inlining #method into #compile() and #test() for (TestCase test : TestCase.values()) {
WHITE_BOX.testSetDontInlineMethod(METHOD, true); new ClearMethodStateTest(test).runTest();
new ClearMethodStateTest().runTest(); }
} }
public ClearMethodStateTest(TestCase testCase) {
super(testCase);
// to prevent inlining of #method
WHITE_BOX.testSetDontInlineMethod(method, true);
}
/**
* Tests {@code WB::clearMethodState()} by calling it before/after
* compilation. For non-tiered, checks that counters will be rested after
* clearing of method state.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception { protected void test() throws Exception {
checkNotCompiled(METHOD); checkNotCompiled();
compile(); compile();
checkCompiled(METHOD); WHITE_BOX.clearMethodState(method);
WHITE_BOX.clearMethodState(METHOD); checkCompiled();
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.clearMethodState(method);
checkNotCompiled(METHOD); WHITE_BOX.deoptimizeMethod(method);
checkNotCompiled();
if (!TIERED_COMPILATION) { if (!TIERED_COMPILATION) {
WHITE_BOX.clearMethodState(METHOD); WHITE_BOX.clearMethodState(method);
compile(COMPILE_THRESHOLD); compile(COMPILE_THRESHOLD);
checkCompiled(METHOD); checkCompiled();
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.deoptimizeMethod(method);
checkNotCompiled(METHOD); checkNotCompiled();
WHITE_BOX.clearMethodState(METHOD); WHITE_BOX.clearMethodState(method);
// invoke method one less time than needed to compile
if (COMPILE_THRESHOLD > 1) { if (COMPILE_THRESHOLD > 1) {
compile(COMPILE_THRESHOLD - 1); compile(COMPILE_THRESHOLD - 1);
checkNotCompiled(METHOD); checkNotCompiled();
} else { } else {
System.err.println("Warning: 'CompileThreshold' <= 1"); System.err.println("Warning: 'CompileThreshold' <= 1");
} }
method(); compile(1);
checkCompiled(METHOD); checkCompiled();
} else { } else {
System.err.println( System.err.println(
"Warning: part of test is not applicable in Tiered"); "Warning: part of test is not applicable in Tiered");

View file

@ -21,68 +21,132 @@
* questions. * questions.
*/ */
import com.sun.management.HotSpotDiagnosticMXBean;
import com.sun.management.VMOption;
import sun.hotspot.WhiteBox; import sun.hotspot.WhiteBox;
import sun.management.ManagementFactoryHelper; import sun.management.ManagementFactoryHelper;
import com.sun.management.HotSpotDiagnosticMXBean;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Objects;
import java.util.concurrent.Callable;
/* /**
* Abstract class for WhiteBox testing of JIT.
*
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public abstract class CompilerWhiteBoxTest { public abstract class CompilerWhiteBoxTest {
/** {@code CompLevel::CompLevel_none} -- Interpreter */
protected static int COMP_LEVEL_NONE = 0;
/** {@code CompLevel::CompLevel_any}, {@code CompLevel::CompLevel_all} */
protected static int COMP_LEVEL_ANY = -1;
/** Instance of WhiteBox */
protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
protected static final Method METHOD = getMethod("method"); /** Value of {@code -XX:CompileThreshold} */
protected static final int COMPILE_THRESHOLD protected static final int COMPILE_THRESHOLD
= Integer.parseInt(getVMOption("CompileThreshold", "10000")); = Integer.parseInt(getVMOption("CompileThreshold", "10000"));
/** Value of {@code -XX:BackgroundCompilation} */
protected static final boolean BACKGROUND_COMPILATION protected static final boolean BACKGROUND_COMPILATION
= Boolean.valueOf(getVMOption("BackgroundCompilation", "true")); = Boolean.valueOf(getVMOption("BackgroundCompilation", "true"));
/** Value of {@code -XX:TieredCompilation} */
protected static final boolean TIERED_COMPILATION protected static final boolean TIERED_COMPILATION
= Boolean.valueOf(getVMOption("TieredCompilation", "false")); = Boolean.valueOf(getVMOption("TieredCompilation", "false"));
/** Value of {@code -XX:TieredStopAtLevel} */
protected static final int TIERED_STOP_AT_LEVEL
= Integer.parseInt(getVMOption("TieredStopAtLevel", "0"));
protected static Method getMethod(String name) { /**
try { * Returns value of VM option.
return CompilerWhiteBoxTest.class.getDeclaredMethod(name); *
} catch (NoSuchMethodException | SecurityException e) { * @param name option's name
throw new RuntimeException( * @return value of option or {@code null}, if option doesn't exist
"exception on getting method " + name, e); * @throws NullPointerException if name is null
} */
}
protected static String getVMOption(String name) { protected static String getVMOption(String name) {
String result; Objects.requireNonNull(name);
HotSpotDiagnosticMXBean diagnostic HotSpotDiagnosticMXBean diagnostic
= ManagementFactoryHelper.getDiagnosticMXBean(); = ManagementFactoryHelper.getDiagnosticMXBean();
result = diagnostic.getVMOption(name).getValue(); VMOption tmp;
return result; try {
tmp = diagnostic.getVMOption(name);
} catch (IllegalArgumentException e) {
tmp = null;
}
return (tmp == null ? null : tmp.getValue());
} }
/**
* Returns value of VM option or default value.
*
* @param name option's name
* @param defaultValue default value
* @return value of option or {@code defaultValue}, if option doesn't exist
* @throws NullPointerException if name is null
* @see #getVMOption(String)
*/
protected static String getVMOption(String name, String defaultValue) { protected static String getVMOption(String name, String defaultValue) {
String result = getVMOption(name); String result = getVMOption(name);
return result == null ? defaultValue : result; return result == null ? defaultValue : result;
} }
protected final void runTest() throws RuntimeException { /** tested method */
protected final Executable method;
private final Callable<Integer> callable;
/**
* Constructor.
*
* @param testCase object, that contains tested method and way to invoke it.
*/
protected CompilerWhiteBoxTest(TestCase testCase) {
Objects.requireNonNull(testCase);
System.out.println("TEST CASE:" + testCase.name());
method = testCase.executable;
callable = testCase.callable;
}
/**
* Template method for testing. Prints tested method's info before
* {@linkplain #test()} and after {@linkplain #test()} or on thrown
* exception.
*
* @throws RuntimeException if method {@linkplain #test()} throws any
* exception
* @see #test()
*/
protected final void runTest() {
if (ManagementFactoryHelper.getCompilationMXBean() == null) { if (ManagementFactoryHelper.getCompilationMXBean() == null) {
System.err.println( System.err.println(
"Warning: test is not applicable in interpreted mode"); "Warning: test is not applicable in interpreted mode");
return; return;
} }
System.out.println("at test's start:"); System.out.println("at test's start:");
printInfo(METHOD); printInfo();
try { try {
test(); test();
} catch (Exception e) { } catch (Exception e) {
System.out.printf("on exception '%s':", e.getMessage()); System.out.printf("on exception '%s':", e.getMessage());
printInfo(METHOD); printInfo();
e.printStackTrace(); e.printStackTrace();
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
}
throw new RuntimeException(e); throw new RuntimeException(e);
} }
System.out.println("at test's end:"); System.out.println("at test's end:");
printInfo(METHOD); printInfo();
} }
protected static void checkNotCompiled(Method method) { /**
* Checks, that {@linkplain #method} is not compiled.
*
* @throws RuntimeException if {@linkplain #method} is in compiler queue or
* is compiled, or if {@linkplain #method} has zero
* compilation level.
*/
protected final void checkNotCompiled() {
if (WHITE_BOX.isMethodQueuedForCompilation(method)) { if (WHITE_BOX.isMethodQueuedForCompilation(method)) {
throw new RuntimeException(method + " must not be in queue"); throw new RuntimeException(method + " must not be in queue");
} }
@ -94,10 +158,16 @@ public abstract class CompilerWhiteBoxTest {
} }
} }
protected static void checkCompiled(Method method) /**
throws InterruptedException { * Checks, that {@linkplain #method} is compiled.
*
* @throws RuntimeException if {@linkplain #method} isn't in compiler queue
* and isn't compiled, or if {@linkplain #method}
* has nonzero compilation level
*/
protected final void checkCompiled() {
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
waitBackgroundCompilation(method); waitBackgroundCompilation();
if (WHITE_BOX.isMethodQueuedForCompilation(method)) { if (WHITE_BOX.isMethodQueuedForCompilation(method)) {
System.err.printf("Warning: %s is still in queue after %dms%n", System.err.printf("Warning: %s is still in queue after %dms%n",
method, System.currentTimeMillis() - start); method, System.currentTimeMillis() - start);
@ -111,23 +181,30 @@ public abstract class CompilerWhiteBoxTest {
} }
} }
protected static void waitBackgroundCompilation(Method method) /**
throws InterruptedException { * Waits for completion of background compilation of {@linkplain #method}.
*/
protected final void waitBackgroundCompilation() {
if (!BACKGROUND_COMPILATION) { if (!BACKGROUND_COMPILATION) {
return; return;
} }
final Object obj = new Object(); final Object obj = new Object();
for (int i = 0; i < 10
&& WHITE_BOX.isMethodQueuedForCompilation(method); ++i) {
synchronized (obj) { synchronized (obj) {
for (int i = 0; i < 10; ++i) { try {
if (!WHITE_BOX.isMethodQueuedForCompilation(method)) {
break;
}
obj.wait(1000); obj.wait(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} }
} }
} }
protected static void printInfo(Method method) { /**
* Prints information about {@linkplain #method}.
*/
protected final void printInfo() {
System.out.printf("%n%s:%n", method); System.out.printf("%n%s:%n", method);
System.out.printf("\tcompilable:\t%b%n", System.out.printf("\tcompilable:\t%b%n",
WHITE_BOX.isMethodCompilable(method)); WHITE_BOX.isMethodCompilable(method));
@ -141,22 +218,139 @@ public abstract class CompilerWhiteBoxTest {
WHITE_BOX.getCompileQueuesSize()); WHITE_BOX.getCompileQueuesSize());
} }
/**
* Executes testing.
*/
protected abstract void test() throws Exception; protected abstract void test() throws Exception;
/**
* Tries to trigger compilation of {@linkplain #method} by call
* {@linkplain #callable} enough times.
*
* @return accumulated result
* @see #compile(int)
*/
protected final int compile() { protected final int compile() {
return compile(Math.max(COMPILE_THRESHOLD, 150000)); return compile(Math.max(COMPILE_THRESHOLD, 150000));
} }
/**
* Tries to trigger compilation of {@linkplain #method} by call
* {@linkplain #callable} specified times.
*
* @param count invocation count
* @return accumulated result
*/
protected final int compile(int count) { protected final int compile(int count) {
int result = 0; int result = 0;
Integer tmp;
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
result += method(); try {
tmp = callable.call();
} catch (Exception e) {
tmp = null;
}
result += tmp == null ? 0 : tmp;
} }
System.out.println("method was invoked " + count + " times"); System.out.println("method was invoked " + count + " times");
return result; return result;
} }
}
protected int method() { /**
* Utility structure containing tested method and object to invoke it.
*/
enum TestCase {
/** constructor test case */
CONSTRUCTOR_TEST(Helper.CONSTRUCTOR, Helper.CONSTRUCTOR_CALLABLE),
/** method test case */
METOD_TEST(Helper.METHOD, Helper.METHOD_CALLABLE),
/** static method test case */
STATIC_TEST(Helper.STATIC, Helper.STATIC_CALLABLE);
/** tested method */
final Executable executable;
/** object to invoke {@linkplain #executable} */
final Callable<Integer> callable;
private TestCase(Executable executable, Callable<Integer> callable) {
this.executable = executable;
this.callable = callable;
}
private static class Helper {
private static final Callable<Integer> CONSTRUCTOR_CALLABLE
= new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return new Helper(1337).hashCode();
}
};
private static final Callable<Integer> METHOD_CALLABLE
= new Callable<Integer>() {
private final Helper helper = new Helper();
@Override
public Integer call() throws Exception {
return helper.method();
}
};
private static final Callable<Integer> STATIC_CALLABLE
= new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return staticMethod();
}
};
private static final Constructor CONSTRUCTOR;
private static final Method METHOD;
private static final Method STATIC;
static {
try {
CONSTRUCTOR = Helper.class.getDeclaredConstructor(int.class);
} catch (NoSuchMethodException | SecurityException e) {
throw new RuntimeException(
"exception on getting method Helper.<init>(int)", e);
}
try {
METHOD = Helper.class.getDeclaredMethod("method");
} catch (NoSuchMethodException | SecurityException e) {
throw new RuntimeException(
"exception on getting method Helper.method()", e);
}
try {
STATIC = Helper.class.getDeclaredMethod("staticMethod");
} catch (NoSuchMethodException | SecurityException e) {
throw new RuntimeException(
"exception on getting method Helper.staticMethod()", e);
}
}
private static int staticMethod() {
return 1138;
}
private int method() {
return 42; return 42;
} }
private final int x;
public Helper() {
x = 0;
}
private Helper(int x) {
this.x = x;
}
@Override
public int hashCode() {
return x;
}
}
} }

View file

@ -27,20 +27,34 @@
* @build DeoptimizeAllTest * @build DeoptimizeAllTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeAllTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeAllTest
* @summary testing of WB::deoptimizeAll()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class DeoptimizeAllTest extends CompilerWhiteBoxTest { public class DeoptimizeAllTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// to prevent inlining #method into #compile() for (TestCase test : TestCase.values()) {
WHITE_BOX.testSetDontInlineMethod(METHOD, true); new DeoptimizeAllTest(test).runTest();
new DeoptimizeAllTest().runTest(); }
} }
public DeoptimizeAllTest(TestCase testCase) {
super(testCase);
// to prevent inlining of #method
WHITE_BOX.testSetDontInlineMethod(method, true);
}
/**
* Tests {@code WB::deoptimizeAll()} by calling it after
* compilation and checking that method isn't compiled.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception { protected void test() throws Exception {
compile(); compile();
checkCompiled(METHOD); checkCompiled();
WHITE_BOX.deoptimizeAll(); WHITE_BOX.deoptimizeAll();
checkNotCompiled(METHOD); checkNotCompiled();
} }
} }

View file

@ -27,20 +27,34 @@
* @build DeoptimizeMethodTest * @build DeoptimizeMethodTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeMethodTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeMethodTest
* @summary testing of WB::deoptimizeMethod()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class DeoptimizeMethodTest extends CompilerWhiteBoxTest { public class DeoptimizeMethodTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// to prevent inlining #method into #compile() for (TestCase test : TestCase.values()) {
WHITE_BOX.testSetDontInlineMethod(METHOD, true); new DeoptimizeMethodTest(test).runTest();
new DeoptimizeMethodTest().runTest(); }
} }
public DeoptimizeMethodTest(TestCase testCase) {
super(testCase);
// to prevent inlining of #method
WHITE_BOX.testSetDontInlineMethod(method, true);
}
/**
* Tests {@code WB::deoptimizeMethod()} by calling it after
* compilation and checking that method isn't compiled.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception { protected void test() throws Exception {
compile(); compile();
checkCompiled(METHOD); checkCompiled();
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.deoptimizeMethod(method);
checkNotCompiled(METHOD); checkNotCompiled();
} }
} }

View file

@ -27,48 +27,60 @@
* @build EnqueueMethodForCompilationTest * @build EnqueueMethodForCompilationTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI EnqueueMethodForCompilationTest * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI EnqueueMethodForCompilationTest
* @summary testing of WB::enqueueMethodForCompilation()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// to prevent inlining #method into #compile() for (TestCase test : TestCase.values()) {
WHITE_BOX.testSetDontInlineMethod(METHOD, true); new EnqueueMethodForCompilationTest(test).runTest();
new EnqueueMethodForCompilationTest().runTest(); }
} }
public EnqueueMethodForCompilationTest(TestCase testCase) {
super(testCase);
// to prevent inlining of #method
WHITE_BOX.testSetDontInlineMethod(method, true);
}
@Override
protected void test() throws Exception { protected void test() throws Exception {
checkNotCompiled(METHOD); checkNotCompiled();
WHITE_BOX.enqueueMethodForCompilation(METHOD, 0); // method can not be compiled on level 'none'
if (WHITE_BOX.isMethodCompilable(METHOD, 0)) { WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_NONE);
throw new RuntimeException(METHOD + " is compilable at level 0"); if (WHITE_BOX.isMethodCompilable(method, COMP_LEVEL_NONE)) {
throw new RuntimeException(method
+ " is compilable at level COMP_LEVEL_NONE");
} }
checkNotCompiled(METHOD); checkNotCompiled();
WHITE_BOX.enqueueMethodForCompilation(METHOD, -1); // COMP_LEVEL_ANY is inapplicable as level for compilation
checkNotCompiled(METHOD); WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_ANY);
checkNotCompiled();
WHITE_BOX.enqueueMethodForCompilation(METHOD, 5); WHITE_BOX.enqueueMethodForCompilation(method, 5);
if (!WHITE_BOX.isMethodCompilable(METHOD, 5)) { if (!WHITE_BOX.isMethodCompilable(method, 5)) {
checkNotCompiled(METHOD); checkNotCompiled();
compile(); compile();
checkCompiled(METHOD); checkCompiled();
} else { } else {
checkCompiled(METHOD); checkCompiled();
} }
int compLevel = WHITE_BOX.getMethodCompilationLevel(METHOD); int compLevel = WHITE_BOX.getMethodCompilationLevel(method);
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.deoptimizeMethod(method);
checkNotCompiled(METHOD); checkNotCompiled();
WHITE_BOX.enqueueMethodForCompilation(METHOD, compLevel); WHITE_BOX.enqueueMethodForCompilation(method, compLevel);
checkCompiled(METHOD); checkCompiled();
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.deoptimizeMethod(method);
checkNotCompiled(METHOD); checkNotCompiled();
compile(); compile();
checkCompiled(METHOD); checkCompiled();
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.deoptimizeMethod(method);
checkNotCompiled(METHOD); checkNotCompiled();
} }
} }

View file

@ -28,9 +28,13 @@
* @build IsMethodCompilableTest * @build IsMethodCompilableTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI IsMethodCompilableTest * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI IsMethodCompilableTest
* @summary testing of WB::isMethodCompilable()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class IsMethodCompilableTest extends CompilerWhiteBoxTest { public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
/**
* Value of {@code -XX:PerMethodRecompilationCutoff}
*/
protected static final long PER_METHOD_RECOMPILATION_CUTOFF; protected static final long PER_METHOD_RECOMPILATION_CUTOFF;
static { static {
@ -44,14 +48,28 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// to prevent inlining #method into #compile() for (TestCase test : TestCase.values()) {
WHITE_BOX.testSetDontInlineMethod(METHOD, true); new IsMethodCompilableTest(test).runTest();
new IsMethodCompilableTest().runTest(); }
} }
public IsMethodCompilableTest(TestCase testCase) {
super(testCase);
// to prevent inlining of #method
WHITE_BOX.testSetDontInlineMethod(method, true);
}
/**
* Tests {@code WB::isMethodCompilable()} by recompilation of tested method
* 'PerMethodRecompilationCutoff' times and checks compilation status. Also
* checks that WB::clearMethodState() clears no-compilable flags.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception { protected void test() throws Exception {
if (!WHITE_BOX.isMethodCompilable(METHOD)) { if (!WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(METHOD + " must be compilable"); throw new RuntimeException(method + " must be compilable");
} }
System.out.println("PerMethodRecompilationCutoff = " System.out.println("PerMethodRecompilationCutoff = "
+ PER_METHOD_RECOMPILATION_CUTOFF); + PER_METHOD_RECOMPILATION_CUTOFF);
@ -61,46 +79,47 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
return; return;
} }
// deoptimze 'PerMethodRecompilationCutoff' times and clear state // deoptimize 'PerMethodRecompilationCutoff' times and clear state
for (long i = 0L, n = PER_METHOD_RECOMPILATION_CUTOFF - 1; i < n; ++i) { for (long i = 0L, n = PER_METHOD_RECOMPILATION_CUTOFF - 1; i < n; ++i) {
compileAndDeoptimaze(); compileAndDeoptimize();
} }
if (!WHITE_BOX.isMethodCompilable(METHOD)) { if (!WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(METHOD + " is not compilable after " throw new RuntimeException(method + " is not compilable after "
+ (PER_METHOD_RECOMPILATION_CUTOFF - 1) + " iterations"); + (PER_METHOD_RECOMPILATION_CUTOFF - 1) + " iterations");
} }
WHITE_BOX.clearMethodState(METHOD); WHITE_BOX.clearMethodState(method);
// deoptimze 'PerMethodRecompilationCutoff' + 1 times // deoptimize 'PerMethodRecompilationCutoff' + 1 times
long i; long i;
for (i = 0L; i < PER_METHOD_RECOMPILATION_CUTOFF for (i = 0L; i < PER_METHOD_RECOMPILATION_CUTOFF
&& WHITE_BOX.isMethodCompilable(METHOD); ++i) { && WHITE_BOX.isMethodCompilable(method); ++i) {
compileAndDeoptimaze(); compileAndDeoptimize();
} }
if (i != PER_METHOD_RECOMPILATION_CUTOFF) { if (i != PER_METHOD_RECOMPILATION_CUTOFF) {
throw new RuntimeException(METHOD + " is not compilable after " throw new RuntimeException(method + " is not compilable after "
+ i + " iterations, but must only after " + i + " iterations, but must only after "
+ PER_METHOD_RECOMPILATION_CUTOFF); + PER_METHOD_RECOMPILATION_CUTOFF);
} }
if (WHITE_BOX.isMethodCompilable(METHOD)) { if (WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(METHOD + " is still compilable after " throw new RuntimeException(method + " is still compilable after "
+ PER_METHOD_RECOMPILATION_CUTOFF + " iterations"); + PER_METHOD_RECOMPILATION_CUTOFF + " iterations");
} }
compile(); compile();
checkNotCompiled(METHOD); checkNotCompiled();
WHITE_BOX.clearMethodState(METHOD); // WB.clearMethodState() must reset no-compilable flags
if (!WHITE_BOX.isMethodCompilable(METHOD)) { WHITE_BOX.clearMethodState(method);
throw new RuntimeException(METHOD if (!WHITE_BOX.isMethodCompilable(method)) {
+ " is compilable after clearMethodState()"); throw new RuntimeException(method
+ " is not compilable after clearMethodState()");
} }
compile(); compile();
checkCompiled(METHOD); checkCompiled();
} }
private void compileAndDeoptimaze() throws Exception { private void compileAndDeoptimize() throws Exception {
compile(); compile();
waitBackgroundCompilation(METHOD); waitBackgroundCompilation();
WHITE_BOX.deoptimizeMethod(METHOD); WHITE_BOX.deoptimizeMethod(method);
} }
} }

View file

@ -27,28 +27,85 @@
* @build MakeMethodNotCompilableTest * @build MakeMethodNotCompilableTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MakeMethodNotCompilableTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MakeMethodNotCompilableTest
* @summary testing of WB::makeMethodNotCompilable()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// to prevent inlining #method into #compile() if (args.length == 0) {
WHITE_BOX.testSetDontInlineMethod(METHOD, true); for (TestCase test : TestCase.values()) {
new MakeMethodNotCompilableTest().runTest(); new MakeMethodNotCompilableTest(test).runTest();
}
} else {
for (String name : args) {
new MakeMethodNotCompilableTest(
TestCase.valueOf(name)).runTest();
}
}
} }
protected void test() throws Exception { public MakeMethodNotCompilableTest(TestCase testCase) {
if (!WHITE_BOX.isMethodCompilable(METHOD)) { super(testCase);
throw new RuntimeException(METHOD + " must be compilable"); // to prevent inlining of #method
WHITE_BOX.testSetDontInlineMethod(method, true);
} }
WHITE_BOX.makeMethodNotCompilable(METHOD);
if (WHITE_BOX.isMethodCompilable(METHOD)) { /**
throw new RuntimeException(METHOD + " must be not compilable"); * Tests {@code WB::makeMethodNotCompilable()} by calling it before
* compilation and checking that method isn't compiled. Also
* checks that WB::clearMethodState() clears no-compilable flags. For
* tiered, additional checks for all available levels are conducted.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception {
checkNotCompiled();
if (!WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(method + " must be compilable");
}
if (TIERED_COMPILATION) {
for (int i = 1, n = TIERED_STOP_AT_LEVEL + 1; i < n; ++i) {
WHITE_BOX.makeMethodNotCompilable(method, i);
if (WHITE_BOX.isMethodCompilable(method, i)) {
throw new RuntimeException(method
+ " must be not compilable at level" + i);
}
WHITE_BOX.enqueueMethodForCompilation(method, i);
checkNotCompiled();
if (!WHITE_BOX.isMethodCompilable(method)) {
System.out.println(method
+ " is not compilable after level " + i);
}
}
// WB.clearMethodState() must reset no-compilable flags
WHITE_BOX.clearMethodState(method);
if (!WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(method
+ " is not compilable after clearMethodState()");
}
}
WHITE_BOX.makeMethodNotCompilable(method);
if (WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(method + " must be not compilable");
}
compile();
checkNotCompiled();
if (WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(method + " must be not compilable");
}
// WB.clearMethodState() must reset no-compilable flags
WHITE_BOX.clearMethodState(method);
if (!WHITE_BOX.isMethodCompilable(method)) {
throw new RuntimeException(method
+ " is not compilable after clearMethodState()");
} }
compile(); compile();
checkNotCompiled(METHOD); checkCompiled();
if (WHITE_BOX.isMethodCompilable(METHOD)) {
throw new RuntimeException(METHOD + " must be not compilable");
}
} }
} }

View file

@ -27,33 +27,47 @@
* @build SetDontInlineMethodTest * @build SetDontInlineMethodTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetDontInlineMethodTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetDontInlineMethodTest
* @summary testing of WB::testSetDontInlineMethod()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class SetDontInlineMethodTest extends CompilerWhiteBoxTest { public class SetDontInlineMethodTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
new SetDontInlineMethodTest().runTest(); for (TestCase test : TestCase.values()) {
new SetDontInlineMethodTest(test).runTest();
}
} }
public SetDontInlineMethodTest(TestCase testCase) {
super(testCase);
}
/**
* Tests {@code WB::testSetDontInlineMethod()} by sequential calling it and
* checking of return value.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception { protected void test() throws Exception {
if (WHITE_BOX.testSetDontInlineMethod(METHOD, true)) { if (WHITE_BOX.testSetDontInlineMethod(method, true)) {
throw new RuntimeException("on start " + METHOD throw new RuntimeException("on start " + method
+ " must be inlineable"); + " must be inlineable");
} }
if (!WHITE_BOX.testSetDontInlineMethod(METHOD, true)) { if (!WHITE_BOX.testSetDontInlineMethod(method, true)) {
throw new RuntimeException("after first change to true " + METHOD throw new RuntimeException("after first change to true " + method
+ " must be not inlineable"); + " must be not inlineable");
} }
if (!WHITE_BOX.testSetDontInlineMethod(METHOD, false)) { if (!WHITE_BOX.testSetDontInlineMethod(method, false)) {
throw new RuntimeException("after second change to true " + METHOD throw new RuntimeException("after second change to true " + method
+ " must be still not inlineable"); + " must be still not inlineable");
} }
if (WHITE_BOX.testSetDontInlineMethod(METHOD, false)) { if (WHITE_BOX.testSetDontInlineMethod(method, false)) {
throw new RuntimeException("after first change to false" + METHOD throw new RuntimeException("after first change to false" + method
+ " must be inlineable"); + " must be inlineable");
} }
if (WHITE_BOX.testSetDontInlineMethod(METHOD, false)) { if (WHITE_BOX.testSetDontInlineMethod(method, false)) {
throw new RuntimeException("after second change to false " + METHOD throw new RuntimeException("after second change to false " + method
+ " must be inlineable"); + " must be inlineable");
} }
} }

View file

@ -27,33 +27,47 @@
* @build SetForceInlineMethodTest * @build SetForceInlineMethodTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetForceInlineMethodTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetForceInlineMethodTest
* @summary testing of WB::testSetForceInlineMethod()
* @author igor.ignatyev@oracle.com * @author igor.ignatyev@oracle.com
*/ */
public class SetForceInlineMethodTest extends CompilerWhiteBoxTest { public class SetForceInlineMethodTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
new SetForceInlineMethodTest().runTest(); for (TestCase test : TestCase.values()) {
new SetForceInlineMethodTest(test).runTest();
}
} }
public SetForceInlineMethodTest(TestCase testCase) {
super(testCase);
}
/**
* Tests {@code WB::testSetForceInlineMethod()} by sequential calling it and
* checking of return value.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected void test() throws Exception { protected void test() throws Exception {
if (WHITE_BOX.testSetForceInlineMethod(METHOD, true)) { if (WHITE_BOX.testSetForceInlineMethod(method, true)) {
throw new RuntimeException("on start " + METHOD throw new RuntimeException("on start " + method
+ " must be not force inlineable"); + " must be not force inlineable");
} }
if (!WHITE_BOX.testSetForceInlineMethod(METHOD, true)) { if (!WHITE_BOX.testSetForceInlineMethod(method, true)) {
throw new RuntimeException("after first change to true " + METHOD throw new RuntimeException("after first change to true " + method
+ " must be force inlineable"); + " must be force inlineable");
} }
if (!WHITE_BOX.testSetForceInlineMethod(METHOD, false)) { if (!WHITE_BOX.testSetForceInlineMethod(method, false)) {
throw new RuntimeException("after second change to true " + METHOD throw new RuntimeException("after second change to true " + method
+ " must be still force inlineable"); + " must be still force inlineable");
} }
if (WHITE_BOX.testSetForceInlineMethod(METHOD, false)) { if (WHITE_BOX.testSetForceInlineMethod(method, false)) {
throw new RuntimeException("after first change to false" + METHOD throw new RuntimeException("after first change to false" + method
+ " must be not force inlineable"); + " must be not force inlineable");
} }
if (WHITE_BOX.testSetForceInlineMethod(METHOD, false)) { if (WHITE_BOX.testSetForceInlineMethod(method, false)) {
throw new RuntimeException("after second change to false " + METHOD throw new RuntimeException("after second change to false " + method
+ " must be not force inlineable"); + " must be not force inlineable");
} }
} }

View file

@ -24,7 +24,7 @@
package sun.hotspot; package sun.hotspot;
import java.lang.reflect.Method; import java.lang.reflect.Executable;
import java.security.BasicPermission; import java.security.BasicPermission;
import sun.hotspot.parser.DiagnosticCommand; import sun.hotspot.parser.DiagnosticCommand;
@ -90,20 +90,23 @@ public class WhiteBox {
// Compiler // Compiler
public native void deoptimizeAll(); public native void deoptimizeAll();
public native boolean isMethodCompiled(Method method); public native boolean isMethodCompiled(Executable method);
public boolean isMethodCompilable(Method method) { public boolean isMethodCompilable(Executable method) {
return isMethodCompilable(method, -1 /*any*/); return isMethodCompilable(method, -1 /*any*/);
} }
public native boolean isMethodCompilable(Method method, int compLevel); public native boolean isMethodCompilable(Executable method, int compLevel);
public native boolean isMethodQueuedForCompilation(Method method); public native boolean isMethodQueuedForCompilation(Executable method);
public native int deoptimizeMethod(Method method); public native int deoptimizeMethod(Executable method);
public native void makeMethodNotCompilable(Method method); public void makeMethodNotCompilable(Executable method) {
public native int getMethodCompilationLevel(Method method); makeMethodNotCompilable(method, -1 /*any*/);
public native boolean testSetDontInlineMethod(Method method, boolean value); }
public native void makeMethodNotCompilable(Executable method, int compLevel);
public native int getMethodCompilationLevel(Executable method);
public native boolean testSetDontInlineMethod(Executable method, boolean value);
public native int getCompileQueuesSize(); public native int getCompileQueuesSize();
public native boolean testSetForceInlineMethod(Method method, boolean value); public native boolean testSetForceInlineMethod(Executable method, boolean value);
public native boolean enqueueMethodForCompilation(Method method, int compLevel); public native boolean enqueueMethodForCompilation(Executable method, int compLevel);
public native void clearMethodState(Method method); public native void clearMethodState(Executable method);
// Intered strings // Intered strings
public native boolean isInStringTable(String str); public native boolean isInStringTable(String str);