Skip to content

Commit 6240431

Browse files
author
Alex Menkov
committed
8295697: Resolve conflicts between serviceability/jvmti and nsk/jvmti shared code
Reviewed-by: lmesnik, sspitsyn, cjplummer
1 parent 1164258 commit 6240431

File tree

5 files changed

+54
-425
lines changed

5 files changed

+54
-425
lines changed

test/hotspot/jtreg/vmTestbase/nsk/share/jni/jni_tools.cpp

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -43,9 +43,6 @@
4343
#include "nsk_tools.h"
4444
#include "jni_tools.h"
4545

46-
/*************************************************************/
47-
48-
extern "C" {
4946

5047
/*************************************************************/
5148

@@ -101,54 +98,6 @@ int nsk_jni_lverify_void(JNIEnv* jni, const char file[], int line,
10198
return !failure;
10299
}
103100

104-
char *jlong_to_string(jlong value, char *string) {
105-
char buffer[32];
106-
char *pbuf, *pstr;
107-
108-
pstr = string;
109-
if (value == 0) {
110-
*pstr++ = '0';
111-
} else {
112-
if (value < 0) {
113-
*pstr++ = '-';
114-
value = -value;
115-
}
116-
pbuf = buffer;
117-
while (value != 0) {
118-
*pbuf++ = '0' + (char)(value % 10);
119-
value = value / 10;
120-
}
121-
while (pbuf != buffer) {
122-
*pstr++ = *--pbuf;
123-
}
124-
}
125-
*pstr = '\0';
126-
127-
return string;
128-
}
129-
130-
char *julong_to_string(julong value, char *string) {
131-
char buffer[32];
132-
char *pbuf, *pstr;
133-
134-
pstr = string;
135-
if (value == 0) {
136-
*pstr++ = '0';
137-
} else {
138-
pbuf = buffer;
139-
while (value != 0) {
140-
*pbuf++ = '0' + (char)(value % 10);
141-
value = value / 10;
142-
}
143-
while (pbuf != buffer) {
144-
*pstr++ = *--pbuf;
145-
}
146-
}
147-
*pstr = '\0';
148-
149-
return string;
150-
}
151-
152101
void mssleep(long millis) {
153102
#if (defined(WIN32) || defined(_WIN32))
154103
Sleep(millis);
@@ -197,4 +146,3 @@ jni_create_vmoptions(int size, char *args[], int argsCnt)
197146

198147
/*************************************************************/
199148

200-
}

test/hotspot/jtreg/vmTestbase/nsk/share/jni/jni_tools.h

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,8 @@
3434

3535
/*************************************************************/
3636

37+
#include "jvmti_common.h"
38+
3739
/* printf format specifier for jlong */
3840
#ifdef _WIN32
3941

@@ -52,16 +54,6 @@
5254

5355
#endif // !_WIN32
5456

55-
/**
56-
* Additional Java basic types
57-
*/
58-
59-
#ifdef _WIN32
60-
typedef unsigned __int64 julong;
61-
#else
62-
typedef unsigned long long julong;
63-
#endif
64-
6557
/*************************************************************/
6658

6759
/**
@@ -94,10 +86,6 @@
9486

9587
/*************************************************************/
9688

97-
extern "C" {
98-
99-
/*************************************************************/
100-
10189
/**
10290
* If positive, assert status is true; or
10391
* if !positive, assert status is not true.
@@ -127,22 +115,6 @@ int nsk_jni_lverify_void(JNIEnv* jni, const char file[], int line,
127115
*/
128116
int nsk_jni_check_exception(JNIEnv* jni, const char file[], int line);
129117

130-
/**
131-
* Convert the digits of the given value argument to a null-terminated
132-
* character string and store the result (up to 32 bytes) in string.
133-
* If value is negative, the first character of the stored string is
134-
* the minus sign (-). The function returns a pointer to the begining
135-
* of the result string.
136-
*/
137-
char *jlong_to_string(jlong value, char *string);
138-
139-
/**
140-
* Convert the digits of the given value argument to a null-terminated
141-
* character string and store the result (up to 32 bytes) in string.
142-
* The function returns a pointer to the begining of the result string.
143-
*/
144-
char *julong_to_string(julong value, char *string);
145-
146118
/**
147119
* Sleep for given number of milliseconds.
148120
*/
@@ -163,8 +135,4 @@ void jni_print_vmargs(JavaVMInitArgs vmargs);
163135

164136
/*************************************************************/
165137

166-
}
167-
168-
/*************************************************************/
169-
170138
#endif

0 commit comments

Comments
 (0)