< prev index next >
src/share/vm/runtime/globals.cpp
Print this page
rev 8910 : full patch for jfr
*** 1,7 ****
/*
! * Copyright (c) 1997, 2014, 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.
--- 1,7 ----
/*
! * Copyright (c) 1997, 2019, 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.
*** 90,99 ****
--- 90,125 ----
void Flag::set_bool(bool value) {
check_writable();
*((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;
}
intx Flag::get_intx() const {
*** 129,138 ****
--- 155,177 ----
void Flag::set_uint64_t(uint64_t value) {
check_writable();
*((uint64_t*) _addr) = value;
}
+ bool Flag::is_size_t() const {
+ return strcmp(_type, "size_t") == 0;
+ }
+
+ size_t Flag::get_size_t() const {
+ return *((size_t*) _addr);
+ }
+
+ void Flag::set_size_t(size_t value) {
+ check_writable();
+ *((size_t*) _addr) = value;
+ }
+
bool Flag::is_double() const {
return strcmp(_type, "double") == 0;
}
double Flag::get_double() const {
*** 608,619 ****
template<class E, class T>
static void trace_flag_changed(const char* name, const T old_value, const T new_value, const Flag::Flags origin)
{
E e;
e.set_name(name);
! e.set_old_value(old_value);
! e.set_new_value(new_value);
e.set_origin(origin);
e.commit();
}
bool CommandLineFlags::boolAt(const char* name, size_t len, bool* value) {
--- 647,658 ----
template<class E, class T>
static void trace_flag_changed(const char* name, const T old_value, const T new_value, const Flag::Flags origin)
{
E e;
e.set_name(name);
! e.set_oldValue(old_value);
! e.set_newValue(new_value);
e.set_origin(origin);
e.commit();
}
bool CommandLineFlags::boolAt(const char* name, size_t len, bool* value) {
*** 670,681 ****
trace_flag_changed<EventLongFlagChanged, s8>(faddr->_name, faddr->get_intx(), value, origin);
faddr->set_intx(value);
faddr->set_origin(origin);
}
! bool CommandLineFlags::uintxAt(const char* name, size_t len, uintx* value) {
! Flag* result = Flag::find_flag(name, len);
if (result == NULL) return false;
if (!result->is_uintx()) return false;
*value = result->get_uintx();
return true;
}
--- 709,720 ----
trace_flag_changed<EventLongFlagChanged, s8>(faddr->_name, faddr->get_intx(), value, origin);
faddr->set_intx(value);
faddr->set_origin(origin);
}
! bool CommandLineFlags::uintxAt(const char* name, size_t len, uintx* 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_uintx()) return false;
*value = result->get_uintx();
return true;
}
< prev index next >