提交 2a4aa503 编写于 作者: E egahlin

8216064: -XX:StartFlightRecording:settings= doesn't work properly

Reviewed-by: mgronlun
上级 5e443ff9
...@@ -434,7 +434,13 @@ void JfrStartFlightRecordingDCmd::execute(DCmdSource source, TRAPS) { ...@@ -434,7 +434,13 @@ void JfrStartFlightRecordingDCmd::execute(DCmdSource source, TRAPS) {
jobjectArray settings = NULL; jobjectArray settings = NULL;
if (_settings.is_set()) { if (_settings.is_set()) {
const int length = _settings.value()->array()->length(); int length = _settings.value()->array()->length();
if (length == 1) {
const char* c_str = _settings.value()->array()->at(0);
if (strcmp(c_str, "none") == 0) {
length = 0;
}
}
settings = JfrJavaSupport::new_string_array(length, CHECK); settings = JfrJavaSupport::new_string_array(length, CHECK);
assert(settings != NULL, "invariant"); assert(settings != NULL, "invariant");
for (int i = 0; i < length; ++i) { for (int i = 0; i < length; ++i) {
......
...@@ -184,7 +184,7 @@ void JfrJavaArguments::Parameters::copy(JavaCallArguments& args, TRAPS) const { ...@@ -184,7 +184,7 @@ void JfrJavaArguments::Parameters::copy(JavaCallArguments& args, TRAPS) const {
} }
} }
JfrJavaArguments::JfrJavaArguments(JavaValue* result) : _result(result), _klass(NULL), _name(NULL), _signature(NULL), _array_length(0) { JfrJavaArguments::JfrJavaArguments(JavaValue* result) : _result(result), _klass(NULL), _name(NULL), _signature(NULL), _array_length(-1) {
assert(result != NULL, "invariant"); assert(result != NULL, "invariant");
} }
...@@ -193,7 +193,7 @@ JfrJavaArguments::JfrJavaArguments(JavaValue* result, const char* klass_name, co ...@@ -193,7 +193,7 @@ JfrJavaArguments::JfrJavaArguments(JavaValue* result, const char* klass_name, co
_klass(NULL), _klass(NULL),
_name(NULL), _name(NULL),
_signature(NULL), _signature(NULL),
_array_length(0) { _array_length(-1) {
assert(result != NULL, "invariant"); assert(result != NULL, "invariant");
if (klass_name != NULL) { if (klass_name != NULL) {
set_klass(klass_name, CHECK); set_klass(klass_name, CHECK);
...@@ -210,7 +210,7 @@ JfrJavaArguments::JfrJavaArguments(JavaValue* result, const Klass* klass, const ...@@ -210,7 +210,7 @@ JfrJavaArguments::JfrJavaArguments(JavaValue* result, const Klass* klass, const
_klass(NULL), _klass(NULL),
_name(NULL), _name(NULL),
_signature(NULL), _signature(NULL),
_array_length(0) { _array_length(-1) {
assert(result != NULL, "invariant"); assert(result != NULL, "invariant");
if (klass != NULL) { if (klass != NULL) {
set_klass(klass); set_klass(klass);
......
...@@ -166,7 +166,7 @@ static void create_object(JfrJavaArguments* args, JavaValue* result, TRAPS) { ...@@ -166,7 +166,7 @@ static void create_object(JfrJavaArguments* args, JavaValue* result, TRAPS) {
const int array_length = args->array_length(); const int array_length = args->array_length();
if (array_length > 0) { if (array_length >= 0) {
array_construction(args, result, klass, array_length, CHECK); array_construction(args, result, klass, array_length, CHECK);
} else { } else {
object_construction(args, result, klass, THREAD); object_construction(args, result, klass, THREAD);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册