8202331: Obsolete support for commercial features

Reviewed-by: kvn, cjplummer, dholmes
This commit is contained in:
Mikael Vidstedt 2018-06-21 21:37:28 -07:00
parent c1c2c677cf
commit 1f437b30f3
13 changed files with 20 additions and 60 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2010, 2018, 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
@ -75,7 +75,6 @@ fi
# #
# see above - already in place, copy the flags down here to disable # see above - already in place, copy the flags down here to disable
ENABLE_FLIGHT_RECORDER_FLAGS="\ ENABLE_FLIGHT_RECORDER_FLAGS="\
-XX:+UnlockCommercialFeatures \
-XX:+FlightRecorder \ -XX:+FlightRecorder \
-XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024" -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024"

View File

@ -351,7 +351,7 @@ test.src.dir=test/nashorn/src
run.test.xmx=2G run.test.xmx=2G
run.test.xms=2G run.test.xms=2G
# uncomment this jfr.args to enable light recordings. the stack needs to be cranked up to 1024 frames, # uncomment this jfr.args to enable flight recordings. the stack needs to be cranked up to 1024 frames,
# or everything will as of the now drown in lambda forms and be cut off. # or everything will as of the now drown in lambda forms and be cut off.
# #
#jfr.args=-XX:StartFlightRecording=disk=true,dumponexit=true,dumponexitpath="test_suite.jfr",stackdepth=1024 #jfr.args=-XX:StartFlightRecording=disk=true,dumponexit=true,dumponexitpath="test_suite.jfr",stackdepth=1024

View File

