Merge
This commit is contained in:
commit
c8b6cfbdc5
@ -242,16 +242,6 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
|
||||
)
|
||||
|
||||
JDK_SYMBOLS_BUNDLE_FILES := \
|
||||
$(filter \
|
||||
$(JDK_SYMBOLS_EXCLUDE_PATTERN) \
|
||||
$(SYMBOLS_EXCLUDE_PATTERN) \
|
||||
, \
|
||||
$(filter-out \
|
||||
$(JDK_IMAGE_HOMEDIR)/demo/% %.stripped.pdb \
|
||||
, \
|
||||
$(ALL_JDK_SYMBOLS_FILES) \
|
||||
) \
|
||||
) \
|
||||
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
|
||||
|
||||
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
|
||||
@ -383,7 +373,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
|
||||
$(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
|
||||
BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
|
||||
FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
|
||||
BASE_DIRS := $(JDK_SYMBOLS_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
|
||||
BASE_DIRS := $(SYMBOLS_IMAGE_DIR), \
|
||||
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
|
||||
UNZIP_DEBUGINFO := true, \
|
||||
))
|
||||
|
@ -238,6 +238,7 @@ endif
|
||||
ALL_JDK_MODULES := $(JDK_MODULES)
|
||||
ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \
|
||||
$(call FindTransitiveDepsForModule, $m)))
|
||||
ALL_SYMBOLS_MODULES := $(JDK_MODULES)
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBS_TARGET_SUBDIR := bin
|
||||
@ -293,6 +294,7 @@ SetupCopyDebuginfo = \
|
||||
# implementation above.
|
||||
$(call SetupCopyDebuginfo,JDK)
|
||||
$(call SetupCopyDebuginfo,JRE)
|
||||
$(call SetupCopyDebuginfo,SYMBOLS)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
@ -38,11 +38,8 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
|
||||
MACOSX_PLIST_SRC := $(TOPDIR)/make/data/bundle
|
||||
|
||||
BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT)
|
||||
BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_SHORT)
|
||||
BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(VERSION_STRING)
|
||||
BUNDLE_PLATFORM_VERSION := $(VERSION_FEATURE).$(VERSION_INTERIM)
|
||||
BUNDLE_VERSION := $(VERSION_NUMBER)
|
||||
ifeq ($(COMPANY_NAME), N/A)
|
||||
BUNDLE_VENDOR := UNDEFINED
|
||||
else
|
||||
@ -75,24 +72,26 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
|
||||
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(BUNDLE_ID).jdk ; \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jdk ; \
|
||||
@@NAME@@ => $(BUNDLE_NAME) ; \
|
||||
@@INFO@@ => $(BUNDLE_INFO) ; \
|
||||
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
|
||||
@@VERSION@@ => $(BUNDLE_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) ; \
|
||||
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
|
||||
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(BUNDLE_ID).jre ; \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jre ; \
|
||||
@@NAME@@ => $(BUNDLE_NAME) ; \
|
||||
@@INFO@@ => $(BUNDLE_INFO) ; \
|
||||
@@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
|
||||
@@VERSION@@ => $(BUNDLE_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) , \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
@@BUILD_VERSION@@ => $(BUNDLE_BUILD_VERSION) ; \
|
||||
@@VENDOR@@ => $(BUNDLE_VENDOR) ; \
|
||||
@@MACOSX_VERSION_MIN@@ => $(MACOSX_VERSION_MIN) , \
|
||||
))
|
||||
|
||||
$(SUPPORT_OUTPUTDIR)/images/_jdk_bundle_attribute_set: $(COPY_JDK_IMAGE)
|
||||
|
@ -67,34 +67,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
AC_SUBST(JDK_RC_PLATFORM_NAME)
|
||||
AC_SUBST(HOTSPOT_VM_DISTRO)
|
||||
|
||||
# Set the MACOSX Bundle Name base
|
||||
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
|
||||
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_name_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
|
||||
elif test "x$with_macosx_bundle_name_base" != x; then
|
||||
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
|
||||
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
|
||||
|
||||
# Set the MACOSX Bundle ID base
|
||||
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
|
||||
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_id_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
|
||||
elif test "x$with_macosx_bundle_id_base" != x; then
|
||||
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
|
||||
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
|
||||
|
||||
# Set the JDK RC name
|
||||
AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name],
|
||||
[Set JDK RC name. This is used for FileDescription and ProductName properties
|
||||
@ -502,6 +474,60 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
VENDOR_VERSION_STRING="$with_vendor_version_string"
|
||||
fi
|
||||
|
||||
# Set the MACOSX Bundle Name base
|
||||
AC_ARG_WITH(macosx-bundle-name-base, [AS_HELP_STRING([--with-macosx-bundle-name-base],
|
||||
[Set the MacOSX Bundle Name base. This is the base name for calculating MacOSX Bundle Names.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_name_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_name_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-name-base contains non-printing characters: $with_macosx_bundle_name_base])
|
||||
elif test "x$with_macosx_bundle_name_base" != x; then
|
||||
# Set MACOSX_BUNDLE_NAME_BASE to the configured value.
|
||||
MACOSX_BUNDLE_NAME_BASE="$with_macosx_bundle_name_base"
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
|
||||
|
||||
# Set the MACOSX Bundle ID base
|
||||
AC_ARG_WITH(macosx-bundle-id-base, [AS_HELP_STRING([--with-macosx-bundle-id-base],
|
||||
[Set the MacOSX Bundle ID base. This is the base ID for calculating MacOSX Bundle IDs.
|
||||
@<:@not specified@:>@])])
|
||||
if test "x$with_macosx_bundle_id_base" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_id_base =~ ^[[:print:]]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-id-base contains non-printing characters: $with_macosx_bundle_id_base])
|
||||
elif test "x$with_macosx_bundle_id_base" != x; then
|
||||
# Set MACOSX_BUNDLE_ID_BASE to the configured value.
|
||||
MACOSX_BUNDLE_ID_BASE="$with_macosx_bundle_id_base"
|
||||
else
|
||||
# If using the default value, append the VERSION_PRE if there is one
|
||||
# to make it possible to tell official builds apart from developer builds
|
||||
if test "x$VERSION_PRE" != x; then
|
||||
MACOSX_BUNDLE_ID_BASE="$MACOSX_BUNDLE_ID_BASE-$VERSION_PRE"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
|
||||
|
||||
# Set the MACOSX CFBundleVersion field
|
||||
AC_ARG_WITH(macosx-bundle-build-version, [AS_HELP_STRING([--with-macosx-bundle-build-version],
|
||||
[Set the MacOSX Bundle CFBundleVersion field. This key is a machine-readable
|
||||
string composed of one to three period-separated integers and should represent the
|
||||
build version. Defaults to the build number.])])
|
||||
if test "x$with_macosx_bundle_build_version" = xyes; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-build-version must have a value])
|
||||
elif [ ! [[ $with_macosx_bundle_build_version =~ ^[0-9\.]*$ ]] ]; then
|
||||
AC_MSG_ERROR([--with-macosx-bundle-build-version contains non numbers and periods: $with_macosx_bundle_build_version])
|
||||
elif test "x$with_macosx_bundle_build_version" != x; then
|
||||
MACOSX_BUNDLE_BUILD_VERSION="$with_macosx_bundle_build_version"
|
||||
else
|
||||
MACOSX_BUNDLE_BUILD_VERSION="$VERSION_BUILD"
|
||||
# If VERSION_OPT consists of only numbers and periods, add it.
|
||||
if [ [[ $VERSION_OPT =~ ^[0-9\.]+$ ]] ]; then
|
||||
MACOSX_BUNDLE_BUILD_VERSION+=".$VERSION_OPT"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MACOSX_BUNDLE_BUILD_VERSION)
|
||||
|
||||
# We could define --with flags for these, if really needed
|
||||
VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
|
||||
VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
|
||||
|
@ -170,6 +170,7 @@ COMPANY_NAME:=@COMPANY_NAME@
|
||||
HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
|
||||
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
|
||||
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
|
||||
MACOSX_BUNDLE_BUILD_VERSION=@MACOSX_BUNDLE_BUILD_VERSION@
|
||||
USERNAME:=@USERNAME@
|
||||
VENDOR_URL:=@VENDOR_URL@
|
||||
VENDOR_URL_BUG:=@VENDOR_URL_BUG@
|
||||
|
@ -102,19 +102,19 @@ define SetupBuildLauncherBody
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
ifeq ($$($1_MACOSX_PRIVILEGED), true)
|
||||
$1_PLIST_SRC_FILE := Info-privileged.plist
|
||||
else
|
||||
$1_PLIST_SRC_FILE := Info-cmdline.plist
|
||||
$1_PLIST_EXTRA := <key>SecTaskAccess</key><string>allowed</string>
|
||||
endif
|
||||
|
||||
$1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
|
||||
|
||||
$$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
|
||||
SOURCE_FILES := $$(TOPDIR)/src/java.base/macosx/native/launcher/$$($1_PLIST_SRC_FILE), \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist, \
|
||||
OUTPUT_FILE := $$($1_PLIST_FILE), \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$(VERSION_SHORT).$1 ; \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$1 ; \
|
||||
@@VERSION@@ => $(VERSION_NUMBER) ; \
|
||||
@@BUILD_VERSION@@ => $(MACOSX_BUNDLE_BUILD_VERSION) ; \
|
||||
@@EXTRA@@ => $$($1_PLIST_EXTRA), \
|
||||
))
|
||||
|
||||
$1_LDFLAGS += -sectcreate __TEXT __info_plist $$($1_PLIST_FILE)
|
||||
@ -187,6 +187,10 @@ define SetupBuildLauncherBody
|
||||
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
|
||||
$$($1_WINDOWS_JLI_LIB)
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
@ -1339,13 +1339,17 @@ var versionArgs = function(input, common) {
|
||||
"--with-version-pre=" + version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"),
|
||||
"--without-version-opt");
|
||||
} else if (input.build_type == "ci") {
|
||||
var optString = input.build_id_data.ciBuildNumber;
|
||||
var ciBuildNumber = input.build_id_data.ciBuildNumber;
|
||||
var preString = input.build_id_data.projectName;
|
||||
if (preString == "jdk") {
|
||||
preString = version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE");
|
||||
}
|
||||
args = concat(args, "--with-version-pre=" + preString,
|
||||
"--with-version-opt=" + optString);
|
||||
"--with-version-opt=" + ciBuildNumber);
|
||||
if (input.target_os == "macosx") {
|
||||
args = concat(args, "--with-macosx-bundle-build-version="
|
||||
+ common.build_number + "." + ciBuildNumber);
|
||||
}
|
||||
} else {
|
||||
args = concat(args, "--with-version-opt=" + common.build_id);
|
||||
}
|
||||
|
@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<string>@@BUILD_VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
<key>JavaVM</key>
|
||||
@ -33,9 +33,9 @@
|
||||
<key>JVMMinimumFrameworkVersion</key>
|
||||
<string>13.2.9</string>
|
||||
<key>JVMMinimumSystemVersion</key>
|
||||
<string>10.6.0</string>
|
||||
<string>@@MACOSX_VERSION_MIN@@</string>
|
||||
<key>JVMPlatformVersion</key>
|
||||
<string>@@PLATFORM_VERSION@@</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>JVMVendor</key>
|
||||
<string>@@VENDOR@@</string>
|
||||
<key>JVMVersion</key>
|
||||
|
@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<string>@@BUILD_VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
<key>JavaVM</key>
|
||||
@ -29,9 +29,9 @@
|
||||
<key>JVMMinimumFrameworkVersion</key>
|
||||
<string>13.2.9</string>
|
||||
<key>JVMMinimumSystemVersion</key>
|
||||
<string>10.6.0</string>
|
||||
<string>@@MACOSX_VERSION_MIN@@</string>
|
||||
<key>JVMPlatformVersion</key>
|
||||
<string>@@PLATFORM_VERSION@@</string>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>JVMVendor</key>
|
||||
<string>@@VENDOR@@</string>
|
||||
<key>JVMVersion</key>
|
||||
|
@ -7,10 +7,11 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@BUILD_VERSION@@</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>The application is requesting access to the microphone.</string>
|
||||
@@EXTRA@@
|
||||
</dict>
|
||||
</plist>
|
@ -105,12 +105,6 @@ void DefNewGeneration::FastEvacuateFollowersClosure::do_void() {
|
||||
guarantee(_heap->young_gen()->promo_failure_scan_is_complete(), "Failed to finish scan");
|
||||
}
|
||||
|
||||
ScanClosure::ScanClosure(DefNewGeneration* g, bool gc_barrier) :
|
||||
OopsInClassLoaderDataOrGenClosure(g), _g(g), _gc_barrier(gc_barrier)
|
||||
{
|
||||
_boundary = _g->reserved().end();
|
||||
}
|
||||
|
||||
FastScanClosure::FastScanClosure(DefNewGeneration* g, bool gc_barrier) :
|
||||
OopsInClassLoaderDataOrGenClosure(g), _g(g), _gc_barrier(gc_barrier)
|
||||
{
|
||||
@ -430,10 +424,6 @@ void DefNewGeneration::compute_new_size() {
|
||||
}
|
||||
}
|
||||
|
||||
void DefNewGeneration::younger_refs_iterate(OopsInGenClosure* cl, uint n_threads) {
|
||||
assert(false, "NYI -- are you sure you want to call this?");
|
||||
}
|
||||
|
||||
|
||||
size_t DefNewGeneration::capacity() const {
|
||||
return eden()->capacity()
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "utilities/stack.hpp"
|
||||
|
||||
class ContiguousSpace;
|
||||
class ScanClosure;
|
||||
class STWGCTimer;
|
||||
class CSpaceCounters;
|
||||
class ScanWeakRefClosure;
|
||||
@ -242,8 +241,6 @@ protected:
|
||||
// Iteration
|
||||
void object_iterate(ObjectClosure* blk);
|
||||
|
||||
void younger_refs_iterate(OopsInGenClosure* cl, uint n_threads);
|
||||
|
||||
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
|
||||
|
||||
// Allocation support
|
||||
|
@ -178,12 +178,6 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
|
||||
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
|
||||
// Because follow_root_closure is created statically, cannot
|
||||
// use OopsInGenClosure constructor which takes a generation,
|
||||
// as the Universe has not been created when the static constructors
|
||||
// are run.
|
||||
follow_root_closure.set_orig_generation(gch->old_gen());
|
||||
|
||||
// Need new claim bits before marking starts.
|
||||
ClassLoaderDataGraph::clear_claimed_marks();
|
||||
|
||||
@ -277,12 +271,6 @@ void GenMarkSweep::mark_sweep_phase3() {
|
||||
// Need new claim bits for the pointer adjustment tracing.
|
||||
ClassLoaderDataGraph::clear_claimed_marks();
|
||||
|
||||
// Because the closure below is created statically, we cannot
|
||||
// use OopsInGenClosure constructor which takes a generation,
|
||||
// as the Universe has not been created when the static constructors
|
||||
// are run.
|
||||
adjust_pointer_closure.set_orig_generation(gch->old_gen());
|
||||
|
||||
{
|
||||
StrongRootsScope srs(1);
|
||||
|
||||
|
@ -56,7 +56,7 @@ class MarkSweep : AllStatic {
|
||||
//
|
||||
// Inline closure decls
|
||||
//
|
||||
class FollowRootClosure: public BasicOopsInGenClosure {
|
||||
class FollowRootClosure: public BasicOopIterateClosure {
|
||||
public:
|
||||
virtual void do_oop(oop* p);
|
||||
virtual void do_oop(narrowOop* p);
|
||||
@ -185,7 +185,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class AdjustPointerClosure: public BasicOopsInGenClosure {
|
||||
class AdjustPointerClosure: public BasicOopIterateClosure {
|
||||
public:
|
||||
template <typename T> void do_oop_work(T* p);
|
||||
virtual void do_oop(oop* p);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "gc/serial/serialHeap.hpp"
|
||||
#include "gc/serial/tenuredGeneration.inline.hpp"
|
||||
#include "gc/shared/genMemoryPools.hpp"
|
||||
#include "gc/shared/strongRootsScope.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "services/memoryManager.hpp"
|
||||
|
||||
@ -87,3 +88,24 @@ GrowableArray<MemoryPool*> SerialHeap::memory_pools() {
|
||||
memory_pools.append(_old_pool);
|
||||
return memory_pools;
|
||||
}
|
||||
|
||||
void SerialHeap::young_process_roots(StrongRootsScope* scope,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopsInGenClosure* old_gen_closure,
|
||||
CLDClosure* cld_closure) {
|
||||
MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
|
||||
|
||||
process_roots(scope, SO_ScavengeCodeCache, root_closure,
|
||||
cld_closure, cld_closure, &mark_code_closure);
|
||||
|
||||
if (_process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
|
||||
root_closure->reset_generation();
|
||||
}
|
||||
|
||||
old_gen_closure->set_generation(_old_gen);
|
||||
rem_set()->at_younger_refs_iterate();
|
||||
old_gen()->younger_refs_iterate(old_gen_closure, scope->n_threads());
|
||||
old_gen_closure->reset_generation();
|
||||
|
||||
_process_strong_tasks->all_tasks_completed(scope->n_threads());
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
class GCMemoryManager;
|
||||
class MemoryPool;
|
||||
class OopsInGenClosure;
|
||||
class TenuredGeneration;
|
||||
|
||||
class SerialHeap : public GenCollectedHeap {
|
||||
@ -75,6 +76,11 @@ public:
|
||||
template <typename OopClosureType1, typename OopClosureType2>
|
||||
void oop_since_save_marks_iterate(OopClosureType1* cur,
|
||||
OopClosureType2* older);
|
||||
|
||||
void young_process_roots(StrongRootsScope* scope,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopsInGenClosure* old_gen_closure,
|
||||
CLDClosure* cld_closure);
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SERIAL_SERIALHEAP_HPP
|
||||
|
@ -307,8 +307,13 @@ void CardGeneration::space_iterate(SpaceClosure* blk,
|
||||
blk->do_space(space());
|
||||
}
|
||||
|
||||
void CardGeneration::younger_refs_iterate(OopsInGenClosure* blk, uint n_threads) {
|
||||
blk->set_generation(this);
|
||||
younger_refs_in_space_iterate(space(), blk, n_threads);
|
||||
blk->reset_generation();
|
||||
void CardGeneration::younger_refs_iterate(OopIterateClosure* blk, uint n_threads) {
|
||||
// Apply "cl->do_oop" to (the address of) (exactly) all the ref fields in
|
||||
// "sp" that point into younger generations.
|
||||
// The iteration is only over objects allocated at the start of the
|
||||
// iterations; objects allocated as a result of applying the closure are
|
||||
// not included.
|
||||
|
||||
HeapWord* gen_boundary = reserved().start();
|
||||
_rs->younger_refs_in_space_iterate(space(), gen_boundary, blk, n_threads);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ class CardGeneration: public Generation {
|
||||
|
||||
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
|
||||
|
||||
void younger_refs_iterate(OopsInGenClosure* blk, uint n_threads);
|
||||
void younger_refs_iterate(OopIterateClosure* blk, uint n_threads);
|
||||
|
||||
bool is_in(const void* p) const;
|
||||
|
||||
|
@ -112,13 +112,10 @@ void CardTableRS::prepare_for_younger_refs_iterate(bool parallel) {
|
||||
}
|
||||
}
|
||||
|
||||
void CardTableRS::younger_refs_iterate(Generation* g,
|
||||
OopsInGenClosure* blk,
|
||||
uint n_threads) {
|
||||
void CardTableRS::at_younger_refs_iterate() {
|
||||
// The indexing in this array is slightly odd. We want to access
|
||||
// the old generation record here, which is at index 2.
|
||||
_last_cur_val_in_gen[2] = cur_youngergen_card_val();
|
||||
g->younger_refs_iterate(blk, n_threads);
|
||||
}
|
||||
|
||||
inline bool ClearNoncleanCardWrapper::clear_card(CardValue* entry) {
|
||||
@ -245,12 +242,13 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) {
|
||||
}
|
||||
|
||||
void CardTableRS::younger_refs_in_space_iterate(Space* sp,
|
||||
OopsInGenClosure* cl,
|
||||
HeapWord* gen_boundary,
|
||||
OopIterateClosure* cl,
|
||||
uint n_threads) {
|
||||
verify_used_region_at_save_marks(sp);
|
||||
|
||||
const MemRegion urasm = sp->used_region_at_save_marks();
|
||||
non_clean_card_iterate_possibly_parallel(sp, urasm, cl, this, n_threads);
|
||||
non_clean_card_iterate_possibly_parallel(sp, gen_boundary, urasm, cl, this, n_threads);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
@ -624,8 +622,9 @@ bool CardTableRS::card_may_have_been_dirty(CardValue cv) {
|
||||
|
||||
void CardTableRS::non_clean_card_iterate_possibly_parallel(
|
||||
Space* sp,
|
||||
HeapWord* gen_boundary,
|
||||
MemRegion mr,
|
||||
OopsInGenClosure* cl,
|
||||
OopIterateClosure* cl,
|
||||
CardTableRS* ct,
|
||||
uint n_threads)
|
||||
{
|
||||
@ -638,7 +637,7 @@ void CardTableRS::non_clean_card_iterate_possibly_parallel(
|
||||
// This is the single-threaded version used by DefNew.
|
||||
const bool parallel = false;
|
||||
|
||||
DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary(), parallel);
|
||||
DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), gen_boundary, parallel);
|
||||
ClearNoncleanCardWrapper clear_cl(dcto_cl, ct, parallel);
|
||||
|
||||
clear_cl.do_MemRegion(mr);
|
||||
@ -647,7 +646,7 @@ void CardTableRS::non_clean_card_iterate_possibly_parallel(
|
||||
}
|
||||
|
||||
void CardTableRS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
|
||||
OopsInGenClosure* cl, CardTableRS* ct,
|
||||
OopIterateClosure* cl, CardTableRS* ct,
|
||||
uint n_threads) {
|
||||
fatal("Parallel gc not supported here.");
|
||||
}
|
||||
|
@ -32,7 +32,6 @@
|
||||
class DirtyCardToOopClosure;
|
||||
class Generation;
|
||||
class Space;
|
||||
class OopsInGenClosure;
|
||||
|
||||
// Helper to remember modified oops in all clds.
|
||||
class CLDRemSet {
|
||||
@ -104,17 +103,15 @@ public:
|
||||
|
||||
CLDRemSet* cld_rem_set() { return &_cld_rem_set; }
|
||||
|
||||
void younger_refs_in_space_iterate(Space* sp, OopsInGenClosure* cl, uint n_threads);
|
||||
void younger_refs_in_space_iterate(Space* sp, HeapWord* gen_boundary, OopIterateClosure* cl, uint n_threads);
|
||||
|
||||
virtual void verify_used_region_at_save_marks(Space* sp) const NOT_DEBUG_RETURN;
|
||||
|
||||
// Override.
|
||||
void prepare_for_younger_refs_iterate(bool parallel);
|
||||
|
||||
// Card table entries are cleared before application; "blk" is
|
||||
// responsible for dirtying if the oop is still older-to-younger after
|
||||
// closure application.
|
||||
void younger_refs_iterate(Generation* g, OopsInGenClosure* blk, uint n_threads);
|
||||
// Card table entries are cleared before application;
|
||||
void at_younger_refs_iterate();
|
||||
|
||||
void inline_write_ref_field_gc(void* field, oop new_val) {
|
||||
CardValue* byte = byte_for(field);
|
||||
@ -165,14 +162,14 @@ public:
|
||||
// Iterate over the portion of the card-table which covers the given
|
||||
// region mr in the given space and apply cl to any dirty sub-regions
|
||||
// of mr. Clears the dirty cards as they are processed.
|
||||
void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
|
||||
OopsInGenClosure* cl, CardTableRS* ct,
|
||||
uint n_threads);
|
||||
void non_clean_card_iterate_possibly_parallel(Space* sp, HeapWord* gen_boundary,
|
||||
MemRegion mr, OopIterateClosure* cl,
|
||||
CardTableRS* ct, uint n_threads);
|
||||
|
||||
// Work method used to implement non_clean_card_iterate_possibly_parallel()
|
||||
// above in the parallel case.
|
||||
virtual void non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
|
||||
OopsInGenClosure* cl, CardTableRS* ct,
|
||||
OopIterateClosure* cl, CardTableRS* ct,
|
||||
uint n_threads);
|
||||
|
||||
// This is an array, one element per covered region of the card table.
|
||||
|
@ -850,33 +850,11 @@ void GenCollectedHeap::process_roots(StrongRootsScope* scope,
|
||||
}
|
||||
}
|
||||
|
||||
void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopsInGenClosure* old_gen_closure,
|
||||
CLDClosure* cld_closure) {
|
||||
MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
|
||||
|
||||
process_roots(scope, SO_ScavengeCodeCache, root_closure,
|
||||
cld_closure, cld_closure, &mark_code_closure);
|
||||
|
||||
if (_process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
|
||||
root_closure->reset_generation();
|
||||
}
|
||||
|
||||
// When collection is parallel, all threads get to cooperate to do
|
||||
// old generation scanning.
|
||||
old_gen_closure->set_generation(_old_gen);
|
||||
rem_set()->younger_refs_iterate(_old_gen, old_gen_closure, scope->n_threads());
|
||||
old_gen_closure->reset_generation();
|
||||
|
||||
_process_strong_tasks->all_tasks_completed(scope->n_threads());
|
||||
}
|
||||
|
||||
void GenCollectedHeap::full_process_roots(StrongRootsScope* scope,
|
||||
bool is_adjust_phase,
|
||||
ScanningOption so,
|
||||
bool only_strong_roots,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopClosure* root_closure,
|
||||
CLDClosure* cld_closure) {
|
||||
MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
|
||||
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
|
||||
|
@ -371,16 +371,11 @@ public:
|
||||
virtual void gc_epilogue(bool full);
|
||||
|
||||
public:
|
||||
void young_process_roots(StrongRootsScope* scope,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopsInGenClosure* old_gen_closure,
|
||||
CLDClosure* cld_closure);
|
||||
|
||||
void full_process_roots(StrongRootsScope* scope,
|
||||
bool is_adjust_phase,
|
||||
ScanningOption so,
|
||||
bool only_strong_roots,
|
||||
OopsInGenClosure* root_closure,
|
||||
OopClosure* root_closure,
|
||||
CLDClosure* cld_closure);
|
||||
|
||||
// Apply "root_closure" to all the weak roots of the system.
|
||||
|
@ -58,28 +58,16 @@ class OopsInGenClosure : public OopIterateClosure {
|
||||
template <class T> void do_barrier(T* p);
|
||||
|
||||
public:
|
||||
OopsInGenClosure() : OopIterateClosure(NULL),
|
||||
_orig_gen(NULL), _gen(NULL), _gen_boundary(NULL), _rs(NULL) {};
|
||||
|
||||
OopsInGenClosure(Generation* gen);
|
||||
void set_generation(Generation* gen);
|
||||
|
||||
void reset_generation() { _gen = _orig_gen; }
|
||||
|
||||
// Problem with static closures: must have _gen_boundary set at some point,
|
||||
// but cannot do this until after the heap is initialized.
|
||||
void set_orig_generation(Generation* gen) {
|
||||
_orig_gen = gen;
|
||||
set_generation(gen);
|
||||
}
|
||||
|
||||
HeapWord* gen_boundary() { return _gen_boundary; }
|
||||
|
||||
};
|
||||
|
||||
class BasicOopsInGenClosure: public OopsInGenClosure {
|
||||
public:
|
||||
BasicOopsInGenClosure() : OopsInGenClosure() {}
|
||||
BasicOopsInGenClosure(Generation* gen);
|
||||
|
||||
virtual bool do_metadata() { return false; }
|
||||
@ -102,27 +90,10 @@ class OopsInClassLoaderDataOrGenClosure: public BasicOopsInGenClosure {
|
||||
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// Closure for scanning DefNewGeneration.
|
||||
//
|
||||
// This closure will perform barrier store calls for ALL
|
||||
// pointers in scanned oops.
|
||||
class ScanClosure: public OopsInClassLoaderDataOrGenClosure {
|
||||
private:
|
||||
DefNewGeneration* _g;
|
||||
HeapWord* _boundary;
|
||||
bool _gc_barrier;
|
||||
template <class T> inline void do_oop_work(T* p);
|
||||
public:
|
||||
ScanClosure(DefNewGeneration* g, bool gc_barrier);
|
||||
virtual void do_oop(oop* p);
|
||||
virtual void do_oop(narrowOop* p);
|
||||
};
|
||||
|
||||
// Closure for scanning DefNewGeneration.
|
||||
//
|
||||
// This closure only performs barrier store calls on
|
||||
// pointers into the DefNewGeneration. This is less
|
||||
// precise, but faster, than a ScanClosure
|
||||
// pointers into the DefNewGeneration.
|
||||
class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
|
||||
protected:
|
||||
DefNewGeneration* _g;
|
||||
@ -168,9 +139,8 @@ class FilteringClosure: public OopIterateClosure {
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// Closure for scanning DefNewGeneration's weak references.
|
||||
// NOTE: very much like ScanClosure but not derived from
|
||||
// OopsInGenClosure -- weak references are processed all
|
||||
// at once, with no notion of which generation they were in.
|
||||
// -- weak references are processed all at once,
|
||||
// with no notion of which generation they were in.
|
||||
class ScanWeakRefClosure: public OopClosure {
|
||||
protected:
|
||||
DefNewGeneration* _g;
|
||||
|
@ -74,34 +74,6 @@ inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
|
||||
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// NOTE! Any changes made here should also be made
|
||||
// in FastScanClosure::do_oop_work()
|
||||
template <class T> inline void ScanClosure::do_oop_work(T* p) {
|
||||
T heap_oop = RawAccess<>::oop_load(p);
|
||||
// Should we copy the obj?
|
||||
if (!CompressedOops::is_null(heap_oop)) {
|
||||
oop obj = CompressedOops::decode_not_null(heap_oop);
|
||||
if (cast_from_oop<HeapWord*>(obj) < _boundary) {
|
||||
assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?");
|
||||
oop new_obj = obj->is_forwarded() ? obj->forwardee()
|
||||
: _g->copy_to_survivor_space(obj);
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
|
||||
}
|
||||
|
||||
if (is_scanning_a_cld()) {
|
||||
do_cld_barrier();
|
||||
} else if (_gc_barrier) {
|
||||
// Now call parent closure
|
||||
do_barrier(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void ScanClosure::do_oop(oop* p) { ScanClosure::do_oop_work(p); }
|
||||
inline void ScanClosure::do_oop(narrowOop* p) { ScanClosure::do_oop_work(p); }
|
||||
|
||||
// NOTE! Any changes made here should also be made
|
||||
// in ScanClosure::do_oop_work()
|
||||
template <class T> inline void FastScanClosure::do_oop_work(T* p) {
|
||||
T heap_oop = RawAccess<>::oop_load(p);
|
||||
// Should we copy the obj?
|
||||
@ -142,7 +114,7 @@ inline void FilteringClosure::do_oop(narrowOop* p) { FilteringClosure::do_oop_wo
|
||||
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// Note similarity to ScanClosure; the difference is that
|
||||
// Note similarity to FastScanClosure; the difference is that
|
||||
// the barrier set is taken care of outside this closure.
|
||||
template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
|
||||
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
|
||||
|
@ -264,13 +264,6 @@ void Generation::oop_iterate(OopIterateClosure* cl) {
|
||||
space_iterate(&blk);
|
||||
}
|
||||
|
||||
void Generation::younger_refs_in_space_iterate(Space* sp,
|
||||
OopsInGenClosure* cl,
|
||||
uint n_threads) {
|
||||
CardTableRS* rs = GenCollectedHeap::heap()->rem_set();
|
||||
rs->younger_refs_in_space_iterate(sp, cl, n_threads);
|
||||
}
|
||||
|
||||
class GenerationObjIterateClosure : public SpaceClosure {
|
||||
private:
|
||||
ObjectClosure* _cl;
|
||||
|
@ -55,9 +55,7 @@ class GenerationSpec;
|
||||
class CompactibleSpace;
|
||||
class ContiguousSpace;
|
||||
class CompactPoint;
|
||||
class OopsInGenClosure;
|
||||
class OopClosure;
|
||||
class ScanClosure;
|
||||
class FastScanClosure;
|
||||
class GenCollectedHeap;
|
||||
class GCStats;
|
||||
@ -103,13 +101,6 @@ class Generation: public CHeapObj<mtGC> {
|
||||
// Initialize the generation.
|
||||
Generation(ReservedSpace rs, size_t initial_byte_size);
|
||||
|
||||
// Apply "cl->do_oop" to (the address of) (exactly) all the ref fields in
|
||||
// "sp" that point into younger generations.
|
||||
// The iteration is only over objects allocated at the start of the
|
||||
// iterations; objects allocated as a result of applying the closure are
|
||||
// not included.
|
||||
void younger_refs_in_space_iterate(Space* sp, OopsInGenClosure* cl, uint n_threads);
|
||||
|
||||
public:
|
||||
// The set of possible generation kinds.
|
||||
enum Name {
|
||||
@ -450,12 +441,6 @@ class Generation: public CHeapObj<mtGC> {
|
||||
// each.
|
||||
virtual void object_iterate(ObjectClosure* cl);
|
||||
|
||||
// Apply "cl->do_oop" to (the address of) all and only all the ref fields
|
||||
// in the current generation that contain pointers to objects in younger
|
||||
// generations. Objects allocated since the last "save_marks" call are
|
||||
// excluded.
|
||||
virtual void younger_refs_iterate(OopsInGenClosure* cl, uint n_threads) = 0;
|
||||
|
||||
// Inform a generation that it longer contains references to objects
|
||||
// in any younger generation. [e.g. Because younger gens are empty,
|
||||
// clear the card table.]
|
||||
|
@ -42,7 +42,6 @@
|
||||
|
||||
// Forward declarations.
|
||||
class OopClosure;
|
||||
class ScanClosure;
|
||||
class FastScanClosure;
|
||||
class FilteringClosure;
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>@@ID@@</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>OpenJDK Command</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@@VERSION@@</string>
|
||||
<key>SecTaskAccess</key>
|
||||
<string>allowed</string>
|
||||
</dict>
|
||||
</plist>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,6 +34,7 @@ import java.io.Serializable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CoderResult;
|
||||
import java.nio.charset.CodingErrorAction;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
@ -41,7 +42,6 @@ import java.nio.file.Path;
|
||||
import java.text.Normalizer;
|
||||
import jdk.internal.access.JavaNetUriAccess;
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import sun.nio.cs.ThreadLocalCoders;
|
||||
import sun.nio.cs.UTF_8;
|
||||
|
||||
import java.lang.Character; // for javadoc
|
||||
@ -2761,11 +2761,10 @@ public final class URI
|
||||
sb.append(hexDigits[(b >> 0) & 0x0f]);
|
||||
}
|
||||
|
||||
private static void appendEncoded(StringBuilder sb, char c) {
|
||||
private static void appendEncoded(CharsetEncoder encoder, StringBuilder sb, char c) {
|
||||
ByteBuffer bb = null;
|
||||
try {
|
||||
bb = ThreadLocalCoders.encoderFor(UTF_8.INSTANCE)
|
||||
.encode(CharBuffer.wrap("" + c));
|
||||
bb = encoder.encode(CharBuffer.wrap("" + c));
|
||||
} catch (CharacterCodingException x) {
|
||||
assert false;
|
||||
}
|
||||
@ -2783,6 +2782,7 @@ public final class URI
|
||||
//
|
||||
private static String quote(String s, long lowMask, long highMask) {
|
||||
StringBuilder sb = null;
|
||||
CharsetEncoder encoder = null;
|
||||
boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0);
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
@ -2800,11 +2800,13 @@ public final class URI
|
||||
} else if (allowNonASCII
|
||||
&& (Character.isSpaceChar(c)
|
||||
|| Character.isISOControl(c))) {
|
||||
if (encoder == null)
|
||||
encoder = UTF_8.INSTANCE.newEncoder();
|
||||
if (sb == null) {
|
||||
sb = new StringBuilder();
|
||||
sb.append(s, 0, i);
|
||||
}
|
||||
appendEncoded(sb, c);
|
||||
appendEncoded(encoder, sb, c);
|
||||
} else {
|
||||
if (sb != null)
|
||||
sb.append(c);
|
||||
@ -2832,8 +2834,9 @@ public final class URI
|
||||
String ns = Normalizer.normalize(s, Normalizer.Form.NFC);
|
||||
ByteBuffer bb = null;
|
||||
try {
|
||||
bb = ThreadLocalCoders.encoderFor(UTF_8.INSTANCE)
|
||||
bb = UTF_8.INSTANCE.newEncoder()
|
||||
.encode(CharBuffer.wrap(ns));
|
||||
|
||||
} catch (CharacterCodingException x) {
|
||||
assert false;
|
||||
}
|
||||
@ -2890,9 +2893,9 @@ public final class URI
|
||||
StringBuilder sb = new StringBuilder(n);
|
||||
ByteBuffer bb = ByteBuffer.allocate(n);
|
||||
CharBuffer cb = CharBuffer.allocate(n);
|
||||
CharsetDecoder dec = ThreadLocalCoders.decoderFor(UTF_8.INSTANCE)
|
||||
.onMalformedInput(CodingErrorAction.REPLACE)
|
||||
.onUnmappableCharacter(CodingErrorAction.REPLACE);
|
||||
CharsetDecoder dec = UTF_8.INSTANCE.newDecoder()
|
||||
.onMalformedInput(CodingErrorAction.REPLACE)
|
||||
.onUnmappableCharacter(CodingErrorAction.REPLACE);
|
||||
|
||||
// This is not horribly efficient, but it will do for now
|
||||
char c = s.charAt(0);
|
||||
|
@ -55,8 +55,8 @@ public interface AttributeTree extends DocTree {
|
||||
Name getName();
|
||||
|
||||
/**
|
||||
* Returns the kind of the attribute.
|
||||
* @return the kind of the attribute
|
||||
* Returns the kind of the attribute value.
|
||||
* @return the kind of the attribute value
|
||||
*/
|
||||
ValueKind getValueKind();
|
||||
|
||||
|
@ -81,7 +81,7 @@ public interface DocTreeFactory {
|
||||
/**
|
||||
* Creates a new {@code AttributeTree} object, to represent an HTML attribute in an HTML tag.
|
||||
* @param name the name of the attribute
|
||||
* @param vkind the kind of attribute value
|
||||
* @param vkind the kind of the attribute value
|
||||
* @param value the value, if any, of the attribute
|
||||
* @return an {@code AttributeTree} object
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ import com.sun.tools.javac.util.DefinedBy;
|
||||
import com.sun.tools.javac.util.DefinedBy.Api;
|
||||
|
||||
/**
|
||||
* Prints out a doc comment tree.
|
||||
* Prints out a doc-comment tree.
|
||||
*
|
||||
* <p><b>This is NOT part of any supported API.
|
||||
* If you write code that depends on this, you do so at your own risk.
|
||||
@ -50,11 +50,6 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
*/
|
||||
final Writer out;
|
||||
|
||||
/**
|
||||
* The left margin.
|
||||
*/
|
||||
int lmargin = 0;
|
||||
|
||||
public DocPretty(Writer out) {
|
||||
this.out = out;
|
||||
}
|
||||
@ -90,7 +85,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Print list., with separators
|
||||
* Print list with separators.
|
||||
*/
|
||||
protected void print(List<? extends DocTree> list, String sep) throws IOException {
|
||||
if (list.isEmpty())
|
||||
@ -497,7 +492,7 @@ public class DocPretty implements DocTreeVisitor<Void,Void> {
|
||||
List<? extends DocTree> attrs = node.getAttributes();
|
||||
if (!attrs.isEmpty()) {
|
||||
print(" ");
|
||||
print(attrs);
|
||||
print(attrs, " ");
|
||||
DocTree last = node.getAttributes().get(attrs.size() - 1);
|
||||
if (node.isSelfClosing() && last instanceof AttributeTree
|
||||
&& ((AttributeTree) last).getValueKind() == ValueKind.UNQUOTED)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2020, 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
|
||||
@ -305,5 +305,44 @@ DocComment[DOC_COMMENT, pos:1
|
||||
Text[TEXT, pos:26, jjg]
|
||||
]
|
||||
]
|
||||
*/
|
||||
|
||||
/**
|
||||
* <a name1="val1" name2='val2' name3=val3 name4>
|
||||
*/
|
||||
void multiple_attr() { }
|
||||
/*
|
||||
DocComment[DOC_COMMENT, pos:1
|
||||
firstSentence: 1
|
||||
StartElement[START_ELEMENT, pos:1
|
||||
name:a
|
||||
attributes: 4
|
||||
Attribute[ATTRIBUTE, pos:4
|
||||
name: name1
|
||||
vkind: DOUBLE
|
||||
value: 1
|
||||
Text[TEXT, pos:11, val1]
|
||||
]
|
||||
Attribute[ATTRIBUTE, pos:17
|
||||
name: name2
|
||||
vkind: SINGLE
|
||||
value: 1
|
||||
Text[TEXT, pos:24, val2]
|
||||
]
|
||||
Attribute[ATTRIBUTE, pos:30
|
||||
name: name3
|
||||
vkind: UNQUOTED
|
||||
value: 1
|
||||
Text[TEXT, pos:36, val3]
|
||||
]
|
||||
Attribute[ATTRIBUTE, pos:41
|
||||
name: name4
|
||||
vkind: EMPTY
|
||||
value: null
|
||||
]
|
||||
]
|
||||
body: empty
|
||||
block tags: empty
|
||||
]
|
||||
*/
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2020, 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
|
||||
@ -66,7 +66,7 @@ public class DocCommentTester {
|
||||
this.useBreakIterator = useBreakIterator;
|
||||
}
|
||||
public static void main(String... args) throws Exception {
|
||||
ArrayList<String> list = new ArrayList(Arrays.asList(args));
|
||||
ArrayList<String> list = new ArrayList<>(Arrays.asList(args));
|
||||
if (!list.isEmpty() && "-useBreakIterator".equals(list.get(0))) {
|
||||
list.remove(0);
|
||||
new DocCommentTester(true).run(list);
|
||||
@ -255,7 +255,7 @@ public class DocCommentTester {
|
||||
* changes are approved, the new files can be used to replace the old.
|
||||
*/
|
||||
public static void main(String... args) throws Exception {
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
File o = null;
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
String arg = args[i];
|
||||
@ -305,11 +305,8 @@ public class DocCommentTester {
|
||||
File f = new File(tree.getSourceFile().getName());
|
||||
File outFile = new File(outDir, f.getName());
|
||||
try {
|
||||
FileWriter out = new FileWriter(outFile);
|
||||
try {
|
||||
try (FileWriter out = new FileWriter(outFile)) {
|
||||
out.write(source);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println("Can't write " + tree.getSourceFile().getName()
|
||||
@ -701,7 +698,7 @@ public class DocCommentTester {
|
||||
|
||||
/*
|
||||
* Use this method to start printing a multi-line representation of a
|
||||
* DocTree node. The representation should be termintated by calling
|
||||
* DocTree node. The representation should be terminated by calling
|
||||
* out.println("]").
|
||||
*/
|
||||
void header(DocTree node) {
|
||||
@ -804,7 +801,7 @@ public class DocCommentTester {
|
||||
final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path);
|
||||
DCTree t = (DCTree) trees.getDocCommentTree(path);
|
||||
|
||||
DocTreeScanner scanner = new DocTreeScanner<Void,Void>() {
|
||||
DocTreeScanner<Void, Void> scanner = new DocTreeScanner<>() {
|
||||
@Override
|
||||
public Void scan(DocTree node, Void ignore) {
|
||||
if (node != null) {
|
||||
|
@ -117,7 +117,12 @@ public final class Utils {
|
||||
*/
|
||||
public static final String TEST_NAME = System.getProperty("test.name", ".");
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the value of 'test.nativepath' system property
|
||||
*/
|
||||
public static final String TEST_NATIVE_PATH = System.getProperty("test.nativepath", ".");
|
||||
|
||||
/**
|
||||
* Defines property name for seed value.
|
||||
*/
|
||||
public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed";
|
||||
|
60
test/micro/org/openjdk/bench/java/net/ThreadLocalURI.java
Normal file
60
test/micro/org/openjdk/bench/java/net/ThreadLocalURI.java
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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.
|
||||
*/
|
||||
|
||||
package org.openjdk.bench.java.net;
|
||||
|
||||
import org.openjdk.jmh.annotations.State;
|
||||
import org.openjdk.jmh.annotations.Scope;
|
||||
import org.openjdk.jmh.annotations.Benchmark;
|
||||
import org.openjdk.jmh.annotations.CompilerControl;
|
||||
import org.openjdk.jmh.annotations.BenchmarkMode;
|
||||
import org.openjdk.jmh.annotations.Mode;
|
||||
import org.openjdk.jmh.annotations.OutputTimeUnit;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
@OutputTimeUnit(TimeUnit.NANOSECONDS)
|
||||
@State(Scope.Thread)
|
||||
public class ThreadLocalURI {
|
||||
|
||||
@Benchmark
|
||||
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
|
||||
public URI uriEncoderTest() throws URISyntaxException {
|
||||
return new URI("http", "\u00A0", "\u00A0");
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
|
||||
public URI uriDecoderBaseline() throws URISyntaxException {
|
||||
return new URI("https", "example.com", "/xyz/abc/def?query=", "#30");
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
|
||||
public String uriDecoderTest() throws URISyntaxException {
|
||||
return new URI("https", "example.com", "/xyz/abc/def?query=", "#30")
|
||||
.getPath();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user