--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Thu Jun 18 13:18:12 2015 -0700
@@ -121,6 +121,8 @@
private Flag[] commandLineFlags;
private Map flagsMap;
+ private static Type intType;
+ private static Type uintType;
private static Type intxType;
private static Type uintxType;
private static Type sizetType;
@@ -170,6 +172,28 @@
return addr.getCIntegerAt(0, boolType.getSize(), boolType.isUnsigned()) != 0;
}
+ public boolean isInt() {
+ return type.equals("int");
+ }
+
+ public long getInt() {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(isInt(), "not an int flag!");
+ }
+ return addr.getCIntegerAt(0, intType.getSize(), false);
+ }
+
+ public boolean isUInt() {
+ return type.equals("uint");
+ }
+
+ public long getUInt() {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(isUInt(), "not a uint flag!");
+ }
+ return addr.getCIntegerAt(0, uintType.getSize(), false);
+ }
+
public boolean isIntx() {
return type.equals("intx");
}
@@ -206,6 +230,10 @@
public String getValue() {
if (isBool()) {
return new Boolean(getBool()).toString();
+ } else if (isInt()) {
+ return new Long(getInt()).toString();
+ } else if (isUInt()) {
+ return new Long(getUInt()).toString();
} else if (isIntx()) {
return new Long(getIntx()).toString();
} else if (isUIntx()) {
@@ -334,6 +362,8 @@
heapWordSize = db.lookupIntConstant("HeapWordSize").intValue();
oopSize = db.lookupIntConstant("oopSize").intValue();
+ intType = db.lookupType("int");
+ uintType = db.lookupType("uint");
intxType = db.lookupType("intx");
uintxType = db.lookupType("uintx");
sizetType = db.lookupType("size_t");
--- a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -96,7 +96,7 @@
heap->collector_policy()->should_clear_all_soft_refs();
uint count = maximum_heap_compaction ? 1 : MarkSweepAlwaysCompactCount;
- UIntFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count);
+ UIntXFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count);
PSMarkSweep::invoke_no_policy(clear_all_soft_refs || maximum_heap_compaction);
}
--- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -785,7 +785,7 @@
// free memory should be here, especially if they are expensive. If this
// attempt fails, an OOM exception will be thrown.
{
- UIntFlagSetting flag_change(MarkSweepAlwaysCompactCount, 1); // Make sure the heap is fully compacted
+ UIntXFlagSetting flag_change(MarkSweepAlwaysCompactCount, 1); // Make sure the heap is fully compacted
gch->do_collection(true /* full */,
true /* clear_all_soft_refs */,
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -43,6 +43,7 @@
#include "runtime/deoptimization.hpp"
#include "runtime/relocator.hpp"
#include "utilities/bitMap.inline.hpp"
+#include "utilities/events.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
@@ -174,6 +175,9 @@
// Free os::malloc allocated memory.
os::free(_scratch_classes);
+ // Reset the_class_oop to null for error printing.
+ _the_class_oop = NULL;
+
if (RC_TRACE_ENABLED(0x00000004)) {
// Used to have separate timers for "doit" and "all", but the timer
// overhead skewed the measurements.
@@ -4105,6 +4109,13 @@
java_lang_Class::classRedefinedCount(the_class_mirror),
os::available_memory() >> 10));
+ {
+ ResourceMark rm(THREAD);
+ Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
+ the_class->external_name(),
+ java_lang_Class::classRedefinedCount(the_class_mirror));
+
+ }
RC_TIMER_STOP(_timer_rsc_phase2);
} // end redefine_single_class()
@@ -4249,3 +4260,11 @@
tty->cr();
}
}
+
+void VM_RedefineClasses::print_on_error(outputStream* st) const {
+ VM_Operation::print_on_error(st);
+ if (_the_class_oop != NULL) {
+ ResourceMark rm;
+ st->print_cr(", redefining class %s", _the_class_oop->external_name());
+ }
+}
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp Thu Jun 18 13:18:12 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -539,5 +539,8 @@
static unsigned char * get_cached_class_file_bytes(JvmtiCachedClassFileData *cache) {
return cache == NULL ? NULL : cache->data;
}
+
+ // Error printing
+ void print_on_error(outputStream* st) const;
};
#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES_HPP
--- a/hotspot/src/share/vm/prims/whitebox.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/prims/whitebox.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -710,6 +710,24 @@
return NULL;
WB_END
+WB_ENTRY(jobject, WB_GetIntVMFlag(JNIEnv* env, jobject o, jstring name))
+ int result;
+ if (GetVMFlag <int> (thread, env, name, &result, &CommandLineFlags::intAt)) {
+ ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
+ return longBox(thread, env, result);
+ }
+ return NULL;
+WB_END
+
+WB_ENTRY(jobject, WB_GetUintVMFlag(JNIEnv* env, jobject o, jstring name))
+ uint result;
+ if (GetVMFlag <uint> (thread, env, name, &result, &CommandLineFlags::uintAt)) {
+ ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
+ return longBox(thread, env, result);
+ }
+ return NULL;
+WB_END
+
WB_ENTRY(jobject, WB_GetIntxVMFlag(JNIEnv* env, jobject o, jstring name))
intx result;
if (GetVMFlag <intx> (thread, env, name, &result, &CommandLineFlags::intxAt)) {
@@ -771,6 +789,16 @@
SetVMFlag <bool> (thread, env, name, &result, &CommandLineFlags::boolAtPut);
WB_END
+WB_ENTRY(void, WB_SetIntVMFlag(JNIEnv* env, jobject o, jstring name, jlong value))
+ int result = value;
+ SetVMFlag <int> (thread, env, name, &result, &CommandLineFlags::intAtPut);
+WB_END
+
+WB_ENTRY(void, WB_SetUintVMFlag(JNIEnv* env, jobject o, jstring name, jlong value))
+ uint result = value;
+ SetVMFlag <uint> (thread, env, name, &result, &CommandLineFlags::uintAtPut);
+WB_END
+
WB_ENTRY(void, WB_SetIntxVMFlag(JNIEnv* env, jobject o, jstring name, jlong value))
intx result = value;
SetVMFlag <intx> (thread, env, name, &result, &CommandLineFlags::intxAtPut);
@@ -1336,6 +1364,8 @@
{CC"isConstantVMFlag", CC"(Ljava/lang/String;)Z", (void*)&WB_IsConstantVMFlag},
{CC"isLockedVMFlag", CC"(Ljava/lang/String;)Z", (void*)&WB_IsLockedVMFlag},
{CC"setBooleanVMFlag", CC"(Ljava/lang/String;Z)V",(void*)&WB_SetBooleanVMFlag},
+ {CC"setIntVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetIntVMFlag},
+ {CC"setUintVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUintVMFlag},
{CC"setIntxVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetIntxVMFlag},
{CC"setUintxVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUintxVMFlag},
{CC"setUint64VMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUint64VMFlag},
@@ -1345,6 +1375,10 @@
(void*)&WB_SetStringVMFlag},
{CC"getBooleanVMFlag", CC"(Ljava/lang/String;)Ljava/lang/Boolean;",
(void*)&WB_GetBooleanVMFlag},
+ {CC"getIntVMFlag", CC"(Ljava/lang/String;)Ljava/lang/Long;",
+ (void*)&WB_GetIntVMFlag},
+ {CC"getUintVMFlag", CC"(Ljava/lang/String;)Ljava/lang/Long;",
+ (void*)&WB_GetUintVMFlag},
{CC"getIntxVMFlag", CC"(Ljava/lang/String;)Ljava/lang/Long;",
(void*)&WB_GetIntxVMFlag},
{CC"getUintxVMFlag", CC"(Ljava/lang/String;)Ljava/lang/Long;",
--- a/hotspot/src/share/vm/runtime/arguments.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -586,11 +586,12 @@
static bool set_numeric_flag(char* name, char* value, Flag::Flags origin) {
julong v;
+ int int_v;
intx intx_v;
bool is_neg = false;
// Check the sign first since atomull() parses only unsigned values.
if (*value == '-') {
- if (!CommandLineFlags::intxAt(name, &intx_v)) {
+ if (!CommandLineFlags::intxAt(name, &intx_v) && !CommandLineFlags::intAt(name, &int_v)) {
return false;
}
value++;
@@ -599,6 +600,17 @@
if (!atomull(value, &v)) {
return false;
}
+ int_v = (int) v;
+ if (is_neg) {
+ int_v = -int_v;
+ }
+ if (CommandLineFlags::intAtPut(name, &int_v, origin)) {
+ return true;
+ }
+ uint uint_v = (uint) v;
+ if (!is_neg && CommandLineFlags::uintAtPut(name, &uint_v, origin)) {
+ return true;
+ }
intx_v = (intx) v;
if (is_neg) {
intx_v = -intx_v;
--- a/hotspot/src/share/vm/runtime/globals.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -93,6 +93,32 @@
*((bool*) _addr) = value;
}
+bool Flag::is_int() const {
+ return strcmp(_type, "int") == 0;
+}
+
+int Flag::get_int() const {
+ return *((int*) _addr);
+}
+
+void Flag::set_int(int value) {
+ check_writable();
+ *((int*) _addr) = value;
+}
+
+bool Flag::is_uint() const {
+ return strcmp(_type, "uint") == 0;
+}
+
+uint Flag::get_uint() const {
+ return *((uint*) _addr);
+}
+
+void Flag::set_uint(uint value) {
+ check_writable();
+ *((uint*) _addr) = value;
+}
+
bool Flag::is_intx() const {
return strcmp(_type, "intx") == 0;
}
@@ -316,6 +342,12 @@
if (is_bool()) {
st->print("%-16s", get_bool() ? "true" : "false");
}
+ if (is_int()) {
+ st->print("%-16d", get_int());
+ }
+ if (is_uint()) {
+ st->print("%-16u", get_uint());
+ }
if (is_intx()) {
st->print("%-16ld", get_intx());
}
@@ -411,6 +443,10 @@
void Flag::print_as_flag(outputStream* st) {
if (is_bool()) {
st->print("-XX:%s%s", get_bool() ? "+" : "-", _name);
+ } else if (is_int()) {
+ st->print("-XX:%s=%d", _name, get_int());
+ } else if (is_uint()) {
+ st->print("-XX:%s=%u", _name, get_uint());
} else if (is_intx()) {
st->print("-XX:%s=" INTX_FORMAT, _name, get_intx());
} else if (is_uintx()) {
@@ -663,6 +699,62 @@
faddr->set_origin(origin);
}
+bool CommandLineFlags::intAt(const char* name, size_t len, int* value, bool allow_locked, bool return_flag) {
+ Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
+ if (result == NULL) return false;
+ if (!result->is_int()) return false;
+ *value = result->get_int();
+ return true;
+}
+
+bool CommandLineFlags::intAtPut(const char* name, size_t len, int* value, Flag::Flags origin) {
+ Flag* result = Flag::find_flag(name, len);
+ if (result == NULL) return false;
+ if (!result->is_int()) return false;
+ int old_value = result->get_int();
+ trace_flag_changed<EventIntFlagChanged, s4>(name, old_value, *value, origin);
+ result->set_int(*value);
+ *value = old_value;
+ result->set_origin(origin);
+ return true;
+}
+
+void CommandLineFlagsEx::intAtPut(CommandLineFlagWithType flag, int value, Flag::Flags origin) {
+ Flag* faddr = address_of_flag(flag);
+ guarantee(faddr != NULL && faddr->is_int(), "wrong flag type");
+ trace_flag_changed<EventIntFlagChanged, s4>(faddr->_name, faddr->get_int(), value, origin);
+ faddr->set_int(value);
+ faddr->set_origin(origin);
+}
+
+bool CommandLineFlags::uintAt(const char* name, size_t len, uint* value, bool allow_locked, bool return_flag) {
+ Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
+ if (result == NULL) return false;
+ if (!result->is_uint()) return false;
+ *value = result->get_uint();
+ return true;
+}
+
+bool CommandLineFlags::uintAtPut(const char* name, size_t len, uint* value, Flag::Flags origin) {
+ Flag* result = Flag::find_flag(name, len);
+ if (result == NULL) return false;
+ if (!result->is_uint()) return false;
+ uint old_value = result->get_uint();
+ trace_flag_changed<EventUnsignedIntFlagChanged, u4>(name, old_value, *value, origin);
+ result->set_uint(*value);
+ *value = old_value;
+ result->set_origin(origin);
+ return true;
+}
+
+void CommandLineFlagsEx::uintAtPut(CommandLineFlagWithType flag, uint value, Flag::Flags origin) {
+ Flag* faddr = address_of_flag(flag);
+ guarantee(faddr != NULL && faddr->is_uint(), "wrong flag type");
+ trace_flag_changed<EventUnsignedIntFlagChanged, u4>(faddr->_name, faddr->get_uint(), value, origin);
+ faddr->set_uint(value);
+ faddr->set_origin(origin);
+}
+
bool CommandLineFlags::intxAt(const char* name, size_t len, intx* value, bool allow_locked, bool return_flag) {
Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
if (result == NULL) return false;
--- a/hotspot/src/share/vm/runtime/globals.hpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp Thu Jun 18 13:18:12 2015 -0700
@@ -279,6 +279,14 @@
bool get_bool() const;
void set_bool(bool value);
+ bool is_int() const;
+ int get_int() const;
+ void set_int(int value);
+
+ bool is_uint() const;
+ uint get_uint() const;
+ void set_uint(uint value);
+
bool is_intx() const;
intx get_intx() const;
void set_intx(intx value);
@@ -363,13 +371,28 @@
~CounterSetting() { (*counter)--; }
};
+class IntFlagSetting {
+ int val;
+ int* flag;
+ public:
+ IntFlagSetting(int& fl, int newValue) { flag = &fl; val = fl; fl = newValue; }
+ ~IntFlagSetting() { *flag = val; }
+};
class UIntFlagSetting {
+ uint val;
+ uint* flag;
+ public:
+ UIntFlagSetting(uint& fl, uint newValue) { flag = &fl; val = fl; fl = newValue; }
+ ~UIntFlagSetting() { *flag = val; }
+};
+
+class UIntXFlagSetting {
uintx val;
uintx* flag;
public:
- UIntFlagSetting(uintx& fl, uintx newValue) { flag = &fl; val = fl; fl = newValue; }
- ~UIntFlagSetting() { *flag = val; }
+ UIntXFlagSetting(uintx& fl, uintx newValue) { flag = &fl; val = fl; fl = newValue; }
+ ~UIntXFlagSetting() { *flag = val; }
};
class DoubleFlagSetting {
@@ -396,6 +419,16 @@
static bool boolAtPut(const char* name, size_t len, bool* value, Flag::Flags origin);
static bool boolAtPut(const char* name, bool* value, Flag::Flags origin) { return boolAtPut(name, strlen(name), value, origin); }
+ static bool intAt(const char* name, size_t len, int* value, bool allow_locked = false, bool return_flag = false);
+ static bool intAt(const char* name, int* value, bool allow_locked = false, bool return_flag = false) { return intAt(name, strlen(name), value, allow_locked, return_flag); }
+ static bool intAtPut(const char* name, size_t len, int* value, Flag::Flags origin);
+ static bool intAtPut(const char* name, int* value, Flag::Flags origin) { return intAtPut(name, strlen(name), value, origin); }
+
+ static bool uintAt(const char* name, size_t len, uint* value, bool allow_locked = false, bool return_flag = false);
+ static bool uintAt(const char* name, uint* value, bool allow_locked = false, bool return_flag = false) { return uintAt(name, strlen(name), value, allow_locked, return_flag); }
+ static bool uintAtPut(const char* name, size_t len, uint* value, Flag::Flags origin);
+ static bool uintAtPut(const char* name, uint* value, Flag::Flags origin) { return uintAtPut(name, strlen(name), value, origin); }
+
static bool intxAt(const char* name, size_t len, intx* value, bool allow_locked = false, bool return_flag = false);
static bool intxAt(const char* name, intx* value, bool allow_locked = false, bool return_flag = false) { return intxAt(name, strlen(name), value, allow_locked, return_flag); }
static bool intxAtPut(const char* name, size_t len, intx* value, Flag::Flags origin);
--- a/hotspot/src/share/vm/runtime/globals_extension.hpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/runtime/globals_extension.hpp Thu Jun 18 13:18:12 2015 -0700
@@ -197,6 +197,8 @@
class CommandLineFlagsEx : CommandLineFlags {
public:
static void boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin);
+ static void intAtPut(CommandLineFlagWithType flag, int value, Flag::Flags origin);
+ static void uintAtPut(CommandLineFlagWithType flag, uint value, Flag::Flags origin);
static void intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin);
static void uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin);
static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin);
--- a/hotspot/src/share/vm/runtime/vm_operations.hpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/runtime/vm_operations.hpp Thu Jun 18 13:18:12 2015 -0700
@@ -192,7 +192,7 @@
static const char* mode_to_string(Mode mode);
// Debugging
- void print_on_error(outputStream* st) const;
+ virtual void print_on_error(outputStream* st) const;
const char* name() const { return _names[type()]; }
static const char* name(int type) {
assert(type >= 0 && type < VMOp_Terminating, "invalid VM operation type");
--- a/hotspot/src/share/vm/services/management.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/services/management.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -1558,6 +1558,12 @@
if (flag->is_bool()) {
global->value.z = flag->get_bool() ? JNI_TRUE : JNI_FALSE;
global->type = JMM_VMGLOBAL_TYPE_JBOOLEAN;
+ } else if (flag->is_int()) {
+ global->value.j = (jlong)flag->get_int();
+ global->type = JMM_VMGLOBAL_TYPE_JLONG;
+ } else if (flag->is_uint()) {
+ global->value.j = (jlong)flag->get_uint();
+ global->type = JMM_VMGLOBAL_TYPE_JLONG;
} else if (flag->is_intx()) {
global->value.j = (jlong)flag->get_intx();
global->type = JMM_VMGLOBAL_TYPE_JLONG;
--- a/hotspot/src/share/vm/services/writeableFlags.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -44,6 +44,36 @@
return CommandLineFlags::boolAtPut((char*)name, &value, origin) ? SUCCESS : ERR_OTHER;
}
+// set a int global flag
+int WriteableFlags::set_int_flag(const char* name, const char* arg, Flag::Flags origin, FormatBuffer<80>& err_msg) {
+ int value;
+
+ if (sscanf(arg, "%d", &value)) {
+ return set_int_flag(name, value, origin, err_msg);
+ }
+ err_msg.print("flag value must be an integer");
+ return WRONG_FORMAT;
+}
+
+int WriteableFlags::set_int_flag(const char* name, int value, Flag::Flags origin, FormatBuffer<80>& err_msg) {
+ return CommandLineFlags::intAtPut((char*)name, &value, origin) ? SUCCESS : ERR_OTHER;
+}
+
+// set a uint global flag
+int WriteableFlags::set_uint_flag(const char* name, const char* arg, Flag::Flags origin, FormatBuffer<80>& err_msg) {
+ uint value;
+
+ if (sscanf(arg, "%u", &value)) {
+ return set_uint_flag(name, value, origin, err_msg);
+ }
+ err_msg.print("flag value must be an unsigned integer");
+ return WRONG_FORMAT;
+}
+
+int WriteableFlags::set_uint_flag(const char* name, uint value, Flag::Flags origin, FormatBuffer<80>& err_msg) {
+ return CommandLineFlags::uintAtPut((char*)name, &value, origin) ? SUCCESS : ERR_OTHER;
+}
+
// set a intx global flag
int WriteableFlags::set_intx_flag(const char* name, const char* arg, Flag::Flags origin, FormatBuffer<80>& err_msg) {
intx value;
@@ -173,6 +203,10 @@
}
if (f->is_bool()) {
return set_bool_flag(f->_name, flag_value, origin, err_msg);
+ } else if (f->is_int()) {
+ return set_int_flag(f->_name, flag_value, origin, err_msg);
+ } else if (f->is_uint()) {
+ return set_uint_flag(f->_name, flag_value, origin, err_msg);
} else if (f->is_intx()) {
return set_intx_flag(f->_name, flag_value, origin, err_msg);
} else if (f->is_uintx()) {
@@ -195,6 +229,12 @@
if (f->is_bool()) {
bool bvalue = (new_value.z == JNI_TRUE ? true : false);
return set_bool_flag(f->_name, bvalue, origin, err_msg);
+ } else if (f->is_int()) {
+ int ivalue = (int)new_value.j;
+ return set_int_flag(f->_name, ivalue, origin, err_msg);
+ } else if (f->is_uint()) {
+ uint uvalue = (uint)new_value.j;
+ return set_uint_flag(f->_name, uvalue, origin, err_msg);
} else if (f->is_intx()) {
intx ivalue = (intx)new_value.j;
return set_intx_flag(f->_name, ivalue, origin, err_msg);
--- a/hotspot/src/share/vm/services/writeableFlags.hpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/services/writeableFlags.hpp Thu Jun 18 13:18:12 2015 -0700
@@ -56,6 +56,10 @@
// set a boolean global flag
static int set_bool_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
+ // set a int global flag
+ static int set_int_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
+ // set a uint global flag
+ static int set_uint_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
// set a intx global flag
static int set_intx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
// set a uintx global flag
@@ -66,6 +70,10 @@
static int set_size_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
// set a boolean global flag
static int set_bool_flag(const char* name, bool value, Flag::Flags origin, FormatBuffer<80>& err_msg);
+ // set a int global flag
+ static int set_int_flag(const char* name, int value, Flag::Flags origin, FormatBuffer<80>& err_msg);
+ // set a uint global flag
+ static int set_uint_flag(const char* name, uint value, Flag::Flags origin, FormatBuffer<80>& err_msg);
// set a intx global flag
static int set_intx_flag(const char* name, intx value, Flag::Flags origin, FormatBuffer<80>& err_msg);
// set a uintx global flag
--- a/hotspot/src/share/vm/trace/trace.xml Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/trace/trace.xml Thu Jun 18 13:18:12 2015 -0700
@@ -122,6 +122,22 @@
<value type="CLASS" field="definingClassLoader" label="Defining Class Loader"/>
</event>
+ <event id="IntFlagChanged" path="vm/flag/int_changed" label="Int Flag Changed"
+ is_instant="true">
+ <value type="UTF8" field="name" label="Name" />
+ <value type="INTEGER" field="old_value" label="Old Value" />
+ <value type="INTEGER" field="new_value" label="New Value" />
+ <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+ </event>
+
+ <event id="UnsignedIntFlagChanged" path="vm/flag/uint_changed" label="Unsigned Int Flag Changed"
+ is_instant="true">
+ <value type="UTF8" field="name" label="Name" />
+ <value type="UINT" field="old_value" label="Old Value" />
+ <value type="UINT" field="new_value" label="New Value" />
+ <value type="FLAGVALUEORIGIN" field="origin" label="Origin" />
+ </event>
+
<event id="LongFlagChanged" path="vm/flag/long_changed" label="Long Flag Changed"
is_instant="true">
<value type="UTF8" field="name" label="Name" />
--- a/hotspot/src/share/vm/utilities/events.cpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/utilities/events.cpp Thu Jun 18 13:18:12 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
EventLog* Events::_logs = NULL;
StringEventLog* Events::_messages = NULL;
StringEventLog* Events::_exceptions = NULL;
+StringEventLog* Events::_redefinitions = NULL;
StringEventLog* Events::_deopt_messages = NULL;
EventLog::EventLog() {
@@ -66,6 +67,7 @@
if (LogEvents) {
_messages = new StringEventLog("Events");
_exceptions = new StringEventLog("Internal exceptions");
+ _redefinitions = new StringEventLog("Classes redefined");
_deopt_messages = new StringEventLog("Deoptimization events");
}
}
--- a/hotspot/src/share/vm/utilities/events.hpp Tue Jun 09 12:09:03 2015 +0200
+++ b/hotspot/src/share/vm/utilities/events.hpp Thu Jun 18 13:18:12 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -186,6 +186,9 @@
// Deoptization related messages
static StringEventLog* _deopt_messages;
+ // Redefinition related messages
+ static StringEventLog* _redefinitions;
+
public:
static void print_all(outputStream* out);
@@ -198,6 +201,8 @@
// Log exception related message
static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+ static void log_redefinition(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
+
static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
// Register default loggers
@@ -222,6 +227,15 @@
}
}
+inline void Events::log_redefinition(Thread* thread, const char* format, ...) {
+ if (LogEvents) {
+ va_list ap;
+ va_start(ap, format);
+ _redefinitions->logv(thread, format, ap);
+ va_end(ap);
+ }
+}
+
inline void Events::log_deopt_message(Thread* thread, const char* format, ...) {
if (LogEvents) {
va_list ap;