@ -488,7 +488,7 @@ void Arguments::init_version_specific_system_properties() {
* *
* Recommended approach for removing options: * Recommended approach for removing options:
* *
* To remove options commonly used by customers (e.g. product, commercial -XX options), use * To remove options commonly used by customers (e.g. product -XX options), use
* the 3-step model adding major release numbers to the deprecate, obsolete and expire columns. * the 3-step model adding major release numbers to the deprecate, obsolete and expire columns.
* *
* To remove internal options (e.g. diagnostic, experimental, develop options), use * To remove internal options (e.g. diagnostic, experimental, develop options), use

View File

@ -326,10 +326,6 @@ bool JVMFlag::is_read_write() const {
return (_flags & KIND_READ_WRITE) != 0; return (_flags & KIND_READ_WRITE) != 0;
} }
bool JVMFlag::is_commercial() const {
return (_flags & KIND_COMMERCIAL) != 0;
}
/** /**
* Returns if this flag is a constant in the binary. Right now this is * Returns if this flag is a constant in the binary. Right now this is
* true for notproduct and develop flags in product builds. * true for notproduct and develop flags in product builds.
@ -642,7 +638,6 @@ void JVMFlag::print_kind(outputStream* st, unsigned int width) {
{ KIND_MANAGEABLE, "manageable" }, { KIND_MANAGEABLE, "manageable" },
{ KIND_DIAGNOSTIC, "diagnostic" }, { KIND_DIAGNOSTIC, "diagnostic" },
{ KIND_EXPERIMENTAL, "experimental" }, { KIND_EXPERIMENTAL, "experimental" },
{ KIND_COMMERCIAL, "commercial" },
{ KIND_NOT_PRODUCT, "notproduct" }, { KIND_NOT_PRODUCT, "notproduct" },
{ KIND_DEVELOP, "develop" }, { KIND_DEVELOP, "develop" },
{ KIND_LP64_PRODUCT, "lp64_product" }, { KIND_LP64_PRODUCT, "lp64_product" },
@ -911,7 +906,7 @@ JVMFlag* JVMFlag::find_flag(const char* name, size_t length, bool allow_locked,
if (!(current->is_unlocked() || current->is_unlocker())) { if (!(current->is_unlocked() || current->is_unlocker())) {
if (!allow_locked) { if (!allow_locked) {
// disable use of locked flags, e.g. diagnostic, experimental, // disable use of locked flags, e.g. diagnostic, experimental,
// commercial... until they are explicitly unlocked // etc. until they are explicitly unlocked
return NULL; return NULL;
} }
} }

View File

@ -60,11 +60,10 @@ struct JVMFlag {
KIND_C2 = 1 << 13, KIND_C2 = 1 << 13,
KIND_ARCH = 1 << 14, KIND_ARCH = 1 << 14,
KIND_LP64_PRODUCT = 1 << 15, KIND_LP64_PRODUCT = 1 << 15,
KIND_COMMERCIAL = 1 << 16, KIND_JVMCI = 1 << 16,
KIND_JVMCI = 1 << 17,
// set this bit if the flag was set on the command line // set this bit if the flag was set on the command line
ORIG_COMMAND_LINE = 1 << 18, ORIG_COMMAND_LINE = 1 << 17,
KIND_MASK = ~(VALUE_ORIGIN_MASK | ORIG_COMMAND_LINE) KIND_MASK = ~(VALUE_ORIGIN_MASK | ORIG_COMMAND_LINE)
}; };
@ -101,9 +100,7 @@ struct JVMFlag {
DIAGNOSTIC_FLAG_BUT_LOCKED, DIAGNOSTIC_FLAG_BUT_LOCKED,
EXPERIMENTAL_FLAG_BUT_LOCKED, EXPERIMENTAL_FLAG_BUT_LOCKED,
DEVELOPER_FLAG_BUT_PRODUCT_BUILD, DEVELOPER_FLAG_BUT_PRODUCT_BUILD,
NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD, NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD
COMMERCIAL_FLAG_BUT_DISABLED,
COMMERCIAL_FLAG_BUT_LOCKED
}; };
const char* _type; const char* _type;
@ -187,7 +184,6 @@ struct JVMFlag {
bool is_notproduct() const; bool is_notproduct() const;
bool is_develop() const; bool is_develop() const;
bool is_read_write() const; bool is_read_write() const;
bool is_commercial() const;
bool is_constant_in_binary() const; bool is_constant_in_binary() const;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2018, 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
@ -242,7 +242,6 @@ void emit_constraint_double(const char* name, const double* ptr, JVMFlagConstrai
// Generate code to call emit_constraint_xxx function // Generate code to call emit_constraint_xxx function
#define EMIT_CONSTRAINT_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
#define EMIT_CONSTRAINT_COMMERCIAL_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
#define EMIT_CONSTRAINT_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
#define EMIT_CONSTRAINT_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
#define EMIT_CONSTRAINT_MANAGEABLE_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_MANAGEABLE_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name

View File

@ -293,7 +293,6 @@ void emit_range_double(const char* name, const double* ptr, double min, double m
// Generate code to call emit_range_xxx function // Generate code to call emit_range_xxx function
#define EMIT_RANGE_PRODUCT_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_PRODUCT_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name
#define EMIT_RANGE_COMMERCIAL_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name
#define EMIT_RANGE_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name
#define EMIT_RANGE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name
#define EMIT_RANGE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2018, 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
@ -94,7 +94,6 @@ void emit_writeable_double(const char* name, JVMFlagWriteable::WriteableType typ
// Generate code to call emit_writeable_xxx function // Generate code to call emit_writeable_xxx function
#define EMIT_WRITEABLE_PRODUCT_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_PRODUCT_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
#define EMIT_WRITEABLE_COMMERCIAL_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
#define EMIT_WRITEABLE_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
#define EMIT_WRITEABLE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
#define EMIT_WRITEABLE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_writeable_##type(#name

View File

@ -68,22 +68,10 @@ public class CommandLineFlagCombo {
if (skipTestCase(testEntry)) if (skipTestCase(testEntry))
continue; continue;
OutputAnalyzer dumpOutput; OutputAnalyzer dumpOutput = TestCommon.dump(appJar, classList, testEntry);
if (testEntry.equals("-XX:+FlightRecorder")) {
dumpOutput = TestCommon.dump(appJar, classList, "-XX:+UnlockCommercialFeatures", testEntry);
} else {
dumpOutput = TestCommon.dump(appJar, classList, testEntry);
}
TestCommon.checkDump(dumpOutput, "Loading classes to share"); TestCommon.checkDump(dumpOutput, "Loading classes to share");
OutputAnalyzer execOutput; OutputAnalyzer execOutput = TestCommon.exec(appJar, testEntry, "Hello");
if (testEntry.equals("-XX:+FlightRecorder")) {
execOutput = TestCommon.exec(appJar, "-XX:+UnlockCommercialFeatures", testEntry, "Hello");
} else {
execOutput = TestCommon.exec(appJar, testEntry, "Hello");
}
TestCommon.checkExec(execOutput, "Hello World"); TestCommon.checkExec(execOutput, "Hello World");
} }
@ -121,11 +109,6 @@ public class CommandLineFlagCombo {
} }
} }
if (!BuildHelper.isCommercialBuild() && testEntry.equals("-XX:+FlightRecorder"))
{
System.out.println("Test case not applicable on non-commercial builds");
return true;
}
if (Compiler.isGraalEnabled() && testEntry.equals("-XX:+UseConcMarkSweepGC")) if (Compiler.isGraalEnabled() && testEntry.equals("-XX:+UseConcMarkSweepGC"))
{ {
System.out.println("Graal does not support CMS"); System.out.println("Graal does not support CMS");

View File

@ -45,10 +45,8 @@ public class FlagCombo {
SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC"); SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC");
if (BuildHelper.isCommercialBuild()) { SharedStringsUtils.runWithArchiveAuto("HelloString",
SharedStringsUtils.runWithArchiveAuto("HelloString", "-XX:+UnlockCommercialFeatures",
"-XX:StartFlightRecording=dumponexit=true"); "-XX:StartFlightRecording=dumponexit=true");
}
SharedStringsUtils.runWithArchive("HelloString", "-XX:+UnlockDiagnosticVMOptions", SharedStringsUtils.runWithArchive("HelloString", "-XX:+UnlockDiagnosticVMOptions",
"-XX:NativeMemoryTracking=detail", "-XX:+PrintNMTStatistics"); "-XX:NativeMemoryTracking=detail", "-XX:+PrintNMTStatistics");

View File

@ -55,11 +55,7 @@ public class SharedStringsStress {
out.close(); out.close();
} }
// Set NewSize to 8m due to dumping could fail in hs-tier6 testing with OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"),
// the vm options: -XX:+UnlockCommercialFeatures -XX:+UseDeterministicG1GC
// resulting in vm initialization error:
// "GC triggered before VM initialization completed. Try increasing NewSize, current value 1331K."
OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"), "-XX:NewSize=8m",
"-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile); "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile);
TestCommon.checkDump(dumpOutput); TestCommon.checkDump(dumpOutput);
OutputAnalyzer execOutput = TestCommon.exec(appJar, "HelloString"); OutputAnalyzer execOutput = TestCommon.exec(appJar, "HelloString");

View File

@ -637,10 +637,9 @@ abstract public class Debugee extends DebugeeProcess {
public boolean isJFR_active() { public boolean isJFR_active() {
String opts = argumentHandler.getLaunchOptions(); String opts = argumentHandler.getLaunchOptions();
int unlockPos = opts.indexOf("-XX:+UnlockCommercialFeatures");
int jfrPos = opts.indexOf("-XX:+FlightRecorder"); int jfrPos = opts.indexOf("-XX:+FlightRecorder");
if (unlockPos >= 0 && jfrPos >= 0 && jfrPos > unlockPos) if (jfrPos >= 0)
return true; return true;
else else
return false; return false;

View File

@ -176,17 +176,14 @@ public class VMProps implements Callable<Map<String, String>> {
* @return "true" if Flight Recorder is enabled, "false" if is disabled. * @return "true" if Flight Recorder is enabled, "false" if is disabled.
*/ */
protected String vmFlightRecorder() { protected String vmFlightRecorder() {
Boolean isUnlockedCommercialFatures = WB.getBooleanVMFlag("UnlockCommercialFeatures");
Boolean isFlightRecorder = WB.getBooleanVMFlag("FlightRecorder"); Boolean isFlightRecorder = WB.getBooleanVMFlag("FlightRecorder");
String startFROptions = WB.getStringVMFlag("StartFlightRecording"); String startFROptions = WB.getStringVMFlag("StartFlightRecording");
if (isUnlockedCommercialFatures != null && isUnlockedCommercialFatures) {
if (isFlightRecorder != null && isFlightRecorder) { if (isFlightRecorder != null && isFlightRecorder) {
return "true"; return "true";
} }
if (startFROptions != null && !startFROptions.isEmpty()) { if (startFROptions != null && !startFROptions.isEmpty()) {
return "true"; return "true";
} }
}
return "false"; return "false";
} }