--- old/src/share/vm/runtime/globals.cpp 2019-01-28 17:44:24.000000000 +0800 +++ new/src/share/vm/runtime/globals.cpp 2019-01-28 17:44:23.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -92,6 +92,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; } @@ -131,6 +157,19 @@ *((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; } @@ -610,8 +649,8 @@ { E e; e.set_name(name); - e.set_old_value(old_value); - e.set_new_value(new_value); + e.set_oldValue(old_value); + e.set_newValue(new_value); e.set_origin(origin); e.commit(); } @@ -672,8 +711,8 @@ faddr->set_origin(origin); } -bool CommandLineFlags::uintxAt(const char* name, size_t len, uintx* value) { - Flag* result = Flag::find_flag(name, len); +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();